123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- package com.sooka.sponest.mobile.comprehensive.actualPeopleController;
- import com.ruoyi.common.core.constant.HttpStatus;
- import com.ruoyi.common.core.domain.DictKeys;
- import com.ruoyi.common.core.web.controller.BaseController;
- import com.ruoyi.common.core.web.domain.AjaxResult;
- import com.ruoyi.common.core.web.page.PageDomain;
- import com.ruoyi.common.core.web.page.TableDataInfo;
- import com.ruoyi.common.core.web.page.TableSupport;
- import com.ruoyi.common.security.utils.DictUtils;
- import com.sooka.sponest.comprehensive.api.comprehensiveActualPeople.domain.ComprehensiveRhfOverseasPersonInfo;
- import com.sooka.sponest.comprehensive.api.comprehensiveActualPeople.service.RemoteOverseasPersonInfoService;
- import org.apache.commons.collections4.MapUtils;
- import org.springframework.web.bind.annotation.*;
- import javax.annotation.Resource;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- /**
- * 境外人员App
- *
- * @author hanfucheng
- * @date 2023/9/6 14:57
- */
- @RestController
- @RequestMapping("/AppOverseasPersonInfoController")
- public class AppOverseasPersonInfoController extends BaseController {
- @Resource
- RemoteOverseasPersonInfoService remoteOverseasPersonInfoService;
- /**
- * 查询境外人员列表
- */
- @GetMapping("/info/list")
- public AjaxResult list(ComprehensiveRhfOverseasPersonInfo comprehensiveRhfOverseasPersonInfo) {
- PageDomain pageDomain = TableSupport.buildPageRequest();
- Integer pageNum = pageDomain.getPageNum();
- Integer pageSize = pageDomain.getPageSize();
- TableDataInfo tableDataInfo = remoteOverseasPersonInfoService.selectComprehensiveRhfOverseasPersonInfoList(pageNum, pageSize, comprehensiveRhfOverseasPersonInfo.getIdentityNumber(), comprehensiveRhfOverseasPersonInfo.getPhone());
- if(HttpStatus.SUCCESS == tableDataInfo.getCode()){
- List<Map<String,Object>> rows = (List<Map<String, Object>>) tableDataInfo.getRows();
- Map<String,Object> comprehensiveCityCode = DictUtils.getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);//2260
- Map<String,Object> comprehensiveSex = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_SEX);
- Map<String,Object> comprehensiveInternation = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_INTERNATION);
- Map<String,Object> comprehensiveReligiousBelief = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_RELIGIOUS_BELIEF);
- Map<String,Object> comprehensiveCertificateCode = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_CERTIFICATE_CODE);
- Map<String,Object> comprehensiveComingToChinaPurpose = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_COMING_TO_CHINA_PURPOSE);
- Map<String,Object> comprehensiveOccupationalCategory = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_OCCUPATIONAL_CATEGORY);
- for (Map<String, Object> row : rows) {
- row.put("genderLabel",comprehensiveSex.get(MapUtils.getString(row,"gender")));
- row.put("nativePlaceLabel",comprehensiveInternation.get(MapUtils.getString(row,"nativePlace")));
- row.put("religiousBeliefLabel",comprehensiveReligiousBelief.get(MapUtils.getString(row,"religiousBelief")));
- row.put("identityCodeLabel",comprehensiveCertificateCode.get(MapUtils.getString(row,"identityCode")));
- row.put("purposeComingChinaLabel",comprehensiveComingToChinaPurpose.get(MapUtils.getString(row,"purposeComingChina")));
- row.put("occupationalCategoryLabel",comprehensiveOccupationalCategory.get(MapUtils.getString(row,"occupationalCategory")));
- row.put("focusPeopleLabel",null == row.get("focusPeople")?"":(MapUtils.getInteger(row,"focusPeople")== 1?"是":"否"));
- row.put("currentResidencePlaceLabel",comprehensiveCityCode.get(MapUtils.getString(row,"currentResidencePlace")));
- }
- return AjaxResult.success(rows);
- }else{
- return AjaxResult.error(tableDataInfo.getCode(),tableDataInfo.getMsg());
- }
- }
- /**
- * 获取境外人员详细信息
- */
- @GetMapping("/info/edit")
- public AjaxResult getInfo(String id) {
- AjaxResult ajaxResult = remoteOverseasPersonInfoService.selectComprehensiveRhfOverseasPersonInfoById(id);
- if("200".equals(MapUtils.getString(ajaxResult,"code"))){
- HashMap<String,Object> comprehensiveRhfOverseasPersonInfo = (HashMap<String, Object>) ajaxResult.get("data");
- Map<String,Object> comprehensiveCityCode = DictUtils.getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);
- comprehensiveRhfOverseasPersonInfo.put("genderLabel",DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_SEX,MapUtils.getString(comprehensiveRhfOverseasPersonInfo,"gender")));
- comprehensiveRhfOverseasPersonInfo.put("nativePlaceLabel",DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_INTERNATION,MapUtils.getString(comprehensiveRhfOverseasPersonInfo,"nativePlace")));
- comprehensiveRhfOverseasPersonInfo.put("religiousBeliefLabel",DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_RELIGIOUS_BELIEF,MapUtils.getString(comprehensiveRhfOverseasPersonInfo,"religiousBelief")));
- comprehensiveRhfOverseasPersonInfo.put("identityCodeLabel",DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_CERTIFICATE_CODE,MapUtils.getString(comprehensiveRhfOverseasPersonInfo,"identityCode")));
- comprehensiveRhfOverseasPersonInfo.put("purposeComingChinaLabel",DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_COMING_TO_CHINA_PURPOSE,MapUtils.getString(comprehensiveRhfOverseasPersonInfo,"purposeComingChina")));
- comprehensiveRhfOverseasPersonInfo.put("occupationalCategoryLabel",DictUtils.getDictDataByValue(DictKeys.COMPREHENSIVE_OCCUPATIONAL_CATEGORY,MapUtils.getString(comprehensiveRhfOverseasPersonInfo,"occupationalCategory")));
- comprehensiveRhfOverseasPersonInfo.put("focusPeopleLabel",null == comprehensiveRhfOverseasPersonInfo.get("focusPeople")?"":(MapUtils.getInteger(comprehensiveRhfOverseasPersonInfo,"focusPeople")== 1?"是":"否"));
- comprehensiveRhfOverseasPersonInfo.put("currentResidencePlaceLabel",comprehensiveCityCode.get(MapUtils.getString(comprehensiveRhfOverseasPersonInfo,"currentResidencePlace")));
- return AjaxResult.success(comprehensiveRhfOverseasPersonInfo);
- }else{
- return AjaxResult.error(MapUtils.getString(ajaxResult,"code"), MapUtils.getString(ajaxResult,"msg"));
- }
- }
- /**
- * 新增境外人员
- */
- @PostMapping("/info")
- public AjaxResult add(@RequestBody String json) {
- return remoteOverseasPersonInfoService.insertComprehensiveRhfOverseasPersonInfo(json);
- }
- /**
- * 修改境外人员
- */
- @PostMapping("/info/put")
- public AjaxResult edit(@RequestBody String json) {
- return remoteOverseasPersonInfoService.updateComprehensiveRhfOverseasPersonInfo(json);
- }
- /**
- * 删除境外人员
- */
- @GetMapping("/info/del")
- public AjaxResult remove(@RequestParam("id") List<String> id) {
- return remoteOverseasPersonInfoService.deleteComprehensiveRhfOverseasPersonInfoByIds(id.toArray(new String[0]));
- }
- }
|