Commit b2d65fc9 authored by lisong's avatar lisong

修改bug

parent 8eb340bf
package com.yeejoin.amos.boot.module.tzs.api.entity; package com.yeejoin.amos.boot.module.tzs.api.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -183,5 +185,6 @@ public class TzBaseEnterpriseInfo extends BaseEntity { ...@@ -183,5 +185,6 @@ public class TzBaseEnterpriseInfo extends BaseEntity {
private String industrySupervisor; private String industrySupervisor;
@ApiModelProperty(value = "企业标签信息") @ApiModelProperty(value = "企业标签信息")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String regulatoryLabels; private String regulatoryLabels;
} }
...@@ -9,14 +9,13 @@ ...@@ -9,14 +9,13 @@
count( CASE WHEN i.next_inspection_date <![CDATA[ < ]]> now() THEN 1 END ) AS outOfDateNum count( CASE WHEN i.next_inspection_date <![CDATA[ < ]]> now() THEN 1 END ) AS outOfDateNum
FROM FROM
tz_cylinder_unit U tz_cylinder_unit U
LEFT JOIN tz_cylinder_info AS t ON u.credit_code = t.credit_code and t.app_id = u.app_id LEFT JOIN tz_cylinder_info AS t ON t.app_id = u.app_id
LEFT JOIN tz_cylinder_inspection AS i ON i.sequence_code = t.sequence_code LEFT JOIN tz_cylinder_inspection AS i ON i.sequence_code = t.sequence_code
LEFT JOIN (SELECT * FROM tz_base_unit_licence LEFT JOIN (SELECT * FROM tz_base_unit_licence
GROUP BY unit_code GROUP BY unit_code
ORDER BY expiry_date DESC) AS l ON l.unit_code = u.credit_code ORDER BY expiry_date DESC) AS l ON l.unit_code = u.credit_code
WHERE WHERE
t.sequence_nbr IN ( SELECT max( tt.sequence_nbr ) FROM tz_cylinder_info tt GROUP BY tt.sequence_code ) u.sequence_nbr = #{sequenceNbr}
AND u.sequence_nbr = #{sequenceNbr}
GROUP BY u.sequence_nbr GROUP BY u.sequence_nbr
</select> </select>
......
...@@ -139,10 +139,12 @@ ...@@ -139,10 +139,12 @@
test="tzBaseEnterpriseInfoDto.address!=null and tzBaseEnterpriseInfoDto.address!='' "> test="tzBaseEnterpriseInfoDto.address!=null and tzBaseEnterpriseInfoDto.address!='' ">
AND supervise_org_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.address},'%') AND supervise_org_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.address},'%')
</if> </if>
<if test="tzBaseEnterpriseInfoDto.regulatoryLabels!=null and tzBaseEnterpriseInfoDto.regulatoryLabels!='' ">
AND regulatory_labels LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.regulatoryLabels},'%')
</if>
<if test="orgCodeList != null and ! orgCodeList.isEmpty() and orgCodeList.size() > 0"> <if test="orgCodeList != null and ! orgCodeList.isEmpty() and orgCodeList.size() > 0">
1=1
<foreach collection="orgCodeList" item="item" index="index" > <foreach collection="orgCodeList" item="item" index="index" >
<if test="index==0"> <if test="index==0">
AND AND
...@@ -155,6 +157,7 @@ ...@@ -155,6 +157,7 @@
</if> </if>
AND is_delete = 0 AND is_delete = 0
</where> </where>
order by rec_date desc
</select> </select>
<select id="selectByUseUnit" resultType="com.yeejoin.amos.boot.module.tzs.api.entity.TzBaseEnterpriseInfo"> <select id="selectByUseUnit" resultType="com.yeejoin.amos.boot.module.tzs.api.entity.TzBaseEnterpriseInfo">
......
...@@ -242,10 +242,9 @@ public class TzBaseEnterpriseInfoController { ...@@ -242,10 +242,9 @@ public class TzBaseEnterpriseInfoController {
public ResponseModel<Object> setLabel(@RequestBody Map<String, Object> map) { public ResponseModel<Object> setLabel(@RequestBody Map<String, Object> map) {
ArrayList<String> enterpriseLabel = new ArrayList<>(); ArrayList<String> enterpriseLabel = new ArrayList<>();
ArrayList<Long> enterpriseIds = new ArrayList<>(); ArrayList<Long> enterpriseIds = (ArrayList) map.get("enterpriseIds");
if (!ObjectUtils.isEmpty(map) && !ObjectUtils.isEmpty(map.get("enterpriseLabel")) && !ObjectUtils.isEmpty(map.get("enterpriseIds"))) { if (!ObjectUtils.isEmpty(map) && !ObjectUtils.isEmpty(map.get("enterpriseLabel")) && !ObjectUtils.isEmpty(map.get("enterpriseIds"))) {
enterpriseLabel = (ArrayList) map.get("enterpriseLabel"); enterpriseLabel = (ArrayList) map.get("enterpriseLabel");
enterpriseIds = (ArrayList) map.get("enterpriseIds");
} }
return ResponseHelper.buildResponse(iTzBaseEnterpriseInfoService.setLabel(enterpriseIds, enterpriseLabel)); return ResponseHelper.buildResponse(iTzBaseEnterpriseInfoService.setLabel(enterpriseIds, enterpriseLabel));
......
...@@ -479,6 +479,7 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -479,6 +479,7 @@ public class TzBaseEnterpriseInfoServiceImpl
@Override @Override
public String setLabel(List<Long> enterpriseIds, List<String> enterpriseLabels) { public String setLabel(List<Long> enterpriseIds, List<String> enterpriseLabels) {
List<TzBaseEnterpriseInfo> tzBaseEnterpriseInfos = tzBaseEnterpriseInfoMapper.selectBatchIds(enterpriseIds); List<TzBaseEnterpriseInfo> tzBaseEnterpriseInfos = tzBaseEnterpriseInfoMapper.selectBatchIds(enterpriseIds);
if (!ObjectUtils.isEmpty(enterpriseLabels)) {
for (TzBaseEnterpriseInfo tzBaseEnterpriseInfo : tzBaseEnterpriseInfos) { for (TzBaseEnterpriseInfo tzBaseEnterpriseInfo : tzBaseEnterpriseInfos) {
// 标签递增逻辑 // 标签递增逻辑
// if (!ObjectUtils.isEmpty(tzBaseEnterpriseInfo.getRegulatoryLabels())) { // if (!ObjectUtils.isEmpty(tzBaseEnterpriseInfo.getRegulatoryLabels())) {
...@@ -491,6 +492,11 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -491,6 +492,11 @@ public class TzBaseEnterpriseInfoServiceImpl
String labels = String.join(",", enterpriseLabels); String labels = String.join(",", enterpriseLabels);
tzBaseEnterpriseInfo.setRegulatoryLabels(labels); tzBaseEnterpriseInfo.setRegulatoryLabels(labels);
} }
} else {
tzBaseEnterpriseInfos.forEach(item -> {
item.setRegulatoryLabels(null);
});
}
this.updateBatchById(tzBaseEnterpriseInfos); this.updateBatchById(tzBaseEnterpriseInfos);
return "success"; return "success";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment