diff --git a/src/main/java/com/cm/inspection/controller/app/apis/enterprise/EnterpriseAppController.java b/src/main/java/com/cm/inspection/controller/app/apis/enterprise/EnterpriseAppController.java index a47e875..33adc4c 100644 --- a/src/main/java/com/cm/inspection/controller/app/apis/enterprise/EnterpriseAppController.java +++ b/src/main/java/com/cm/inspection/controller/app/apis/enterprise/EnterpriseAppController.java @@ -11,6 +11,7 @@ import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO; +import com.cm.inspection.pojo.vos.enterprise.EnterpriseClassifyVO; import com.cm.inspection.pojo.vos.enterprise.EnterpriseNatureVO; import com.cm.inspection.pojo.vos.enterprise.EnterpriseVO; import com.cm.inspection.service.enterprise.IEnterpriseService; @@ -85,6 +86,20 @@ public class EnterpriseAppController extends AbstractController { return enterpriseService.updateEnterpriseNatureByToken(token, enterpriseId, enterpriseNatureVO); } + @ApiOperation(value = "更新企业分类", notes = "更新企业分类") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "enterpriseId", value = "企业ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PutMapping("updateenterpriseclassify/{enterpriseId}") + @CheckRequestBodyAnnotation + public SuccessResult updateEnterpriseClassify(@RequestHeader("token") String token, + @PathVariable("enterpriseId") String enterpriseId, + @RequestBody EnterpriseClassifyVO enterpriseClassifyVO) throws Exception { + return enterpriseService.updateEnterpriseClassifyByToken(token, enterpriseId, enterpriseClassifyVO); + } + @ApiOperation(value = "企业详情(通过ID)", notes = "企业详情(通过ID)接口") @ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", paramType = "header"), diff --git a/src/main/java/com/cm/inspection/dao/enterprise/IEnterpriseDao.java b/src/main/java/com/cm/inspection/dao/enterprise/IEnterpriseDao.java index 3d6c200..73db604 100644 --- a/src/main/java/com/cm/inspection/dao/enterprise/IEnterpriseDao.java +++ b/src/main/java/com/cm/inspection/dao/enterprise/IEnterpriseDao.java @@ -61,6 +61,14 @@ public interface IEnterpriseDao { */ void updateEnterpriseNature(Map params) throws UpdateException; + /** + * 更新企业分类 + * + * @param params + * @throws UpdateException + */ + void updateEnterpriseClassify(Map params) throws UpdateException; + /** * 企业详情 * @@ -89,6 +97,8 @@ public interface IEnterpriseDao { List listEnterprise(Map params) throws SearchException; /** + * 统计企业 + * * @param params * @return * @throws SearchException @@ -103,4 +113,6 @@ public interface IEnterpriseDao { * @throws SearchException */ List listEnterpriseByUser(Map params) throws SearchException; + + } diff --git a/src/main/java/com/cm/inspection/pojo/dtos/taskcheck/TaskCheckDTO.java b/src/main/java/com/cm/inspection/pojo/dtos/taskcheck/TaskCheckDTO.java index 6a9f7ec..a46b5e2 100644 --- a/src/main/java/com/cm/inspection/pojo/dtos/taskcheck/TaskCheckDTO.java +++ b/src/main/java/com/cm/inspection/pojo/dtos/taskcheck/TaskCheckDTO.java @@ -29,6 +29,10 @@ public class TaskCheckDTO { private String enterpriseNature; @ApiModelProperty(name = "enterpriseNatureDictionaryName", value = "企业场所性质名称") private String enterpriseNatureDictionaryName; + @ApiModelProperty(name = "enterpriseClassify", value = "企业分类") + private String enterpriseClassify; + @ApiModelProperty(name = "enterpriseClassifyDictionaryName", value = "企业分类名称") + private String enterpriseClassifyDictionaryName; @ApiModelProperty(name = "gmtCreate", value = "发布时间") private String gmtCreate; @ApiModelProperty(name = "userId", value = "处理人") @@ -108,6 +112,22 @@ public class TaskCheckDTO { this.userId = userId; } + public String getEnterpriseClassify() { + return enterpriseClassify == null ? "" : enterpriseClassify.trim(); + } + + public void setEnterpriseClassify(String enterpriseClassify) { + this.enterpriseClassify = enterpriseClassify; + } + + public String getEnterpriseClassifyDictionaryName() { + return enterpriseClassifyDictionaryName == null ? "" : enterpriseClassifyDictionaryName.trim(); + } + + public void setEnterpriseClassifyDictionaryName(String enterpriseClassifyDictionaryName) { + this.enterpriseClassifyDictionaryName = enterpriseClassifyDictionaryName; + } + public String getGmtCreate() { return gmtCreate == null ? "" : gmtCreate.trim(); } @@ -143,6 +163,10 @@ public class TaskCheckDTO { .append(enterpriseNature).append('\"'); sb.append(",\"enterpriseNatureDictionaryName\":\"") .append(enterpriseNatureDictionaryName).append('\"'); + sb.append(",\"enterpriseClassify\":\"") + .append(enterpriseClassify).append('\"'); + sb.append(",\"enterpriseClassifyDictionaryName\":\"") + .append(enterpriseClassifyDictionaryName).append('\"'); sb.append(",\"gmtCreate\":\"") .append(gmtCreate).append('\"'); sb.append(",\"userId\":\"") diff --git a/src/main/java/com/cm/inspection/pojo/vos/enterprise/EnterpriseClassifyVO.java b/src/main/java/com/cm/inspection/pojo/vos/enterprise/EnterpriseClassifyVO.java new file mode 100644 index 0000000..cb6cf9c --- /dev/null +++ b/src/main/java/com/cm/inspection/pojo/vos/enterprise/EnterpriseClassifyVO.java @@ -0,0 +1,40 @@ +package com.cm.inspection.pojo.vos.enterprise; + +import com.cm.common.annotation.CheckEmptyAnnotation; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: EnterpriseNatureVO + * @Description: 企业分类 + * @Author: WangGeng + * @Date: 2020/5/3 20:00 + * @Version: 1.0 + **/ +@ApiModel +public class EnterpriseClassifyVO { + + @ApiModelProperty(name = "classifyId", value = "企业分类") + @CheckEmptyAnnotation(name = "企业分类") + private String classifyId; + + public String getClassifyId() { + return classifyId == null ? "" : classifyId.trim(); + } + + public void setClassifyId(String classifyId) { + this.classifyId = classifyId; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("{"); + sb.append("\"classifyId\":\"") + .append(classifyId).append('\"'); + sb.append('}'); + return sb.toString(); + } +} diff --git a/src/main/java/com/cm/inspection/service/enterprise/IEnterpriseService.java b/src/main/java/com/cm/inspection/service/enterprise/IEnterpriseService.java index 23353d7..57d22af 100644 --- a/src/main/java/com/cm/inspection/service/enterprise/IEnterpriseService.java +++ b/src/main/java/com/cm/inspection/service/enterprise/IEnterpriseService.java @@ -9,6 +9,7 @@ import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO; +import com.cm.inspection.pojo.vos.enterprise.EnterpriseClassifyVO; import com.cm.inspection.pojo.vos.enterprise.EnterpriseNatureVO; import com.cm.inspection.pojo.vos.enterprise.EnterpriseVO; @@ -104,6 +105,17 @@ public interface IEnterpriseService { */ SuccessResult updateEnterpriseNatureByToken(String token, String enterpriseId, EnterpriseNatureVO enterpriseNatureVO) throws Exception; + /** + * 更新企业分类 + * + * @param token + * @param enterpriseId + * @param enterpriseClassifyVO + * @return + * @throws Exception + */ + SuccessResult updateEnterpriseClassifyByToken(String token, String enterpriseId, EnterpriseClassifyVO enterpriseClassifyVO) throws Exception; + /** * 更新企业位置 * @@ -195,4 +207,5 @@ public interface IEnterpriseService { * @throws SearchException */ List listEnterpriseByUserId(String userId) throws SearchException; + } diff --git a/src/main/java/com/cm/inspection/service/enterprise/impl/EnterpriseServiceImpl.java b/src/main/java/com/cm/inspection/service/enterprise/impl/EnterpriseServiceImpl.java index f8426a9..e1383e7 100644 --- a/src/main/java/com/cm/inspection/service/enterprise/impl/EnterpriseServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/enterprise/impl/EnterpriseServiceImpl.java @@ -12,6 +12,7 @@ import com.cm.common.utils.HashMapUtil; import com.cm.common.utils.UUIDUtil; import com.cm.inspection.dao.enterprise.IEnterpriseDao; import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO; +import com.cm.inspection.pojo.vos.enterprise.EnterpriseClassifyVO; import com.cm.inspection.pojo.vos.enterprise.EnterpriseNatureVO; import com.cm.inspection.pojo.vos.enterprise.EnterpriseVO; import com.cm.inspection.pojo.vos.enterpriseofgridoperator.EnterpriseOfGridOperatorVO; @@ -162,6 +163,28 @@ public class EnterpriseServiceImpl extends BaseService implements IEnterpriseSer return new SuccessResult(); } + @Override + public SuccessResult updateEnterpriseClassifyByToken(String token, String enterpriseId, EnterpriseClassifyVO enterpriseClassifyVO) throws Exception { + EnterpriseDTO enterpriseDTO = getEnterpriseById(enterpriseId); + if (enterpriseDTO == null) { + throw new ParamsException("企业不存在"); + } + if (!StringUtils.isBlank(enterpriseDTO.getClassify())) { + throw new ParamsException("企业已经绑定分类"); + } + DataDictionaryDTO dataDictionaryDTO = dataDictionaryService.getDictionaryById(enterpriseClassifyVO.getClassifyId()); + if (dataDictionaryDTO == null) { + throw new ParamsException("企业分类不存在"); + } + Map params = getHashMap(5); + params.put("enterpriseId", enterpriseId); + params.put("classify", enterpriseClassifyVO.getClassifyId()); + params.put("classifyDictionaryName", dataDictionaryDTO.getDictionaryName()); + setUpdateInfo(token, params); + enterpriseDao.updateEnterpriseClassify(params); + return new SuccessResult(); + } + @Override public void updateEnterpriseLocationByEnterpriseId(String enterpriseId, String checkLng, String checkLat) throws UpdateException { updateEnterpriseLocationByTokenAndEnterpriseId(null, enterpriseId, checkLng, checkLat); diff --git a/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml b/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml index 2541b65..deaf943 100644 --- a/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml +++ b/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml @@ -133,13 +133,13 @@ UPDATE - gen_enterprise + gen_enterprise SET - is_delete = 1, - modifier = #{modifier}, - gmt_modified = #{gmtModified} + is_delete = 1, + modifier = #{modifier}, + gmt_modified = #{gmtModified} WHERE - enterprise_id IN + enterprise_id IN #{enterpriseIds[${index}]} @@ -148,7 +148,7 @@ UPDATE - gen_enterprise + gen_enterprise SET name = #{name}, @@ -249,16 +249,16 @@ is_log_off = #{isLogOff}, - modifier = #{modifier}, - gmt_modified = #{gmtModified} + modifier = #{modifier}, + gmt_modified = #{gmtModified} WHERE - enterprise_id = #{enterpriseId} + enterprise_id = #{enterpriseId} UPDATE - gen_enterprise + gen_enterprise SET enterprise_lng = #{enterpriseLng}, @@ -266,16 +266,16 @@ enterprise_lat = #{enterpriseLat}, - modifier = #{modifier}, - gmt_modified = #{gmtModified} + modifier = #{modifier}, + gmt_modified = #{gmtModified} WHERE - enterprise_id = #{enterpriseId} + enterprise_id = #{enterpriseId} UPDATE - gen_enterprise + gen_enterprise SET nature = #{nature}, @@ -283,54 +283,71 @@ nature_dictionary_name = #{natureDictionaryName}, - modifier = #{modifier}, - gmt_modified = #{gmtModified} + modifier = #{modifier}, + gmt_modified = #{gmtModified} WHERE - enterprise_id = #{enterpriseId} + enterprise_id = #{enterpriseId} + + + + + UPDATE + gen_enterprise + SET + + classify = #{classify}, + + + classify_dictionary_name = #{classifyDictionaryName}, + + modifier = #{modifier}, + gmt_modified = #{gmtModified} + WHERE + enterprise_id = #{enterpriseId} SELECT - t1.name, - t1.type, - t1.area1, - t1.area2, - t1.area3, - t1.area4, - t1.area5, - t1.address, - t1.industry_type, - t1.industry, - t1.engaged_count, - t1.risk_operation, - t1.master, - t1.phone, - t1.factory_gate, - t1.workplace, - t1.industry_type, - t1.bussiness_reg_num, - t1.legal_person, - t1.summary, - t1.classify, - t1.classify_dictionary_name, - t1.nature, - t1.nature_dictionary_name, - t1.is_log_off, - t1.remarks, - t1.enterprise_id + t1.name, + t1.type, + t1.area1, + t1.area2, + t1.area3, + t1.area4, + t1.area5, + t1.address, + t1.industry_type, + t1.industry, + t1.engaged_count, + t1.risk_operation, + t1.master, + t1.phone, + t1.factory_gate, + t1.workplace, + t1.industry_type, + t1.bussiness_reg_num, + t1.legal_person, + t1.summary, + t1.classify, + t1.classify_dictionary_name, + t1.nature, + t1.nature_dictionary_name, + t1.is_log_off, + t1.remarks, + t1.enterprise_id FROM - gen_enterprise t1 + gen_enterprise t1 WHERE - t1.is_delete = 0 + t1.is_delete = 0 - AND + AND t1.enterprise_id = #{enterpriseId} diff --git a/src/main/resources/mybatis/mapper/taskcheck/taskcheck-mapper.xml b/src/main/resources/mybatis/mapper/taskcheck/taskcheck-mapper.xml index 06579b6..f3ba2c8 100644 --- a/src/main/resources/mybatis/mapper/taskcheck/taskcheck-mapper.xml +++ b/src/main/resources/mybatis/mapper/taskcheck/taskcheck-mapper.xml @@ -11,6 +11,8 @@ + + @@ -115,6 +117,8 @@ jt1.phone enterprise_phone, jt1.nature enterprise_nature, jt1.nature_dictionary_name enterprise_nature_dictionary_name, + jt1.classify enterprise_classify, + jt1.classify_dictionary_name enterprise_classify_dictionary_name, t1.user_id, LEFT(t1.gmt_create, 19) gmt_create, t1.is_handled, diff --git a/src/main/resources/static/route/industrycheckitem/list-tree-industrycheckitem.html b/src/main/resources/static/route/industrycheckitem/list-tree-industrycheckitem.html index 3cd5fa0..0438795 100644 --- a/src/main/resources/static/route/industrycheckitem/list-tree-industrycheckitem.html +++ b/src/main/resources/static/route/industrycheckitem/list-tree-industrycheckitem.html @@ -63,14 +63,15 @@ } // 初始化树 function initThree() { - top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionaryallbyparentid/54c583df-6a6f-4a55-bcb3-2d6ace99b8ef', []), {}, null, function(code, data) { + // 这里之前是行业类型,换成企业分类 + top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionaryallbyparentid/27694872-7295-4b41-aaa0-297fc6dbac3e', []), {}, null, function(code, data) { var setting = { data: { key: { title: 'dictionaryName', name: 'dictionaryName', id: 'dictionaryId', - children: 'subDictionary' + // children: 'subDictionary' }, }, callback: { diff --git a/src/main/resources/static/route/publicareareport/list-publicareareport.html b/src/main/resources/static/route/publicareareport/list-publicareareport.html index 940b35f..d71535f 100644 --- a/src/main/resources/static/route/publicareareport/list-publicareareport.html +++ b/src/main/resources/static/route/publicareareport/list-publicareareport.html @@ -15,6 +15,7 @@ .col-area {width: 100px;} .col-area-content {width: 100px; margin: 0 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;} .col-area-address {width: 480px !important;} + .col-content-info {width: 480px !important;} @@ -144,7 +145,7 @@ '
'+ (row.area5DictionaryName ? row.area5DictionaryName : '-') +'
' + ''; infoDiv += '检查地址
'+ row.checkAddress +'
'; - infoDiv += '检查内容
'+ row.checkContent +'
'; + infoDiv += '检查内容'; infoDiv += ''; return infoDiv; }