From 28a463193a33315c270d02d956de0302256718ee Mon Sep 17 00:00:00 2001 From: guoshengxiong <1923636941@qq.com> Date: Mon, 2 Sep 2024 17:45:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=85=E5=A4=B4=202024-09-02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ivilEngineeringQualityInspectionOrder.java | 6 +- .../mapper/FirstExampleManageMapper.java | 2 + .../mapper/xml/FirstExampleManageMapper.xml | 19 ++ .../NondestructiveTestOrderTicketMapper.xml | 24 +- .../impl/FirstExampleManageServiceImpl.java | 2 +- .../ProjectEnterpriseController.java | 210 ++++++++++++++++-- .../entity/EnterpriseQualification.java | 16 ++ .../zhgd/xmgl/security/WebSecurityConfig.java | 3 + .../java/com/zhgd/xmgl/util/FlowUtil.java | 8 + 9 files changed, 251 insertions(+), 39 deletions(-) diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/entity/CivilEngineeringQualityInspectionOrder.java b/src/main/java/com/zhgd/xmgl/modules/baotou/entity/CivilEngineeringQualityInspectionOrder.java index e2b9bd392..d960e54b0 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/entity/CivilEngineeringQualityInspectionOrder.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/entity/CivilEngineeringQualityInspectionOrder.java @@ -138,9 +138,9 @@ public class CivilEngineeringQualityInspectionOrder implements Serializable { @Excel(name = "监理见证人", width = 15) @ApiModelProperty(value="监理见证人") private java.lang.Long supervisingWitnessUser ; - /**委托方电话*/ - @Excel(name = "委托方电话", width = 15) - @ApiModelProperty(value="委托方电话") + /**委托人电话*/ + @Excel(name = "委托人电话", width = 15) + @ApiModelProperty(value="委托人电话") private java.lang.String clientPhoneNumber ; /**见证记录*/ @Excel(name = "见证记录", width = 15) diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/FirstExampleManageMapper.java b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/FirstExampleManageMapper.java index 1c97d74e6..52910d411 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/FirstExampleManageMapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/FirstExampleManageMapper.java @@ -19,4 +19,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; public interface FirstExampleManageMapper extends BaseMapper { IPage queryList(Page page,@Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + FirstExampleManage getById(String id); } diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/FirstExampleManageMapper.xml b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/FirstExampleManageMapper.xml index 5b09231c3..9be98090b 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/FirstExampleManageMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/FirstExampleManageMapper.xml @@ -20,4 +20,23 @@ left join enterprise_info ei3 on ei3.id=t.construction_unit_id) t ${ew.customSqlSegment} + + diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/NondestructiveTestOrderTicketMapper.xml b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/NondestructiveTestOrderTicketMapper.xml index 789ad813f..6d414f42a 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/NondestructiveTestOrderTicketMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/NondestructiveTestOrderTicketMapper.xml @@ -9,12 +9,12 @@ ei.enterprise_name as commissioning_unit_name, ei1.enterprise_name as construction_unit_name, wi1.real_name as quality_charge_person_signature_name, - ei1.enterprise_name as epc_contractor_name, - wi1.real_name as professional_engineer_signature_name, - ei1.enterprise_name as supervising_unit_name, - wi1.real_name as supervising_engineer_signature_name, - ei1.enterprise_name as testing_unit_name, - wi1.real_name as testing_unit_charge_person_signature_name + ei2.enterprise_name as epc_contractor_name, + wi2.real_name as professional_engineer_signature_name, + ei3.enterprise_name as supervising_unit_name, + wi3.real_name as supervising_engineer_signature_name, + ei4.enterprise_name as testing_unit_name, + wi4.real_name as testing_unit_charge_person_signature_name from nondestructive_test_order_ticket t left join device_unit du on t.device_unit_id = du.id left join enterprise_info ei on ei.id=t.commissioning_unit @@ -38,12 +38,12 @@ ei.enterprise_name as commissioning_unit_name, ei1.enterprise_name as construction_unit_name, wi1.real_name as quality_charge_person_signature_name, - ei1.enterprise_name as epc_contractor_name, - wi1.real_name as professional_engineer_signature_name, - ei1.enterprise_name as supervising_unit_name, - wi1.real_name as supervising_engineer_signature_name, - ei1.enterprise_name as testing_unit_name, - wi1.real_name as testing_unit_charge_person_signature_name + ei2.enterprise_name as epc_contractor_name, + wi2.real_name as professional_engineer_signature_name, + ei3.enterprise_name as supervising_unit_name, + wi3.real_name as supervising_engineer_signature_name, + ei4.enterprise_name as testing_unit_name, + wi4.real_name as testing_unit_charge_person_signature_name from nondestructive_test_order_ticket t left join device_unit du on t.device_unit_id = du.id left join enterprise_info ei on ei.id=t.commissioning_unit diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/service/impl/FirstExampleManageServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/baotou/service/impl/FirstExampleManageServiceImpl.java index 0efcc9ea9..b32425e4b 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/service/impl/FirstExampleManageServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/service/impl/FirstExampleManageServiceImpl.java @@ -77,7 +77,7 @@ public class FirstExampleManageServiceImpl extends ServiceImpl> selectProjectEnterpriseList(@RequestBody Map map) { + public Result> selectProjectEnterpriseList(@RequestBody Map map) { List pageList = projectEnterpriseService.selectProjectEnterpriseList(map); return Result.success(pageList); } @@ -84,7 +113,7 @@ public class ProjectEnterpriseController { @ApiImplicitParam(name = "sn", value = "项目sn或企业sn", paramType = "body", required = true, dataType = "String"), }) @PostMapping(value = "/selectDetailList") - public Result>> selectDetailList(@RequestBody Map map) { + public Result>> selectDetailList(@RequestBody Map map) { map.put("pageNo", -1); map.put("pageSize", 10); IPage pageList = projectEnterpriseService.selectProjectEnterprisePage(map); @@ -109,7 +138,8 @@ public class ProjectEnterpriseController { } /** - * 添加 + * 添加 + * * @param projectEnterprise * @return */ @@ -122,12 +152,13 @@ public class ProjectEnterpriseController { } /** - * 编辑 + * 编辑 + * * @param projectEnterprise * @return */ - @OperLog(operModul = "合作单位管理",operType = "编辑合作的劳务公司",operDesc = "编辑合作的劳务公司") - @ApiOperation(value = "编辑项目劳务公司关联信息", notes = "编辑项目劳务公司关联信息" , httpMethod="POST") + @OperLog(operModul = "合作单位管理", operType = "编辑合作的劳务公司", operDesc = "编辑合作的劳务公司") + @ApiOperation(value = "编辑项目劳务公司关联信息", notes = "编辑项目劳务公司关联信息", httpMethod = "POST") @PostMapping(value = "/edit") public Result edit(@RequestBody ProjectEnterprise projectEnterprise) { projectEnterpriseService.editProjectEnterprise(projectEnterprise); @@ -135,64 +166,197 @@ public class ProjectEnterpriseController { } /** - * 通过id删除 + * 通过id删除 + * * @param * @return */ - @OperLog(operModul = "合作单位管理",operType = "删除合作的劳务公司",operDesc = "删除合作的劳务公司") + @OperLog(operModul = "合作单位管理", operType = "删除合作的劳务公司", operDesc = "删除合作的劳务公司") @ApiOperation(value = "删除项目劳务公司关联信息", notes = "删除项目劳务公司关联信息", httpMethod = "POST") @ApiImplicitParam(name = "id", value = "项目劳务公司关联ID", paramType = "body", required = true, dataType = "Integer") @PostMapping(value = "/delete") - public Result delete(@RequestBody Map map) { + public Result delete(@RequestBody Map map) { String id = MapUtils.getString(map, "id"); projectEnterpriseService.delete(id); return Result.ok(); } /** - * 批量删除 + * 批量删除 + * * @param * @return */ - @OperLog(operModul = "合作单位管理",operType = "批量删除合作的劳务公司",operDesc = "批量删除合作的劳务公司") + @OperLog(operModul = "合作单位管理", operType = "批量删除合作的劳务公司", operDesc = "批量删除合作的劳务公司") @ApiOperation(value = "批量删除项目劳务公司关联信息", notes = "批量删除项目劳务公司关联信息", httpMethod = "POST") @ApiImplicitParam(name = "ids", value = "项目劳务公司关联ID字符串", paramType = "body", required = true, dataType = "String") @PostMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestBody Map map) { + public Result deleteBatch(@RequestBody Map map) { projectEnterpriseService.deleteBatch(map); return Result.ok(); } /** * 通过id查询 + * * @param * @return */ @ApiOperation(value = "通过id查询项目劳务公司关联信息", notes = "通过id查询项目劳务公司关联信息", httpMethod = "POST") @ApiImplicitParam(name = "id", value = "项目劳务公司关联ID", paramType = "body", required = true, dataType = "Integer") @PostMapping(value = "/queryById") - public Result queryById(@RequestBody Map map) { + public Result queryById(@RequestBody Map map) { Result result = new Result(); - ProjectEnterprise projectEnterprise = projectEnterpriseService.getById(MapUtils.getString(map,"id")); - if(projectEnterprise==null) { + ProjectEnterprise projectEnterprise = projectEnterpriseService.getById(MapUtils.getString(map, "id")); + if (projectEnterprise == null) { result.error500(MessageUtil.get("notFindErr")); - }else { + } else { result.setResult(projectEnterprise); result.setSuccess(true); } return result; } - @ApiOperation(value = "修改项目下劳务公司企业类型", notes = "修改项目下劳务公司企业类型" , httpMethod="POST") + @ApiOperation(value = "修改项目下劳务公司企业类型", notes = "修改项目下劳务公司企业类型", httpMethod = "POST") @ApiImplicitParams({ @ApiImplicitParam(name = "enterpriseTypeId", value = "企业类型ID", paramType = "body", required = true, dataType = "String"), @ApiImplicitParam(name = "ids", value = "项目劳务公司关联ID,多个逗号分隔", paramType = "body", required = true, dataType = "Integer") }) @PostMapping(value = "/updateEnterpriseType") - public Result updateEnterpriseType(@RequestBody Map map) { + public Result updateEnterpriseType(@RequestBody Map map) { projectEnterpriseService.updateEnterpriseType(map); return Result.ok(); } - + @OperLog(operModul = "合作单位管理", operType = "", operDesc = "工作流承包商入场") + @ApiOperation(value = "工作流承包商入场", notes = "工作流承包商入场", httpMethod = "POST") + @PostMapping(value = "/flow/add") + public Result addFromFlow(@RequestBody Map map) { + log.info("工作流承包商入场:{}", JSON.toJSONString(map)); + String title = "承包商入场申请"; + String enterpriseName = FlowUtil.getString(map, "enterpriseName"); + String description = FlowUtil.getString(map, "description"); + String enterpriseAddress = FlowUtil.getString(map, "enterpriseAddress"); + String enterpriseLegalPerson = FlowUtil.getString(map, "enterpriseLegalPerson"); + String legalPersonIdCard = FlowUtil.getString(map, "legalPersonIdCard"); + String enterpriseSafeAllow = FlowUtil.getString(map, "enterpriseSafeAllow"); + String legalPersonTel = FlowUtil.getString(map, "legalPersonTel"); + String socialCode = FlowUtil.getString(map, "socialCode"); + String businessNumber = FlowUtil.getString(map, "businessNumber"); + String qualificationNumber = FlowUtil.getString(map, "qualificationNumber"); + String enterpriseEmail = FlowUtil.getString(map, "enterpriseEmail"); + String registeredCapital = FlowUtil.getString(map, "registeredCapital"); + String bankname = FlowUtil.getString(map, "bankname"); + String bankcardnumber = FlowUtil.getString(map, "bankcardnumber"); + String bankcode = FlowUtil.getString(map, "bankcode"); + String enterpriseQualificationUrl = FlowUtil.getString(map, "enterpriseQualificationUrl"); + String businessLicenseEndDate = FlowUtil.getString(map, "businessLicenseEndDate"); + String registerPersonName = FlowUtil.getString(map, "registerPersonName"); + String registerPersonPhoneTel = FlowUtil.getString(map, "registerPersonPhoneTel"); + String enterpriseSn = FlowUtil.getString(map, "enterpriseSn"); + String logo = FlowUtil.getString(map, "logo"); + String projectSn = FlowUtil.getString(map, "projectSn"); + String registDate = FlowUtil.getString(map, "registDate"); + String businessLicenseUrl = FlowUtil.getString(map, "businessLicenseUrl"); + String projectDirectorName = FlowUtil.getString(map, "projectDirectorName"); + String projectDirectorPhone = FlowUtil.getString(map, "projectDirectorPhone"); + Long parentEnterpriseId = FlowUtil.getPullDownLong(map, "parentEnterpriseId"); + Long enterpriseTypeId = FlowUtil.getPullDownLong(map, "enterpriseTypeId"); + EnterpriseInfo enterpriseInfo = new EnterpriseInfo(); + enterpriseInfo.setEnterpriseName(enterpriseName); + enterpriseInfo.setDescription(description); + enterpriseInfo.setEnterpriseAddress(enterpriseAddress); + enterpriseInfo.setEnterpriseLegalPerson(enterpriseLegalPerson); + enterpriseInfo.setLegalPersonIdCard(legalPersonIdCard); + enterpriseInfo.setEnterpriseSafeAllow(enterpriseSafeAllow); +// enterpriseInfo.setEnterpriseProperty(0); + enterpriseInfo.setLegalPersonTel(legalPersonTel); + enterpriseInfo.setSocialCode(socialCode); + enterpriseInfo.setBusinessNumber(businessNumber); +// enterpriseInfo.setQualificationNumber(qualificationNumber); +// enterpriseInfo.setEnterpriseEmail(enterpriseEmail); +// enterpriseInfo.setRegisteredCapital(registeredCapital); +// enterpriseInfo.setBankname(bankname); +// enterpriseInfo.setBankcardnumber(bankcardnumber); +// enterpriseInfo.setBankcode(bankcode); + enterpriseInfo.setEnterpriseQualificationUrl(enterpriseQualificationUrl); + enterpriseInfo.setBusinessLicenseEndDate(businessLicenseEndDate); + enterpriseInfo.setRegisterPersonName(registerPersonName); + enterpriseInfo.setRegisterPersonPhoneTel(registerPersonPhoneTel); + enterpriseInfo.setEnterpriseSn(enterpriseSn); +// enterpriseInfo.setLogo(logo); + enterpriseInfo.setRegistDate(registDate); + enterpriseInfo.setBusinessLicenseUrl(businessLicenseUrl); + enterpriseInfo.setParentEnterpriseId(parentEnterpriseId); + enterpriseInfo.setEnterpriseTypeId(enterpriseTypeId); + enterpriseInfo.setProjectDirectorName(projectDirectorName); + enterpriseInfo.setProjectDirectorPhone(projectDirectorPhone); + enterpriseInfo.setProjectSn(projectSn); + String sub = enterpriseName + "(信用代码:" + socialCode + ")"; + EnterpriseInfo existEnterpriseInfo = enterpriseInfoService.getOne(new LambdaQueryWrapper().eq(EnterpriseInfo::getSocialCode, socialCode)); + if (existEnterpriseInfo != null) { + List projectEnterpriseList = projectEnterpriseService.list(new LambdaQueryWrapper() + .eq(ProjectEnterprise::getEnterpriseId, existEnterpriseInfo.getId()) + .eq(ProjectEnterprise::getProjectSn, projectSn)); + if (CollUtil.isNotEmpty(projectEnterpriseList)) { + String msg = sub + "已存在"; + noticeService.addProjectLevelNotice(projectSn, title, msg, "1", null); + return Result.ok(); + } + } + List enterpriseQualifications = Optional.ofNullable(map.get("enterpriseQualifications")).map(o -> ((List) o)).orElse(null); + if (CollUtil.isEmpty(enterpriseQualifications)) { + throw new OpenAlertException("企业资质不能为空"); + } + HashSet haveQualificationTypes = new HashSet<>(); + if (Objects.equals(enterpriseTypeId, 6)) { + //专业分包 + haveQualificationTypes.add(1); + haveQualificationTypes.add(3); + haveQualificationTypes.add(4); + haveQualificationTypes.add(5); + haveQualificationTypes.add(6); + haveQualificationTypes.add(7); + } else { + haveQualificationTypes.add(1); + haveQualificationTypes.add(2); + } + ArrayList qualificationList = new ArrayList<>(); + for (Object qr : enterpriseQualifications) { + Map map1 = (Map) qr; + String fileName = MapUtils.getString(map1, "field3157982972904"); + String fileNumber = MapUtils.getString(map1, "field1097582981600"); + String fileUrl = FlowUtil.getFileUrl(map1, "field9706683030062"); + String remarks = MapUtils.getString(map1, "field8724783057283"); + String originFileName = FlowUtil.getFileOriginFileName(map1, "field9706683030062"); + Integer qualificationType = Optional.ofNullable(map1.get("field6906058457282")).map(o -> Convert.toInt(((List) o).get(0))).orElse(null); + Date qualificationStartTime = FlowUtil.getStartDate(map1, "field8056482998908"); + Date qualificationEndTime = FlowUtil.getEndDate(map1, "field8056482998908"); + haveQualificationTypes.remove(qualificationType); + EnterpriseQualification qualification = new EnterpriseQualification(); +// qualification.setEnterpriseId(0L); + qualification.setFileName(fileName); + qualification.setFileNumber(fileNumber); + qualification.setFileUrl(fileUrl); + qualification.setRemarks(remarks); + qualification.setOriginFileName(originFileName); + qualification.setQualificationType(qualificationType); + qualification.setQualificationStartTime(qualificationStartTime); + qualification.setQualificationEndTime(qualificationEndTime); + qualificationList.add(qualification); + } + if (CollUtil.isNotEmpty(haveQualificationTypes)) { + if (Objects.equals(enterpriseTypeId, 6)) { + throw new OpenAlertException("需要上传营业执照、企业资质、设计资质(设计专业提供)、安全生产许可证、职业健康安全管理体系认证证书、环境管理体系认证证书"); + } else { + throw new OpenAlertException("需要上传营业执照、资质证书"); + } + } + enterpriseInfoService.saveEnterpriseInfo(enterpriseInfo); + for (EnterpriseQualification qualification : qualificationList) { + qualification.setEnterpriseId(enterpriseInfo.getId()); + } + enterpriseQualificationService.saveBatch(qualificationList); + return Result.ok(); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/entity/EnterpriseQualification.java b/src/main/java/com/zhgd/xmgl/modules/worker/entity/EnterpriseQualification.java index a3f07f81a..1bbd07791 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/entity/EnterpriseQualification.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/entity/EnterpriseQualification.java @@ -75,6 +75,22 @@ public class EnterpriseQualification implements Serializable { @Excel(name = "资质类型(字典)", width = 15) @ApiModelProperty(value = "资质类型(字典)") private java.lang.Integer qualificationType; + /** + * 资质开始时间 + */ + @Excel(name = "资质开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "资质开始时间") + private java.util.Date qualificationStartTime; + /** + * 资质结束时间 + */ + @Excel(name = "资质结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "资质结束时间") + private java.util.Date qualificationEndTime; @TableField(exist = false) private Long userId; @TableField(exist = false) diff --git a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java index 9bba75695..8ff571178 100644 --- a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java +++ b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java @@ -80,6 +80,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { http.authorizeRequests() //请求路径允许访问 + .antMatchers("/xmgl/projectEnterprise/flow/add").permitAll() + .antMatchers("/xmgl/flowExceptionLog/flow/add").permitAll() + .antMatchers("/xmgl/flowExceptionLog/add").permitAll() .antMatchers("/xmgl/civilEngineeringQualityInspectionOrder/flow/add").permitAll() .antMatchers("/xmgl/nondestructiveTestOrderTicket/flow/add").permitAll() .antMatchers("/xmgl/constructionEquipmentTool/flow/add").permitAll() diff --git a/src/main/java/com/zhgd/xmgl/util/FlowUtil.java b/src/main/java/com/zhgd/xmgl/util/FlowUtil.java index 90889a9df..a64635de5 100644 --- a/src/main/java/com/zhgd/xmgl/util/FlowUtil.java +++ b/src/main/java/com/zhgd/xmgl/util/FlowUtil.java @@ -62,6 +62,14 @@ public class FlowUtil { return Optional.ofNullable(map.get(key)).map(o -> DateUtil.parse(o.toString())).orElse(null); } + public static Date getStartDate(Map map, String key) { + return Optional.ofNullable(map.get(key)).map(o -> DateUtil.parse(Convert.toStr(((List) o).get(0)))).orElse(null); + } + + public static Date getEndDate(Map map, String key) { + return Optional.ofNullable(map.get(key)).map(o -> DateUtil.parse(Convert.toStr(((List) o).get(1)))).orElse(null); + } + public static String getJSONString(Map map, String key) { return Optional.ofNullable(map.get(key)).map(JSON::toJSONString).orElse(null); }