Commit cfe31a6f authored by tianyiming's avatar tianyiming

一码通删除修改码表状态

parent 748b2ca1
...@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.tzs.api.mapper; ...@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.tzs.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.tzs.api.entity.SupervisoryCodeInfo; import com.yeejoin.amos.boot.module.tzs.api.entity.SupervisoryCodeInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 装备分类 Mapper 接口 * 装备分类 Mapper 接口
...@@ -11,4 +14,5 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.SupervisoryCodeInfo; ...@@ -11,4 +14,5 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.SupervisoryCodeInfo;
*/ */
public interface SupervisoryCodeInfoMapper extends BaseMapper<SupervisoryCodeInfo> { public interface SupervisoryCodeInfoMapper extends BaseMapper<SupervisoryCodeInfo> {
void updateStatus(@Param("superviseCodeList") List<String> superviseCodeList);
} }
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.tzs.api.mapper.SupervisoryCodeInfoMapper">
<update id="updateStatus">
update biz_jg_supervisory_code set status = '2' where supervisory_code in
<foreach collection="superviseCodeList" separator="," item="superviseCode" open="(" close=")">
#{superviseCode}
</foreach>
</update>
</mapper>
\ No newline at end of file
...@@ -62,6 +62,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -62,6 +62,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.IOException; import java.io.IOException;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -103,6 +104,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -103,6 +104,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
SupervisoryCodeInfoMapper supervisoryCodeInfoMapper; SupervisoryCodeInfoMapper supervisoryCodeInfoMapper;
@Autowired @Autowired
SuperviseInfoService superviseInfoService;
@Autowired
EquipmentCategoryDataMapper equipmentCategoryDataMapper; EquipmentCategoryDataMapper equipmentCategoryDataMapper;
@Autowired @Autowired
...@@ -947,7 +951,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -947,7 +951,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
List<String> superviseCodeList = superviseInfoMapper.selectSuperviseCodeList(records); List<String> superviseCodeList = superviseInfoMapper.selectSuperviseCodeList(records);
List<String> unitCodeList = superviseInfoMapper.selectUnitCodeList(records); List<String> unitCodeList = superviseInfoMapper.selectUnitCodeList(records);
if(!ObjectUtils.isEmpty(superviseCodeList)){ if(!ObjectUtils.isEmpty(superviseCodeList)){
supervisoryCodeInfoMapper.delete(new QueryWrapper<SupervisoryCodeInfo>().in("supervisory_code", superviseCodeList)); supervisoryCodeInfoMapper.updateStatus(superviseCodeList);
} }
//删除涉及的19张表的数据 //删除涉及的19张表的数据
...@@ -962,11 +966,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -962,11 +966,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
@Override @Override
@Transactional @Transactional(rollbackFor = Exception.class)
public ResponseModel submit(Map<String, Object> map) { public ResponseModel submit(Map<String, Object> map) {
SupervisoryCodeInfo supervisoryCodeInfo = new SupervisoryCodeInfo(); SupervisoryCodeInfo supervisoryCodeInfo = new SupervisoryCodeInfo();
ResponseModel responseModel = new ResponseModel(); ResponseModel responseModel = new ResponseModel();
LinkedHashMap useInfoFrom = (LinkedHashMap) map.get(USE_INFO_FROM_ID); LinkedHashMap useInfoFrom = (LinkedHashMap) map.get(USE_INFO_FROM_ID);
Calendar calendar= Calendar.getInstance();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
useInfoFrom.put("REC_DATE", dateFormat.format(calendar.getTime()));
String unitCode = String.valueOf(useInfoFrom.get("USE_UNIT_CREDIT_CODE")); String unitCode = String.valueOf(useInfoFrom.get("USE_UNIT_CREDIT_CODE"));
try { try {
LinkedHashMap superviseMap = (LinkedHashMap) map.get("data"); LinkedHashMap superviseMap = (LinkedHashMap) map.get("data");
......
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