Commit b7c390f0 authored by 王果's avatar 王果

Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register

# Conflicts: # amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/CommonController.java
parents 6307da3b 8f22d497
...@@ -25,17 +25,9 @@ import com.yeejoin.amos.boot.module.elevator.flc.api.feign.PrivilegeFeginService ...@@ -25,17 +25,9 @@ import com.yeejoin.amos.boot.module.elevator.flc.api.feign.PrivilegeFeginService
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient; import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
...@@ -123,39 +115,39 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -123,39 +115,39 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
//管辖机构redis缓存key // 管辖机构redis缓存key
private static final String REGULATOR_UNIT_TREE = "REGULATOR_UNIT_TREE"; private static final String REGULATOR_UNIT_TREE = "REGULATOR_UNIT_TREE";
//行政区划redis缓存key // 行政区划redis缓存key
private static final String PROVINCE = "PROVINCE"; private static final String PROVINCE = "PROVINCE";
private static final String CITY = "CITY"; private static final String CITY = "CITY";
private static final String REGION = "REGION"; private static final String REGION = "REGION";
//西安行政区划code // 西安行政区划code
private static final String XIAN = "610100"; private static final String XIAN = "610100";
//判断行政区划查询市还是区 // 判断行政区划查询市还是区
private static final String END_CODE = "0000"; private static final String END_CODE = "0000";
//一码通监督管理表单id // 一码通监督管理表单id
private static final String SUPERVISION_FROM_ID = "1627903532906602497"; private static final String SUPERVISION_FROM_ID = "1627903532906602497";
//一码通使用信息表单id // 一码通使用信息表单id
private static final String USE_INFO_FROM_ID = "1627903393253056514"; private static final String USE_INFO_FROM_ID = "1627903393253056514";
//一码通码自动生成 // 一码通码自动生成
final static String CREATE = "1"; final static String CREATE = "1";
//一码通码手动输入 // 一码通码手动输入
final static String NOT_CREATE = "0"; final static String NOT_CREATE = "0";
//一码通复制功能url参数key // 一码通复制功能url参数key
private static final String COPY_KEY = "stashType"; private static final String COPY_KEY = "stashType";
//判断行政区划查询街道 // 判断行政区划查询街道
private static final String STREET_END_CODE = "00"; private static final String STREET_END_CODE = "00";
private static final String STREET = "STREET"; private static final String STREET = "STREET";
private static final String STREET_LEVEL = "4"; private static final String STREET_LEVEL = "4";
private static final String CITY_LEVEL = "2"; private static final String CITY_LEVEL = "2";
private static final String REGION_LEVEL = "3"; private static final String REGION_LEVEL = "3";
@Autowired @Autowired
RestHighLevelClient restHighLevelClient; RestHighLevelClient restHighLevelClient;
private static String USE_CODE = "use_code"; private static String USE_CODE = "use_code";
...@@ -242,14 +234,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -242,14 +234,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String city, county, equipCategory; String city, county, equipCategory;
EquInfoDto equInfoDto = new EquInfoDto(); EquInfoDto equInfoDto = new EquInfoDto();
if (ObjectUtils.isEmpty(record)) { if (ObjectUtils.isEmpty(record)) {
//获取对应行政区划 // 获取对应行政区划
county = EquipmentCategoryEnum.XZQH.getCode(); county = EquipmentCategoryEnum.XZQH.getCode();
city = map.get("regionCode").toString(); city = map.get("regionCode").toString();
//获取对应设备分类 // 获取对应设备分类
equipCategory = map.get("equCategory").toString(); equipCategory = map.get("equCategory").toString();
} else { } else {
equInfoDto = categoryOtherInfoMapper.selectEquipInfo(record); equInfoDto = categoryOtherInfoMapper.selectEquipInfo(record);
//判断这条数据认领状态是否为已认领,否则直接返回 // 判断这条数据认领状态是否为已认领,否则直接返回
if (!ObjectUtils.isEmpty(equInfoDto) && EquipmentCategoryEnum.YRL.getName().equals(equInfoDto.getStatus())) { if (!ObjectUtils.isEmpty(equInfoDto) && EquipmentCategoryEnum.YRL.getName().equals(equInfoDto.getStatus())) {
city = equInfoDto.getCity(); city = equInfoDto.getCity();
county = equInfoDto.getCounty(); county = equInfoDto.getCounty();
...@@ -258,10 +250,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -258,10 +250,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return new HashMap<>(); return new HashMap<>();
} }
} }
//生成码 // 生成码
Map<String, String> codeMap; Map<String, String> codeMap;
synchronized (EquipmentCategoryServiceImpl.class) { synchronized (EquipmentCategoryServiceImpl.class) {
codeMap = creatCode(city, county, equipCategory, null,null); codeMap = creatCode(city, county, equipCategory, null, null);
} }
if (ObjectUtils.isEmpty(codeMap)) { if (ObjectUtils.isEmpty(codeMap)) {
return new HashMap<>(); return new HashMap<>();
...@@ -274,19 +266,19 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -274,19 +266,19 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
supervisoryCodeInfo.setStatus(equState); supervisoryCodeInfo.setStatus(equState);
if (!ObjectUtils.isEmpty(record)) { if (!ObjectUtils.isEmpty(record)) {
String supervisorCode, elevatorCode; String supervisorCode, elevatorCode;
//设备状态为报废,对应电梯码作废 // 设备状态为报废,对应电梯码作废
equState = EquipmentCategoryEnum.BF.getCode().equals(equInfoDto.getEquState()) ? EquipmentCategoryEnum.WSY.getCode() : EquipmentCategoryEnum.YSY.getCode(); equState = EquipmentCategoryEnum.BF.getCode().equals(equInfoDto.getEquState()) ? EquipmentCategoryEnum.WSY.getCode() : EquipmentCategoryEnum.YSY.getCode();
supervisorCode = codeMap.get("superviseCode"); supervisorCode = codeMap.get("superviseCode");
elevatorCode = EquipmentCategoryEnum.BF.getCode().equals(equInfoDto.getEquState()) ? null : codeMap.get("code96333"); elevatorCode = EquipmentCategoryEnum.BF.getCode().equals(equInfoDto.getEquState()) ? null : codeMap.get("code96333");
List<CategoryOtherInfo> categoryOtherInfo = categoryOtherInfoMapper.selectList(new QueryWrapper<CategoryOtherInfo>().eq("SUPERVISORY_CODE", supervisorCode)); List<CategoryOtherInfo> categoryOtherInfo = categoryOtherInfoMapper.selectList(new QueryWrapper<CategoryOtherInfo>().eq("SUPERVISORY_CODE", supervisorCode));
if (categoryOtherInfo.size() > 0) { if (categoryOtherInfo.size() > 0) {
// categoryOtherInfoMapper.updateCode(supervisorCode, equState); // categoryOtherInfoMapper.updateCode(supervisorCode, equState);
supervisoryCodeInfoMapper.update(supervisoryCodeInfo,new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code",supervisoryCodeInfo.getSupervisoryCode())); supervisoryCodeInfoMapper.update(supervisoryCodeInfo, new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code", supervisoryCodeInfo.getSupervisoryCode()));
} else { } else {
supervisoryCodeInfo.setStatus(equState); supervisoryCodeInfo.setStatus(equState);
supervisoryCodeInfoMapper.insert(supervisoryCodeInfo); supervisoryCodeInfoMapper.insert(supervisoryCodeInfo);
} }
//修改源数据的电梯码 // 修改源数据的电梯码
categoryOtherInfoMapper.updateSupervisorCode(supervisorCode, elevatorCode, record); categoryOtherInfoMapper.updateSupervisorCode(supervisorCode, elevatorCode, record);
} else { } else {
supervisoryCodeInfoMapper.insert(supervisoryCodeInfo); supervisoryCodeInfoMapper.insert(supervisoryCodeInfo);
...@@ -297,13 +289,13 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -297,13 +289,13 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
@Override @Override
public List<LinkedHashMap> getTree() { public List<LinkedHashMap> getTree() {
List<LinkedHashMap> result = (List<LinkedHashMap>) redisUtils.get(REGULATOR_UNIT_TREE); List<LinkedHashMap> result = (List<LinkedHashMap>) redisUtils.get(REGULATOR_UNIT_TREE);
//判断redis是否存在管辖机构树 // 判断redis是否存在管辖机构树
return !ObjectUtils.isEmpty(result) ? result : creatTree(); return !ObjectUtils.isEmpty(result) ? result : creatTree();
} }
@Override @Override
public List<LinkedHashMap> creatTree() { public List<LinkedHashMap> creatTree() {
FeignClientResult tree = privilegeFeginService.tree(RequestContext.getToken(),RequestContext.getAppKey(),RequestContext.getProduct()); FeignClientResult tree = privilegeFeginService.tree(RequestContext.getToken(), RequestContext.getAppKey(), RequestContext.getProduct());
List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult(); List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult();
List<LinkedHashMap> treeData = deleteRegulatorTreeData(result); List<LinkedHashMap> treeData = deleteRegulatorTreeData(result);
List<LinkedHashMap> supervisionTree = treeData.stream().filter(e -> code.equals(e.get("orgCode"))).collect(Collectors.toList()); List<LinkedHashMap> supervisionTree = treeData.stream().filter(e -> code.equals(e.get("orgCode"))).collect(Collectors.toList());
...@@ -322,7 +314,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -322,7 +314,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
Iterator it = result.iterator(); Iterator it = result.iterator();
while (it.hasNext()) { while (it.hasNext()) {
LinkedHashMap e = (LinkedHashMap) it.next(); LinkedHashMap e = (LinkedHashMap) it.next();
//将管辖机构树中children为[]的修改为null // 将管辖机构树中children为[]的修改为null
if (e.get("children") != null) { if (e.get("children") != null) {
if (((List<LinkedHashMap>) e.get("children")).size() == 0) { if (((List<LinkedHashMap>) e.get("children")).size() == 0) {
e.put("children", null); e.put("children", null);
...@@ -345,7 +337,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -345,7 +337,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
Iterator it = result.iterator(); Iterator it = result.iterator();
while (it.hasNext()) { while (it.hasNext()) {
LinkedHashMap e = (LinkedHashMap) it.next(); LinkedHashMap e = (LinkedHashMap) it.next();
//删除使用单位 // 删除使用单位
if ("company".equals(e.get("level"))) { if ("company".equals(e.get("level"))) {
it.remove(); it.remove();
} }
...@@ -368,7 +360,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -368,7 +360,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return ObjectUtils.isEmpty(list) ? getProvinceList(level) : list; return ObjectUtils.isEmpty(list) ? getProvinceList(level) : list;
} else if (!ObjectUtils.isEmpty(parentId)) { } else if (!ObjectUtils.isEmpty(parentId)) {
String regionCode = parentId.split("_")[0]; String regionCode = parentId.split("_")[0];
//regionCode不是以00结尾查询街道,以0000结果查询市、否则查询区 // regionCode不是以00结尾查询街道,以0000结果查询市、否则查询区
if (!regionCode.endsWith(STREET_END_CODE)) { if (!regionCode.endsWith(STREET_END_CODE)) {
list = ObjectUtils.isEmpty(redisUtils.get(STREET)) ? getProvinceList(STREET_LEVEL) : (List<LinkedHashMap>) redisUtils.get(STREET); list = ObjectUtils.isEmpty(redisUtils.get(STREET)) ? getProvinceList(STREET_LEVEL) : (List<LinkedHashMap>) redisUtils.get(STREET);
} else if (regionCode.endsWith(END_CODE)) { } else if (regionCode.endsWith(END_CODE)) {
...@@ -383,19 +375,19 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -383,19 +375,19 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
public Map<String, Object> getRegionList() { public Map<String, Object> getRegionList() {
//查询省下所有的行政区划市,封装并存入redis // 查询省下所有的行政区划市,封装并存入redis
Map<String, Object> map1 = new HashMap<>(); Map<String, Object> map1 = new HashMap<>();
List<LinkedHashMap> cityList; List<LinkedHashMap> cityList;
FeignClientResult tree = privilegeFeginService.getTree(); FeignClientResult tree = privilegeFeginService.getTree();
List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult(); List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult();
//获取陕西省regionCode // 获取陕西省regionCode
String regionCode = ((List<LinkedHashMap>) privilegeFeginService.getProvince("1").getResult()).get(0).get("regionCode").toString(); String regionCode = ((List<LinkedHashMap>) privilegeFeginService.getProvince("1").getResult()).get(0).get("regionCode").toString();
cityList = deleteTreeData(result, regionCode); cityList = deleteTreeData(result, regionCode);
Map<String, Object> cityMap = new HashMap<>(); Map<String, Object> cityMap = new HashMap<>();
cityMap.put(regionCode, cityList); cityMap.put(regionCode, cityList);
map1.put(regionCode, cityList); map1.put(regionCode, cityList);
redisUtils.set(CITY, cityMap); redisUtils.set(CITY, cityMap);
//查询市下所有的行政区划区,封装并存入redis // 查询市下所有的行政区划区,封装并存入redis
if (!ObjectUtils.isEmpty(cityList)) { if (!ObjectUtils.isEmpty(cityList)) {
List<LinkedHashMap> region = (List<LinkedHashMap>) privilegeFeginService.getTree().getResult(); List<LinkedHashMap> region = (List<LinkedHashMap>) privilegeFeginService.getTree().getResult();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
...@@ -464,7 +456,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -464,7 +456,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
List<LinkedHashMap> list = new ArrayList<>(); List<LinkedHashMap> list = new ArrayList<>();
while (it.hasNext()) { while (it.hasNext()) {
LinkedHashMap e = (LinkedHashMap) it.next(); LinkedHashMap e = (LinkedHashMap) it.next();
//修改数据 // 修改数据
if (type.equals(e.get("parentRegionCode").toString())) { if (type.equals(e.get("parentRegionCode").toString())) {
e.put("children", null); e.put("children", null);
e.put("sequenceNbr", e.get("regionCode")); e.put("sequenceNbr", e.get("regionCode"));
...@@ -481,33 +473,33 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -481,33 +473,33 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
/** /**
* 具体生成监管码和电梯96333识别码逻辑 * 具体生成监管码和电梯96333识别码逻辑
*/ */
private synchronized Map<String, String> creatCode(String city, String county, String equipCategory, String code96333,String supervisionCode) { private synchronized Map<String, String> creatCode(String city, String county, String equipCategory, String code96333, String supervisionCode) {
Map<String, String> resultMap = new HashMap<>(); Map<String, String> resultMap = new HashMap<>();
StringBuilder supervisorCode = new StringBuilder(); StringBuilder supervisorCode = new StringBuilder();
StringBuilder elevatorCode = new StringBuilder(); StringBuilder elevatorCode = new StringBuilder();
CategoryOtherInfo categoryOtherInfo = new CategoryOtherInfo(); CategoryOtherInfo categoryOtherInfo = new CategoryOtherInfo();
String prefix; String prefix;
//判断是否需要生成96333电梯码 // 判断是否需要生成96333电梯码
if (equipCategory.startsWith("3") && !XIAN.equals(city)) { if (equipCategory.startsWith("3") && !XIAN.equals(city)) {
//判断数据是否携带96333电梯码,携带则使用,不携带则生成 // 判断数据是否携带96333电梯码,携带则使用,不携带则生成
if("null".equals(code96333)){ if ("null".equals(code96333)) {
prefix = getPrefix(EquipmentCategoryEnum.XZQHDT.getCode(), city); prefix = getPrefix(EquipmentCategoryEnum.XZQHDT.getCode(), city);
//查询未使用的电梯码 // 查询未使用的电梯码
categoryOtherInfo = categoryOtherInfoMapper.selectElevatorCode(prefix, EquipmentCategoryEnum.WSY.getCode()); categoryOtherInfo = categoryOtherInfoMapper.selectElevatorCode(prefix, EquipmentCategoryEnum.WSY.getCode());
//如果存在未使用的电梯码则启用未使用的否则创建 // 如果存在未使用的电梯码则启用未使用的否则创建
String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? createElevatorCode(city, county) : categoryOtherInfo.getCode(); String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? createElevatorCode(city, county) : categoryOtherInfo.getCode();
if(!ObjectUtils.isEmpty(categoryOtherInfo)){ if (!ObjectUtils.isEmpty(categoryOtherInfo)) {
supervisoryCodeInfoMapper.delete(new QueryWrapper<SupervisoryCodeInfo>().eq("code96333",categoryOtherInfo.getCode())); supervisoryCodeInfoMapper.delete(new QueryWrapper<SupervisoryCodeInfo>().eq("code96333", categoryOtherInfo.getCode()));
} }
elevatorCode.append(elevator); elevatorCode.append(elevator);
resultMap.put("creatStatus",CREATE); resultMap.put("creatStatus", CREATE);
} else { } else {
elevatorCode.append(code96333); elevatorCode.append(code96333);
resultMap.put("creatStatus",NOT_CREATE); resultMap.put("creatStatus", NOT_CREATE);
} }
} }
//判断原数据是否存在监管码,存在则用原监管码即可,不存在则生成 // 判断原数据是否存在监管码,存在则用原监管码即可,不存在则生成
if("null".equals(supervisionCode)){ if ("null".equals(supervisionCode)) {
String supervisor = createSupervisorCode(city, county, equipCategory); String supervisor = createSupervisorCode(city, county, equipCategory);
supervisorCode.append(supervisor); supervisorCode.append(supervisor);
} else { } else {
...@@ -520,18 +512,18 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -520,18 +512,18 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
SupervisoryCodeInfo supervisoryCodeInfo = new SupervisoryCodeInfo(); SupervisoryCodeInfo supervisoryCodeInfo = new SupervisoryCodeInfo();
SupervisoryCodeInfo selectOne = supervisoryCodeInfoMapper.selectOne(new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code", supervisionCode)); SupervisoryCodeInfo selectOne = supervisoryCodeInfoMapper.selectOne(new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code", supervisionCode));
//将生成的码添加到码表中,码的使用状态为初始状态 // 将生成的码添加到码表中,码的使用状态为初始状态
String equState = EquipmentCategoryEnum.CSZT.getCode(); String equState = EquipmentCategoryEnum.CSZT.getCode();
supervisoryCodeInfo.setCode96333(String.valueOf(elevatorCode)); supervisoryCodeInfo.setCode96333(String.valueOf(elevatorCode));
supervisoryCodeInfo.setCreateStatus(resultMap.get("creatStatus")); supervisoryCodeInfo.setCreateStatus(resultMap.get("creatStatus"));
supervisoryCodeInfo.setSupervisoryCode(String.valueOf(supervisorCode)); supervisoryCodeInfo.setSupervisoryCode(String.valueOf(supervisorCode));
supervisoryCodeInfo.setStatus(equState); supervisoryCodeInfo.setStatus(equState);
if(ObjectUtils.isEmpty(selectOne)){ if (ObjectUtils.isEmpty(selectOne)) {
supervisoryCodeInfoMapper.insert(supervisoryCodeInfo); supervisoryCodeInfoMapper.insert(supervisoryCodeInfo);
} else { } else {
selectOne.setCode96333(String.valueOf(elevatorCode)); selectOne.setCode96333(String.valueOf(elevatorCode));
supervisoryCodeInfoMapper.update(selectOne, supervisoryCodeInfoMapper.update(selectOne,
new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code",selectOne.getSupervisoryCode())); new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code", selectOne.getSupervisoryCode()));
} }
resultMap.put("superviseCode", ObjectUtils.isEmpty(supervisorCode) ? null : supervisorCode.toString()); resultMap.put("superviseCode", ObjectUtils.isEmpty(supervisorCode) ? null : supervisorCode.toString());
resultMap.put("code96333", ObjectUtils.isEmpty(elevatorCode) ? null : elevatorCode.toString()); resultMap.put("code96333", ObjectUtils.isEmpty(elevatorCode) ? null : elevatorCode.toString());
...@@ -552,15 +544,15 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -552,15 +544,15 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
*/ */
private String createSupervisorCode(String city, String county, String equipCategory) { private String createSupervisorCode(String city, String county, String equipCategory) {
StringBuilder supervisorCode = new StringBuilder(); StringBuilder supervisorCode = new StringBuilder();
//生成监管码前缀 // 生成监管码前缀
Map<String, Object> divisionMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), county); Map<String, Object> divisionMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), county);
String division = ObjectUtils.isEmpty(divisionMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), city).get("code").toString() : divisionMap.get("code").toString(); String division = ObjectUtils.isEmpty(divisionMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), city).get("code").toString() : divisionMap.get("code").toString();
supervisorCode.append(division).append(equipCategory).append("-"); supervisorCode.append(division).append(equipCategory).append("-");
//获取行政区划区县、市是否存在历史监管码 // 获取行政区划区县、市是否存在历史监管码
CategoryOtherInfo supervisor = categoryOtherInfoMapper.selectSupervisorCode(supervisorCode.toString()); CategoryOtherInfo supervisor = categoryOtherInfoMapper.selectSupervisorCode(supervisorCode.toString());
//生成对应监管码 // 生成对应监管码
if (!ObjectUtils.isEmpty(supervisor) && supervisor.getSupervisoryCode() != null) { if (!ObjectUtils.isEmpty(supervisor) && supervisor.getSupervisoryCode() != null) {
//获取补零位长度 // 获取补零位长度
String supervisoryCode = supervisor.getSupervisoryCode().substring(6); String supervisoryCode = supervisor.getSupervisoryCode().substring(6);
long num = Long.valueOf(supervisoryCode) + 1; long num = Long.valueOf(supervisoryCode) + 1;
int numLength = String.valueOf(num).length(); int numLength = String.valueOf(num).length();
...@@ -586,7 +578,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -586,7 +578,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
*/ */
private String createElevatorCode(String city, String county) { private String createElevatorCode(String city, String county) {
StringBuilder elevatorCode = new StringBuilder(); StringBuilder elevatorCode = new StringBuilder();
//生成生成96333电梯码前缀 // 生成生成96333电梯码前缀
Map<String, Object> elevatorMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), county); Map<String, Object> elevatorMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), county);
String elevator = ObjectUtils.isEmpty(elevatorMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), city).get("code").toString() : elevatorMap.get("code").toString(); String elevator = ObjectUtils.isEmpty(elevatorMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), city).get("code").toString() : elevatorMap.get("code").toString();
elevatorCode.append(elevator); elevatorCode.append(elevator);
...@@ -595,10 +587,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -595,10 +587,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if (ValidationUtil.isEmpty(initSupervisoryCode)) { if (ValidationUtil.isEmpty(initSupervisoryCode)) {
elevatorCode.append(EquipmentCategoryEnum.getValue.get(elevator)); elevatorCode.append(EquipmentCategoryEnum.getValue.get(elevator));
} else { } else {
//获取行政区划区县、市是否存在历史96333电梯码 // 获取行政区划区县、市是否存在历史96333电梯码
CategoryOtherInfo elevatorOtherInfo = categoryOtherInfoMapper.selectElevatorCode(elevatorCode.toString(), null); CategoryOtherInfo elevatorOtherInfo = categoryOtherInfoMapper.selectElevatorCode(elevatorCode.toString(), null);
if (!ObjectUtils.isEmpty(elevatorOtherInfo) && elevatorOtherInfo.getCode() != null) { if (!ObjectUtils.isEmpty(elevatorOtherInfo) && elevatorOtherInfo.getCode() != null) {
//获取补零位长度 // 获取补零位长度
String elevatorCode1 = elevatorOtherInfo.getCode().substring(2); String elevatorCode1 = elevatorOtherInfo.getCode().substring(2);
long num = Long.parseLong(elevatorCode1) + 1; long num = Long.parseLong(elevatorCode1) + 1;
int numLength = String.valueOf(num).length(); int numLength = String.valueOf(num).length();
...@@ -735,12 +727,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -735,12 +727,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if (!ValidationUtil.isEmpty(level)) { if (!ValidationUtil.isEmpty(level)) {
Page<Map<String, Object>> m = new Page<>(); Page<Map<String, Object>> m = new Page<>();
if (LEVEL.equals(level)) { if (LEVEL.equals(level)) {
//企业 // 企业
map.put("USE_UNIT_CREDIT_CODE", companyCode); map.put("USE_UNIT_CREDIT_CODE", companyCode);
m = this.getPage(map); m = this.getPage(map);
map.remove("USE_UNIT_CREDIT_CODE"); map.remove("USE_UNIT_CREDIT_CODE");
} else { } else {
//监管单位 // 监管单位
map.put("ORG_BRANCH_CODE", code); map.put("ORG_BRANCH_CODE", code);
m = this.getPage(map); m = this.getPage(map);
map.remove("ORG_BRANCH_CODE"); map.remove("ORG_BRANCH_CODE");
...@@ -758,7 +750,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -758,7 +750,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
objectPage.setSize(Long.valueOf(map.get("size").toString())); objectPage.setSize(Long.valueOf(map.get("size").toString()));
objectPage.setCurrent(Long.valueOf(map.get("number").toString())); objectPage.setCurrent(Long.valueOf(map.get("number").toString()));
model.setResult(objectPage); model.setResult(objectPage);
//设备状态码对应枚举值 // 设备状态码对应枚举值
List<Map<String, Object>> records = model.getResult().getRecords(); List<Map<String, Object>> records = model.getResult().getRecords();
List<Map<String, Object>> result = new ArrayList<>(); List<Map<String, Object>> result = new ArrayList<>();
for (Map<String, Object> record : records) { for (Map<String, Object> record : records) {
...@@ -799,7 +791,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -799,7 +791,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return list; return list;
} }
public List<EquipExportVo> getEquipExportData(EquipExportDto dto){ public List<EquipExportVo> getEquipExportData(EquipExportDto dto) {
ArrayList<EquipExportVo> list = new ArrayList<>(); ArrayList<EquipExportVo> list = new ArrayList<>();
List<JSONObject> objectList = getCompanyType(); List<JSONObject> objectList = getCompanyType();
if (!ValidationUtil.isEmpty(dto.getEQU_STATE())) { if (!ValidationUtil.isEmpty(dto.getEQU_STATE())) {
...@@ -811,14 +803,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -811,14 +803,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String companyCode = object.getString("companyCode"); String companyCode = object.getString("companyCode");
if (!ValidationUtil.isEmpty(level)) { if (!ValidationUtil.isEmpty(level)) {
if (LEVEL.equals(level)) { if (LEVEL.equals(level)) {
//企业 // 企业
dto.setUSE_UNIT_CREDIT_CODE(companyCode); dto.setUSE_UNIT_CREDIT_CODE(companyCode);
} else { } else {
//监管单位 // 监管单位
dto.setORG_BRANCH_CODE(orgCode); dto.setORG_BRANCH_CODE(orgCode);
} }
List<EquipExportVo> equipExportData = equipmentCategoryMapper.getEquipExportData(dto); List<EquipExportVo> equipExportData = equipmentCategoryMapper.getEquipExportData(dto);
if (!ObjectUtils.isEmpty(equipExportData) ) { if (!ObjectUtils.isEmpty(equipExportData)) {
list.addAll(equipExportData); list.addAll(equipExportData);
} }
} }
...@@ -858,23 +850,22 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -858,23 +850,22 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
@Override @Override
@Async @Async
public void createEquipmentCategoryData() { public void createEquipmentCategoryData() {
if(log.isInfoEnabled()){ if (log.isInfoEnabled()) {
log.info("初始化一码通总览数据开始"); log.info("初始化一码通总览数据开始");
} }
equipmentCategoryDataService.remove(new QueryWrapper<>()); equipmentCategoryDataService.remove(new QueryWrapper<>());
getCategoryData(null,null); getCategoryData(null, null);
} }
private List<EquipmentCategoryData> getCategoryData(List<String> unitCodes,List<String> orgBranchCodes) { private List<EquipmentCategoryData> getCategoryData(List<String> unitCodes, List<String> orgBranchCodes) {
StopWatch stopWatch = new StopWatch(); StopWatch stopWatch = new StopWatch();
stopWatch.start(); stopWatch.start();
List<EquipmentCategoryData> list = new ArrayList<>(); List<EquipmentCategoryData> list = new ArrayList<>();
// 查询所有单位 // 查询所有单位
List<Map<String, Object>> allUnitList = equipmentCategoryMapper.getAllUnit(unitCodes,orgBranchCodes); List<Map<String, Object>> allUnitList = equipmentCategoryMapper.getAllUnit(unitCodes, orgBranchCodes);
// 统计查询不同单位、不同装备定义、不同状态下的设备数量 // 统计查询不同单位、不同装备定义、不同状态下的设备数量
List<UseUnitCreditCodeCategoryDto> equipCountList = equipmentCategoryMapper.useUnitCreditCodeCategoryCount(); List<UseUnitCreditCodeCategoryDto> equipCountList = equipmentCategoryMapper.useUnitCreditCodeCategoryCount();
// 查询8大类设备定义 // 查询8大类设备定义
...@@ -882,31 +873,31 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -882,31 +873,31 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
// 组织EquipmentCategoryData表数据 // 组织EquipmentCategoryData表数据
for (Map<String, Object> map : allUnitList) { for (Map<String, Object> map : allUnitList) {
EquipmentCategoryData equipmentCategoryData = new EquipmentCategoryData(); EquipmentCategoryData equipmentCategoryData = new EquipmentCategoryData();
if(ObjectUtils.isEmpty(map.get("supervise_org_code")) || ObjectUtils.isEmpty(map.get(USE_CODE))){ if (ObjectUtils.isEmpty(map.get("supervise_org_code")) || ObjectUtils.isEmpty(map.get(USE_CODE))) {
continue; continue;
} }
equipmentCategoryData.setOrgBranchCode(map.get("supervise_org_code").toString()); equipmentCategoryData.setOrgBranchCode(map.get("supervise_org_code").toString());
equipmentCategoryData.setUnitCode(map.get(USE_CODE).toString()); equipmentCategoryData.setUnitCode(map.get(USE_CODE).toString());
// 指定单位的设备统计信息 // 指定单位的设备统计信息
List<UseUnitCreditCodeCategoryDto> unitEquipCountList = equipCountList.stream().filter(r->r.getUseUnitCreditCode().equals(map.get(USE_CODE).toString())).collect(Collectors.toList()); List<UseUnitCreditCodeCategoryDto> unitEquipCountList = equipCountList.stream().filter(r -> r.getUseUnitCreditCode().equals(map.get(USE_CODE).toString())).collect(Collectors.toList());
unitEquipCountList = unitEquipCountList.stream().filter(r->r.getOrgBranchCode().equals(map.get(ORG_BRANCH_CODE).toString())).collect(Collectors.toList()); unitEquipCountList = unitEquipCountList.stream().filter(r -> r.getOrgBranchCode().equals(map.get(ORG_BRANCH_CODE).toString())).collect(Collectors.toList());
for (EquipmentCategory category : equipmentCategories) { for (EquipmentCategory category : equipmentCategories) {
Map<String, Object> data = new HashMap<>(); Map<String, Object> data = new HashMap<>();
data.put("waitClaim", unitEquipCountList.stream().filter(r->r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.DRL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum()); data.put("waitClaim", unitEquipCountList.stream().filter(r -> r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.DRL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum());
data.put("alreadyClaim", unitEquipCountList.stream().filter(r->r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.YRL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum()); data.put("alreadyClaim", unitEquipCountList.stream().filter(r -> r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.YRL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum());
data.put("refuseClaim", unitEquipCountList.stream().filter(r->r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.YJL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum()); data.put("refuseClaim", unitEquipCountList.stream().filter(r -> r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.YJL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum());
this.set8CategoryCountData(equipmentCategoryData, category, data); this.set8CategoryCountData(equipmentCategoryData, category, data);
} }
equipmentCategoryData.setRecDate(new Date()); equipmentCategoryData.setRecDate(new Date());
list.add(equipmentCategoryData); list.add(equipmentCategoryData);
} }
if(!ObjectUtils.isEmpty(unitCodes)){ if (!ObjectUtils.isEmpty(unitCodes)) {
equipmentCategoryDataMapper.delete(new QueryWrapper<EquipmentCategoryData>().in("unit_code",unitCodes)); equipmentCategoryDataMapper.delete(new QueryWrapper<EquipmentCategoryData>().in("unit_code", unitCodes));
} }
equipmentCategoryDataService.saveOrUpdateBatch(list); equipmentCategoryDataService.saveOrUpdateBatch(list);
stopWatch.stop(); stopWatch.stop();
if(log.isInfoEnabled()){ if (log.isInfoEnabled()) {
log.info("总览数据刷新结束,耗时:{} 秒",stopWatch.getTotalTimeSeconds()); log.info("总览数据刷新结束,耗时:{} 秒", stopWatch.getTotalTimeSeconds());
} }
return list; return list;
} }
...@@ -945,19 +936,19 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -945,19 +936,19 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
private List<EquipmentCategory> getEquipmentCategories() { private List<EquipmentCategory> getEquipmentCategories() {
LambdaQueryWrapper<EquipmentCategory> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<EquipmentCategory> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.likeLeft(EquipmentCategory::getCode,"000"); lambdaQueryWrapper.likeLeft(EquipmentCategory::getCode, "000");
lambdaQueryWrapper.ne(EquipmentCategory::getCode,"7000"); lambdaQueryWrapper.ne(EquipmentCategory::getCode, "7000");
lambdaQueryWrapper.ne(EquipmentCategory::getCode,"F000"); lambdaQueryWrapper.ne(EquipmentCategory::getCode, "F000");
return equipmentCategoryMapper.selectList(lambdaQueryWrapper); return equipmentCategoryMapper.selectList(lambdaQueryWrapper);
} }
private List<EquipmentCategoryData> updateEquipmentCategoryData(String unitCode,String orgBranchCode) { private List<EquipmentCategoryData> updateEquipmentCategoryData(String unitCode, String orgBranchCode) {
List<String> unitCodeList = new ArrayList<>(); List<String> unitCodeList = new ArrayList<>();
unitCodeList.add(unitCode); unitCodeList.add(unitCode);
List<String> orgBranchCodeList = new ArrayList<>(); List<String> orgBranchCodeList = new ArrayList<>();
orgBranchCodeList.add(orgBranchCode); orgBranchCodeList.add(orgBranchCode);
List<EquipmentCategoryData> equipmentCategoryData = getCategoryData(unitCodeList,null); List<EquipmentCategoryData> equipmentCategoryData = getCategoryData(unitCodeList, null);
return equipmentCategoryData; return equipmentCategoryData;
} }
...@@ -968,7 +959,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -968,7 +959,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
List<String> records = new ArrayList<>(); List<String> records = new ArrayList<>();
List<ESEquipmentCategoryDto> list = new ArrayList<>(); List<ESEquipmentCategoryDto> list = new ArrayList<>();
if(recordList.toString().contains("[")){ if (recordList.toString().contains("[")) {
for (String record : (List<String>) recordList) { for (String record : (List<String>) recordList) {
records.add(record); records.add(record);
ESEquipmentCategoryDto esEquipmentCategoryDto = new ESEquipmentCategoryDto(); ESEquipmentCategoryDto esEquipmentCategoryDto = new ESEquipmentCategoryDto();
...@@ -981,7 +972,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -981,7 +972,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
esEquipmentCategoryDto.setSEQUENCE_NBR(recordList.toString()); esEquipmentCategoryDto.setSEQUENCE_NBR(recordList.toString());
list.add(esEquipmentCategoryDto); list.add(esEquipmentCategoryDto);
} }
//删除监管码表数据 // 删除监管码表数据
List<String> superviseCodeList = superviseInfoMapper.selectSuperviseCodeList(records); List<String> superviseCodeList = superviseInfoMapper.selectSuperviseCodeList(records);
List<Map<String, Object>> unitCodeAndOrgBranchCodeList = superviseInfoMapper.selectUnitCodeList(records); List<Map<String, Object>> unitCodeAndOrgBranchCodeList = superviseInfoMapper.selectUnitCodeList(records);
List<String> unitCodeList = new ArrayList<>(); List<String> unitCodeList = new ArrayList<>();
...@@ -991,17 +982,17 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -991,17 +982,17 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
orgBranchCodeList.add(String.valueOf(objectMap.get("orgBranchCode"))); orgBranchCodeList.add(String.valueOf(objectMap.get("orgBranchCode")));
} }
if(!ObjectUtils.isEmpty(superviseCodeList)){ if (!ObjectUtils.isEmpty(superviseCodeList)) {
supervisoryCodeInfoMapper.updateStatus(superviseCodeList); supervisoryCodeInfoMapper.updateStatus(superviseCodeList);
} }
//删除涉及的19张表的数据 // 删除涉及的19张表的数据
superviseInfoMapper.deleteDataAll(records); superviseInfoMapper.deleteDataAll(records);
// 根据统一信用代码更新总览表 // 根据统一信用代码更新总览表
if(!ObjectUtils.isEmpty(unitCodeList)){ if (!ObjectUtils.isEmpty(unitCodeList)) {
getCategoryData(unitCodeList,orgBranchCodeList); getCategoryData(unitCodeList, orgBranchCodeList);
} }
//删除es中的数据 // 删除es中的数据
esEquipmentCategory.deleteAll(list); esEquipmentCategory.deleteAll(list);
return records; return records;
} }
...@@ -1025,7 +1016,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1025,7 +1016,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String claimStatus = String.valueOf(superviseMap.get("claimStatus")); String claimStatus = String.valueOf(superviseMap.get("claimStatus"));
String code96333 = String.valueOf(superviseMap.get("code96333")); String code96333 = String.valueOf(superviseMap.get("code96333"));
String operateType = String.valueOf(superviseMap.get("operateType")); String operateType = String.valueOf(superviseMap.get("operateType"));
//生成码 // 生成码
Map<String, String> codeMap; Map<String, String> codeMap;
if (EquipmentCategoryEnum.YRL.getName().equals(claimStatus)) { if (EquipmentCategoryEnum.YRL.getName().equals(claimStatus)) {
log.info("准备生成监管码或96333电梯识别码"); log.info("准备生成监管码或96333电梯识别码");
...@@ -1033,15 +1024,15 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1033,15 +1024,15 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String county = String.valueOf(superviseMap.get("county")); String county = String.valueOf(superviseMap.get("county"));
String equCategory = String.valueOf(superviseMap.get("equCategory")); String equCategory = String.valueOf(superviseMap.get("equCategory"));
String supervisionCode = String.valueOf(superviseMap.get("supervisionCode")); String supervisionCode = String.valueOf(superviseMap.get("supervisionCode"));
//生成码 // 生成码
codeMap = creatCode(city, county, equCategory, code96333, supervisionCode); codeMap = creatCode(city, county, equCategory, code96333, supervisionCode);
log.info("已生成对应监管码或96333电梯识别码"); log.info("已生成对应监管码或96333电梯识别码");
//删除map中的冗余数据,添加对应监管码和96333码调用idx多表单页提交接口吧保存数据 // 删除map中的冗余数据,添加对应监管码和96333码调用idx多表单页提交接口吧保存数据
map.remove("data"); map.remove("data");
supervisionMap.put("CODE96333", codeMap.get("code96333")); supervisionMap.put("CODE96333", codeMap.get("code96333"));
supervisionMap.put("SUPERVISORY_CODE", codeMap.get("superviseCode")); supervisionMap.put("SUPERVISORY_CODE", codeMap.get("superviseCode"));
map.put(SUPERVISION_FROM_ID, supervisionMap); map.put(SUPERVISION_FROM_ID, supervisionMap);
//根据操作状态判断是调用新增还是修改接口 // 根据操作状态判断是调用新增还是修改接口
responseModel = "save".equals(operateType) ? idxFeignService.batchSubmit(null, null, null, null, map) : responseModel = "save".equals(operateType) ? idxFeignService.batchSubmit(null, null, null, null, map) :
idxFeignService.batchUpdate(null, null, map); idxFeignService.batchUpdate(null, null, map);
if (!ObjectUtils.isEmpty(responseModel) && "200".equals(String.valueOf(responseModel.getStatus()))) { if (!ObjectUtils.isEmpty(responseModel) && "200".equals(String.valueOf(responseModel.getStatus()))) {
...@@ -1053,7 +1044,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1053,7 +1044,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
map.remove("data"); map.remove("data");
supervisionMap.put("CODE96333", "null".equals(code96333) ? null : code96333); supervisionMap.put("CODE96333", "null".equals(code96333) ? null : code96333);
map.put(SUPERVISION_FROM_ID, supervisionMap); map.put(SUPERVISION_FROM_ID, supervisionMap);
//根据操作状态判断是调用新增还是修改接口 // 根据操作状态判断是调用新增还是修改接口
responseModel = "save".equals(operateType) ? idxFeignService.batchSubmit(null, null, null, null, map) : responseModel = "save".equals(operateType) ? idxFeignService.batchSubmit(null, null, null, null, map) :
idxFeignService.batchUpdate(null, null, map); idxFeignService.batchUpdate(null, null, map);
} else { } else {
...@@ -1061,11 +1052,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1061,11 +1052,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
responseModel = idxFeignService.batchUpdate(null, null, map); responseModel = idxFeignService.batchUpdate(null, null, map);
} }
stopWatch.stop(); stopWatch.stop();
if(log.isInfoEnabled()){ if (log.isInfoEnabled()) {
log.info("通用提交耗时:{} 秒",stopWatch.getTotalTimeSeconds()); log.info("通用提交耗时:{} 秒", stopWatch.getTotalTimeSeconds());
} }
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(),e); log.error(e.getMessage(), e);
supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.BF.getCode()); supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.BF.getCode());
ResponseModel<Object> response = new ResponseModel<>(); ResponseModel<Object> response = new ResponseModel<>();
response.setDevMessage(e.getMessage()); response.setDevMessage(e.getMessage());
...@@ -1074,14 +1065,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1074,14 +1065,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
response.setStatus(HttpStatus.BAD_REQUEST.value()); response.setStatus(HttpStatus.BAD_REQUEST.value());
return response; return response;
} finally { } finally {
updateEquipmentCategoryData(unitCode,orgBranchCode); updateEquipmentCategoryData(unitCode, orgBranchCode);
supervisoryCodeInfoMapper.update(supervisoryCodeInfo,new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code",supervisoryCodeInfo.getSupervisoryCode())); supervisoryCodeInfoMapper.update(supervisoryCodeInfo, new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code", supervisoryCodeInfo.getSupervisoryCode()));
} }
return responseModel; return responseModel;
} }
//分页查询所有数据 // 分页查询所有数据
public Page<Map<String, Object>> getAll(Map<String, Object> map) { public Page<Map<String, Object>> getAll(Map<String, Object> map) {
String tableName = map.get(TABLENAME).toString(); String tableName = map.get(TABLENAME).toString();
Assert.hasText(tableName, "表名不能为空"); Assert.hasText(tableName, "表名不能为空");
...@@ -1099,7 +1090,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1099,7 +1090,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return page; return page;
} }
//查询总条数 // 查询总条数
public Long counts(Map<String, Object> map) { public Long counts(Map<String, Object> map) {
String tableName = map.get(TABLENAME).toString(); String tableName = map.get(TABLENAME).toString();
Assert.hasText(tableName, "表名不能为空"); Assert.hasText(tableName, "表名不能为空");
...@@ -1107,6 +1098,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1107,6 +1098,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
Long count = bizJdbcTemplate.queryForObject(countSql, Long.class); Long count = bizJdbcTemplate.queryForObject(countSql, Long.class);
return count; return count;
} }
/** /**
* es数据同步 * es数据同步
* *
...@@ -1182,15 +1174,15 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1182,15 +1174,15 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
* es保存设备数据 * es保存设备数据
*/ */
public ESEquipmentCategoryDto saveESEquipmentCategory(Map<String, Object> map) { public ESEquipmentCategoryDto saveESEquipmentCategory(Map<String, Object> map) {
//处理时间问题 // 处理时间问题
String recDate1 = map.get("REC_DATE").toString().substring(0,19); String recDate1 = map.get("REC_DATE").toString().substring(0, 19);
long time = Timestamp.valueOf(recDate1).getTime(); long time = Timestamp.valueOf(recDate1).getTime();
map.put("REC_DATE",time); map.put("REC_DATE", time);
ESEquipmentCategoryDto dto = JSONObject.parseObject(toJSONString(map), ESEquipmentCategoryDto.class); ESEquipmentCategoryDto dto = JSONObject.parseObject(toJSONString(map), ESEquipmentCategoryDto.class);
ESEquipmentCategoryDto save = esEquipmentCategory.save(dto); ESEquipmentCategoryDto save = esEquipmentCategory.save(dto);
if (!ObjectUtils.isEmpty(save)) { if (!ObjectUtils.isEmpty(save)) {
//同步到es后修改 // 同步到es后修改
UseInfo useInfo = new UseInfo(); UseInfo useInfo = new UseInfo();
useInfo.setIsNotEs(1); useInfo.setIsNotEs(1);
useInfoMapper.update(useInfo, new QueryWrapper<UseInfo>().eq("RECORD", useInfoMapper.update(useInfo, new QueryWrapper<UseInfo>().eq("RECORD",
...@@ -1198,6 +1190,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1198,6 +1190,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
return save; return save;
} }
public Page<JSONObject> queryByKeys(JSONObject map) { public Page<JSONObject> queryByKeys(JSONObject map) {
// //根据当前登录人查询 // //根据当前登录人查询
if (!ValidationUtil.isEmpty(map.get(EQUSTATE))) { if (!ValidationUtil.isEmpty(map.get(EQUSTATE))) {
...@@ -1209,10 +1202,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1209,10 +1202,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String companyCode = object.getString("companyCode"); String companyCode = object.getString("companyCode");
if (!ValidationUtil.isEmpty(level)) { if (!ValidationUtil.isEmpty(level)) {
if (LEVEL.equals(level)) { if (LEVEL.equals(level)) {
//企业 // 企业
map.put("USE_UNIT_CREDIT_CODE", companyCode); map.put("USE_UNIT_CREDIT_CODE", companyCode);
} else { } else {
//监管单位 // 监管单位
map.put("ORG_BRANCH_CODE", code); map.put("ORG_BRANCH_CODE", code);
} }
} }
...@@ -1222,16 +1215,16 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1222,16 +1215,16 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
SearchSourceBuilder builder = new SearchSourceBuilder(); SearchSourceBuilder builder = new SearchSourceBuilder();
builder.trackTotalHits(true); builder.trackTotalHits(true);
BoolQueryBuilder boolMust = QueryBuilders.boolQuery(); BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
//通用匹配规则,条件构建 // 通用匹配规则,条件构建
//SEQUENCE_NBR // SEQUENCE_NBR
if (!ObjectUtils.isEmpty(map.getString("SEQUENCE_NBR"))) { if (!ObjectUtils.isEmpty(map.getString("SEQUENCE_NBR"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("SEQUENCE_NBR", "*"+map.getString("SEQUENCE_NBR")+"*")); meBuilder.must(QueryBuilders.matchPhraseQuery("SEQUENCE_NBR", "*" + map.getString("SEQUENCE_NBR") + "*"));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_NAME"))) { if (!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_NAME"))) {
BoolQueryBuilder query = QueryBuilders.boolQuery(); BoolQueryBuilder query = QueryBuilders.boolQuery();
query.must(QueryBuilders.matchPhraseQuery("ORG_BRANCH_NAME", "*"+map.getString("ORG_BRANCH_NAME")+"*" )); query.must(QueryBuilders.matchPhraseQuery("ORG_BRANCH_NAME", "*" + map.getString("ORG_BRANCH_NAME") + "*"));
boolMust.must(query); boolMust.must(query);
} }
if (!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_CODE"))) { if (!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_CODE"))) {
...@@ -1241,12 +1234,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1241,12 +1234,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_NAME"))) { if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_NAME"))) {
BoolQueryBuilder query = QueryBuilders.boolQuery(); BoolQueryBuilder query = QueryBuilders.boolQuery();
query.must(QueryBuilders.matchPhraseQuery("USE_UNIT_NAME", "*"+map.getString("USE_UNIT_NAME")+"*")); query.must(QueryBuilders.matchPhraseQuery("USE_UNIT_NAME", "*" + map.getString("USE_UNIT_NAME") + "*"));
boolMust.must(query); boolMust.must(query);
} }
if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_CREDIT_CODE"))) { if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_CREDIT_CODE"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("USE_UNIT_CREDIT_CODE", "*"+map.getString("USE_UNIT_CREDIT_CODE")+"*")); meBuilder.must(QueryBuilders.matchPhraseQuery("USE_UNIT_CREDIT_CODE", "*" + map.getString("USE_UNIT_CREDIT_CODE") + "*"));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("EQU_LIST_CODE"))) { if (!ObjectUtils.isEmpty(map.getString("EQU_LIST_CODE"))) {
...@@ -1256,23 +1249,23 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1256,23 +1249,23 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
if (!ObjectUtils.isEmpty(map.getString("EQU_LIST"))) { if (!ObjectUtils.isEmpty(map.getString("EQU_LIST"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("EQU_LIST", "*"+map.getString("EQU_LIST")+"*")); meBuilder.must(QueryBuilders.matchPhraseQuery("EQU_LIST", "*" + map.getString("EQU_LIST") + "*"));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("EQU_CATEGORY"))) { if (!ObjectUtils.isEmpty(map.getString("EQU_CATEGORY"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("EQU_CATEGORY", "*"+map.getString("EQU_CATEGORY")+"*")); meBuilder.must(QueryBuilders.matchPhraseQuery("EQU_CATEGORY", "*" + map.getString("EQU_CATEGORY") + "*"));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("USE_ORG_CODE"))) { if (!ObjectUtils.isEmpty(map.getString("USE_ORG_CODE"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*"+map.getString("USE_ORG_CODE").toLowerCase()+"*")); meBuilder.must(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*" + map.getString("USE_ORG_CODE").toLowerCase() + "*"));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("CODE96333"))) { if (!ObjectUtils.isEmpty(map.getString("CODE96333"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.wildcardQuery("CODE96333", "*"+map.getString("CODE96333").toLowerCase()+"*")); meBuilder.must(QueryBuilders.wildcardQuery("CODE96333", "*" + map.getString("CODE96333").toLowerCase() + "*"));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("EQU_CODE"))) { if (!ObjectUtils.isEmpty(map.getString("EQU_CODE"))) {
...@@ -1283,7 +1276,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1283,7 +1276,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if (!ObjectUtils.isEmpty(map.getString("SUPERVISORY_CODE"))) { if (!ObjectUtils.isEmpty(map.getString("SUPERVISORY_CODE"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.wildcardQuery("SUPERVISORY_CODE", "*"+map.getString("SUPERVISORY_CODE").toLowerCase()+"*")); meBuilder.must(QueryBuilders.wildcardQuery("SUPERVISORY_CODE", "*" + map.getString("SUPERVISORY_CODE").toLowerCase() + "*"));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("USE_PLACE"))) { if (!ObjectUtils.isEmpty(map.getString("USE_PLACE"))) {
...@@ -1296,14 +1289,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1296,14 +1289,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
query.must(QueryBuilders.matchPhraseQuery("ADDRESS", "*" + map.getString("ADDRESS") + "*")); query.must(QueryBuilders.matchPhraseQuery("ADDRESS", "*" + map.getString("ADDRESS") + "*"));
boolMust.must(query); boolMust.must(query);
} }
if (!ObjectUtils.isEmpty(map.getString("EQU_STATE")) ) { if (!ObjectUtils.isEmpty(map.getString("EQU_STATE"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchQuery("EQU_STATE", map.getLong("EQU_STATE"))); meBuilder.must(QueryBuilders.matchQuery("EQU_STATE", map.getLong("EQU_STATE")));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("STATUS"))) { if (!ObjectUtils.isEmpty(map.getString("STATUS"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("STATUS", "*"+map.getString("STATUS")+"*")); meBuilder.must(QueryBuilders.matchPhraseQuery("STATUS", "*" + map.getString("STATUS") + "*"));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
builder.query(boolMust); builder.query(boolMust);
...@@ -1335,7 +1328,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1335,7 +1328,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return result; return result;
} }
//es统计总记录数 // es统计总记录数
public Long getCount(String indexs, RestHighLevelClient esClient) { public Long getCount(String indexs, RestHighLevelClient esClient) {
Long totle = 0L; Long totle = 0L;
SearchRequest searchRequest = new SearchRequest(indexs); SearchRequest searchRequest = new SearchRequest(indexs);
......
...@@ -10,8 +10,6 @@ import com.google.common.collect.Lists; ...@@ -10,8 +10,6 @@ import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.cylinder.biz.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.cylinder.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.cylinder.api.dto.*; import com.yeejoin.amos.boot.module.cylinder.api.dto.*;
import com.yeejoin.amos.boot.module.cylinder.api.entity.*; import com.yeejoin.amos.boot.module.cylinder.api.entity.*;
import com.yeejoin.amos.boot.module.cylinder.api.enums.EquimentEnum; import com.yeejoin.amos.boot.module.cylinder.api.enums.EquimentEnum;
...@@ -20,22 +18,16 @@ import com.yeejoin.amos.boot.module.cylinder.api.enums.EquipmentClassifityEnum; ...@@ -20,22 +18,16 @@ import com.yeejoin.amos.boot.module.cylinder.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.cylinder.api.mapper.*; import com.yeejoin.amos.boot.module.cylinder.api.mapper.*;
import com.yeejoin.amos.boot.module.cylinder.api.service.IEquipmentCategoryService; import com.yeejoin.amos.boot.module.cylinder.api.service.IEquipmentCategoryService;
import com.yeejoin.amos.boot.module.cylinder.api.vo.EquipExportVo; import com.yeejoin.amos.boot.module.cylinder.api.vo.EquipExportVo;
import com.yeejoin.amos.boot.module.cylinder.biz.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.cylinder.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.cylinder.flc.api.feign.IdxFeignService; import com.yeejoin.amos.boot.module.cylinder.flc.api.feign.IdxFeignService;
import com.yeejoin.amos.boot.module.cylinder.flc.api.feign.PrivilegeFeginService; import com.yeejoin.amos.boot.module.cylinder.flc.api.feign.PrivilegeFeginService;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient; import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
...@@ -123,33 +115,33 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -123,33 +115,33 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
//管辖机构redis缓存key // 管辖机构redis缓存key
private static final String REGULATOR_UNIT_TREE = "REGULATOR_UNIT_TREE"; private static final String REGULATOR_UNIT_TREE = "REGULATOR_UNIT_TREE";
//行政区划redis缓存key // 行政区划redis缓存key
private static final String PROVINCE = "PROVINCE"; private static final String PROVINCE = "PROVINCE";
private static final String CITY = "CITY"; private static final String CITY = "CITY";
private static final String REGION = "REGION"; private static final String REGION = "REGION";
//西安行政区划code // 西安行政区划code
private static final String XIAN = "610100"; private static final String XIAN = "610100";
//判断行政区划查询市还是区 // 判断行政区划查询市还是区
private static final String END_CODE = "0000"; private static final String END_CODE = "0000";
//一码通监督管理表单id // 一码通监督管理表单id
private static final String SUPERVISION_FROM_ID = "1627903532906602497"; private static final String SUPERVISION_FROM_ID = "1627903532906602497";
//一码通使用信息表单id // 一码通使用信息表单id
private static final String USE_INFO_FROM_ID = "1627903393253056514"; private static final String USE_INFO_FROM_ID = "1627903393253056514";
//一码通码自动生成 // 一码通码自动生成
final static String CREATE = "1"; final static String CREATE = "1";
//一码通码手动输入 // 一码通码手动输入
final static String NOT_CREATE = "0"; final static String NOT_CREATE = "0";
//一码通复制功能url参数key // 一码通复制功能url参数key
private static final String COPY_KEY = "stashType"; private static final String COPY_KEY = "stashType";
@Autowired @Autowired
RestHighLevelClient restHighLevelClient; RestHighLevelClient restHighLevelClient;
private static String USE_CODE = "use_code"; private static String USE_CODE = "use_code";
...@@ -236,14 +228,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -236,14 +228,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String city, county, equipCategory; String city, county, equipCategory;
EquInfoDto equInfoDto = new EquInfoDto(); EquInfoDto equInfoDto = new EquInfoDto();
if (ObjectUtils.isEmpty(record)) { if (ObjectUtils.isEmpty(record)) {
//获取对应行政区划 // 获取对应行政区划
county = EquipmentCategoryEnum.XZQH.getCode(); county = EquipmentCategoryEnum.XZQH.getCode();
city = map.get("regionCode").toString(); city = map.get("regionCode").toString();
//获取对应设备分类 // 获取对应设备分类
equipCategory = map.get("equCategory").toString(); equipCategory = map.get("equCategory").toString();
} else { } else {
equInfoDto = categoryOtherInfoMapper.selectEquipInfo(record); equInfoDto = categoryOtherInfoMapper.selectEquipInfo(record);
//判断这条数据认领状态是否为已认领,否则直接返回 // 判断这条数据认领状态是否为已认领,否则直接返回
if (!ObjectUtils.isEmpty(equInfoDto) && EquipmentCategoryEnum.YRL.getName().equals(equInfoDto.getStatus())) { if (!ObjectUtils.isEmpty(equInfoDto) && EquipmentCategoryEnum.YRL.getName().equals(equInfoDto.getStatus())) {
city = equInfoDto.getCity(); city = equInfoDto.getCity();
county = equInfoDto.getCounty(); county = equInfoDto.getCounty();
...@@ -252,10 +244,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -252,10 +244,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return new HashMap<>(); return new HashMap<>();
} }
} }
//生成码 // 生成码
Map<String, String> codeMap; Map<String, String> codeMap;
synchronized (EquipmentCategoryServiceImpl.class) { synchronized (EquipmentCategoryServiceImpl.class) {
codeMap = creatCode(city, county, equipCategory, null,null); codeMap = creatCode(city, county, equipCategory, null, null);
} }
if (ObjectUtils.isEmpty(codeMap)) { if (ObjectUtils.isEmpty(codeMap)) {
return new HashMap<>(); return new HashMap<>();
...@@ -268,19 +260,19 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -268,19 +260,19 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
supervisoryCodeInfo.setStatus(equState); supervisoryCodeInfo.setStatus(equState);
if (!ObjectUtils.isEmpty(record)) { if (!ObjectUtils.isEmpty(record)) {
String supervisorCode, elevatorCode; String supervisorCode, elevatorCode;
//设备状态为报废,对应电梯码作废 // 设备状态为报废,对应电梯码作废
equState = EquipmentCategoryEnum.BF.getCode().equals(equInfoDto.getEquState()) ? EquipmentCategoryEnum.WSY.getCode() : EquipmentCategoryEnum.YSY.getCode(); equState = EquipmentCategoryEnum.BF.getCode().equals(equInfoDto.getEquState()) ? EquipmentCategoryEnum.WSY.getCode() : EquipmentCategoryEnum.YSY.getCode();
supervisorCode = codeMap.get("superviseCode"); supervisorCode = codeMap.get("superviseCode");
elevatorCode = EquipmentCategoryEnum.BF.getCode().equals(equInfoDto.getEquState()) ? null : codeMap.get("code96333"); elevatorCode = EquipmentCategoryEnum.BF.getCode().equals(equInfoDto.getEquState()) ? null : codeMap.get("code96333");
List<CategoryOtherInfo> categoryOtherInfo = categoryOtherInfoMapper.selectList(new QueryWrapper<CategoryOtherInfo>().eq("SUPERVISORY_CODE", supervisorCode)); List<CategoryOtherInfo> categoryOtherInfo = categoryOtherInfoMapper.selectList(new QueryWrapper<CategoryOtherInfo>().eq("SUPERVISORY_CODE", supervisorCode));
if (categoryOtherInfo.size() > 0) { if (categoryOtherInfo.size() > 0) {
// categoryOtherInfoMapper.updateCode(supervisorCode, equState); // categoryOtherInfoMapper.updateCode(supervisorCode, equState);
supervisoryCodeInfoMapper.update(supervisoryCodeInfo,new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code",supervisoryCodeInfo.getSupervisoryCode())); supervisoryCodeInfoMapper.update(supervisoryCodeInfo, new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code", supervisoryCodeInfo.getSupervisoryCode()));
} else { } else {
supervisoryCodeInfo.setStatus(equState); supervisoryCodeInfo.setStatus(equState);
supervisoryCodeInfoMapper.insert(supervisoryCodeInfo); supervisoryCodeInfoMapper.insert(supervisoryCodeInfo);
} }
//修改源数据的电梯码 // 修改源数据的电梯码
categoryOtherInfoMapper.updateSupervisorCode(supervisorCode, elevatorCode, record); categoryOtherInfoMapper.updateSupervisorCode(supervisorCode, elevatorCode, record);
} else { } else {
supervisoryCodeInfoMapper.insert(supervisoryCodeInfo); supervisoryCodeInfoMapper.insert(supervisoryCodeInfo);
...@@ -291,13 +283,13 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -291,13 +283,13 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
@Override @Override
public List<LinkedHashMap> getTree() { public List<LinkedHashMap> getTree() {
List<LinkedHashMap> result = (List<LinkedHashMap>) redisUtils.get(REGULATOR_UNIT_TREE); List<LinkedHashMap> result = (List<LinkedHashMap>) redisUtils.get(REGULATOR_UNIT_TREE);
//判断redis是否存在管辖机构树 // 判断redis是否存在管辖机构树
return !ObjectUtils.isEmpty(result) ? result : creatTree(); return !ObjectUtils.isEmpty(result) ? result : creatTree();
} }
@Override @Override
public List<LinkedHashMap> creatTree() { public List<LinkedHashMap> creatTree() {
FeignClientResult tree = privilegeFeginService.tree(RequestContext.getToken(),RequestContext.getAppKey(),RequestContext.getProduct()); FeignClientResult tree = privilegeFeginService.tree(RequestContext.getToken(), RequestContext.getAppKey(), RequestContext.getProduct());
List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult(); List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult();
List<LinkedHashMap> treeData = deleteRegulatorTreeData(result); List<LinkedHashMap> treeData = deleteRegulatorTreeData(result);
List<LinkedHashMap> supervisionTree = treeData.stream().filter(e -> code.equals(e.get("orgCode"))).collect(Collectors.toList()); List<LinkedHashMap> supervisionTree = treeData.stream().filter(e -> code.equals(e.get("orgCode"))).collect(Collectors.toList());
...@@ -316,7 +308,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -316,7 +308,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
Iterator it = result.iterator(); Iterator it = result.iterator();
while (it.hasNext()) { while (it.hasNext()) {
LinkedHashMap e = (LinkedHashMap) it.next(); LinkedHashMap e = (LinkedHashMap) it.next();
//将管辖机构树中children为[]的修改为null // 将管辖机构树中children为[]的修改为null
if (e.get("children") != null) { if (e.get("children") != null) {
if (((List<LinkedHashMap>) e.get("children")).size() == 0) { if (((List<LinkedHashMap>) e.get("children")).size() == 0) {
e.put("children", null); e.put("children", null);
...@@ -339,7 +331,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -339,7 +331,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
Iterator it = result.iterator(); Iterator it = result.iterator();
while (it.hasNext()) { while (it.hasNext()) {
LinkedHashMap e = (LinkedHashMap) it.next(); LinkedHashMap e = (LinkedHashMap) it.next();
//删除使用单位 // 删除使用单位
if ("company".equals(e.get("level"))) { if ("company".equals(e.get("level"))) {
it.remove(); it.remove();
} }
...@@ -362,7 +354,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -362,7 +354,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return ObjectUtils.isEmpty(list) ? getProvinceList(level) : list; return ObjectUtils.isEmpty(list) ? getProvinceList(level) : list;
} else if (!ObjectUtils.isEmpty(parentId)) { } else if (!ObjectUtils.isEmpty(parentId)) {
String regionCode = parentId.split("_")[0]; String regionCode = parentId.split("_")[0];
//regionCode以0000结果查询市、否则查询区 // regionCode以0000结果查询市、否则查询区
Map<String, Object> map = regionCode.endsWith(END_CODE) ? (Map<String, Object>) redisUtils.get(CITY) : (Map<String, Object>) redisUtils.get(REGION); Map<String, Object> map = regionCode.endsWith(END_CODE) ? (Map<String, Object>) redisUtils.get(CITY) : (Map<String, Object>) redisUtils.get(REGION);
if (ObjectUtils.isEmpty(map)) { if (ObjectUtils.isEmpty(map)) {
map = getRegionList(); map = getRegionList();
...@@ -375,19 +367,19 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -375,19 +367,19 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
public Map<String, Object> getRegionList() { public Map<String, Object> getRegionList() {
//查询省下所有的行政区划市,封装并存入redis // 查询省下所有的行政区划市,封装并存入redis
Map<String, Object> map1 = new HashMap<>(); Map<String, Object> map1 = new HashMap<>();
List<LinkedHashMap> cityList; List<LinkedHashMap> cityList;
FeignClientResult tree = privilegeFeginService.getTree(); FeignClientResult tree = privilegeFeginService.getTree();
List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult(); List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult();
//获取陕西省regionCode // 获取陕西省regionCode
String regionCode = ((List<LinkedHashMap>) privilegeFeginService.getProvince("1").getResult()).get(0).get("regionCode").toString(); String regionCode = ((List<LinkedHashMap>) privilegeFeginService.getProvince("1").getResult()).get(0).get("regionCode").toString();
cityList = deleteTreeData(result, regionCode); cityList = deleteTreeData(result, regionCode);
Map<String, Object> cityMap = new HashMap<>(); Map<String, Object> cityMap = new HashMap<>();
cityMap.put(regionCode, cityList); cityMap.put(regionCode, cityList);
map1.put(regionCode, cityList); map1.put(regionCode, cityList);
redisUtils.set(CITY, cityMap); redisUtils.set(CITY, cityMap);
//查询市下所有的行政区划区,封装并存入redis // 查询市下所有的行政区划区,封装并存入redis
if (!ObjectUtils.isEmpty(cityList)) { if (!ObjectUtils.isEmpty(cityList)) {
List<LinkedHashMap> region = (List<LinkedHashMap>) privilegeFeginService.getTree().getResult(); List<LinkedHashMap> region = (List<LinkedHashMap>) privilegeFeginService.getTree().getResult();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
...@@ -456,7 +448,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -456,7 +448,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
List<LinkedHashMap> list = new ArrayList<>(); List<LinkedHashMap> list = new ArrayList<>();
while (it.hasNext()) { while (it.hasNext()) {
LinkedHashMap e = (LinkedHashMap) it.next(); LinkedHashMap e = (LinkedHashMap) it.next();
//修改数据 // 修改数据
if (type.equals(e.get("parentRegionCode").toString())) { if (type.equals(e.get("parentRegionCode").toString())) {
e.put("children", null); e.put("children", null);
e.put("sequenceNbr", e.get("regionCode")); e.put("sequenceNbr", e.get("regionCode"));
...@@ -473,33 +465,33 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -473,33 +465,33 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
/** /**
* 具体生成监管码和电梯96333识别码逻辑 * 具体生成监管码和电梯96333识别码逻辑
*/ */
private synchronized Map<String, String> creatCode(String city, String county, String equipCategory, String code96333,String supervisionCode) { private synchronized Map<String, String> creatCode(String city, String county, String equipCategory, String code96333, String supervisionCode) {
Map<String, String> resultMap = new HashMap<>(); Map<String, String> resultMap = new HashMap<>();
StringBuilder supervisorCode = new StringBuilder(); StringBuilder supervisorCode = new StringBuilder();
StringBuilder elevatorCode = new StringBuilder(); StringBuilder elevatorCode = new StringBuilder();
CategoryOtherInfo categoryOtherInfo = new CategoryOtherInfo(); CategoryOtherInfo categoryOtherInfo = new CategoryOtherInfo();
String prefix; String prefix;
//判断是否需要生成96333电梯码 // 判断是否需要生成96333电梯码
if (equipCategory.startsWith("3") && !XIAN.equals(city)) { if (equipCategory.startsWith("3") && !XIAN.equals(city)) {
//判断数据是否携带96333电梯码,携带则使用,不携带则生成 // 判断数据是否携带96333电梯码,携带则使用,不携带则生成
if("null".equals(code96333)){ if ("null".equals(code96333)) {
prefix = getPrefix(EquipmentCategoryEnum.XZQHDT.getCode(), city); prefix = getPrefix(EquipmentCategoryEnum.XZQHDT.getCode(), city);
//查询未使用的电梯码 // 查询未使用的电梯码
categoryOtherInfo = categoryOtherInfoMapper.selectElevatorCode(prefix, EquipmentCategoryEnum.WSY.getCode()); categoryOtherInfo = categoryOtherInfoMapper.selectElevatorCode(prefix, EquipmentCategoryEnum.WSY.getCode());
//如果存在未使用的电梯码则启用未使用的否则创建 // 如果存在未使用的电梯码则启用未使用的否则创建
String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? createElevatorCode(city, county) : categoryOtherInfo.getCode(); String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? createElevatorCode(city, county) : categoryOtherInfo.getCode();
if(!ObjectUtils.isEmpty(categoryOtherInfo)){ if (!ObjectUtils.isEmpty(categoryOtherInfo)) {
supervisoryCodeInfoMapper.delete(new QueryWrapper<SupervisoryCodeInfo>().eq("code96333",categoryOtherInfo.getCode())); supervisoryCodeInfoMapper.delete(new QueryWrapper<SupervisoryCodeInfo>().eq("code96333", categoryOtherInfo.getCode()));
} }
elevatorCode.append(elevator); elevatorCode.append(elevator);
resultMap.put("creatStatus",CREATE); resultMap.put("creatStatus", CREATE);
} else { } else {
elevatorCode.append(code96333); elevatorCode.append(code96333);
resultMap.put("creatStatus",NOT_CREATE); resultMap.put("creatStatus", NOT_CREATE);
} }
} }
//判断原数据是否存在监管码,存在则用原监管码即可,不存在则生成 // 判断原数据是否存在监管码,存在则用原监管码即可,不存在则生成
if("null".equals(supervisionCode)){ if ("null".equals(supervisionCode)) {
String supervisor = createSupervisorCode(city, county, equipCategory); String supervisor = createSupervisorCode(city, county, equipCategory);
supervisorCode.append(supervisor); supervisorCode.append(supervisor);
} else { } else {
...@@ -512,18 +504,18 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -512,18 +504,18 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
SupervisoryCodeInfo supervisoryCodeInfo = new SupervisoryCodeInfo(); SupervisoryCodeInfo supervisoryCodeInfo = new SupervisoryCodeInfo();
SupervisoryCodeInfo selectOne = supervisoryCodeInfoMapper.selectOne(new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code", supervisionCode)); SupervisoryCodeInfo selectOne = supervisoryCodeInfoMapper.selectOne(new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code", supervisionCode));
//将生成的码添加到码表中,码的使用状态为初始状态 // 将生成的码添加到码表中,码的使用状态为初始状态
String equState = EquipmentCategoryEnum.CSZT.getCode(); String equState = EquipmentCategoryEnum.CSZT.getCode();
supervisoryCodeInfo.setCode96333(String.valueOf(elevatorCode)); supervisoryCodeInfo.setCode96333(String.valueOf(elevatorCode));
supervisoryCodeInfo.setCreateStatus(resultMap.get("creatStatus")); supervisoryCodeInfo.setCreateStatus(resultMap.get("creatStatus"));
supervisoryCodeInfo.setSupervisoryCode(String.valueOf(supervisorCode)); supervisoryCodeInfo.setSupervisoryCode(String.valueOf(supervisorCode));
supervisoryCodeInfo.setStatus(equState); supervisoryCodeInfo.setStatus(equState);
if(ObjectUtils.isEmpty(selectOne)){ if (ObjectUtils.isEmpty(selectOne)) {
supervisoryCodeInfoMapper.insert(supervisoryCodeInfo); supervisoryCodeInfoMapper.insert(supervisoryCodeInfo);
} else { } else {
selectOne.setCode96333(String.valueOf(elevatorCode)); selectOne.setCode96333(String.valueOf(elevatorCode));
supervisoryCodeInfoMapper.update(selectOne, supervisoryCodeInfoMapper.update(selectOne,
new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code",selectOne.getSupervisoryCode())); new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code", selectOne.getSupervisoryCode()));
} }
resultMap.put("superviseCode", ObjectUtils.isEmpty(supervisorCode) ? null : supervisorCode.toString()); resultMap.put("superviseCode", ObjectUtils.isEmpty(supervisorCode) ? null : supervisorCode.toString());
resultMap.put("code96333", ObjectUtils.isEmpty(elevatorCode) ? null : elevatorCode.toString()); resultMap.put("code96333", ObjectUtils.isEmpty(elevatorCode) ? null : elevatorCode.toString());
...@@ -544,15 +536,15 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -544,15 +536,15 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
*/ */
private String createSupervisorCode(String city, String county, String equipCategory) { private String createSupervisorCode(String city, String county, String equipCategory) {
StringBuilder supervisorCode = new StringBuilder(); StringBuilder supervisorCode = new StringBuilder();
//生成监管码前缀 // 生成监管码前缀
Map<String, Object> divisionMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), county); Map<String, Object> divisionMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), county);
String division = ObjectUtils.isEmpty(divisionMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), city).get("code").toString() : divisionMap.get("code").toString(); String division = ObjectUtils.isEmpty(divisionMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), city).get("code").toString() : divisionMap.get("code").toString();
supervisorCode.append(division).append(equipCategory).append("-"); supervisorCode.append(division).append(equipCategory).append("-");
//获取行政区划区县、市是否存在历史监管码 // 获取行政区划区县、市是否存在历史监管码
CategoryOtherInfo supervisor = categoryOtherInfoMapper.selectSupervisorCode(supervisorCode.toString()); CategoryOtherInfo supervisor = categoryOtherInfoMapper.selectSupervisorCode(supervisorCode.toString());
//生成对应监管码 // 生成对应监管码
if (!ObjectUtils.isEmpty(supervisor) && supervisor.getSupervisoryCode() != null) { if (!ObjectUtils.isEmpty(supervisor) && supervisor.getSupervisoryCode() != null) {
//获取补零位长度 // 获取补零位长度
String supervisoryCode = supervisor.getSupervisoryCode().substring(6); String supervisoryCode = supervisor.getSupervisoryCode().substring(6);
long num = Long.valueOf(supervisoryCode) + 1; long num = Long.valueOf(supervisoryCode) + 1;
int numLength = String.valueOf(num).length(); int numLength = String.valueOf(num).length();
...@@ -578,7 +570,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -578,7 +570,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
*/ */
private String createElevatorCode(String city, String county) { private String createElevatorCode(String city, String county) {
StringBuilder elevatorCode = new StringBuilder(); StringBuilder elevatorCode = new StringBuilder();
//生成生成96333电梯码前缀 // 生成生成96333电梯码前缀
Map<String, Object> elevatorMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), county); Map<String, Object> elevatorMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), county);
String elevator = ObjectUtils.isEmpty(elevatorMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), city).get("code").toString() : elevatorMap.get("code").toString(); String elevator = ObjectUtils.isEmpty(elevatorMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), city).get("code").toString() : elevatorMap.get("code").toString();
elevatorCode.append(elevator); elevatorCode.append(elevator);
...@@ -587,10 +579,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -587,10 +579,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if (ValidationUtil.isEmpty(initSupervisoryCode)) { if (ValidationUtil.isEmpty(initSupervisoryCode)) {
elevatorCode.append(EquipmentCategoryEnum.getValue.get(elevator)); elevatorCode.append(EquipmentCategoryEnum.getValue.get(elevator));
} else { } else {
//获取行政区划区县、市是否存在历史96333电梯码 // 获取行政区划区县、市是否存在历史96333电梯码
CategoryOtherInfo elevatorOtherInfo = categoryOtherInfoMapper.selectElevatorCode(elevatorCode.toString(), null); CategoryOtherInfo elevatorOtherInfo = categoryOtherInfoMapper.selectElevatorCode(elevatorCode.toString(), null);
if (!ObjectUtils.isEmpty(elevatorOtherInfo) && elevatorOtherInfo.getCode() != null) { if (!ObjectUtils.isEmpty(elevatorOtherInfo) && elevatorOtherInfo.getCode() != null) {
//获取补零位长度 // 获取补零位长度
String elevatorCode1 = elevatorOtherInfo.getCode().substring(2); String elevatorCode1 = elevatorOtherInfo.getCode().substring(2);
long num = Long.parseLong(elevatorCode1) + 1; long num = Long.parseLong(elevatorCode1) + 1;
int numLength = String.valueOf(num).length(); int numLength = String.valueOf(num).length();
...@@ -727,12 +719,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -727,12 +719,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if (!ValidationUtil.isEmpty(level)) { if (!ValidationUtil.isEmpty(level)) {
Page<Map<String, Object>> m = new Page<>(); Page<Map<String, Object>> m = new Page<>();
if (LEVEL.equals(level)) { if (LEVEL.equals(level)) {
//企业 // 企业
map.put("USE_UNIT_CREDIT_CODE", companyCode); map.put("USE_UNIT_CREDIT_CODE", companyCode);
m = this.getPage(map); m = this.getPage(map);
map.remove("USE_UNIT_CREDIT_CODE"); map.remove("USE_UNIT_CREDIT_CODE");
} else { } else {
//监管单位 // 监管单位
map.put("ORG_BRANCH_CODE", code); map.put("ORG_BRANCH_CODE", code);
m = this.getPage(map); m = this.getPage(map);
map.remove("ORG_BRANCH_CODE"); map.remove("ORG_BRANCH_CODE");
...@@ -750,7 +742,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -750,7 +742,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
objectPage.setSize(Long.valueOf(map.get("size").toString())); objectPage.setSize(Long.valueOf(map.get("size").toString()));
objectPage.setCurrent(Long.valueOf(map.get("number").toString())); objectPage.setCurrent(Long.valueOf(map.get("number").toString()));
model.setResult(objectPage); model.setResult(objectPage);
//设备状态码对应枚举值 // 设备状态码对应枚举值
List<Map<String, Object>> records = model.getResult().getRecords(); List<Map<String, Object>> records = model.getResult().getRecords();
List<Map<String, Object>> result = new ArrayList<>(); List<Map<String, Object>> result = new ArrayList<>();
for (Map<String, Object> record : records) { for (Map<String, Object> record : records) {
...@@ -791,7 +783,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -791,7 +783,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return list; return list;
} }
public List<EquipExportVo> getEquipExportData(EquipExportDto dto){ public List<EquipExportVo> getEquipExportData(EquipExportDto dto) {
ArrayList<EquipExportVo> list = new ArrayList<>(); ArrayList<EquipExportVo> list = new ArrayList<>();
List<JSONObject> objectList = getCompanyType(); List<JSONObject> objectList = getCompanyType();
if (!ValidationUtil.isEmpty(dto.getEQU_STATE())) { if (!ValidationUtil.isEmpty(dto.getEQU_STATE())) {
...@@ -803,14 +795,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -803,14 +795,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String companyCode = object.getString("companyCode"); String companyCode = object.getString("companyCode");
if (!ValidationUtil.isEmpty(level)) { if (!ValidationUtil.isEmpty(level)) {
if (LEVEL.equals(level)) { if (LEVEL.equals(level)) {
//企业 // 企业
dto.setUSE_UNIT_CREDIT_CODE(companyCode); dto.setUSE_UNIT_CREDIT_CODE(companyCode);
} else { } else {
//监管单位 // 监管单位
dto.setORG_BRANCH_CODE(orgCode); dto.setORG_BRANCH_CODE(orgCode);
} }
List<EquipExportVo> equipExportData = equipmentCategoryMapper.getEquipExportData(dto); List<EquipExportVo> equipExportData = equipmentCategoryMapper.getEquipExportData(dto);
if (!ObjectUtils.isEmpty(equipExportData) ) { if (!ObjectUtils.isEmpty(equipExportData)) {
list.addAll(equipExportData); list.addAll(equipExportData);
} }
} }
...@@ -850,23 +842,22 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -850,23 +842,22 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
@Override @Override
@Async @Async
public void createEquipmentCategoryData() { public void createEquipmentCategoryData() {
if(log.isInfoEnabled()){ if (log.isInfoEnabled()) {
log.info("初始化一码通总览数据开始"); log.info("初始化一码通总览数据开始");
} }
equipmentCategoryDataService.remove(new QueryWrapper<>()); equipmentCategoryDataService.remove(new QueryWrapper<>());
getCategoryData(null,null); getCategoryData(null, null);
} }
private List<EquipmentCategoryData> getCategoryData(List<String> unitCodes,List<String> orgBranchCodes) { private List<EquipmentCategoryData> getCategoryData(List<String> unitCodes, List<String> orgBranchCodes) {
StopWatch stopWatch = new StopWatch(); StopWatch stopWatch = new StopWatch();
stopWatch.start(); stopWatch.start();
List<EquipmentCategoryData> list = new ArrayList<>(); List<EquipmentCategoryData> list = new ArrayList<>();
// 查询所有单位 // 查询所有单位
List<Map<String, Object>> allUnitList = equipmentCategoryMapper.getAllUnit(unitCodes,orgBranchCodes); List<Map<String, Object>> allUnitList = equipmentCategoryMapper.getAllUnit(unitCodes, orgBranchCodes);
// 统计查询不同单位、不同装备定义、不同状态下的设备数量 // 统计查询不同单位、不同装备定义、不同状态下的设备数量
List<UseUnitCreditCodeCategoryDto> equipCountList = equipmentCategoryMapper.useUnitCreditCodeCategoryCount(); List<UseUnitCreditCodeCategoryDto> equipCountList = equipmentCategoryMapper.useUnitCreditCodeCategoryCount();
// 查询8大类设备定义 // 查询8大类设备定义
...@@ -874,31 +865,31 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -874,31 +865,31 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
// 组织EquipmentCategoryData表数据 // 组织EquipmentCategoryData表数据
for (Map<String, Object> map : allUnitList) { for (Map<String, Object> map : allUnitList) {
EquipmentCategoryData equipmentCategoryData = new EquipmentCategoryData(); EquipmentCategoryData equipmentCategoryData = new EquipmentCategoryData();
if(ObjectUtils.isEmpty(map.get("supervise_org_code")) || ObjectUtils.isEmpty(map.get(USE_CODE))){ if (ObjectUtils.isEmpty(map.get("supervise_org_code")) || ObjectUtils.isEmpty(map.get(USE_CODE))) {
continue; continue;
} }
equipmentCategoryData.setOrgBranchCode(map.get("supervise_org_code").toString()); equipmentCategoryData.setOrgBranchCode(map.get("supervise_org_code").toString());
equipmentCategoryData.setUnitCode(map.get(USE_CODE).toString()); equipmentCategoryData.setUnitCode(map.get(USE_CODE).toString());
// 指定单位的设备统计信息 // 指定单位的设备统计信息
List<UseUnitCreditCodeCategoryDto> unitEquipCountList = equipCountList.stream().filter(r->r.getUseUnitCreditCode().equals(map.get(USE_CODE).toString())).collect(Collectors.toList()); List<UseUnitCreditCodeCategoryDto> unitEquipCountList = equipCountList.stream().filter(r -> r.getUseUnitCreditCode().equals(map.get(USE_CODE).toString())).collect(Collectors.toList());
unitEquipCountList = unitEquipCountList.stream().filter(r->r.getOrgBranchCode().equals(map.get(ORG_BRANCH_CODE).toString())).collect(Collectors.toList()); unitEquipCountList = unitEquipCountList.stream().filter(r -> r.getOrgBranchCode().equals(map.get(ORG_BRANCH_CODE).toString())).collect(Collectors.toList());
for (EquipmentCategory category : equipmentCategories) { for (EquipmentCategory category : equipmentCategories) {
Map<String, Object> data = new HashMap<>(); Map<String, Object> data = new HashMap<>();
data.put("waitClaim", unitEquipCountList.stream().filter(r->r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.DRL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum()); data.put("waitClaim", unitEquipCountList.stream().filter(r -> r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.DRL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum());
data.put("alreadyClaim", unitEquipCountList.stream().filter(r->r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.YRL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum()); data.put("alreadyClaim", unitEquipCountList.stream().filter(r -> r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.YRL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum());
data.put("refuseClaim", unitEquipCountList.stream().filter(r->r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.YJL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum()); data.put("refuseClaim", unitEquipCountList.stream().filter(r -> r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.YJL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum());
this.set8CategoryCountData(equipmentCategoryData, category, data); this.set8CategoryCountData(equipmentCategoryData, category, data);
} }
equipmentCategoryData.setRecDate(new Date()); equipmentCategoryData.setRecDate(new Date());
list.add(equipmentCategoryData); list.add(equipmentCategoryData);
} }
if(!ObjectUtils.isEmpty(unitCodes)){ if (!ObjectUtils.isEmpty(unitCodes)) {
equipmentCategoryDataMapper.delete(new QueryWrapper<EquipmentCategoryData>().in("unit_code",unitCodes)); equipmentCategoryDataMapper.delete(new QueryWrapper<EquipmentCategoryData>().in("unit_code", unitCodes));
} }
equipmentCategoryDataService.saveOrUpdateBatch(list); equipmentCategoryDataService.saveOrUpdateBatch(list);
stopWatch.stop(); stopWatch.stop();
if(log.isInfoEnabled()){ if (log.isInfoEnabled()) {
log.info("总览数据刷新结束,耗时:{} 秒",stopWatch.getTotalTimeSeconds()); log.info("总览数据刷新结束,耗时:{} 秒", stopWatch.getTotalTimeSeconds());
} }
return list; return list;
} }
...@@ -937,19 +928,19 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -937,19 +928,19 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
private List<EquipmentCategory> getEquipmentCategories() { private List<EquipmentCategory> getEquipmentCategories() {
LambdaQueryWrapper<EquipmentCategory> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<EquipmentCategory> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.likeLeft(EquipmentCategory::getCode,"000"); lambdaQueryWrapper.likeLeft(EquipmentCategory::getCode, "000");
lambdaQueryWrapper.ne(EquipmentCategory::getCode,"7000"); lambdaQueryWrapper.ne(EquipmentCategory::getCode, "7000");
lambdaQueryWrapper.ne(EquipmentCategory::getCode,"F000"); lambdaQueryWrapper.ne(EquipmentCategory::getCode, "F000");
return equipmentCategoryMapper.selectList(lambdaQueryWrapper); return equipmentCategoryMapper.selectList(lambdaQueryWrapper);
} }
private List<EquipmentCategoryData> updateEquipmentCategoryData(String unitCode,String orgBranchCode) { private List<EquipmentCategoryData> updateEquipmentCategoryData(String unitCode, String orgBranchCode) {
List<String> unitCodeList = new ArrayList<>(); List<String> unitCodeList = new ArrayList<>();
unitCodeList.add(unitCode); unitCodeList.add(unitCode);
List<String> orgBranchCodeList = new ArrayList<>(); List<String> orgBranchCodeList = new ArrayList<>();
orgBranchCodeList.add(orgBranchCode); orgBranchCodeList.add(orgBranchCode);
List<EquipmentCategoryData> equipmentCategoryData = getCategoryData(unitCodeList,null); List<EquipmentCategoryData> equipmentCategoryData = getCategoryData(unitCodeList, null);
return equipmentCategoryData; return equipmentCategoryData;
} }
...@@ -960,7 +951,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -960,7 +951,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
List<String> records = new ArrayList<>(); List<String> records = new ArrayList<>();
List<ESEquipmentCategoryDto> list = new ArrayList<>(); List<ESEquipmentCategoryDto> list = new ArrayList<>();
if(recordList.toString().contains("[")){ if (recordList.toString().contains("[")) {
for (String record : (List<String>) recordList) { for (String record : (List<String>) recordList) {
records.add(record); records.add(record);
ESEquipmentCategoryDto esEquipmentCategoryDto = new ESEquipmentCategoryDto(); ESEquipmentCategoryDto esEquipmentCategoryDto = new ESEquipmentCategoryDto();
...@@ -973,7 +964,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -973,7 +964,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
esEquipmentCategoryDto.setSEQUENCE_NBR(recordList.toString()); esEquipmentCategoryDto.setSEQUENCE_NBR(recordList.toString());
list.add(esEquipmentCategoryDto); list.add(esEquipmentCategoryDto);
} }
//删除监管码表数据 // 删除监管码表数据
List<String> superviseCodeList = superviseInfoMapper.selectSuperviseCodeList(records); List<String> superviseCodeList = superviseInfoMapper.selectSuperviseCodeList(records);
List<Map<String, Object>> unitCodeAndOrgBranchCodeList = superviseInfoMapper.selectUnitCodeList(records); List<Map<String, Object>> unitCodeAndOrgBranchCodeList = superviseInfoMapper.selectUnitCodeList(records);
List<String> unitCodeList = new ArrayList<>(); List<String> unitCodeList = new ArrayList<>();
...@@ -983,17 +974,17 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -983,17 +974,17 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
orgBranchCodeList.add(String.valueOf(objectMap.get("orgBranchCode"))); orgBranchCodeList.add(String.valueOf(objectMap.get("orgBranchCode")));
} }
if(!ObjectUtils.isEmpty(superviseCodeList)){ if (!ObjectUtils.isEmpty(superviseCodeList)) {
supervisoryCodeInfoMapper.updateStatus(superviseCodeList); supervisoryCodeInfoMapper.updateStatus(superviseCodeList);
} }
//删除涉及的19张表的数据 // 删除涉及的19张表的数据
superviseInfoMapper.deleteDataAll(records); superviseInfoMapper.deleteDataAll(records);
// 根据统一信用代码更新总览表 // 根据统一信用代码更新总览表
if(!ObjectUtils.isEmpty(unitCodeList)){ if (!ObjectUtils.isEmpty(unitCodeList)) {
getCategoryData(unitCodeList,orgBranchCodeList); getCategoryData(unitCodeList, orgBranchCodeList);
} }
//删除es中的数据 // 删除es中的数据
esEquipmentCategory.deleteAll(list); esEquipmentCategory.deleteAll(list);
return records; return records;
} }
...@@ -1017,7 +1008,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1017,7 +1008,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String claimStatus = String.valueOf(superviseMap.get("claimStatus")); String claimStatus = String.valueOf(superviseMap.get("claimStatus"));
String code96333 = String.valueOf(superviseMap.get("code96333")); String code96333 = String.valueOf(superviseMap.get("code96333"));
String operateType = String.valueOf(superviseMap.get("operateType")); String operateType = String.valueOf(superviseMap.get("operateType"));
//生成码 // 生成码
Map<String, String> codeMap; Map<String, String> codeMap;
if (EquipmentCategoryEnum.YRL.getName().equals(claimStatus)) { if (EquipmentCategoryEnum.YRL.getName().equals(claimStatus)) {
log.info("准备生成监管码或96333电梯识别码"); log.info("准备生成监管码或96333电梯识别码");
...@@ -1025,15 +1016,15 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1025,15 +1016,15 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String county = String.valueOf(superviseMap.get("county")); String county = String.valueOf(superviseMap.get("county"));
String equCategory = String.valueOf(superviseMap.get("equCategory")); String equCategory = String.valueOf(superviseMap.get("equCategory"));
String supervisionCode = String.valueOf(superviseMap.get("supervisionCode")); String supervisionCode = String.valueOf(superviseMap.get("supervisionCode"));
//生成码 // 生成码
codeMap = creatCode(city, county, equCategory, code96333, supervisionCode); codeMap = creatCode(city, county, equCategory, code96333, supervisionCode);
log.info("已生成对应监管码或96333电梯识别码"); log.info("已生成对应监管码或96333电梯识别码");
//删除map中的冗余数据,添加对应监管码和96333码调用idx多表单页提交接口吧保存数据 // 删除map中的冗余数据,添加对应监管码和96333码调用idx多表单页提交接口吧保存数据
map.remove("data"); map.remove("data");
supervisionMap.put("CODE96333", codeMap.get("code96333")); supervisionMap.put("CODE96333", codeMap.get("code96333"));
supervisionMap.put("SUPERVISORY_CODE", codeMap.get("superviseCode")); supervisionMap.put("SUPERVISORY_CODE", codeMap.get("superviseCode"));
map.put(SUPERVISION_FROM_ID, supervisionMap); map.put(SUPERVISION_FROM_ID, supervisionMap);
//根据操作状态判断是调用新增还是修改接口 // 根据操作状态判断是调用新增还是修改接口
responseModel = "save".equals(operateType) ? idxFeignService.batchSubmit(null, null, null, null, map) : responseModel = "save".equals(operateType) ? idxFeignService.batchSubmit(null, null, null, null, map) :
idxFeignService.batchUpdate(null, null, map); idxFeignService.batchUpdate(null, null, map);
if (!ObjectUtils.isEmpty(responseModel) && "200".equals(String.valueOf(responseModel.getStatus()))) { if (!ObjectUtils.isEmpty(responseModel) && "200".equals(String.valueOf(responseModel.getStatus()))) {
...@@ -1045,7 +1036,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1045,7 +1036,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
map.remove("data"); map.remove("data");
supervisionMap.put("CODE96333", "null".equals(code96333) ? null : code96333); supervisionMap.put("CODE96333", "null".equals(code96333) ? null : code96333);
map.put(SUPERVISION_FROM_ID, supervisionMap); map.put(SUPERVISION_FROM_ID, supervisionMap);
//根据操作状态判断是调用新增还是修改接口 // 根据操作状态判断是调用新增还是修改接口
responseModel = "save".equals(operateType) ? idxFeignService.batchSubmit(null, null, null, null, map) : responseModel = "save".equals(operateType) ? idxFeignService.batchSubmit(null, null, null, null, map) :
idxFeignService.batchUpdate(null, null, map); idxFeignService.batchUpdate(null, null, map);
} else { } else {
...@@ -1053,11 +1044,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1053,11 +1044,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
responseModel = idxFeignService.batchUpdate(null, null, map); responseModel = idxFeignService.batchUpdate(null, null, map);
} }
stopWatch.stop(); stopWatch.stop();
if(log.isInfoEnabled()){ if (log.isInfoEnabled()) {
log.info("通用提交耗时:{} 秒",stopWatch.getTotalTimeSeconds()); log.info("通用提交耗时:{} 秒", stopWatch.getTotalTimeSeconds());
} }
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(),e); log.error(e.getMessage(), e);
supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.BF.getCode()); supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.BF.getCode());
ResponseModel<Object> response = new ResponseModel<>(); ResponseModel<Object> response = new ResponseModel<>();
response.setDevMessage(e.getMessage()); response.setDevMessage(e.getMessage());
...@@ -1066,14 +1057,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1066,14 +1057,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
response.setStatus(HttpStatus.BAD_REQUEST.value()); response.setStatus(HttpStatus.BAD_REQUEST.value());
return response; return response;
} finally { } finally {
updateEquipmentCategoryData(unitCode,orgBranchCode); updateEquipmentCategoryData(unitCode, orgBranchCode);
supervisoryCodeInfoMapper.update(supervisoryCodeInfo,new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code",supervisoryCodeInfo.getSupervisoryCode())); supervisoryCodeInfoMapper.update(supervisoryCodeInfo, new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code", supervisoryCodeInfo.getSupervisoryCode()));
} }
return responseModel; return responseModel;
} }
//分页查询所有数据 // 分页查询所有数据
public Page<Map<String, Object>> getAll(Map<String, Object> map) { public Page<Map<String, Object>> getAll(Map<String, Object> map) {
String tableName = map.get(TABLENAME).toString(); String tableName = map.get(TABLENAME).toString();
Assert.hasText(tableName, "表名不能为空"); Assert.hasText(tableName, "表名不能为空");
...@@ -1091,7 +1082,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1091,7 +1082,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return page; return page;
} }
//查询总条数 // 查询总条数
public Long counts(Map<String, Object> map) { public Long counts(Map<String, Object> map) {
String tableName = map.get(TABLENAME).toString(); String tableName = map.get(TABLENAME).toString();
Assert.hasText(tableName, "表名不能为空"); Assert.hasText(tableName, "表名不能为空");
...@@ -1099,6 +1090,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1099,6 +1090,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
Long count = bizJdbcTemplate.queryForObject(countSql, Long.class); Long count = bizJdbcTemplate.queryForObject(countSql, Long.class);
return count; return count;
} }
/** /**
* es数据同步 * es数据同步
* *
...@@ -1174,15 +1166,15 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1174,15 +1166,15 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
* es保存设备数据 * es保存设备数据
*/ */
public ESEquipmentCategoryDto saveESEquipmentCategory(Map<String, Object> map) { public ESEquipmentCategoryDto saveESEquipmentCategory(Map<String, Object> map) {
//处理时间问题 // 处理时间问题
String recDate1 = map.get("REC_DATE").toString().substring(0,19); String recDate1 = map.get("REC_DATE").toString().substring(0, 19);
long time = Timestamp.valueOf(recDate1).getTime(); long time = Timestamp.valueOf(recDate1).getTime();
map.put("REC_DATE",time); map.put("REC_DATE", time);
ESEquipmentCategoryDto dto = JSONObject.parseObject(toJSONString(map), ESEquipmentCategoryDto.class); ESEquipmentCategoryDto dto = JSONObject.parseObject(toJSONString(map), ESEquipmentCategoryDto.class);
ESEquipmentCategoryDto save = esEquipmentCategory.save(dto); ESEquipmentCategoryDto save = esEquipmentCategory.save(dto);
if (!ObjectUtils.isEmpty(save)) { if (!ObjectUtils.isEmpty(save)) {
//同步到es后修改 // 同步到es后修改
UseInfo useInfo = new UseInfo(); UseInfo useInfo = new UseInfo();
useInfo.setIsNotEs(1); useInfo.setIsNotEs(1);
useInfoMapper.update(useInfo, new QueryWrapper<UseInfo>().eq("RECORD", useInfoMapper.update(useInfo, new QueryWrapper<UseInfo>().eq("RECORD",
...@@ -1190,6 +1182,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1190,6 +1182,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
return save; return save;
} }
public Page<JSONObject> queryByKeys(JSONObject map) { public Page<JSONObject> queryByKeys(JSONObject map) {
// //根据当前登录人查询 // //根据当前登录人查询
if (!ValidationUtil.isEmpty(map.get(EQUSTATE))) { if (!ValidationUtil.isEmpty(map.get(EQUSTATE))) {
...@@ -1201,10 +1194,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1201,10 +1194,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String companyCode = object.getString("companyCode"); String companyCode = object.getString("companyCode");
if (!ValidationUtil.isEmpty(level)) { if (!ValidationUtil.isEmpty(level)) {
if (LEVEL.equals(level)) { if (LEVEL.equals(level)) {
//企业 // 企业
map.put("USE_UNIT_CREDIT_CODE", companyCode); map.put("USE_UNIT_CREDIT_CODE", companyCode);
} else { } else {
//监管单位 // 监管单位
map.put("ORG_BRANCH_CODE", code); map.put("ORG_BRANCH_CODE", code);
} }
} }
...@@ -1214,16 +1207,16 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1214,16 +1207,16 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
SearchSourceBuilder builder = new SearchSourceBuilder(); SearchSourceBuilder builder = new SearchSourceBuilder();
builder.trackTotalHits(true); builder.trackTotalHits(true);
BoolQueryBuilder boolMust = QueryBuilders.boolQuery(); BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
//通用匹配规则,条件构建 // 通用匹配规则,条件构建
//SEQUENCE_NBR // SEQUENCE_NBR
if (!ObjectUtils.isEmpty(map.getString("SEQUENCE_NBR"))) { if (!ObjectUtils.isEmpty(map.getString("SEQUENCE_NBR"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("SEQUENCE_NBR", "*"+map.getString("SEQUENCE_NBR")+"*")); meBuilder.must(QueryBuilders.matchPhraseQuery("SEQUENCE_NBR", "*" + map.getString("SEQUENCE_NBR") + "*"));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_NAME"))) { if (!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_NAME"))) {
BoolQueryBuilder query = QueryBuilders.boolQuery(); BoolQueryBuilder query = QueryBuilders.boolQuery();
query.must(QueryBuilders.matchPhraseQuery("ORG_BRANCH_NAME", "*"+map.getString("ORG_BRANCH_NAME")+"*" )); query.must(QueryBuilders.matchPhraseQuery("ORG_BRANCH_NAME", "*" + map.getString("ORG_BRANCH_NAME") + "*"));
boolMust.must(query); boolMust.must(query);
} }
if (!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_CODE"))) { if (!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_CODE"))) {
...@@ -1233,12 +1226,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1233,12 +1226,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_NAME"))) { if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_NAME"))) {
BoolQueryBuilder query = QueryBuilders.boolQuery(); BoolQueryBuilder query = QueryBuilders.boolQuery();
query.must(QueryBuilders.matchPhraseQuery("USE_UNIT_NAME", "*"+map.getString("USE_UNIT_NAME")+"*")); query.must(QueryBuilders.matchPhraseQuery("USE_UNIT_NAME", "*" + map.getString("USE_UNIT_NAME") + "*"));
boolMust.must(query); boolMust.must(query);
} }
if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_CREDIT_CODE"))) { if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_CREDIT_CODE"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("USE_UNIT_CREDIT_CODE", "*"+map.getString("USE_UNIT_CREDIT_CODE")+"*")); meBuilder.must(QueryBuilders.matchPhraseQuery("USE_UNIT_CREDIT_CODE", "*" + map.getString("USE_UNIT_CREDIT_CODE") + "*"));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("EQU_LIST_CODE"))) { if (!ObjectUtils.isEmpty(map.getString("EQU_LIST_CODE"))) {
...@@ -1248,23 +1241,23 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1248,23 +1241,23 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
if (!ObjectUtils.isEmpty(map.getString("EQU_LIST"))) { if (!ObjectUtils.isEmpty(map.getString("EQU_LIST"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("EQU_LIST", "*"+map.getString("EQU_LIST")+"*")); meBuilder.must(QueryBuilders.matchPhraseQuery("EQU_LIST", "*" + map.getString("EQU_LIST") + "*"));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("EQU_CATEGORY"))) { if (!ObjectUtils.isEmpty(map.getString("EQU_CATEGORY"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("EQU_CATEGORY", "*"+map.getString("EQU_CATEGORY")+"*")); meBuilder.must(QueryBuilders.matchPhraseQuery("EQU_CATEGORY", "*" + map.getString("EQU_CATEGORY") + "*"));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("USE_ORG_CODE"))) { if (!ObjectUtils.isEmpty(map.getString("USE_ORG_CODE"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*"+map.getString("USE_ORG_CODE").toLowerCase()+"*")); meBuilder.must(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*" + map.getString("USE_ORG_CODE").toLowerCase() + "*"));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("CODE96333"))) { if (!ObjectUtils.isEmpty(map.getString("CODE96333"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.wildcardQuery("CODE96333", "*"+map.getString("CODE96333").toLowerCase()+"*")); meBuilder.must(QueryBuilders.wildcardQuery("CODE96333", "*" + map.getString("CODE96333").toLowerCase() + "*"));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("EQU_CODE"))) { if (!ObjectUtils.isEmpty(map.getString("EQU_CODE"))) {
...@@ -1275,7 +1268,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1275,7 +1268,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if (!ObjectUtils.isEmpty(map.getString("SUPERVISORY_CODE"))) { if (!ObjectUtils.isEmpty(map.getString("SUPERVISORY_CODE"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.wildcardQuery("SUPERVISORY_CODE", "*"+map.getString("SUPERVISORY_CODE").toLowerCase()+"*")); meBuilder.must(QueryBuilders.wildcardQuery("SUPERVISORY_CODE", "*" + map.getString("SUPERVISORY_CODE").toLowerCase() + "*"));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("USE_PLACE"))) { if (!ObjectUtils.isEmpty(map.getString("USE_PLACE"))) {
...@@ -1288,14 +1281,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1288,14 +1281,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
query.must(QueryBuilders.matchPhraseQuery("ADDRESS", "*" + map.getString("ADDRESS") + "*")); query.must(QueryBuilders.matchPhraseQuery("ADDRESS", "*" + map.getString("ADDRESS") + "*"));
boolMust.must(query); boolMust.must(query);
} }
if (!ObjectUtils.isEmpty(map.getString("EQU_STATE")) ) { if (!ObjectUtils.isEmpty(map.getString("EQU_STATE"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchQuery("EQU_STATE", map.getLong("EQU_STATE"))); meBuilder.must(QueryBuilders.matchQuery("EQU_STATE", map.getLong("EQU_STATE")));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
if (!ObjectUtils.isEmpty(map.getString("STATUS"))) { if (!ObjectUtils.isEmpty(map.getString("STATUS"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("STATUS", "*"+map.getString("STATUS")+"*")); meBuilder.must(QueryBuilders.matchPhraseQuery("STATUS", "*" + map.getString("STATUS") + "*"));
boolMust.must(meBuilder); boolMust.must(meBuilder);
} }
builder.query(boolMust); builder.query(boolMust);
...@@ -1327,7 +1320,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1327,7 +1320,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return result; return result;
} }
//es统计总记录数 // es统计总记录数
public Long getCount(String indexs, RestHighLevelClient esClient) { public Long getCount(String indexs, RestHighLevelClient esClient) {
Long totle = 0L; Long totle = 0L;
SearchRequest searchRequest = new SearchRequest(indexs); SearchRequest searchRequest = new SearchRequest(indexs);
......
...@@ -127,4 +127,14 @@ public class JgChangeRegistrationTransferDto extends BaseDto { ...@@ -127,4 +127,14 @@ public class JgChangeRegistrationTransferDto extends BaseDto {
@ApiModelProperty(value = "设备移装完整详细地址") @ApiModelProperty(value = "设备移装完整详细地址")
private String fullAddress; private String fullAddress;
@ApiModelProperty(value = "设备名称")
private String productName;
@ApiModelProperty(value = "设备移装完整详细地址")
private String allAddress;
@ApiModelProperty(value = " 单位内部编号")
private String innerCode;
} }
...@@ -228,4 +228,8 @@ public class JgTransferNoticeDto extends BaseDto { ...@@ -228,4 +228,8 @@ public class JgTransferNoticeDto extends BaseDto {
@ApiModelProperty (value = "下一节点可执行人") @ApiModelProperty (value = "下一节点可执行人")
private String nextExecuteUserIds; private String nextExecuteUserIds;
@TableField(exist = false)
private String equAddress;
} }
...@@ -336,4 +336,10 @@ public class JgReformNotice extends BaseEntity { ...@@ -336,4 +336,10 @@ public class JgReformNotice extends BaseEntity {
*/ */
@TableField(value = "next_execute_user_ids") @TableField(value = "next_execute_user_ids")
private String nextExecuteUserIds; private String nextExecuteUserIds;
/**
* 地址
*/
@TableField(exist = false)
private String fullAddress;
} }
...@@ -96,7 +96,7 @@ public class JgScrapCancel extends BaseEntity { ...@@ -96,7 +96,7 @@ public class JgScrapCancel extends BaseEntity {
private String receiveOrgName; private String receiveOrgName;
/** /**
* 接收机构公司代码 * 接收机构公司代码--暂时未用到
*/ */
@TableField("receive_company_code") @TableField("receive_company_code")
private String receiveCompanyCode; private String receiveCompanyCode;
......
...@@ -319,5 +319,8 @@ public class JgTransferNotice extends BaseEntity { ...@@ -319,5 +319,8 @@ public class JgTransferNotice extends BaseEntity {
@TableField("\"next_execute_user_ids\"") @TableField("\"next_execute_user_ids\"")
private String nextExecuteUserIds; private String nextExecuteUserIds;
@TableField(exist = false)
private String equAddress;
} }
package com.yeejoin.amos.boot.module.jg.api.mapper; package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.yeejoin.amos.boot.module.jg.api.entity.JgScrapCancelEq;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jg.api.entity.JgScrapCancelEq;
/** /**
* 报废注销设备关系表 Mapper 接口 * 报废注销设备关系表 Mapper 接口
......
...@@ -21,9 +21,9 @@ import java.util.Map; ...@@ -21,9 +21,9 @@ import java.util.Map;
*/ */
public interface IJgChangeRegistrationTransferService extends IService<JgChangeRegistrationTransfer> { public interface IJgChangeRegistrationTransferService extends IService<JgChangeRegistrationTransfer> {
List<JgChangeRegistrationTransfer> updateTransfer(String submitType, JSONObject map, ReginParams reginParams); List<JgChangeRegistrationTransferDto> updateTransfer(String submitType, JSONObject map, ReginParams reginParams);
List<JgChangeRegistrationTransfer> createTransfer(String submitType, JSONObject map, ReginParams reginParams); List<JgChangeRegistrationTransferDto> createTransfer(String submitType, JSONObject map, ReginParams reginParams);
boolean deleteBatchBySequenceNbrs(Long[] sequenceNbrs); boolean deleteBatchBySequenceNbrs(Long[] sequenceNbrs);
......
...@@ -22,14 +22,16 @@ ...@@ -22,14 +22,16 @@
isn.promoter, isn.promoter,
isn.next_execute_ids AS nextExecuteIds, isn.next_execute_ids AS nextExecuteIds,
isn.instance_status AS instanceStatus, isn.instance_status AS instanceStatus,
isn.equ_address AS equAddress, <!-- isn.equ_address AS equAddress,-->
isn.handle_date AS handleDate, isn.handle_date AS handleDate,
isn.equ_list AS equList, isn.equ_list AS equList,
isn.notice_report_url AS noticeReportUrl, isn.notice_report_url AS noticeReportUrl,
isn.create_user_id as createUserId, isn.create_user_id as createUserId,
isn.next_execute_user_ids as nextExecuteUserIds isn.next_execute_user_ids as nextExecuteUserIds,
FROM concat(ibjui."PROVINCE_NAME", '', ibjui."CITY_NAME", '', ibjui."COUNTY_NAME", '', ibjui."STREET_NAME", '', ibjui."ADDRESS") as equAddress
tzs_jg_installation_notice isn FROM tzs_jg_installation_notice isn
LEFT JOIN tzs_jg_installation_notice_eq insEq on insEq.equip_transfer_id = isn.sequence_nbr
LEFT JOIN idx_biz_jg_use_info ibjui on insEq.equ_id = ibjui.RECORD
<where> <where>
isn.is_delete = false isn.is_delete = false
<if test="param != null "> <if test="param != null ">
......
...@@ -10,10 +10,12 @@ ...@@ -10,10 +10,12 @@
<select id="queryForPage" resultType="com.yeejoin.amos.boot.module.jg.api.entity.JgMaintainNotice"> <select id="queryForPage" resultType="com.yeejoin.amos.boot.module.jg.api.entity.JgMaintainNotice">
select select
isn.*, isn.*,
concat(use."PROVINCE_NAME", '', use."CITY_NAME", '', use."COUNTY_NAME", '', use."STREET_NAME", '', use."ADDRESS") as fullAddress concat(ibjui."PROVINCE_NAME", '', ibjui."CITY_NAME", '', ibjui."COUNTY_NAME", '', ibjui."STREET_NAME", '', ibjui."ADDRESS") as fullAddress,
ibjoi.SUPERVISORY_CODE as supervisoryCode
FROM tzs_jg_maintain_notice isn FROM tzs_jg_maintain_notice isn
left join tzs_jg_maintain_notice_eq isneq on isn.sequence_nbr = isneq.equip_transfer_id left join tzs_jg_maintain_notice_eq isneq on isn.sequence_nbr = isneq.equip_transfer_id
LEFT JOIN idx_biz_jg_use_info use on isneq.equ_id = use.RECORD LEFT JOIN idx_biz_jg_use_info ibjui on isneq.equ_id = ibjui.RECORD
LEFT JOIN idx_biz_jg_other_info ibjoi on isneq.equ_id = ibjoi.RECORD
<where> <where>
isn.is_delete = 0 isn.is_delete = 0
<if test="param != null "> <if test="param != null ">
......
...@@ -26,12 +26,16 @@ ...@@ -26,12 +26,16 @@
ec."name" AS equipCateName, ec."name" AS equipCateName,
tjtn.handle_date AS handleDate, tjtn.handle_date AS handleDate,
tjtn.create_user_id as createUserId, tjtn.create_user_id as createUserId,
tjtn.next_execute_user_ids as nextExecuteUserIds tjtn.next_execute_user_ids as nextExecuteUserIds,
oi.SUPERVISORY_CODE as supervisoryCode,
concat(ibjui."PROVINCE_NAME", '', ibjui."CITY_NAME", '', ibjui."COUNTY_NAME", '', ibjui."STREET_NAME", '', ibjui."ADDRESS") as equAddress
FROM FROM
tzs_jg_transfer_notice tjtn tzs_jg_transfer_notice tjtn
LEFT JOIN tzs_jg_transfer_notice_eq re ON re.equip_transfer_id = tjtn.sequence_nbr LEFT JOIN tzs_jg_transfer_notice_eq re ON re.equip_transfer_id = tjtn.sequence_nbr
LEFT JOIN idx_biz_jg_register_info ri ON ri.record = re.equ_id LEFT JOIN idx_biz_jg_register_info ri ON ri.record = re.equ_id
LEFT JOIN tz_equipment_category ec ON ec.code = ri.equ_category LEFT JOIN tz_equipment_category ec ON ec.code = ri.equ_category
LEFT JOIN idx_biz_jg_use_info ibjui on re.equ_id = ibjui.RECORD
left join idx_biz_jg_other_info oi on oi.RECORD = re.equ_id
<where> <where>
tjtn.is_delete = false tjtn.is_delete = false
<if test="param != null "> <if test="param != null ">
......
...@@ -192,7 +192,8 @@ ...@@ -192,7 +192,8 @@
ur.use_registration_code as useRegistrationCode, ur.use_registration_code as useRegistrationCode,
date_format(ur.audit_pass_date, '%Y-%m-%d') as auditPassDate, date_format(ur.audit_pass_date, '%Y-%m-%d') as auditPassDate,
ur.receive_org_name as receiveOrgName, ur.receive_org_name as receiveOrgName,
ur.next_execute_user_ids as nextExecuteUserIds ur.next_execute_user_ids as nextExecuteUserIds,
ur.is_xixian as isXixian
from tzs_jg_use_registration ur from tzs_jg_use_registration ur
LEFT JOIN tzs_jg_use_registration_eq re on ur.sequence_nbr = re.equip_transfer_id LEFT JOIN tzs_jg_use_registration_eq re on ur.sequence_nbr = re.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD
......
...@@ -192,15 +192,18 @@ public class CommonController extends BaseController { ...@@ -192,15 +192,18 @@ public class CommonController extends BaseController {
Object result = commonService.invokeBusinessProcess(submitType, map, reginParams); Object result = commonService.invokeBusinessProcess(submitType, map, reginParams);
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
} }
/** /**
* 根据公司id获取公司下人员 * 获取当前登录人企业类型
*
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/getCompanyUser") @GetMapping(value = "/getCompanyType")
@ApiOperation(httpMethod = "POST", value = "根据公司id获取公司下人员", notes = "根据公司id获取公司下人员") @ApiOperation(httpMethod = "GET", value = "获取当前登录人企业类型", notes = "获取当前登录人企业类型")
public ResponseModel<Object> getCompanyUser(@RequestParam(value = "companyId") Long companyId) { public ResponseModel<Object> getCompanyType() {
Object result = commonService.getCompanyUser(companyId); return ResponseHelper.buildResponse(iJgInstallationNoticeService.getCompanyType());
return ResponseHelper.buildResponse(result);
} }
} }
...@@ -10,7 +10,7 @@ import java.util.List; ...@@ -10,7 +10,7 @@ import java.util.List;
public interface ICmWorkflowService { public interface ICmWorkflowService {
List<ProcessTaskDTO> startBatch(ActWorkflowBatchDTO params); List<ProcessTaskDTO> startBatch(ActWorkflowBatchDTO params);
ProcessTaskDTO complete(String taskId, TaskResultDTO data); ProcessTaskDTO completeOrReject(String taskId, TaskResultDTO data, String operate);
ProcessTaskDTO rollBack(String processInstanceId); ProcessTaskDTO rollBack(String processInstanceId);
} }
...@@ -12,7 +12,6 @@ import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO; ...@@ -12,7 +12,6 @@ import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO;
import com.yeejoin.amos.feign.workflow.model.TaskResultDTO; import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.List; import java.util.List;
...@@ -23,6 +22,18 @@ import java.util.List; ...@@ -23,6 +22,18 @@ import java.util.List;
@Slf4j @Slf4j
public class CmWorkflowServiceImpl implements ICmWorkflowService { public class CmWorkflowServiceImpl implements ICmWorkflowService {
/**
* 通过
*/
public static String PASS_OPERATE = "0";
/**
* 驳回
*/
public static String REJECT_OPERATE = "1";
@Override @Override
public List<ProcessTaskDTO> startBatch(ActWorkflowBatchDTO params) { public List<ProcessTaskDTO> startBatch(ActWorkflowBatchDTO params) {
List<ProcessTaskDTO> processTasks; List<ProcessTaskDTO> processTasks;
...@@ -43,11 +54,23 @@ public class CmWorkflowServiceImpl implements ICmWorkflowService { ...@@ -43,11 +54,23 @@ public class CmWorkflowServiceImpl implements ICmWorkflowService {
} }
@Override @Override
public ProcessTaskDTO complete(String taskId, TaskResultDTO data) { public ProcessTaskDTO completeOrReject(String taskId, TaskResultDTO data, String operate) {
ProcessTaskDTO processTaskDTO; ProcessTaskDTO processTaskDTO = null;
try { try {
log.info("开始请求工作流完成任务接口:/complete/standard/{taskId},请求参数:{},{}", taskId, JSONObject.toJSONString(data)); if(PASS_OPERATE.equals(operate)){
processTaskDTO = Workflow.taskV2Client.completeByTaskFroStandard(taskId, data).getResult(); // 通过操作
log.info("开始请求工作流完成任务接口:/complete/standard/{taskId},请求参数:{},{}", taskId, JSONObject.toJSONString(data));
processTaskDTO = Workflow.taskV2Client.completeByTaskFroStandard(taskId, data).getResult();
} else if(REJECT_OPERATE.equals(operate)) {
// 驳回操作
// todo 需要工作流适配调整后 进行切换 Workflow.taskV2Client.reject(taskId, data);
log.info("开始请求工作流驳回任务接口:/reject/{taskId},请求参数:{},{}", taskId, JSONObject.toJSONString(data));
processTaskDTO = Workflow.taskV2Client.completeByTaskFroStandard(taskId, data).getResult();
} else {
// 执行普通节点(提交)
log.info("开始请求工作流完成任务接口:/complete/standard/{taskId},请求参数:{},{}", taskId, JSONObject.toJSONString(data));
processTaskDTO = Workflow.taskV2Client.completeByTaskFroStandard(taskId, data).getResult();
}
} catch (InnerInvokException e) { } catch (InnerInvokException e) {
//拦截无审核人异常信息 //拦截无审核人异常信息
String devMessage = e.getDevMessage(); String devMessage = e.getDevMessage();
......
...@@ -402,6 +402,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -402,6 +402,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
useInfoMap.put("fullAddress", fullAddress); useInfoMap.put("fullAddress", fullAddress);
} }
useInfoMap.put("useinfoSeq", useInfo.getSequenceNbr()); useInfoMap.put("useinfoSeq", useInfo.getSequenceNbr());
if(!ValidationUtil.isEmpty(useInfo.getLongitudeLatitude())){
useInfoMap.put("longitudeLatitude", JSON.parseObject(useInfo.getLongitudeLatitude()));
}
} else { } else {
useInfoMap = convertCamelToUnderscore(useInfo, null); useInfoMap = convertCamelToUnderscore(useInfo, null);
if (!ValidationUtil.isEmpty(province)) { if (!ValidationUtil.isEmpty(province)) {
...@@ -420,6 +424,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -420,6 +424,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
useInfoMap.put("FULLADDRESS", fullAddress); useInfoMap.put("FULLADDRESS", fullAddress);
} }
useInfoMap.put("USEINFO_SEQ", useInfo.getSequenceNbr()); useInfoMap.put("USEINFO_SEQ", useInfo.getSequenceNbr());
if(!ValidationUtil.isEmpty(useInfo.getLongitudeLatitude())) {
useInfoMap.put("LONGITUDE_LATITUDE", JSON.parseObject(useInfo.getLongitudeLatitude()));
}
} }
if (!useInfoMap.isEmpty()) { if (!useInfoMap.isEmpty()) {
Map<String, Object> filterMap = useInfoMap.entrySet() Map<String, Object> filterMap = useInfoMap.entrySet()
...@@ -1078,42 +1085,43 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1078,42 +1085,43 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if(!ValidationUtil.isEmpty(list)){ if(!ValidationUtil.isEmpty(list)){
equIds = list.stream().map(item -> item.get("SEQUENCE_NBR").toString()).collect(Collectors.toList()); equIds = list.stream().map(item -> item.get("SEQUENCE_NBR").toString()).collect(Collectors.toList());
} }
//查询设备是否正在使用 if(!ValidationUtil.isEmpty(equIds)){
//设备的使用标识是,安装告知和使用登记中有使用记录。 //查询设备是否正在使用
List<JgInstallationNoticeEq> installationNoticeEqList = jgInstallationNoticeEqServiceImpl.getListByEquIds(equIds); //设备的使用标识是,安装告知和使用登记中有使用记录。
List<JgUseRegistrationEq> useRegistrationEqList = jgUseRegistrationEqServiceImpl.getListByEquIds(equIds); List<JgInstallationNoticeEq> installationNoticeEqList = jgInstallationNoticeEqServiceImpl.getListByEquIds(equIds);
Map<String, Boolean> equIsUseMap = new HashMap<>(); List<JgUseRegistrationEq> useRegistrationEqList = jgUseRegistrationEqServiceImpl.getListByEquIds(equIds);
if(!ValidationUtil.isEmpty(installationNoticeEqList) ){ Map<String, Boolean> equIsUseMap = new HashMap<>();
equIsUseMap.putAll(installationNoticeEqList.stream().collect(Collectors.toMap(JgInstallationNoticeEq::getEquId, obj -> true, (oldValue, newValue) -> oldValue))); if(!ValidationUtil.isEmpty(installationNoticeEqList) ){
} equIsUseMap.putAll(installationNoticeEqList.stream().collect(Collectors.toMap(JgInstallationNoticeEq::getEquId, obj -> true, (oldValue, newValue) -> oldValue)));
if(!ValidationUtil.isEmpty(useRegistrationEqList)){ }
equIsUseMap.putAll(useRegistrationEqList.stream().collect(Collectors.toMap(JgUseRegistrationEq::getEquId, obj -> true, (oldValue, newValue) -> oldValue))); if(!ValidationUtil.isEmpty(useRegistrationEqList)){
} equIsUseMap.putAll(useRegistrationEqList.stream().collect(Collectors.toMap(JgUseRegistrationEq::getEquId, obj -> true, (oldValue, newValue) -> oldValue)));
// 查询设备地址 }
List<IdxBizJgUseInfo> useInfoListByEquIds = idxBizJgUseInfoService.getUseInfoListByEquIds(equIds); // 查询设备地址
Map<String, String> equAddressMap = new HashMap<>(); List<IdxBizJgUseInfo> useInfoListByEquIds = idxBizJgUseInfoService.getUseInfoListByEquIds(equIds);
if(!ValidationUtil.isEmpty(useInfoListByEquIds)){ Map<String, String> equAddressMap = new HashMap<>();
equAddressMap = useInfoListByEquIds.stream().collect(Collectors.toMap(IdxBizJgUseInfo::getRecord, if(!ValidationUtil.isEmpty(useInfoListByEquIds)){
useInfo -> { equAddressMap = useInfoListByEquIds.stream().collect(Collectors.toMap(IdxBizJgUseInfo::getRecord,
String fulladdress=""; useInfo -> {
if(!ValidationUtil.isEmpty(useInfo.getProvinceName())) fulladdress += useInfo.getProvinceName(); String fulladdress="";
if(!ValidationUtil.isEmpty(useInfo.getCityName())) fulladdress += useInfo.getCityName(); if(!ValidationUtil.isEmpty(useInfo.getProvinceName())) fulladdress += useInfo.getProvinceName();
if(!ValidationUtil.isEmpty(useInfo.getCountyName())) fulladdress += useInfo.getCountyName(); if(!ValidationUtil.isEmpty(useInfo.getCityName())) fulladdress += useInfo.getCityName();
if(!ValidationUtil.isEmpty(useInfo.getStreetName())) fulladdress += useInfo.getStreetName(); if(!ValidationUtil.isEmpty(useInfo.getCountyName())) fulladdress += useInfo.getCountyName();
if(!ValidationUtil.isEmpty(useInfo.getAddress())) fulladdress += useInfo.getAddress(); if(!ValidationUtil.isEmpty(useInfo.getStreetName())) fulladdress += useInfo.getStreetName();
return fulladdress; if(!ValidationUtil.isEmpty(useInfo.getAddress())) fulladdress += useInfo.getAddress();
} return fulladdress;
) }
); )
} );
// 更新设备使用情况和设备地址 }
for(JSONObject item : list){ // 更新设备使用情况和设备地址
Boolean isUse = equIsUseMap.get(item.getString("SEQUENCE_NBR")); for(JSONObject item : list){
String fullAddress = equAddressMap.get(item.getString("SEQUENCE_NBR")); Boolean isUse = equIsUseMap.get(item.getString("SEQUENCE_NBR"));
item.put("IS_USE", !ValidationUtil.isEmpty(isUse) ? isUse ? isUse : false : false); String fullAddress = equAddressMap.get(item.getString("SEQUENCE_NBR"));
item.put("ADDRESS", !ValidationUtil.isEmpty(fullAddress) ? fullAddress : ""); item.put("IS_USE", !ValidationUtil.isEmpty(isUse) ? isUse ? isUse : false : false);
item.put("ADDRESS", !ValidationUtil.isEmpty(fullAddress) ? fullAddress : "");
}
} }
totle = response.getInternalResponse().hits().getTotalHits().value; totle = response.getInternalResponse().hits().getTotalHits().value;
result.setRecords(list); result.setRecords(list);
result.setTotal(totle); result.setTotal(totle);
......
...@@ -408,7 +408,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg ...@@ -408,7 +408,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", operate); map.put("approvalStatus", operate);
dto.setVariable(map); dto.setVariable(map);
return cmWorkflowService.complete(jgChangeRegistrationName.getNextTaskId(), dto); return cmWorkflowService.completeOrReject(jgChangeRegistrationName.getNextTaskId(), dto, operate);
} }
private void convertField(JgChangeRegistrationNameDto model) { private void convertField(JgChangeRegistrationNameDto model) {
...@@ -514,7 +514,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg ...@@ -514,7 +514,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
} }
dto.setVariable(map); dto.setVariable(map);
//执行流程 //执行流程
ProcessTaskDTO processTaskDTO = cmWorkflowService.complete(taskId, dto); ProcessTaskDTO processTaskDTO = cmWorkflowService.completeOrReject(taskId, dto, operate);
// 更新下一步执行人、创建待办 // 更新下一步执行人、创建待办
updateExecuteIds(instanceId, id, operate, processTaskDTO); updateExecuteIds(instanceId, id, operate, processTaskDTO);
} }
......
...@@ -373,7 +373,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -373,7 +373,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
dto.setVariable(map); dto.setVariable(map);
dto.setNextExecuteUserCompanyCode(getNextUserOrgCode(operate, jgChangeRegistrationReform)); dto.setNextExecuteUserCompanyCode(getNextUserOrgCode(operate, jgChangeRegistrationReform));
//执行流程 //执行流程
processTaskDTO = iCmWorkflowService.complete(taskId, dto); processTaskDTO = iCmWorkflowService.completeOrReject(taskId, dto, operate);
// 更新下一步执行人 // 更新下一步执行人
updateExecuteIds(instanceId, jgChangeRegistrationReform, operate, processTaskDTO); updateExecuteIds(instanceId, jgChangeRegistrationReform, operate, processTaskDTO);
...@@ -792,7 +792,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -792,7 +792,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
*/ */
public String getSummaryInfo(JgChangeRegistrationReform jgChangeRegistrationReform) { public String getSummaryInfo(JgChangeRegistrationReform jgChangeRegistrationReform) {
String result = "来自%s【%s】的业务办理,【申请单号:%s】"; String result = "来自%s【%s】的业务办理,【申请单号:%s】";
return String.format(result, Optional.ofNullable(jgChangeRegistrationReform.getEquipListName()).orElse("无"), jgChangeRegistrationReform.getSupervisoryCode(), jgChangeRegistrationReform.getApplyNo()); return String.format(result, Optional.ofNullable(jgChangeRegistrationReform.getEquipListName()).orElse("无"), Optional.ofNullable(jgChangeRegistrationReform.getSupervisoryCode()).orElse("无"), jgChangeRegistrationReform.getApplyNo());
} }
/** /**
......
...@@ -51,8 +51,6 @@ import org.elasticsearch.index.query.QueryBuilders; ...@@ -51,8 +51,6 @@ import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
...@@ -143,7 +141,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang ...@@ -143,7 +141,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
* @param map * @param map
* @return * @return
*/ */
public List<JgChangeRegistrationTransfer> createTransfer(String submitType, JSONObject map, ReginParams reginParams) { public List<JgChangeRegistrationTransferDto> createTransfer(String submitType, JSONObject map, ReginParams reginParams) {
Map<String, Object> tableData = (Map<String, Object>) map.get(TABLE_PAGE_ID); Map<String, Object> tableData = (Map<String, Object>) map.get(TABLE_PAGE_ID);
if (ValidationUtil.isEmpty(tableData)) { if (ValidationUtil.isEmpty(tableData)) {
...@@ -366,7 +364,16 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang ...@@ -366,7 +364,16 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
modelDtos.add(dto); modelDtos.add(dto);
commonService.buildTaskModel(modelDtos); commonService.buildTaskModel(modelDtos);
} }
return Collections.singletonList(oldTransfer);
JgChangeRegistrationTransferDto resultDto = new JgChangeRegistrationTransferDto();
Bean.copyExistPropertis(oldTransfer,resultDto);
//组装返回信息,添加设备信息的展示
resultDto.setEquCategory((String) tableData.get("equCategoryDesc"));
resultDto.setProductName((String) tableData.get("productName"));
resultDto.setAllAddress(oldTransfer.getFullAddress());
resultDto.setEquCode((String) tableData.get("equCode"));
resultDto.setInnerCode((String) tableData.get("useInnerCode"));
return Collections.singletonList(resultDto);
} }
/** /**
...@@ -375,7 +382,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang ...@@ -375,7 +382,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
* @param map * @param map
* @return * @return
*/ */
public List<JgChangeRegistrationTransfer> updateTransfer(String submitType, JSONObject map, ReginParams reginParams) { public List<JgChangeRegistrationTransferDto> updateTransfer(String submitType, JSONObject map, ReginParams reginParams) {
return this.createTransfer(submitType, map, reginParams); return this.createTransfer(submitType, map, reginParams);
} }
...@@ -406,7 +413,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang ...@@ -406,7 +413,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
map.put("approvalStatus", "提交"); map.put("approvalStatus", "提交");
} }
//执行流程 //执行流程
ProcessTaskDTO complete = icmWorkflowService.complete(taskId, dto); ProcessTaskDTO complete = icmWorkflowService.completeOrReject(taskId, dto, operate);
workflowResult = commonService.buildWorkFlowInfo(Collections.singletonList(complete)).get(0); workflowResult = commonService.buildWorkFlowInfo(Collections.singletonList(complete)).get(0);
// 更新下一步执行人 // 更新下一步执行人
this.updateExecuteIds(instanceId, transfer, operate, workflowResult); this.updateExecuteIds(instanceId, transfer, operate, workflowResult);
...@@ -1140,7 +1147,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang ...@@ -1140,7 +1147,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
*/ */
public String getSummaryInfo(JgChangeRegistrationTransfer transfer) { public String getSummaryInfo(JgChangeRegistrationTransfer transfer) {
String result = "来自%s【%s】的业务办理,【申请单号:%s】"; String result = "来自%s【%s】的业务办理,【申请单号:%s】";
return String.format(result, Optional.ofNullable(transfer.getEquipListName()).orElse("无"), transfer.getSupervisoryCode(), transfer.getApplyNo()); return String.format(result, Optional.ofNullable(transfer.getEquipListName()).orElse("无"), Optional.ofNullable(transfer.getSupervisoryCode()).orElse("无"), Optional.ofNullable(transfer.getApplyNo()).orElse("无"));
} }
public String getNextUserOrgCode(String operate, JgChangeRegistrationTransfer contract) { public String getNextUserOrgCode(String operate, JgChangeRegistrationTransfer contract) {
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.map.MapUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.aspose.words.SaveFormat;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...@@ -21,8 +18,6 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.*; ...@@ -21,8 +18,6 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationUnitService; import com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationUnitService;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient; import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService; import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
import com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils;
import com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils;
import com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService; import com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService;
import com.yeejoin.amos.boot.module.ymt.api.entity.*; import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
...@@ -30,21 +25,16 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum; ...@@ -30,21 +25,16 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.*; import com.yeejoin.amos.boot.module.ymt.api.mapper.*;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.TaskV2Model; import com.yeejoin.amos.feign.systemctl.model.TaskV2Model;
import com.yeejoin.amos.feign.workflow.Workflow; import com.yeejoin.amos.feign.workflow.Workflow;
import com.yeejoin.amos.feign.workflow.model.*; import com.yeejoin.amos.feign.workflow.model.*;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -55,11 +45,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -55,11 +45,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -279,7 +266,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg ...@@ -279,7 +266,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
task.setVariable(map); task.setVariable(map);
//执行流程 //执行流程
task.setNextExecuteUserCompanyCode(noticeDto.getReceiveOrgCode()); task.setNextExecuteUserCompanyCode(noticeDto.getReceiveOrgCode());
ProcessTaskDTO processTaskDTO = cmWorkflowService.complete(taskId, task); ProcessTaskDTO processTaskDTO = cmWorkflowService.completeOrReject(taskId, task, op);
JgChangeRegistrationUnit bean = new JgChangeRegistrationUnit(); JgChangeRegistrationUnit bean = new JgChangeRegistrationUnit();
BeanUtils.copyProperties(noticeDto, bean); BeanUtils.copyProperties(noticeDto, bean);
String taskCode = FlowStatusEnum.TO_BE_FINISHED.getName(); String taskCode = FlowStatusEnum.TO_BE_FINISHED.getName();
...@@ -776,7 +763,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg ...@@ -776,7 +763,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
} }
task.setVariable(map); task.setVariable(map);
//执行流程 //执行流程
ProcessTaskDTO processTaskDTO = cmWorkflowService.complete(taskId, task); ProcessTaskDTO processTaskDTO = cmWorkflowService.completeOrReject(taskId, task, op);
String taskCode = FlowStatusEnum.TO_BE_FINISHED.getName(); String taskCode = FlowStatusEnum.TO_BE_FINISHED.getName();
String taskName1 = ""; String taskName1 = "";
String nextTaskId = ""; String nextTaskId = "";
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.dto.TaskMessageDto; import com.yeejoin.amos.boot.module.jg.api.dto.TaskMessageDto;
...@@ -24,7 +22,6 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgEnableDisableDto; ...@@ -24,7 +22,6 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgEnableDisableDto;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient; import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService; import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService;
import com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService; import com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService;
import com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.RegistrationInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.RegistrationInfoMapper;
...@@ -44,7 +41,6 @@ import org.springframework.stereotype.Service; ...@@ -44,7 +41,6 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.ParseException;
import java.util.*; import java.util.*;
/** /**
...@@ -135,7 +131,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -135,7 +131,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
} }
dto.setVariable(commMap); dto.setVariable(commMap);
ProcessTaskDTO processTaskDTO = iCmWorkflowService.complete(jgEnableDisable.getNextTaskId(), dto); ProcessTaskDTO processTaskDTO = iCmWorkflowService.completeOrReject(jgEnableDisable.getNextTaskId(), dto, submit);
processTaskDTOS.add(processTaskDTO); processTaskDTOS.add(processTaskDTO);
// 提取节点等信息 // 提取节点等信息
workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
...@@ -500,7 +496,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -500,7 +496,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
workDto.setVariable(commMap); workDto.setVariable(commMap);
workDto.setComment(opinion); workDto.setComment(opinion);
workDto.setNextExecuteUserCompanyCode("1".equals(op) ? jgEnableDisable.getUseUnitCreditCode() : jgEnableDisable.getReceiveCompanyCode()); workDto.setNextExecuteUserCompanyCode("1".equals(op) ? jgEnableDisable.getUseUnitCreditCode() : jgEnableDisable.getReceiveCompanyCode());
processTaskDTO = iCmWorkflowService.complete(jgEnableDisable.getNextTaskId(), workDto); processTaskDTO = iCmWorkflowService.completeOrReject(jgEnableDisable.getNextTaskId(), workDto, op);
// 提取节点等信息 // 提取节点等信息
workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
return workflowResultDto; return workflowResultDto;
......
...@@ -96,14 +96,15 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto, ...@@ -96,14 +96,15 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
JgEquipTransferEq jgEquipTransferEq = buildJgEquipTransferEq(obj, applyNo); JgEquipTransferEq jgEquipTransferEq = buildJgEquipTransferEq(obj, applyNo);
JgEquipTransfer transfer = buildJgEquipTransfer(model, applyNo, reginParams, submitType, workflowResultList, i); JgEquipTransfer transfer = buildJgEquipTransfer(model, applyNo, reginParams, submitType, workflowResultList, i);
transfer.setSupervisoryCode(String.valueOf(obj.get("SUPERVISORY_CODE"))); transfer.setSupervisoryCode(String.valueOf(obj.get("SUPERVISORY_CODE")));
transfer.setEquList(String.valueOf(obj.get("EQU_LIST"))); transfer.setEquList(Objects.toString(obj.get("EQU_LIST"),""));
transfer.setEquDefine(String.valueOf(obj.get("EQU_DEFINE"))); transfer.setEquDefine(Objects.toString(obj.get("EQU_DEFINE"),""));
transfer.setEquCategory(String.valueOf(obj.get("EQU_CATEGORY"))); transfer.setEquCategory(Objects.toString(obj.get("EQU_CATEGORY"),""));
transfer.setProductName(String.valueOf(obj.get("PRODUCT_NAME"))); transfer.setProductName(Objects.toString(obj.get("PRODUCT_NAME"),""));
transfer.setUseRegistCode(String.valueOf(obj.get("USE_ORG_CODE"))); transfer.setUseRegistCode(Objects.toString(obj.get("USE_ORG_CODE"),""));
transfer.setUseInnerCode(String.valueOf(obj.get("USE_INNER_CODE"))); transfer.setUseRegistCode(Objects.toString(obj.get("USE_ORG_CODE"), ""));
transfer.setEquAddress(String.valueOf(obj.get("ADDRESS"))); transfer.setUseInnerCode(Objects.toString(obj.get("USE_INNER_CODE"),""));
transfer.setEquCode(String.valueOf(obj.get("EQU_CODE"))); transfer.setEquAddress(Objects.toString(obj.get("ADDRESS"),""));
transfer.setEquCode(Objects.toString(obj.get("EQU_CODE"),""));
transferList.add(transfer); transferList.add(transfer);
equipTransferEqList.add(jgEquipTransferEq); equipTransferEqList.add(jgEquipTransferEq);
}); });
...@@ -137,7 +138,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto, ...@@ -137,7 +138,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
private TaskModelDto buildTempTaskModelDto(JgEquipTransfer item) { private TaskModelDto buildTempTaskModelDto(JgEquipTransfer item) {
return TaskModelDto.builder() return TaskModelDto.builder()
.model(item) .model(item)
.taskContent(String.format("来自%s【%s】的业务办理,【申请单号:%s】", item.getEquList(), item.getSupervisoryCode(), item.getApplyNo())) .taskContent(String.format("来自%s【%s】的业务办理,【申请单号:%s】", item.getEquList(), Objects.toString(item.getSupervisoryCode(), ""), item.getApplyNo()))
.taskCode(item.getApplyNo()) .taskCode(item.getApplyNo())
.taskType(BusinessTypeEnum.JG_EQUIPMENT_HANDOVER.getCode()) .taskType(BusinessTypeEnum.JG_EQUIPMENT_HANDOVER.getCode())
.relationId(item.getSequenceNbr()+"") .relationId(item.getSequenceNbr()+"")
...@@ -183,8 +184,8 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto, ...@@ -183,8 +184,8 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
.taskStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName()) .taskStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName())
.flowStatus(FlowStatusEnum.TO_BE_PROCESSED.getCode()) .flowStatus(FlowStatusEnum.TO_BE_PROCESSED.getCode())
.flowStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName()) .flowStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName())
.taskContent(String.format("来自%s【%s】的业务办理,【申请单号:%s】", item.getEquList(), item.getSupervisoryCode(), item.getApplyNo())) .taskContent(String.format("来自%s【%s】的业务办理,【申请单号:%s】", item.getEquList(), Objects.toString(item.getSupervisoryCode(), ""), item.getApplyNo()))
.taskDesc(String.format("来自%s【%s】的业务办理,【申请单号:%s】", item.getEquList(), item.getSupervisoryCode(), item.getApplyNo())) .taskDesc(String.format("来自%s【%s】的业务办理,【申请单号:%s】", item.getEquList(), Objects.toString(item.getSupervisoryCode(), ""), item.getApplyNo()))
.startUserId(item.getCreateUserId()) .startUserId(item.getCreateUserId())
.startUser(item.getCreateUserName()) .startUser(item.getCreateUserName())
.startUserCompanyName(item.getCreateUserCompanyName()) .startUserCompanyName(item.getCreateUserCompanyName())
...@@ -292,7 +293,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto, ...@@ -292,7 +293,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
} }
dto.setVariable(commMap); dto.setVariable(commMap);
dto.setNextExecuteUserCompanyCode(transfer.getInstallUnitCreditCode()); dto.setNextExecuteUserCompanyCode(transfer.getInstallUnitCreditCode());
ProcessTaskDTO processTaskDTO = cmWorkflowService.complete(transfer.getNextTaskId(), dto); ProcessTaskDTO processTaskDTO = cmWorkflowService.completeOrReject(transfer.getNextTaskId(), dto, op);
// 提取节点等信息 // 提取节点等信息
WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
BeanUtils.copyProperties(equipTransferDto, transfer); BeanUtils.copyProperties(equipTransferDto, transfer);
...@@ -345,7 +346,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto, ...@@ -345,7 +346,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
workDto.setNextExecuteUserCompanyCode("1".equals(op) ? jgEquipTransfer.getUseUnitCreditCode() : jgEquipTransfer.getInstallUnitCreditCode()); workDto.setNextExecuteUserCompanyCode("1".equals(op) ? jgEquipTransfer.getUseUnitCreditCode() : jgEquipTransfer.getInstallUnitCreditCode());
workDto.setVariable(commMap); workDto.setVariable(commMap);
workDto.setComment(jgEquipTransferDto.getProcessAdvice()); workDto.setComment(jgEquipTransferDto.getProcessAdvice());
ProcessTaskDTO processTaskDTO = cmWorkflowService.complete(jgEquipTransfer.getNextTaskId(), workDto); ProcessTaskDTO processTaskDTO = cmWorkflowService.completeOrReject(jgEquipTransfer.getNextTaskId(), workDto, op);
// 提取节点等信息 // 提取节点等信息
WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
jgEquipTransfer.setPromoter(reginParams.getUserModel().getUserId()); jgEquipTransfer.setPromoter(reginParams.getUserModel().getUserId());
......
...@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSON; ...@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper; import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
...@@ -274,7 +273,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -274,7 +273,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
dto.setVariable(commMap); dto.setVariable(commMap);
//下一节点执行人单位(下节点接收机构code) //下一节点执行人单位(下节点接收机构code)
dto.setNextExecuteUserCompanyCode(notice.getReceiveOrgCreditCode()); dto.setNextExecuteUserCompanyCode(notice.getReceiveOrgCreditCode());
processTaskDTO = iCmWorkflowService.complete(notice.getNextTaskId(), dto); processTaskDTO = iCmWorkflowService.completeOrReject(notice.getNextTaskId(), dto, op);
// 提取节点等信息 // 提取节点等信息
workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
BeanUtils.copyProperties(noticeDto, notice); BeanUtils.copyProperties(noticeDto, notice);
...@@ -954,7 +953,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -954,7 +953,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
workDto.setVariable(commMap); workDto.setVariable(commMap);
workDto.setComment(jgTransferNotice.getProcessAdvice()); workDto.setComment(jgTransferNotice.getProcessAdvice());
workDto.setNextExecuteUserCompanyCode("1".equals(op) ? jgTransferNotice.getInstallUnitCreditCode() : jgTransferNotice.getReceiveOrgCreditCode()); workDto.setNextExecuteUserCompanyCode("1".equals(op) ? jgTransferNotice.getInstallUnitCreditCode() : jgTransferNotice.getReceiveOrgCreditCode());
processTaskDTO = iCmWorkflowService.complete(jgTransferNotice.getNextTaskId(), workDto); processTaskDTO = iCmWorkflowService.completeOrReject(jgTransferNotice.getNextTaskId(), workDto, op);
// 提取节点等信息 // 提取节点等信息
workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
return workflowResultDto; return workflowResultDto;
......
...@@ -17,7 +17,6 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgMaintainNoticeDto; ...@@ -17,7 +17,6 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgMaintainNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.dto.TaskMessageDto; import com.yeejoin.amos.boot.module.jg.api.dto.TaskMessageDto;
import com.yeejoin.amos.boot.module.jg.api.dto.TaskModelDto; import com.yeejoin.amos.boot.module.jg.api.dto.TaskModelDto;
import com.yeejoin.amos.boot.module.jg.api.dto.WorkflowResultDto; import com.yeejoin.amos.boot.module.jg.api.dto.WorkflowResultDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisableEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintainNotice; import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintainNotice;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintainNoticeEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintainNoticeEq;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
...@@ -219,7 +218,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -219,7 +218,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
//下一节点执行人单位(下节点接收机构code) //下一节点执行人单位(下节点接收机构code)
dto.setNextExecuteUserCompanyCode(notice.getReceiveCompanyCode()); dto.setNextExecuteUserCompanyCode(notice.getReceiveCompanyCode());
dto.setVariable(commMap); dto.setVariable(commMap);
processTaskDTO = cmWorkflowService.complete(notice.getNextTaskId(), dto); processTaskDTO = cmWorkflowService.completeOrReject(notice.getNextTaskId(), dto, op);
// 提取节点等信息 // 提取节点等信息
workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
BeanUtils.copyProperties(noticeDto, notice); BeanUtils.copyProperties(noticeDto, notice);
...@@ -295,7 +294,6 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -295,7 +294,6 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
if (Objects.nonNull(notice.getMaintainType())) { if (Objects.nonNull(notice.getMaintainType())) {
noticeDto.setMaintainTypeDesc(dictionaries.stream().filter(d -> notice.getMaintainType().equals(d.getCode())).map(DataDictionary::getName).collect(Collectors.joining())); noticeDto.setMaintainTypeDesc(dictionaries.stream().filter(d -> notice.getMaintainType().equals(d.getCode())).map(DataDictionary::getName).collect(Collectors.joining()));
} }
noticeDto.setFullAddress(notice.getProvinceName() + notice.getCityName() + notice.getCountyName() + notice.getStreetName() + notice.getAddress());
return noticeDto; return noticeDto;
}).collect(java.util.stream.Collectors.toList()); }).collect(java.util.stream.Collectors.toList());
noticeDtoPage.setRecords(records); noticeDtoPage.setRecords(records);
...@@ -745,7 +743,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -745,7 +743,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
} }
//组装信息 //组装信息
TaskResultDTO taskResultDTO = assembleData(jgMaintainNotice, op, opinion); TaskResultDTO taskResultDTO = assembleData(jgMaintainNotice, op, opinion);
ProcessTaskDTO processTaskDTO = cmWorkflowService.complete(jgMaintainNotice.getNextTaskId(), taskResultDTO); ProcessTaskDTO processTaskDTO = cmWorkflowService.completeOrReject(jgMaintainNotice.getNextTaskId(), taskResultDTO, op);
// 提取节点等信息 // 提取节点等信息
WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
......
...@@ -177,7 +177,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -177,7 +177,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
dto.setVariable(map); dto.setVariable(map);
//下一节点执行人单位(下节点接收机构code) //下一节点执行人单位(下节点接收机构code)
dto.setNextExecuteUserCompanyCode(getNextUserOrgCode(operate, contract)); dto.setNextExecuteUserCompanyCode(getNextUserOrgCode(operate, contract));
ProcessTaskDTO complete = workflowService.complete(taskId, dto); ProcessTaskDTO complete = workflowService.completeOrReject(taskId, dto, operate);
// 更新下一步执行人、创建待办 // 更新下一步执行人、创建待办
updateExecuteIds(instanceId, id, operate, complete); updateExecuteIds(instanceId, id, operate, complete);
} }
...@@ -450,7 +450,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -450,7 +450,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", op); map.put("approvalStatus", op);
dto.setVariable(map); dto.setVariable(map);
return workflowService.complete(contract.getNextTaskId(), dto); return workflowService.completeOrReject(contract.getNextTaskId(), dto, op);
} }
private void buildRoleList(List<ProcessTaskDTO> processTasks, List<String> roleListNext, List<String> roleListAll) { private void buildRoleList(List<ProcessTaskDTO> processTasks, List<String> roleListNext, List<String> roleListAll) {
......
...@@ -202,7 +202,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -202,7 +202,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
} }
dto.setNextExecuteUserCompanyCode(notice.getReceiveCompanyCode()); dto.setNextExecuteUserCompanyCode(notice.getReceiveCompanyCode());
dto.setVariable(commMap); dto.setVariable(commMap);
ProcessTaskDTO processTaskDTO = cmWorkflowService.complete(notice.getNextTaskId(), dto); ProcessTaskDTO processTaskDTO = cmWorkflowService.completeOrReject(notice.getNextTaskId(), dto, op);
// 提取节点等信息 // 提取节点等信息
WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
BeanUtils.copyProperties(noticeDto, notice); BeanUtils.copyProperties(noticeDto, notice);
...@@ -420,10 +420,11 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -420,10 +420,11 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
dto.setCreateUserName(reginParams.getUserModel().getRealName()); dto.setCreateUserName(reginParams.getUserModel().getRealName());
dto.setCreateUserId(reginParams.getUserModel().getUserId()); dto.setCreateUserId(reginParams.getUserModel().getUserId());
dto.setCreateUserCompanyName(reginParams.getCompany().getCompanyName()); dto.setCreateUserCompanyName(reginParams.getCompany().getCompanyName());
dto.setEquCategory(String.valueOf(obj.get("EQU_CATEGORY"))); dto.setEquCategory(Objects.toString(obj.get("EQU_CATEGORY"),""));
dto.setEquListCode(String.valueOf(obj.get("EQU_DEFINE"))); dto.setEquListCode(Objects.toString(obj.get("EQU_DEFINE"),""));
dto.setSupervisoryCode(String.valueOf(obj.get("SUPERVISORY_CODE"))); dto.setSupervisoryCode(Objects.toString(obj.get("SUPERVISORY_CODE"),""));
dto.setEquList(String.valueOf(obj.get("EQU_LIST"))); dto.setEquList(Objects.toString(obj.get("EQU_LIST"),""));
dto.setFullAddress(Objects.toString(obj.get("ADDRESS"),""));
if (SUBMIT_TYPE_FLOW.equals(submitType)) { if (SUBMIT_TYPE_FLOW.equals(submitType)) {
WorkflowResultDto workflowResult = workflowResultList.get(i); WorkflowResultDto workflowResult = workflowResultList.get(i);
...@@ -487,7 +488,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -487,7 +488,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
private TaskModelDto buildTempTaskModelDto(JgReformNotice item) { private TaskModelDto buildTempTaskModelDto(JgReformNotice item) {
return TaskModelDto.builder() return TaskModelDto.builder()
.model(item) .model(item)
.taskContent(String.format("来自%s【%s】的业务办理,【申请单号:%s】", item.getEquList(), item.getSupervisoryCode(), item.getApplyNo())) .taskContent(String.format("来自%s【%s】的业务办理,【申请单号:%s】", item.getEquList(), Objects.toString(item.getSupervisoryCode(), ""), item.getApplyNo()))
.taskCode(item.getApplyNo()) .taskCode(item.getApplyNo())
.taskType(BusinessTypeEnum.JG_MODIFICATION_NOTIFICATION.getCode()) .taskType(BusinessTypeEnum.JG_MODIFICATION_NOTIFICATION.getCode())
.relationId(item.getSequenceNbr()+"") .relationId(item.getSequenceNbr()+"")
...@@ -722,7 +723,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -722,7 +723,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
workDto.setNextExecuteUserCompanyCode("1".equals(op) ? jgReformNotice.getInstallUnitCreditCode() : jgReformNotice.getReceiveOrgCode()); workDto.setNextExecuteUserCompanyCode("1".equals(op) ? jgReformNotice.getInstallUnitCreditCode() : jgReformNotice.getReceiveOrgCode());
workDto.setVariable(commMap); workDto.setVariable(commMap);
workDto.setComment(dto.getRemark()); workDto.setComment(dto.getRemark());
ProcessTaskDTO processTaskDTO = cmWorkflowService.complete(jgReformNotice.getNextTaskId(), workDto); ProcessTaskDTO processTaskDTO = cmWorkflowService.completeOrReject(jgReformNotice.getNextTaskId(), workDto, op);
WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); WorkflowResultDto workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
jgReformNotice.setPromoter(reginParams.getUserModel().getUserId()); jgReformNotice.setPromoter(reginParams.getUserModel().getUserId());
jgReformNotice.setRemark(dto.getRemark()); jgReformNotice.setRemark(dto.getRemark());
...@@ -812,8 +813,8 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -812,8 +813,8 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
.taskStatusLabel(statusEnum.getName()) .taskStatusLabel(statusEnum.getName())
.flowStatus(statusEnum.getCode()) .flowStatus(statusEnum.getCode())
.flowStatusLabel(statusEnum.getName()) .flowStatusLabel(statusEnum.getName())
.taskContent(String.format("来自%s【%s】的业务办理,【申请单号:%s】", transfer.getEquList(), transfer.getSupervisoryCode(), transfer.getApplyNo())) .taskContent(String.format("来自%s【%s】的业务办理,【申请单号:%s】", transfer.getEquList(), Objects.toString(transfer.getSupervisoryCode(), ""), transfer.getApplyNo()))
.taskDesc(String.format("来自%s【%s】的业务办理,【申请单号:%s】", transfer.getEquList(), transfer.getSupervisoryCode(), transfer.getApplyNo())) .taskDesc(String.format("来自%s【%s】的业务办理,【申请单号:%s】", transfer.getEquList(), Objects.toString(transfer.getSupervisoryCode(), ""), transfer.getApplyNo()))
.startUserCompanyName(transfer.getCreateUserCompanyName()) .startUserCompanyName(transfer.getCreateUserCompanyName())
.startUserId(taskV2Model.getStartUserId()) .startUserId(taskV2Model.getStartUserId())
.startUser(taskV2Model.getStartUser()) .startUser(taskV2Model.getStartUser())
......
...@@ -193,7 +193,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -193,7 +193,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
dto.setProcessDefinitionKey("scrapCancelNew"); dto.setProcessDefinitionKey("scrapCancelNew");
dto.setBusinessKey(applyNoList.get(0)); dto.setBusinessKey(applyNoList.get(0));
dto.setCompleteFirstTask(Boolean.TRUE); dto.setCompleteFirstTask(Boolean.TRUE);
//下一节点执行人单位(下节点接收机构code) // 下一节点执行人单位(下节点接收机构code)
dto.setNextExecuteUserCompanyCode(model.getReceiveOrgCode()); dto.setNextExecuteUserCompanyCode(model.getReceiveOrgCode());
list.add(dto); list.add(dto);
...@@ -314,9 +314,9 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -314,9 +314,9 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
LambdaQueryWrapper<JgScrapCancel> lambda = new QueryWrapper<JgScrapCancel>().lambda(); LambdaQueryWrapper<JgScrapCancel> lambda = new QueryWrapper<JgScrapCancel>().lambda();
lambda.eq(JgScrapCancel::getSequenceNbr, id); lambda.eq(JgScrapCancel::getSequenceNbr, id);
JgScrapCancel jgScrapCancel = this.baseMapper.selectOne(lambda); JgScrapCancel jgScrapCancel = this.baseMapper.selectOne(lambda);
//删除代办消息 // 删除代办消息
commonService.deleteTaskModel(String.valueOf(jgScrapCancel.getSequenceNbr())); commonService.deleteTaskModel(String.valueOf(jgScrapCancel.getSequenceNbr()));
//更新jgScrapCancel数据 // 更新jgScrapCancel数据
jgScrapCancel.setIsDelete(true); jgScrapCancel.setIsDelete(true);
this.updateById(jgScrapCancel); this.updateById(jgScrapCancel);
} }
...@@ -324,6 +324,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -324,6 +324,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
} }
public JgScrapCancelDto updateInfo(String submitType, JgScrapCancelDto jgScrapCancelDto, String op) { public JgScrapCancelDto updateInfo(String submitType, JgScrapCancelDto jgScrapCancelDto, String op) {
if (Objects.isNull(jgScrapCancelDto) || StringUtils.isEmpty(submitType)) { if (Objects.isNull(jgScrapCancelDto) || StringUtils.isEmpty(submitType)) {
throw new IllegalArgumentException("参数不能为空"); throw new IllegalArgumentException("参数不能为空");
} }
...@@ -335,7 +336,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -335,7 +336,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
// 更新并提交 // 更新并提交
// 发起流程 // 发起流程
if (!StringUtils.hasText(jgScrapCancelDto.getInstanceId())) { if (!StringUtils.hasText(jgScrapCancelDto.getInstanceId())) {
//未进流程直接发起并执行 // 未进流程直接发起并执行
List<ProcessTaskDTO> processTasks; List<ProcessTaskDTO> processTasks;
ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO(); ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO();
...@@ -367,7 +368,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -367,7 +368,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
createTaskModel(bean, taskName, "1", nextUserIds); createTaskModel(bean, taskName, "1", nextUserIds);
} else { } else {
// 已经在流程中,执行一步 // 已经在流程中,执行一步
ProcessTaskDTO processTaskDTO = submit(jgScrapCancelDto.getNextTaskId()); ProcessTaskDTO processTaskDTO = submit(jgScrapCancelDto);
String nextTaskId = processTaskDTO.getNextTask().get(0).getId(); String nextTaskId = processTaskDTO.getNextTask().get(0).getId();
String taskName = processTaskDTO.getNextTask().get(0).getName(); String taskName = processTaskDTO.getNextTask().get(0).getName();
this.buildRoleList(Collections.singletonList(processTaskDTO), roleListNext, roleListAll); this.buildRoleList(Collections.singletonList(processTaskDTO), roleListNext, roleListAll);
...@@ -408,7 +409,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -408,7 +409,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
String supervisoryCode = otherInfo.getSupervisoryCode(); String supervisoryCode = otherInfo.getSupervisoryCode();
jgScrapCancelDto.setSupervisoryCode(supervisoryCode); jgScrapCancelDto.setSupervisoryCode(supervisoryCode);
} }
//更新操作 // 更新操作
JgScrapCancel bean = new JgScrapCancel(); JgScrapCancel bean = new JgScrapCancel();
BeanUtils.copyProperties(jgScrapCancelDto, bean); BeanUtils.copyProperties(jgScrapCancelDto, bean);
bean.setCancelCertificate(JSON.toJSONString(jgScrapCancelDto.getCancelCertificateList())); bean.setCancelCertificate(JSON.toJSONString(jgScrapCancelDto.getCancelCertificateList()));
...@@ -428,9 +429,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -428,9 +429,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
taskV2Model.setTaskDesc(""); taskV2Model.setTaskDesc("");
taskV2Model.setTaskContent(this.buildTaskContent(jgScrapCancelDto.getEquList(), jgScrapCancelDto.getSupervisoryCode(), jgScrapCancelDto.getCancelType(), jgScrapCancelDto.getApplyNo())); taskV2Model.setTaskContent(this.buildTaskContent(jgScrapCancelDto.getEquList(), jgScrapCancelDto.getSupervisoryCode(), jgScrapCancelDto.getCancelType(), jgScrapCancelDto.getApplyNo()));
taskV2Model.setTaskName(taskName); taskV2Model.setTaskName(taskName);
taskV2Model.setTaskDesc("");
taskV2Model.setTaskCode(jgScrapCancelDto.getApplyNo()); taskV2Model.setTaskCode(jgScrapCancelDto.getApplyNo());
taskV2Model.setExecuteUserIds(nextUserIds);
taskV2Model.setRelationId(jgScrapCancelDto.getInstanceId()); taskV2Model.setRelationId(jgScrapCancelDto.getInstanceId());
FlowStatusEnum flowStatusEnum = this.getTaskStatus(operate); FlowStatusEnum flowStatusEnum = this.getTaskStatus(operate);
taskV2Model.setTaskStatus(flowStatusEnum.getCode()); taskV2Model.setTaskStatus(flowStatusEnum.getCode());
...@@ -490,15 +489,18 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -490,15 +489,18 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
} }
} }
public ProcessTaskDTO submit(String taskId) { public ProcessTaskDTO submit(JgScrapCancelDto jgScrapCancelDto) {
//组装信息 JgScrapCancel model = this.getById(jgScrapCancelDto.getSequenceNbr());
// 组装信息
String op = "提交";
TaskResultDTO dto = new TaskResultDTO(); TaskResultDTO dto = new TaskResultDTO();
dto.setResultCode("approvalStatus"); dto.setResultCode("approvalStatus");
dto.setTaskId(taskId); dto.setTaskId(jgScrapCancelDto.getNextTaskId());
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", "提交"); map.put("approvalStatus", op);
dto.setNextExecuteUserCompanyCode(model.getReceiveOrgCode());
dto.setVariable(map); dto.setVariable(map);
return cmWorkflowService.complete(taskId, dto); return cmWorkflowService.completeOrReject(jgScrapCancelDto.getNextTaskId(), dto, op);
} }
public Map<String, Object> queryBySequenceNbr(Long sequenceNbr) { public Map<String, Object> queryBySequenceNbr(Long sequenceNbr) {
...@@ -585,7 +587,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -585,7 +587,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
public void flowExecute(String equList, Long id, String instanceId, String operate, String comment) { public void flowExecute(String equList, Long id, String instanceId, String operate, String comment) {
JgScrapCancel jgScrapCancel = this.getBaseMapper().selectById(id); JgScrapCancel jgScrapCancel = this.getBaseMapper().selectById(id);
String taskId = jgScrapCancel.getNextTaskId(); String taskId = jgScrapCancel.getNextTaskId();
//组装信息 // 组装信息
TaskResultDTO dto = new TaskResultDTO(); TaskResultDTO dto = new TaskResultDTO();
dto.setResultCode("approvalStatus"); dto.setResultCode("approvalStatus");
dto.setTaskId(taskId); dto.setTaskId(taskId);
...@@ -596,10 +598,10 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -596,10 +598,10 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
map.put("approvalStatus", "提交"); map.put("approvalStatus", "提交");
} }
dto.setVariable(map); dto.setVariable(map);
//下一节点执行人单位(下节点接收机构code) // 下一节点执行人单位(下节点接收机构code)
dto.setNextExecuteUserCompanyCode(this.getNextUserOrgCode(operate, jgScrapCancel)); dto.setNextExecuteUserCompanyCode(this.getNextUserOrgCode(operate, jgScrapCancel));
//执行流程 // 执行流程
ProcessTaskDTO processTaskDTO = cmWorkflowService.complete(taskId, dto); ProcessTaskDTO processTaskDTO = cmWorkflowService.completeOrReject(taskId, dto, operate);
// 更新下一步执行人、创建待办 // 更新下一步执行人、创建待办
updateExecuteIds(equList, instanceId, id, operate, processTaskDTO); updateExecuteIds(equList, instanceId, id, operate, processTaskDTO);
} }
...@@ -701,8 +703,10 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc ...@@ -701,8 +703,10 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
if ("0".equals(operate)) { if ("0".equals(operate)) {
code = jgScrapCancel.getReceiveOrgCode(); code = jgScrapCancel.getReceiveOrgCode();
} else { } else {
//驳回 // 驳回
if (WorkFlowStatusEnum.CANCEL_RECEIVE.getPass().equals(jgScrapCancel.getAuditStatus()) || WorkFlowStatusEnum.CANCEL_RECEIVE.getReject().equals(jgScrapCancel.getAuditStatus()) || WorkFlowStatusEnum.CANCEL_RECEIVE.getRollBack().equals(jgScrapCancel.getAuditStatus())) { if (WorkFlowStatusEnum.CANCEL_RECEIVE.getPass().equals(jgScrapCancel.getAuditStatus()) ||
WorkFlowStatusEnum.CANCEL_RECEIVE.getReject().equals(jgScrapCancel.getAuditStatus()) ||
WorkFlowStatusEnum.CANCEL_RECEIVE.getRollBack().equals(jgScrapCancel.getAuditStatus())) {
code = jgScrapCancel.getUseUnitCode(); code = jgScrapCancel.getUseUnitCode();
} }
} }
......
...@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSON; ...@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
...@@ -15,7 +14,6 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgTransferNoticeDto; ...@@ -15,7 +14,6 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgTransferNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.dto.TaskMessageDto; import com.yeejoin.amos.boot.module.jg.api.dto.TaskMessageDto;
import com.yeejoin.amos.boot.module.jg.api.dto.TaskModelDto; import com.yeejoin.amos.boot.module.jg.api.dto.TaskModelDto;
import com.yeejoin.amos.boot.module.jg.api.dto.WorkflowResultDto; import com.yeejoin.amos.boot.module.jg.api.dto.WorkflowResultDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice; import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice;
import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNoticeEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNoticeEq;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
...@@ -319,7 +317,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -319,7 +317,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
} }
dto.setVariable(commMap); dto.setVariable(commMap);
dto.setNextExecuteUserCompanyCode(notice.getReceiveOrgCode()); dto.setNextExecuteUserCompanyCode(notice.getReceiveOrgCode());
processTaskDTO = iCmWorkflowService.complete(notice.getNextTaskId(), dto); processTaskDTO = iCmWorkflowService.completeOrReject(notice.getNextTaskId(), dto, op);
// 提取节点等信息 // 提取节点等信息
workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
BeanUtils.copyProperties(noticeDto, notice); BeanUtils.copyProperties(noticeDto, notice);
...@@ -485,6 +483,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -485,6 +483,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
} else { } else {
dto.setNextExecuteUserIds(reginParams.getUserModel().getUserId()); dto.setNextExecuteUserIds(reginParams.getUserModel().getUserId());
} }
dto.setEquipCateName(obj.getOrDefault("EQU_CATEGORY", "").toString());
dto.setEquList(String.valueOf(obj.get("EQU_LIST"))); dto.setEquList(String.valueOf(obj.get("EQU_LIST")));
dto.setSupervisoryCode(String.valueOf(obj.get("SUPERVISORY_CODE"))); dto.setSupervisoryCode(String.valueOf(obj.get("SUPERVISORY_CODE")));
dto.setInstallUnitName(reginParams.getCompany().getCompanyName()); dto.setInstallUnitName(reginParams.getCompany().getCompanyName());
...@@ -499,6 +498,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -499,6 +498,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
} }
dto.setCreateUserName(reginParams.getUserModel().getRealName()); dto.setCreateUserName(reginParams.getUserModel().getRealName());
dto.setCreateUserId(reginParams.getUserModel().getUserId()); dto.setCreateUserId(reginParams.getUserModel().getUserId());
dto.setEquAddress(obj.getOrDefault("ADDRESS", "").toString());
list.add(dto); list.add(dto);
equipList.add(jgRelationEquip); equipList.add(jgRelationEquip);
}); });
...@@ -802,7 +802,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -802,7 +802,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
workDto.setNextExecuteUserCompanyCode("1".equals(op) ? jgTransferNotice.getInstallUnitCreditCode() : jgTransferNotice.getReceiveOrgCode()); workDto.setNextExecuteUserCompanyCode("1".equals(op) ? jgTransferNotice.getInstallUnitCreditCode() : jgTransferNotice.getReceiveOrgCode());
workDto.setVariable(commMap); workDto.setVariable(commMap);
workDto.setComment(opinion); workDto.setComment(opinion);
processTaskDTO = iCmWorkflowService.complete(jgTransferNotice.getNextTaskId(), workDto); processTaskDTO = iCmWorkflowService.completeOrReject(jgTransferNotice.getNextTaskId(), workDto, op);
// 提取节点等信息 // 提取节点等信息
workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
return workflowResultDto; return workflowResultDto;
......
...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
...@@ -47,6 +48,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest; ...@@ -47,6 +48,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.*; import java.util.*;
...@@ -113,6 +115,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -113,6 +115,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
JgRegistrationHistory jgRegistrationHistory = jgRegistrationHistoryService.getBaseMapper().selectOne(lambdaSelect); JgRegistrationHistory jgRegistrationHistory = jgRegistrationHistoryService.getBaseMapper().selectOne(lambdaSelect);
JSONObject map = JSONObject.parseObject(jgRegistrationHistory.getChangeData()); JSONObject map = JSONObject.parseObject(jgRegistrationHistory.getChangeData());
map.remove("status"); map.remove("status");
// 安全管理员
if (map.containsKey("safetyManagerName")){
map.put("safetyManager", map.get("safetyManagerName"));
}
IdxBizJgUseInfo useInfo = new IdxBizJgUseInfo(); IdxBizJgUseInfo useInfo = new IdxBizJgUseInfo();
BeanUtil.copyProperties(map, useInfo); BeanUtil.copyProperties(map, useInfo);
// 城市 // 城市
...@@ -195,12 +201,17 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -195,12 +201,17 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jgUseRegistration.setUseUnitCreditCode(String.valueOf(map.get("useUnitCreditCode"))); jgUseRegistration.setUseUnitCreditCode(String.valueOf(map.get("useUnitCreditCode")));
String equType = this.baseMapper.getEquType(String.valueOf(map.get("equipId"))); String equType = this.baseMapper.getEquType(String.valueOf(map.get("equipId")));
if (map.containsKey("receiveOrgCode")) { if (map.containsKey("receiveOrgCode")) {
//维保单位信息 // 接收单位信息
String[] splitMaintenanceUnitCode = String.valueOf(map.getString("receiveOrgCode")).split("_"); String[] splitMaintenanceUnitCode = String.valueOf(map.getString("receiveOrgCode")).split("_");
jgUseRegistration.setReceiveCompanyCode(splitMaintenanceUnitCode[0]); jgUseRegistration.setReceiveCompanyCode(splitMaintenanceUnitCode[0]);
jgUseRegistration.setReceiveOrgName(splitMaintenanceUnitCode[1]); jgUseRegistration.setReceiveOrgName(splitMaintenanceUnitCode[1]);
} }
// 安全管理员
if (map.containsKey("safetyManager")) {
String[] data = String.valueOf(map.getString("safetyManager")).split("_");
map.put("safetyManagerName", data[1]);
}
// 使用单位提交 // 使用单位提交
jgUseRegistration.setUseUnitCreditCode(reginParams.getCompany().getCompanyCode()); jgUseRegistration.setUseUnitCreditCode(reginParams.getCompany().getCompanyCode());
jgUseRegistration.setCreateUserId(reginParams.getUserModel().getUserId()); jgUseRegistration.setCreateUserId(reginParams.getUserModel().getUserId());
...@@ -479,9 +490,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -479,9 +490,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 驳回到使用单位 // 驳回到使用单位
dto.setNextExecuteUserCompanyCode(jgUseRegistration.getUseUnitCreditCode()); dto.setNextExecuteUserCompanyCode(jgUseRegistration.getUseUnitCreditCode());
} else { } else {
dto.setNextExecuteUserCompanyCode(jgUseRegistration.getReceiveOrgCode()); dto.setNextExecuteUserCompanyCode(jgUseRegistration.getReceiveCompanyCode());
} }
ProcessTaskDTO complete = cmWorkflowService.complete(jgUseRegistration.getNextTaskId(), dto); ProcessTaskDTO complete = cmWorkflowService.completeOrReject(jgUseRegistration.getNextTaskId(), dto, operate);
ArrayList<ProcessTaskDTO> processTaskDTOS = new ArrayList<>(); ArrayList<ProcessTaskDTO> processTaskDTOS = new ArrayList<>();
processTaskDTOS.add(complete); processTaskDTOS.add(complete);
List<WorkflowResultDto> resultDto = commonServiceImpl.buildWorkFlowInfo(processTaskDTOS); List<WorkflowResultDto> resultDto = commonServiceImpl.buildWorkFlowInfo(processTaskDTOS);
...@@ -726,15 +737,32 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -726,15 +737,32 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
LambdaQueryWrapper<IdxBizJgOtherInfo> lambdaOth = new QueryWrapper<IdxBizJgOtherInfo>().lambda(); LambdaQueryWrapper<IdxBizJgOtherInfo> lambdaOth = new QueryWrapper<IdxBizJgOtherInfo>().lambda();
lambdaOth.eq(IdxBizJgOtherInfo::getRecord, record); lambdaOth.eq(IdxBizJgOtherInfo::getRecord, record);
IdxBizJgOtherInfo otherInfo = otherInfoMapper.selectOne(lambdaOth); IdxBizJgOtherInfo otherInfo = otherInfoMapper.selectOne(lambdaOth);
// 使用信息
LambdaQueryWrapper<IdxBizJgUseInfo> lambda = new QueryWrapper<IdxBizJgUseInfo>().lambda();
lambda.eq(IdxBizJgUseInfo::getRecord, record);
IdxBizJgUseInfo useInfo = useInfoMapper.selectOne(lambda);
// 注册信息
LambdaQueryWrapper<IdxBizJgRegisterInfo> lambdaReg = new QueryWrapper<IdxBizJgRegisterInfo>().lambda();
lambdaReg.eq(IdxBizJgRegisterInfo::getRecord, record);
IdxBizJgRegisterInfo registerInfo = idxBizJgRegisterInfoMapper.selectOne(lambdaReg);
if (ObjectUtils.isEmpty(registerInfo.getEquCode())) {
//生成设备注册代码
StringBuffer stringBuffer = new StringBuffer();
String ym = null;
try {
ym = DateUtils.dateFormat(new Date(), DateUtils.DATE_PATTERN_MM);
} catch (ParseException e) {
log.error("日期转换失败:{}", e);
}
stringBuffer.append(registerInfo.getEquCategory()).append(useInfo.getCity()).append(ym);
ResponseModel<String> responseModel = tzsServiceFeignClient.deviceRegistrationCode(stringBuffer.toString());
String deviceRegistrationCode = responseModel.getResult();
if (!ObjectUtils.isEmpty(deviceRegistrationCode)) {
registerInfo.setEquCode(deviceRegistrationCode);
idxBizJgRegisterInfoMapper.updateById(registerInfo);
}
}
if (ObjectUtils.isEmpty(otherInfo.getSupervisoryCode())) { if (ObjectUtils.isEmpty(otherInfo.getSupervisoryCode())) {
// 使用信息
LambdaQueryWrapper<IdxBizJgUseInfo> lambda = new QueryWrapper<IdxBizJgUseInfo>().lambda();
lambda.eq(IdxBizJgUseInfo::getRecord, record);
IdxBizJgUseInfo useInfo = useInfoMapper.selectOne(lambda);
// 注册信息
LambdaQueryWrapper<IdxBizJgRegisterInfo> lambdaReg = new QueryWrapper<IdxBizJgRegisterInfo>().lambda();
lambdaReg.eq(IdxBizJgRegisterInfo::getRecord, record);
IdxBizJgRegisterInfo registerInfo = idxBizJgRegisterInfoMapper.selectOne(lambdaReg);
// 生成监管码、96333码 // 生成监管码、96333码
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("cityCode", useInfo.getCity()); map.put("cityCode", useInfo.getCity());
......
...@@ -182,4 +182,17 @@ public class JyjcInspectionResult extends BaseEntity { ...@@ -182,4 +182,17 @@ public class JyjcInspectionResult extends BaseEntity {
*/ */
@TableField("trace_id") @TableField("trace_id")
private String traceId; private String traceId;
/**
* 检验检测单位名称(冗余)
*/
@TableField(value = "inspection_unit_name")
private String inspectionUnitName;
/**
* 报检单位名称(冗余)
*/
@TableField(value = "application_unit_name")
private String applicationUnitName;
} }
...@@ -41,6 +41,8 @@ public enum DocumentEnum { ...@@ -41,6 +41,8 @@ public enum DocumentEnum {
AGGLRY("aqglry", "安全管理人员证"), AGGLRY("aqglry", "安全管理人员证"),
ZYRYZ("zyry", "作业人员证"), ZYRYZ("zyry", "作业人员证"),
WBHT("wbht", "维保合同"), WBHT("wbht", "维保合同"),
AQBHZZ("aqbhzz", "安全保护装置的型式试验证书"),
ZJHG("zjhg", "自检合格证明"),
AZJY("azjy", "安装监检报告"); AZJY("azjy", "安装监检报告");
private String code; private String code;
......
...@@ -95,7 +95,9 @@ public class JyjcInspectionResultModel extends BaseModel { ...@@ -95,7 +95,9 @@ public class JyjcInspectionResultModel extends BaseModel {
@ApiModelProperty(value = "检验检测类型名称(冗余)") @ApiModelProperty(value = "检验检测类型名称(冗余)")
private String inspectionTypeName; private String inspectionTypeName;
@ApiModelProperty(value = "报检日期") @ApiModelProperty(value = "报检日期")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date applicationDate; private Date applicationDate;
@ApiModelProperty("检验结果方式") @ApiModelProperty("检验结果方式")
...@@ -143,10 +145,10 @@ public class JyjcInspectionResultModel extends BaseModel { ...@@ -143,10 +145,10 @@ public class JyjcInspectionResultModel extends BaseModel {
@ApiModelProperty(value = "设备使用地址") @ApiModelProperty(value = "设备使用地址")
private String equUseAddress; private String equUseAddress;
@ApiModelProperty(value = "检验检测单") @ApiModelProperty(value = "检验检测单位名称(冗余)")
private String inspectionUnitName; private String inspectionUnitName;
@ApiModelProperty(value = "报检单位") @ApiModelProperty(value = "报检单位名称(冗余)")
private String applicationUnitName; private String applicationUnitName;
@ApiModelProperty(value = "监管码") @ApiModelProperty(value = "监管码")
......
...@@ -61,23 +61,54 @@ ...@@ -61,23 +61,54 @@
<select id="selectForPage" <select id="selectForPage"
resultType="com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel"> resultType="com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel">
select res.sequence_nbr, res.inspection_unit_code, res.application_no, res.application_unit_code, SELECT
res.equip_unicode, res.result_status, res.license_number, res.result_no, res.inspector, res.inner_person_code, res.sequence_nbr,
res.inspection_conclusion, res.inspection_date, res.next_inspection_date, res.inspection_start_date, res.inspection_unit_code,
res.inspection_end_date, res.inspection_result_summary, res.non_conformance, res.remark, res.application_no,
res.rec_user_id, res.rec_date, res.biz_type,res.equ_category, res.inspection_type, res.inspection_type_name, res.application_unit_code,
res.application_date,use_unit_name, use_unit_credit_code, province_name, city_name, county_name, street_name, equ_code, use_inner_code, ibjri.equ_list, res.equip_unicode,
tec1.name equ_list_name, ibjri.equ_category , ibjoi.SUPERVISORY_CODE supervisoryCode res.result_status,
, use_org_code, res.equ_define, ibjui.ADDRESS equUseAddress, bei.use_unit inspectionUnitName, bei1.use_unit applicationUnitName, cdb.name inspectionTypeName res.license_number,
from tz_jyjc_inspection_result res res.result_no,
left join idx_biz_jg_other_info ibjoi on res.equip_unicode = ibjoi.record res.inspector,
left join idx_biz_jg_use_info ibjui on ibjui.record = res.equip_unicode res.inner_person_code,
left join idx_biz_jg_register_info ibjri on ibjui.record = ibjri.record res.inspection_conclusion,
left join tz_equipment_category tec on ibjri.equ_category = tec.code res.inspection_date,
left join tz_equipment_category tec1 on ibjri.equ_list = tec1.code res.next_inspection_date,
left join tz_base_enterprise_info bei on res.inspection_unit_code = bei.use_code res.inspection_start_date,
left join tz_base_enterprise_info bei1 on res.application_unit_code = bei1.use_code res.inspection_end_date,
left join cb_data_dictionary cdb on res.inspection_type = cdb.code res.inspection_result_summary,
res.non_conformance,
res.remark,
res.rec_user_id,
res.rec_date,
res.biz_type,
res.equ_category,
res.inspection_type,
res.inspection_type_name,
res.application_date,
res.inspection_unit_name,
res.application_unit_name,
res.inspection_type_name,
ibjui.use_unit_name,
ibjui.use_unit_credit_code,
ibjui.province_name,
ibjui.city_name,
ibjui.county_name,
ibjui.street_name,
ibjri.equ_code,
ibjui.use_inner_code,
ibjri.equ_list,
(SELECT NAME FROM tz_equipment_category WHERE code = res.equ_list) AS equ_list_name,
ibjoi.SUPERVISORY_CODE supervisoryCode,
ibjri.use_org_code,
res.equ_define,
ibjui.ADDRESS equUseAddress
FROM
tz_jyjc_inspection_result res
LEFT JOIN idx_biz_jg_other_info ibjoi ON res.equip_unicode = ibjoi.record
LEFT JOIN idx_biz_jg_use_info ibjui ON ibjui.record = res.equip_unicode
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.record = ibjri.record
<where> <where>
<if test="jyjcInspectionResultModel.applicationNo != '' and jyjcInspectionResultModel.applicationNo != null"> <if test="jyjcInspectionResultModel.applicationNo != '' and jyjcInspectionResultModel.applicationNo != null">
and res.application_no like concat('%',#{jyjcInspectionResultModel.applicationNo},'%') and res.application_no like concat('%',#{jyjcInspectionResultModel.applicationNo},'%')
...@@ -86,19 +117,19 @@ ...@@ -86,19 +117,19 @@
and res.application_unit_code = #{jyjcInspectionResultModel.applicationUnitCode} and res.application_unit_code = #{jyjcInspectionResultModel.applicationUnitCode}
</if> </if>
<if test="jyjcInspectionResultModel.useOrgCode != '' and jyjcInspectionResultModel.useOrgCode != null"> <if test="jyjcInspectionResultModel.useOrgCode != '' and jyjcInspectionResultModel.useOrgCode != null">
and use_org_code like concat('%',#{jyjcInspectionResultModel.useOrgCode},'%') and ibjri.use_org_code like concat('%',#{jyjcInspectionResultModel.useOrgCode},'%')
</if> </if>
<if test="jyjcInspectionResultModel.useInnerCode != '' and jyjcInspectionResultModel.useInnerCode != null"> <if test="jyjcInspectionResultModel.useInnerCode != '' and jyjcInspectionResultModel.useInnerCode != null">
and use_inner_code like concat('%',#{jyjcInspectionResultModel.useInnerCode},'%') and ibjui.use_inner_code like concat('%',#{jyjcInspectionResultModel.useInnerCode},'%')
</if> </if>
<if test="jyjcInspectionResultModel.equCode != '' and jyjcInspectionResultModel.equCode != null"> <if test="jyjcInspectionResultModel.equCode != '' and jyjcInspectionResultModel.equCode != null">
and equ_code like concat('%',#{jyjcInspectionResultModel.equCode},'%') and ibjri.equ_code like concat('%',#{jyjcInspectionResultModel.equCode},'%')
</if> </if>
<if test="jyjcInspectionResultModel.equipUnicode != '' and jyjcInspectionResultModel.equipUnicode != null"> <if test="jyjcInspectionResultModel.equipUnicode != '' and jyjcInspectionResultModel.equipUnicode != null">
and res.equip_unicode like concat('%',#{jyjcInspectionResultModel.equipUnicode},'%') and res.equip_unicode like concat('%',#{jyjcInspectionResultModel.equipUnicode},'%')
</if> </if>
<if test="jyjcInspectionResultModel.equCategory != '' and jyjcInspectionResultModel.equCategory != null"> <if test="jyjcInspectionResultModel.equList != '' and jyjcInspectionResultModel.equList != null">
and ibjri.equ_category = #{jyjcInspectionResultModel.equCategory} and ibjri.equ_list = #{jyjcInspectionResultModel.equList}
</if> </if>
<if test="jyjcInspectionResultModel.inspectionType != '' and jyjcInspectionResultModel.inspectionType != null"> <if test="jyjcInspectionResultModel.inspectionType != '' and jyjcInspectionResultModel.inspectionType != null">
and res.inspection_type = #{jyjcInspectionResultModel.inspectionType} and res.inspection_type = #{jyjcInspectionResultModel.inspectionType}
...@@ -107,7 +138,7 @@ ...@@ -107,7 +138,7 @@
AND TO_DAYS(res.application_date) = TO_DAYS(#{jyjcInspectionResultModel.applicationDate}) AND TO_DAYS(res.application_date) = TO_DAYS(#{jyjcInspectionResultModel.applicationDate})
</if> </if>
<if test="jyjcInspectionResultModel.useUnitCreditCode != '' and jyjcInspectionResultModel.useUnitCreditCode != null"> <if test="jyjcInspectionResultModel.useUnitCreditCode != '' and jyjcInspectionResultModel.useUnitCreditCode != null">
and use_unit_credit_code like concat('%',#{jyjcInspectionResultModel.useUnitCreditCode},'%') and ibjui.use_unit_credit_code like concat('%',#{jyjcInspectionResultModel.useUnitCreditCode},'%')
</if> </if>
<if test="jyjcInspectionResultModel.inspectionUnitCode != '' and jyjcInspectionResultModel.inspectionUnitCode != null"> <if test="jyjcInspectionResultModel.inspectionUnitCode != '' and jyjcInspectionResultModel.inspectionUnitCode != null">
and res.inspection_unit_code = #{jyjcInspectionResultModel.inspectionUnitCode} and res.inspection_unit_code = #{jyjcInspectionResultModel.inspectionUnitCode}
...@@ -130,6 +161,6 @@ ...@@ -130,6 +161,6 @@
</otherwise> </otherwise>
</choose> </choose>
</where> </where>
ORDER BY application_date DESC ORDER BY res.application_date DESC
</select> </select>
</mapper> </mapper>
...@@ -12,7 +12,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -12,7 +12,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sun.org.apache.bcel.internal.generic.NEW; import com.sun.org.apache.bcel.internal.generic.NEW;
import com.sun.org.apache.regexp.internal.RE;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.IDataDictionaryService;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService; import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
...@@ -113,6 +117,9 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -113,6 +117,9 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
@Autowired @Autowired
TaskModelServiceImpl taskModelService; TaskModelServiceImpl taskModelService;
@Autowired
DataDictionaryServiceImpl dataDictionaryService;
public JyjcInspectionApplicationModel save(@RequestBody JSONObject obj) { public JyjcInspectionApplicationModel save(@RequestBody JSONObject obj) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
...@@ -353,6 +360,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -353,6 +360,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
} }
@Override
public Boolean deleteBatchData(List<Long> sequenceNbr) { public Boolean deleteBatchData(List<Long> sequenceNbr) {
// List<JyjcInspectionApplication> jyjcInspectionApplications = this.getBaseMapper().selectBatchIds(sequenceNbr); // List<JyjcInspectionApplication> jyjcInspectionApplications = this.getBaseMapper().selectBatchIds(sequenceNbr);
...@@ -398,6 +406,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -398,6 +406,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
} }
@Override
public Page<JyjcInspectionApplicationModel> queryForPageList(Page<JyjcInspectionApplication> page, JyjcInspectionApplicationModel model) { public Page<JyjcInspectionApplicationModel> queryForPageList(Page<JyjcInspectionApplication> page, JyjcInspectionApplicationModel model) {
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(),
RequestContext.getToken())).toString(), ReginParams.class); RequestContext.getToken())).toString(), ReginParams.class);
...@@ -520,7 +529,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -520,7 +529,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
TaskResultDTO task = new TaskResultDTO(); TaskResultDTO task = new TaskResultDTO();
task.setResultCode("approvalStatus"); task.setResultCode("approvalStatus");
task.setTaskId(taskId); task.setTaskId(taskId);
task.setComment(""); task.setComment(params.getOrDefault("comments","").toString());
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", "0"); map.put("approvalStatus", "0");
task.setVariable(map); task.setVariable(map);
...@@ -581,17 +590,21 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -581,17 +590,21 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
for (int i = 0; i < applicationEquipModels.size(); i++) { for (int i = 0; i < applicationEquipModels.size(); i++) {
JyjcInspectionResult resultModel = new JyjcInspectionResult(); JyjcInspectionResult resultModel = new JyjcInspectionResult();
resultModel.setInspectionUnitCode(inspectionApplicationModel.getInspectionUnitCode()); resultModel.setInspectionUnitCode(inspectionApplicationModel.getInspectionUnitCode());
resultModel.setInspectionUnitName(inspectionApplicationModel.getInspectionUnitName());
resultModel.setApplicationNo(inspectionApplicationModel.getApplicationNo()); resultModel.setApplicationNo(inspectionApplicationModel.getApplicationNo());
resultModel.setApplicationUnitCode(inspectionApplicationModel.getApplicationUnitCode()); resultModel.setApplicationUnitCode(inspectionApplicationModel.getApplicationUnitCode());
resultModel.setApplicationUnitName(inspectionApplicationModel.getApplicationUnitName());
resultModel.setResultStatus(ResultStatusEnum.NO_RESULT.getCode()); resultModel.setResultStatus(ResultStatusEnum.NO_RESULT.getCode());
resultModel.setApplicationDate(inspectionApplicationModel.getApplicationDate()); resultModel.setApplicationDate(inspectionApplicationModel.getApplicationDate());
resultModel.setResultType(inspectionApplicationModel.getResultType()); resultModel.setResultType(inspectionApplicationModel.getResultType());
//resultModel.setResultType("input"); //resultModel.setResultType("input");
resultModel.setInspectionType(inspectionApplicationModel.getInspectionType()); resultModel.setInspectionType(inspectionApplicationModel.getInspectionType());
resultModel.setInspectionTypeName(this.getDictNameByCode(inspectionApplicationModel.getInspectionType()));
// 解析设备 // 解析设备
resultModel.setBizType(inspectionApplicationModel.getBizType()); resultModel.setBizType(inspectionApplicationModel.getBizType());
resultModel.setResultNo(codes.get(i)); resultModel.setResultNo(codes.get(i));
resultModel.setEquipUnicode(applicationEquipModels.get(i).getEquipUnicode());//设备唯一标识 //设备唯一标识
resultModel.setEquipUnicode(applicationEquipModels.get(i).getEquipUnicode());
resultModel.setEquDefine(applicationEquipModels.get(i).getEquDefine()); resultModel.setEquDefine(applicationEquipModels.get(i).getEquDefine());
resultModel.setEquCategory(applicationEquipModels.get(i).getEquCategory()); resultModel.setEquCategory(applicationEquipModels.get(i).getEquCategory());
resultModel.setEquList(applicationEquipModels.get(i).getEquList()); resultModel.setEquList(applicationEquipModels.get(i).getEquList());
...@@ -603,6 +616,11 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -603,6 +616,11 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
JyjcInspectionApplicationHandlerFactory.apply(type).notifyInspectionUnit(thiryPartParams); JyjcInspectionApplicationHandlerFactory.apply(type).notifyInspectionUnit(thiryPartParams);
} }
private String getDictNameByCode(String code) {
DataDictionary dataDictionary = dataDictionaryService.getByCode(code,"JYJC");
return dataDictionary != null ? dataDictionary.getName() : "";
}
/** /**
* 退回 * 退回
* *
...@@ -626,8 +644,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -626,8 +644,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
TaskResultDTO task = new TaskResultDTO(); TaskResultDTO task = new TaskResultDTO();
task.setResultCode("approvalStatus"); task.setResultCode("approvalStatus");
task.setTaskId(taskId); task.setTaskId(taskId);
task.setComment(""); task.setComment(params.getOrDefault("comments","").toString()); HashMap<String, Object> map = new HashMap<>();
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", "1"); map.put("approvalStatus", "1");
task.setVariable(map); task.setVariable(map);
//执行流程 //执行流程
......
...@@ -143,7 +143,7 @@ public class GenerateCodeServiceImpl implements IGenerateCodeService { ...@@ -143,7 +143,7 @@ public class GenerateCodeServiceImpl implements IGenerateCodeService {
categoryOtherInfoMapper.selectSupervisorCodeMaxValue().forEach(vo -> categoryOtherInfoMapper.selectSupervisorCodeMaxValue().forEach(vo ->
stringRedisTemplate.opsForValue().set(vo.getName(), String.valueOf(vo.getValue()))); stringRedisTemplate.opsForValue().set(vo.getName(), String.valueOf(vo.getValue())));
return Long.parseLong(Objects.requireNonNull(redisTemplate.opsForValue().get(sequenceKey))); return Long.parseLong(redisTemplate.opsForValue().get(sequenceKey) == null ? "0" : redisTemplate.opsForValue().get(sequenceKey));
} }
/** /**
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"type": "lifting" "type": "lifting"
}, },
{ {
"name": "场机动车辆", "name": "场(厂)内专用机动车辆",
"code": "5000", "code": "5000",
"image": "upload/tzs/common/image/总览厂车.png", "image": "upload/tzs/common/image/总览厂车.png",
"imageUrl": "upload/tzs/common/image/监管厂车.png", "imageUrl": "upload/tzs/common/image/监管厂车.png",
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
"imageUrl": "upload/tzs/common/image/监管起重机械.png" "imageUrl": "upload/tzs/common/image/监管起重机械.png"
}, },
{ {
"name": "场机动车辆", "name": "场(厂)内专用机动车辆",
"code": "5000", "code": "5000",
"image": "upload/tzs/common/image/总览厂车.png", "image": "upload/tzs/common/image/总览厂车.png",
"imageUrl": "upload/tzs/common/image/监管厂车.png" "imageUrl": "upload/tzs/common/image/监管厂车.png"
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
"imageUrl": "upload/tzs/common/image/监管起重机械.png" "imageUrl": "upload/tzs/common/image/监管起重机械.png"
}, },
{ {
"name": "场机动车辆", "name": "场(厂)内专用机动车辆",
"code": "5000", "code": "5000",
"image": "upload/tzs/common/image/总览厂车.png", "image": "upload/tzs/common/image/总览厂车.png",
"imageUrl": "upload/tzs/common/image/监管厂车.png" "imageUrl": "upload/tzs/common/image/监管厂车.png"
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
"type": "lifting" "type": "lifting"
}, },
{ {
"name": "场机动车辆", "name": "场(厂)内专用机动车辆",
"code": "5000", "code": "5000",
"image": "upload/tzs/common/image/总览厂车.png", "image": "upload/tzs/common/image/总览厂车.png",
"imageUrl": "upload/tzs/common/image/监管厂车.png", "imageUrl": "upload/tzs/common/image/监管厂车.png",
...@@ -300,7 +300,7 @@ ...@@ -300,7 +300,7 @@
"type": "lifting" "type": "lifting"
}, },
{ {
"name": "场机动车辆", "name": "场(厂)内专用机动车辆",
"code": "5000", "code": "5000",
"image": "upload/tzs/common/image/总览厂车.png", "image": "upload/tzs/common/image/总览厂车.png",
"imageUrl": "upload/tzs/common/image/监管厂车.png", "imageUrl": "upload/tzs/common/image/监管厂车.png",
......
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