Commit b2d65fc9 authored by lisong's avatar lisong

修改bug

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