diff --git a/src/main/java/com/zcloud/controller/hidden/HiddenController.java b/src/main/java/com/zcloud/controller/hidden/HiddenController.java index 80fc098..1b36495 100644 --- a/src/main/java/com/zcloud/controller/hidden/HiddenController.java +++ b/src/main/java/com/zcloud/controller/hidden/HiddenController.java @@ -8,6 +8,7 @@ import com.zcloud.entity.PageData; import com.zcloud.entity.system.Dictionaries; import com.zcloud.logs.LogAnno; import com.zcloud.service.bus.HiddenUserService; +import com.zcloud.service.bus.NoticeCorpUtil; import com.zcloud.service.check.ListManagerService; import com.zcloud.service.check.RecordItemService; import com.zcloud.service.corp.CorpInfoService; @@ -17,10 +18,7 @@ import com.zcloud.service.hidden.HiddenService; import com.zcloud.service.inspection.SafetyEnvironmentalService; import com.zcloud.service.sms.SMSLogService; import com.zcloud.service.sms.SMSManagementService; -import com.zcloud.service.system.DepartmentService; -import com.zcloud.service.system.DictionariesService; -import com.zcloud.service.system.ImgFilesService; -import com.zcloud.service.system.UsersService; +import com.zcloud.service.system.*; import com.zcloud.util.*; import com.zcloud.util.message.MessageService; import net.sf.json.JSONArray; @@ -35,6 +33,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.text.SimpleDateFormat; import java.util.*; @@ -46,6 +45,10 @@ import java.util.*; @RequestMapping("/hidden") public class HiddenController extends BaseController { + @Autowired + private FHlogService FHLOG;//日志记录 + @Autowired + private NoticeCorpUtil noticeUtil; @Autowired private HiddenService hiddenService; @Autowired @@ -1974,6 +1977,7 @@ public class HiddenController extends BaseController { pd.put("RECTIFICATIONTYPE","2"); if (list.size() == 0) { inspection.put("INSPECTION_STATUS", "5"); // 指派完成 + pd.put("STATE", "1"); //未整改 } else { inspection.put("INSPECTION_STATUS", "4"); // 指派中 } @@ -2123,4 +2127,102 @@ public class HiddenController extends BaseController { map.put("result", errInfo); return map; } + + /** + * 安全环保检查验收 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/finalcheck") + @ResponseBody + public Object finalcheck() throws Exception { + // 获取IP + HttpServletRequest request = this.getRequest(); + String ip = ""; + if (request.getHeader("x-forwarded-for") == null) { + ip = request.getRemoteAddr(); + } else { + ip = request.getHeader("x-forwarded-for"); + } + + + + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("ACCEPTSTEP", 7); + pd.put("x",false); + boolean success = false; +// List list2 = hiddenService.listOtherNotAccept4pc(pd); +// success = (boolean) pd.get("x"); +// if (success) { +// return null; +// }else { +// return null; +// } + + + + pd.put("FINAL_CHECKOR", Jurisdiction.getUSER_ID()); + hiddenService.finalcheck(pd); + // 是 + if ("1".equals(pd.get("FINAL_CHECK").toString())) { + if (Tools.notEmpty(pd.getString("INSPECTION_ID"))) { //安全环保检查验收 + pd.put("ACCEPTSTEP", 7); + List list = hiddenService.listOtherNotAccept4pc(pd); + if (list.size() == 0) { + PageData inspection = new PageData(); + inspection.put("INSPECTION_ID", pd.getString("INSPECTION_ID")); + inspection.put("OPERATOR", Jurisdiction.getUSER_ID()); + inspection.put("OPERATTIME", DateUtil.date2Str(new Date())); + inspection.put("INSPECTION_STATUS", "8"); // 已验收 + + safetyenvironmentalService.editStatus(inspection); + } + } + } else { + // 否 + PageData pd2 = new PageData(); + pd2.put("FOREIGN_KEY", pd.get("HIDDEN_ID")); + pd2.put("TYPE", "4"); + List zgImgs = imgFilesService.listAll(pd2); + for (PageData pageData : zgImgs) { + imgFilesService.delete(pageData); + if (Tools.notEmpty(pageData.getString("FILEPATH"))) { + smb.deleteFile(pageData.getString("FILEPATH")); + } + } + PageData hidden = new PageData(); + hidden.put("HIDDEN_ID", pd.get("HIDDEN_ID")); + hidden.put("STATE", "101"); //修改隐患表状态为验收打回 + hiddenService.changeState(hidden); + PageData inspection = new PageData(); + inspection.put("INSPECTION_ID", pd.getString("INSPECTION_ID")); + inspection.put("OPERATOR", Jurisdiction.getUSER_ID()); + inspection.put("OPERATTIME", DateUtil.date2Str(new Date())); + inspection.put("INSPECTION_STATUS", "3"); // 安全环保检查打回到归档,隐患待指派 + safetyenvironmentalService.editStatus(inspection); + inspection.put("SENDER_ID", Jurisdiction.getUSER_ID()); + inspection.put("SENDER_NAME", Jurisdiction.getName()); + noticeUtil.SE_Repulse(inspection); + // hiddenExamineService.deleteByHiddenId(pd); 如果验收打回删除隐患相关信息 + FHLOG.save(Jurisdiction.getName(), "删除隐患ID:" + pd.getString("HIDDEN_ID") + ",关于hiddenexamine表数据", ip); +// hidden.put("HIDDENEXAMINE_ID",this.get32UUID()); +// hidden.put("EXAMINE",pd.get("CONTENT"));//打回意见 +// hidden.put("CREATOR",Jurisdiction.getUSER_ID()); +// hidden.put("CREATTIME",DateUtil.date2Str(new Date())); +// hidden.put("OPERATOR",Jurisdiction.getUSER_ID()); +// hidden.put("OPERATTIME",DateUtil.date2Str(new Date())); +// hidden.put("TYPE",3);//验收打回 +// hidden.put("STATE",-1);//验收打回变成初始状态-1 +// hiddenExamineService.save(hidden); + } + map.put("check", pd); + map.put("result", errInfo); + return map; + } + + } diff --git a/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyprojectCheckController.java b/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyprojectCheckController.java index b909250..e5def76 100644 --- a/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyprojectCheckController.java +++ b/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyprojectCheckController.java @@ -534,20 +534,26 @@ public class AppKeyprojectCheckController extends BaseController { return map; } - /** - * 去隐患页面获取数据 - * + /**去隐患页面获取数据 * @param * @throws Exception */ - @RequestMapping(value = "/keyProjectCount") + @RequestMapping(value="/keyProjectCount") @ResponseBody - public Object keyProjectCount() throws Exception { - Map map = new HashMap(); + public Object keyProjectCount() throws Exception{ + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - pd = keyprojectHiddenService.keyprojectcount(pd); //根据ID读取 + String UserId = pd.getString("UserId"); + if(!StringUtils.equals("1",UserId)){ + String CORPINFO_ID = pd.getString("CORPINFO_ID"); + if(!StringUtils.equals(CORPINFO_ID,"1e6dbbe16004402f8d2c0e52afd9a676")&&!StringUtils.equals(CORPINFO_ID,"3a854eefa7894e06aaa1a2611bca80f6")&& + !StringUtils.equals(CORPINFO_ID,"020578a4c1f04bc692ee25145c2efbe5")&&!StringUtils.equals(CORPINFO_ID,"90966974de3c4b83aca6f8fd6432d5c2")){ + pd.put("DeptId",outsourcedService.getDeptId(UserId)); + } + } + pd = keyprojectHiddenService.keyprojectcount(pd); //根据ID读取 map.put("pd", pd); map.put("result", errInfo); return map; diff --git a/src/main/java/com/zcloud/controller/positioning/MapSettingController.java b/src/main/java/com/zcloud/controller/positioning/MapSettingController.java index 7cdf619..afaf998 100644 --- a/src/main/java/com/zcloud/controller/positioning/MapSettingController.java +++ b/src/main/java/com/zcloud/controller/positioning/MapSettingController.java @@ -169,6 +169,7 @@ public class MapSettingController extends BaseController { } return returnMap; } + /** * @Description: 路径规划批量删除 * @Author: dearLin @@ -189,4 +190,7 @@ public class MapSettingController extends BaseController { } return returnMap; } + + + } diff --git a/src/main/java/com/zcloud/controller/positioning/PositAlarmController.java b/src/main/java/com/zcloud/controller/positioning/PositAlarmController.java index 3915bc4..c0b58b4 100644 --- a/src/main/java/com/zcloud/controller/positioning/PositAlarmController.java +++ b/src/main/java/com/zcloud/controller/positioning/PositAlarmController.java @@ -100,7 +100,7 @@ public class PositAlarmController extends BaseController { public ReturnMap otherRegionList(Page page) throws Exception { PageData pageData = this.getPageData(); ReturnMap returnMap = new ReturnMap(); - JSONObject body = PLSUtil.getRyRegionList(Jurisdiction.getCORPINFO_ID(), pageData.getString("str"), Integer.parseInt(pageData.getString("currentPage")), Integer.parseInt(pageData.getString("showCount")),Integer.parseInt(pageData.getString("type"))); + JSONObject body = PLSUtil.getRyRegionList(Jurisdiction.getCORPINFO_ID(), pageData.getString("str"), Integer.parseInt(pageData.getString("currentPage")), Integer.parseInt(pageData.getString("showCount")), Integer.parseInt(pageData.getString("type"))); if (body != null) { returnMap.putAll(body); page.setTotalResult(body.getIntValue("total")); @@ -165,6 +165,7 @@ public class PositAlarmController extends BaseController { } return returnMap; } + /** * @Description: 确认选点 /region/region/redrawTheArea * @Author: dearLin @@ -185,6 +186,7 @@ public class PositAlarmController extends BaseController { } return returnMap; } + /** * @Description: 确认选点 /region/region/redrawTheArea * @Author: dearLin @@ -418,6 +420,7 @@ public class PositAlarmController extends BaseController { } /* 聚集概览 */ + /** * @Description: 聚集告警趋势统计 * @Author: dearLin @@ -437,6 +440,7 @@ public class PositAlarmController extends BaseController { } return returnMap; } + /** * @Description: 根据告警区域进行聚集数据统计 * @Author: dearLin @@ -474,4 +478,35 @@ public class PositAlarmController extends BaseController { } return returnMap; } + + + //串岗告警参数 + //允许进入人员 + @RequestMapping(value = "/getPsnInfo") + @ResponseBody + public ReturnMap getPsnInfo() throws Exception { + PageData pageData = this.getPageData(); + ReturnMap returnMap = new ReturnMap(); + JSONObject body = PLSUtil.GeneralList("/deploy/psnmgt/getPsnInfo", pageData); + if (body != null) { + returnMap.putAll(body); + } + return returnMap; + } + + // 允许进入部门 + ///deploy/dept/list + @RequestMapping(value = "/getDeptList") + @ResponseBody + public ReturnMap getDeptList() throws Exception { + PageData pageData = this.getPageData(); + pageData.put("pageNum", 1); + pageData.put("pageSize", 9999); + ReturnMap returnMap = new ReturnMap(); + JSONObject body = PLSUtil.GeneralList("/deploy/dept/list", pageData); + if (body != null) { + returnMap.putAll(body); + } + return returnMap; + } } diff --git a/src/main/java/com/zcloud/controller/positioning/UserCardController.java b/src/main/java/com/zcloud/controller/positioning/UserCardController.java index 5784cf8..ff19b8b 100644 --- a/src/main/java/com/zcloud/controller/positioning/UserCardController.java +++ b/src/main/java/com/zcloud/controller/positioning/UserCardController.java @@ -4,9 +4,11 @@ import com.alibaba.fastjson.JSONObject; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import com.zcloud.service.system.UsersService; import com.zcloud.util.Jurisdiction; import com.zcloud.util.PLSUtil; import com.zcloud.util.ReturnMap; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -22,6 +24,10 @@ import java.util.List; @RequestMapping("/deploy/card") public class UserCardController extends BaseController { + + @Autowired + private UsersService usersService; + /** * @Description: 人员卡管理 * @Author: dearLin @@ -61,6 +67,8 @@ public class UserCardController extends BaseController { JSONObject body = PLSUtil.GeneralPut("/deploy/card", pageData, Jurisdiction.getCORPINFO_ID()); if (body != null) { returnMap.putAll(body); + if (!"200".equals(body.getString("code"))) return ReturnMap.error(body.getString("msg")); + usersService.editUserCardNoByPid(pageData); } return returnMap; } @@ -117,6 +125,8 @@ public class UserCardController extends BaseController { ReturnMap returnMap = new ReturnMap(); JSONObject body = PLSUtil.GeneralDelete("/deploy/card/", pageData.getString("DATA_IDS"), Jurisdiction.getCORPINFO_ID()); if (body != null) { + if (!"200".equals(body.getString("code"))) return ReturnMap.error(body.getString("msg")); + returnMap.putAll(body); } return returnMap; @@ -138,6 +148,11 @@ public class UserCardController extends BaseController { if (body != null) { if (!"200".equals(body.getString("code"))) return ReturnMap.error(body.getString("msg")); returnMap.putAll(body); + // 人员表里给 对应卡号得人 得 卡移除掉 + String[] dataIds = pageData.getString("DATA_IDS").split(","); + pageData.put("USER_IDS", dataIds); + pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + usersService.removeCardNoUser(pageData); } return returnMap; } diff --git a/src/main/java/com/zcloud/controller/system/DepartmentController.java b/src/main/java/com/zcloud/controller/system/DepartmentController.java index 9143bcf..23324d4 100644 --- a/src/main/java/com/zcloud/controller/system/DepartmentController.java +++ b/src/main/java/com/zcloud/controller/system/DepartmentController.java @@ -7,13 +7,11 @@ import com.zcloud.entity.PageData; import com.zcloud.entity.system.Department; import com.zcloud.logs.LogAnno; import com.zcloud.service.check.ListManagerService; +import com.zcloud.service.corp.CorpInfoService; import com.zcloud.service.system.DepartmentService; import com.zcloud.service.system.SupervisionDepartmentService; import com.zcloud.service.system.UsersService; -import com.zcloud.util.DateUtil; -import com.zcloud.util.Jurisdiction; -import com.zcloud.util.ObjectExcelView; -import com.zcloud.util.Tools; +import com.zcloud.util.*; import net.sf.json.JSONArray; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -37,6 +35,8 @@ public class DepartmentController extends BaseController { @Autowired private DepartmentService departmentService; @Autowired + private CorpInfoService corpInfoService; + @Autowired private UsersService usersService; @Autowired private ListManagerService listManagerService; @@ -56,6 +56,33 @@ public class DepartmentController extends BaseController { String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); + String corpinfoId = Jurisdiction.getCORPINFO_ID(); + PageData corpPage = new PageData(); + corpPage.put("CORPINFO_ID", corpinfoId); + PageData corpInfo = corpInfoService.findById(corpPage); +// {"deptName":"0226-wx","enterpriseId":4,"staffId":"","deptPhone":"","deptAddress":"","remark":"","deptDuty":""} + corpPage.put("enterpriseName",corpInfo.getString("CORP_NAME")); + if (Tools.isEmpty(corpInfo.getString("enterpriseId"))) { + JSONObject body = PLSUtil.GeneralPost("/deploy/enterprise/addDepEnterprise", corpPage, corpinfoId); + if (body != null) { + if (!"200".equals(body.getString("code"))) { + return ReturnMap.error("人员定位系统中部门新增失败"); + } + corpPage.put("enterpriseId", body.getString("data")); + corpInfo.put("enterpriseId", body.getString("data")); + corpInfoService.updateEnterpriseId(corpPage); + } + } + PageData dept = new PageData(); + dept.put("deptName", pd.getString("NAME")); + dept.put("enterpriseId", corpInfo.get("enterpriseId")); + JSONObject body = PLSUtil.GeneralPost("/deploy/dept", dept, corpinfoId); + if (body != null) { + if (!"200".equals(body.getString("code"))) { + return ReturnMap.error("人员定位系统中部门新增失败"); + } + pd.put("deptId", body.getString("data")); + } pd.put("DEPARTMENT_ID", this.get32UUID()); //主键 pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业 departmentService.save(pd); @@ -112,6 +139,15 @@ public class DepartmentController extends BaseController { errInfo = "havelist"; map.put("msg", "该部门有清单,请先删除清单"); //返回结果 }else{ + PageData dept = new PageData(); + dept.put("DEPARTMENT_ID",DEPARTMENT_ID); + PageData byId = departmentService.findById(dept); + JSONObject body = PLSUtil.GeneralDelete("/deploy/dept/", byId.getString("deptId"),Jurisdiction.getCORPINFO_ID()); + if (body != null) { + if (!"200".equals(body.getString("code"))) { + return ReturnMap.error(body.getString("msg")); + } + } departmentService.delete(pd); //执行删除 } map.put("result", errInfo); //返回结果 @@ -131,6 +167,15 @@ public class DepartmentController extends BaseController { String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); + PageData sfDeptID = new PageData(); + sfDeptID.put("deptId", pd.get("deptId")); + sfDeptID.put("deptName", pd.get("NAME")); + JSONObject body = PLSUtil.GeneralPut("/deploy/dept", sfDeptID, Jurisdiction.getCORPINFO_ID()); + if (body != null) { + if (!"200".equals(body.getString("code"))) { + return ReturnMap.error("人员定位系统中部门新增失败"); + } + } departmentService.edit(pd); // 删除旧的监管单位 PageData pd2 = new PageData(); diff --git a/src/main/java/com/zcloud/controller/system/UsersController.java b/src/main/java/com/zcloud/controller/system/UsersController.java index 32b16ea..585f6c8 100644 --- a/src/main/java/com/zcloud/controller/system/UsersController.java +++ b/src/main/java/com/zcloud/controller/system/UsersController.java @@ -411,18 +411,18 @@ public class UsersController extends BaseController { PageData pd = this.getPageData(); - if (pd.get("USERAVATARURL") != null && !pd.getString("USERAVATARURL").equals("")) { +// if(pd.get("USERAVATARURL")!=null && !pd.getString("USERAVATARURL").equals("")){ // System.out.println("USERAVATARURL原长度:"+pd.getString("USERAVATARURL").length()); - String USERAVATARURL64 = ImageAnd64Binary.zipBase64(pd.getString("USERAVATARURL")); +// String USERAVATARURL64 = ImageAnd64Binary.zipBase64(pd.getString("USERAVATARURL")); // System.out.println("USERAVATARURL压缩长度:"+USERAVATARURL64.length()); - try { - FaceUtil.compareFace(pd.getString("USERAVATARURL"), pd.getString("USERAVATARURL")); - } catch (Exception e) { - map.put("result", "fail"); - map.put("msg", "人脸图像不符合要求 请重新上传!"); - return map; - } - } +//// try{ +//// FaceUtil.compareFace(pd.getString("USERAVATARURL"),pd.getString("USERAVATARURL")); +//// }catch (Exception e){ +//// map.put("result", "Error"); +//// map.put("msg", "人脸图像不符合要求 请重新上传!"); +//// return map; +//// } +// } if ("input".equals(pd.getString("LEARNERCATEGORYSTATUS"))) { pd.put("DICTTYPE", "APPLICABLE_PERSONNEL"); @@ -1400,7 +1400,7 @@ public class UsersController extends BaseController { for (PageData lpd : listPd) { number++; for (int i = 0; i < 7; i++) { - if (i == 1 || i == 6) { + if (i == 1 || i == 5 || i == 6) { continue; } if (Tools.isEmpty(lpd.get("var" + i))) { @@ -1418,10 +1418,13 @@ public class UsersController extends BaseController { Pattern patternPhone = Pattern.compile(RegexPatterns.PHONE_REGEX); Pattern patternRardNo = Pattern.compile(RegexPatterns.VERIFY_CARDNO_REGEX); Matcher matcher = patternPhone.matcher(lpd.getString("var2")); - Matcher matcherRardNo = patternRardNo.matcher(lpd.getString("var5")); - if (!matcherRardNo.matches()) { - errorStr.append("第" + number + "行,"); - errorStr.append("定位卡号" + CardNo + "格式不正确,请重新确认数据;\n"); + Matcher matcherRardNo = patternRardNo.matcher(CardNo); + if (Tools.notEmpty(CardNo)) { + // 现在卡号可以为空 不为空得话进入正则 + if (!matcherRardNo.matches()) { + errorStr.append("第" + number + "行,"); + errorStr.append("定位卡号" + CardNo + "格式不正确(非负正整数),请重新确认数据;\n"); + } } if (!matcher.matches()) { errorStr.append("第" + number + "行,"); diff --git a/src/main/java/com/zcloud/entity/hotWorkApplication/Node.java b/src/main/java/com/zcloud/entity/hotWorkApplication/Node.java index 56226f3..9d8a072 100644 --- a/src/main/java/com/zcloud/entity/hotWorkApplication/Node.java +++ b/src/main/java/com/zcloud/entity/hotWorkApplication/Node.java @@ -187,9 +187,6 @@ public class Node { buffer.append("
"); buffer.append("指派人:"); buffer.append(hiddeny.getString("YINNAME")); - buffer.append("
("); - buffer.append(hiddeny.getString("CREATTIME")); - buffer.append(")"); } this.text = buffer.toString(); diff --git a/src/main/java/com/zcloud/mapper/datasource/corp/CorpInfoMapper.java b/src/main/java/com/zcloud/mapper/datasource/corp/CorpInfoMapper.java index b4743e2..2817958 100644 --- a/src/main/java/com/zcloud/mapper/datasource/corp/CorpInfoMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/corp/CorpInfoMapper.java @@ -73,5 +73,7 @@ public interface CorpInfoMapper { PageData getInfo(PageData corpCondition); PageData eightWorkBI(PageData pd); + + void updateEnterpriseId(PageData corpPage); } diff --git a/src/main/java/com/zcloud/mapper/datasource/system/UsersMapper.java b/src/main/java/com/zcloud/mapper/datasource/system/UsersMapper.java index 2e9ac35..e11aa1e 100644 --- a/src/main/java/com/zcloud/mapper/datasource/system/UsersMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/system/UsersMapper.java @@ -259,4 +259,8 @@ public interface UsersMapper { List selectUserListByUserIds(PageData pd); PageData getUserByCardNo(PageData pageData); + + void removeCardNoUser(PageData pageData); + + void editUserCardNoByPid(PageData pageData); } diff --git a/src/main/java/com/zcloud/service/corp/CorpInfoService.java b/src/main/java/com/zcloud/service/corp/CorpInfoService.java index 2b23be0..ed9f58f 100644 --- a/src/main/java/com/zcloud/service/corp/CorpInfoService.java +++ b/src/main/java/com/zcloud/service/corp/CorpInfoService.java @@ -70,5 +70,7 @@ public interface CorpInfoService { public PageData findByCode(PageData pd)throws Exception; PageData eightWorkBI(PageData pd)throws Exception; + + void updateEnterpriseId(PageData corpPage); } diff --git a/src/main/java/com/zcloud/service/corp/impl/CorpInfoServiceImpl.java b/src/main/java/com/zcloud/service/corp/impl/CorpInfoServiceImpl.java index 23e5619..09ffbc7 100644 --- a/src/main/java/com/zcloud/service/corp/impl/CorpInfoServiceImpl.java +++ b/src/main/java/com/zcloud/service/corp/impl/CorpInfoServiceImpl.java @@ -113,5 +113,10 @@ public class CorpInfoServiceImpl implements CorpInfoService { return corpinfoMapper.eightWorkBI(pd); } + @Override + public void updateEnterpriseId(PageData corpPage) { + corpinfoMapper.updateEnterpriseId(corpPage); + } + } diff --git a/src/main/java/com/zcloud/service/inspection/impl/SafetyEnvironmentalServiceImpl.java b/src/main/java/com/zcloud/service/inspection/impl/SafetyEnvironmentalServiceImpl.java index d6e116f..4edeeed 100644 --- a/src/main/java/com/zcloud/service/inspection/impl/SafetyEnvironmentalServiceImpl.java +++ b/src/main/java/com/zcloud/service/inspection/impl/SafetyEnvironmentalServiceImpl.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.mapper.datasource.inspection.SafetyEnvironmentalMapper; +import com.zcloud.mapper.datasource.system.UsersMapper; import com.zcloud.service.bus.*; import com.zcloud.service.hidden.HiddenService; import com.zcloud.service.inspection.*; @@ -59,6 +60,8 @@ public class SafetyEnvironmentalServiceImpl implements SafetyEnvironmentalServic private DepartmentService departmentService; @Autowired private SafetyEnvironmentalExplainService explainService; + @Resource + private UsersMapper usersMapper; @Resource private NoticeCorpUtil noticeCorpUtil; @@ -150,18 +153,23 @@ public class SafetyEnvironmentalServiceImpl implements SafetyEnvironmentalServic hidden.put("HIDDENDESCR", json.getString("HIDDENDESCR")); //隐患描述 hidden.put("HIDDENPART", json.getString("HIDDENPART")); //隐患部位 hidden.put("HIDDENLEVEL", json.getString("HIDDENLEVEL")); //隐患级别 - hidden.put("HIDDENTYPE_NAME", json.getString("HIDDENTYPENAME"));//隐患类型名称 + hidden.put("HIDDENTYPE_NAME", StringUtils.isNotBlank(json.getString("HIDDENTYPENAME")) ? json.getString("HIDDENTYPENAME") : json.getString("HIDDENTYPE_NAME"));//隐患类型名称 hidden.put("LONGITUDE", json.getString("LONGITUDE")); //隐患位置经度 hidden.put("LATITUDE", json.getString("LATITUDE")); //隐患位置纬度 hidden.put("DISCOVERYTIME", json.getString("DISCOVERYTIME")); //隐患发现时间 - hidden.put("HIDDENFINDDEPT", json.getString("HIDDENFINDDEPT")); //隐患发现部门(隐患责任人部门) hidden.put("CREATOR", json.getString("CREATOR")); //发现人(隐患责任人) + PageData user = new PageData(); + user.put("USER_ID",json.getString("CREATOR")); + user = usersMapper.findById(user); + if (user != null) { + hidden.put("HIDDENFINDDEPT", user.getString("DEPARTMENT_ID")); //隐患发现部门(隐患责任人部门) + } hidden.put("SOURCE", json.getString("SOURCE")); //发现人(隐患责任人) hidden.put("ISRELEVANT",json.getString("ISRELEVANT"));//是否相关方1是2否 hidden.put("STATE", "100"); //隐患状态 100-安全环保检查暂存的隐患(流程完转0) hidden.put("CREATTIME", time); //发现时间 hidden.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); - hidden.put("RECTIFICATIONTYPE", pd.getString("RECTIFICATIONTYPE")); + hidden.put("RECTIFICATIONTYPE", "2"); hidden.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) hidden.put("POSITIONDESC",json.getString("POSITIONDESC")); hiddenService.save(hidden); @@ -401,16 +409,23 @@ public class SafetyEnvironmentalServiceImpl implements SafetyEnvironmentalServic hidden.put("HIDDENTYPE2", lists.get(1)); //隐患类型2 hidden.put("HIDDENTYPE3", lists.get(2)); //隐患类型3 } - hidden.put("HIDDENTYPE_NAME", json.getString("HIDDENTYPENAME"));//隐患类型名称 + hidden.put("HIDDENTYPE_NAME", json.getString("HIDDENTYPE_NAME"));//隐患类型名称 hidden.put("LONGITUDE", json.getString("LONGITUDE")); //隐患位置经度 hidden.put("LATITUDE", json.getString("LATITUDE")); //隐患位置纬度 hidden.put("DISCOVERYTIME", json.getString("DISCOVERYTIME")); //隐患发现时间 - hidden.put("HIDDENFINDDEPT", json.getString("HIDDENFINDDEPT")); //隐患发现部门(隐患责任人部门) +// hidden.put("HIDDENFINDDEPT", json.getString("HIDDENFINDDEPT")); //隐患发现部门(隐患责任人部门) hidden.put("CREATOR", json.getString("CREATOR")); //发现人(隐患责任人) + PageData user = new PageData(); + user.put("USER_ID",json.getString("CREATOR")); + user = usersMapper.findById(user); + if (user != null) { + hidden.put("HIDDENFINDDEPT", user.getString("DEPARTMENT_ID")); //隐患发现部门(隐患责任人部门) + } hidden.put("SOURCE", json.getString("SOURCE")); //发现人(隐患责任人) hidden.put("STATE", "100"); //隐患状态 100-安全环保检查暂存的隐患(流程完转0) hidden.put("CREATTIME", time); //发现时间 hidden.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); + hidden.put("RECTIFICATIONTYPE", "2"); hidden.put("ISDELETE", "0"); //是否删除(0:有效 1:删除) hidden.put("POSITIONDESC",json.getString("POSITIONDESC")); hidden.put("ISRELEVANT",json.getString("ISRELEVANT")); diff --git a/src/main/java/com/zcloud/service/system/UsersService.java b/src/main/java/com/zcloud/service/system/UsersService.java index 9896f78..a1910a2 100644 --- a/src/main/java/com/zcloud/service/system/UsersService.java +++ b/src/main/java/com/zcloud/service/system/UsersService.java @@ -305,4 +305,7 @@ public interface UsersService { */ PageData getUserByCardNo(PageData pageData); + void removeCardNoUser(PageData pageData); + + void editUserCardNoByPid(PageData pageData); } diff --git a/src/main/java/com/zcloud/service/system/impl/UsersServiceImpl.java b/src/main/java/com/zcloud/service/system/impl/UsersServiceImpl.java index 9f58f2b..e6b05ab 100644 --- a/src/main/java/com/zcloud/service/system/impl/UsersServiceImpl.java +++ b/src/main/java/com/zcloud/service/system/impl/UsersServiceImpl.java @@ -284,7 +284,15 @@ public class UsersServiceImpl implements UsersService { return usersMapper.getUserByCardNo(pageData); } + @Override + public void removeCardNoUser(PageData pageData) { + usersMapper.removeCardNoUser(pageData); + } + @Override + public void editUserCardNoByPid(PageData pageData) { + usersMapper.editUserCardNoByPid(pageData); + } @Override @@ -358,6 +366,7 @@ public class UsersServiceImpl implements UsersService { PageData response = PLSUtil.saveUser(pd); if ("200".equals(response.getString("code"))) { pd.put("PLS_ID", response.getString("data")); + if (Tools.isEmpty(pd.getString("CARDNO"))) pd.put("CARDNO",null); usersMapper.saveUser(pd); FHLOG.save(Jurisdiction.getUsername(), "新增用户:" + pd.getString("USERNAME")); return ReturnMap.ok(); diff --git a/src/main/java/com/zcloud/util/PLSUtil.java b/src/main/java/com/zcloud/util/PLSUtil.java index a911be9..420c5ca 100644 --- a/src/main/java/com/zcloud/util/PLSUtil.java +++ b/src/main/java/com/zcloud/util/PLSUtil.java @@ -470,6 +470,7 @@ public class PLSUtil { * @Return: void */ public static boolean hasCardNumber(PageData user) throws Exception { + if (Tools.isEmpty(user.getString("CARDNO"))) {return true;} // 根据 定位卡号获取对应的人 String url = BAKEADDR.get(Jurisdiction.getCORPINFO_ID()) + "/deploy/card/peopleDisplay/" + user.getString("CARDNO"); PageData response = sendGetHttpRequest(url, null, getToken(Jurisdiction.getCORPINFO_ID())); diff --git a/src/main/java/com/zcloud/util/RegexPatterns.java b/src/main/java/com/zcloud/util/RegexPatterns.java index 2a80383..6ed37d6 100644 --- a/src/main/java/com/zcloud/util/RegexPatterns.java +++ b/src/main/java/com/zcloud/util/RegexPatterns.java @@ -23,7 +23,7 @@ public class RegexPatterns { * 验证码正则, 6位数字或字母 */ public static final String VERIFY_CODE_REGEX = "^[a-zA-Z\\d]{6}$"; - public static final String VERIFY_CARDNO_REGEX = "^[0-9]{5}$"; + public static final String VERIFY_CARDNO_REGEX = "^[1-9][0-9]*$"; /** * 身份证号正则, 15位或者18位,最后一位可以为字母 */ diff --git a/src/main/resources/mybatis/datasource/corp/CorpInfoMapper.xml b/src/main/resources/mybatis/datasource/corp/CorpInfoMapper.xml index 9650d4b..c3f566a 100644 --- a/src/main/resources/mybatis/datasource/corp/CorpInfoMapper.xml +++ b/src/main/resources/mybatis/datasource/corp/CorpInfoMapper.xml @@ -333,8 +333,16 @@ where CORPINFO_ID = #{CORPINFO_ID} + + update + + set + enterpriseId = #{enterpriseId} + where + CORPINFO_ID = #{CORPINFO_ID} + - +