Commit 1997cc44 authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register
parents 18a6ad6b 866cfe10
...@@ -584,7 +584,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -584,7 +584,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
alertCalled.setCity(map.get("city").toString()); alertCalled.setCity(map.get("city").toString());
alertCalled.setDistrict(map.get("district").toString()); alertCalled.setDistrict(map.get("district").toString());
alertCalled.setRegionCode(map.get("regionCode").toString()); alertCalled.setRegionCode(map.get("regionCode").toString());
alertCalled.setBizOrgCode(map.get("orgCode").toString()); alertCalled.setBizOrgCode(map.get("orgCode") + "");
} }
......
...@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils; ...@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
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.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.module.jg.api.entity.JgInstallationNoticeEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq;
...@@ -136,12 +138,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -136,12 +138,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
ESEquipmentCategory esEquipmentCategory; ESEquipmentCategory esEquipmentCategory;
@Autowired @Autowired
ICommonService commonService; ICommonService commonService;
@Autowired
DataDictionaryServiceImpl iDataDictionaryService;
@Autowired @Autowired
private CategoryOtherInfoMapper categoryOtherInfoMapper; private CategoryOtherInfoMapper categoryOtherInfoMapper;
@Autowired @Autowired
private SuperviseInfoMapper superviseInfoMapper; private SuperviseInfoMapper superviseInfoMapper;
@Autowired @Autowired
private JgInstallationNoticeEqServiceImpl jgInstallationNoticeEqServiceImpl; private JgInstallationNoticeEqServiceImpl jgInstallationNoticeEqServiceImpl;
@Autowired @Autowired
...@@ -1199,6 +1201,23 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1199,6 +1201,23 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return object; return object;
} }
/**
* 获取类型为ZC的“未注册”的字典值
* @return code
*/
private String getRegCode(){
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "ZC");
queryWrapper.eq("name", "未注册");
queryWrapper.eq("is_delete", false);
List<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
if (!list.isEmpty() && list.get(0) != null) {
DataDictionary dictionary = list.get(0);
return Optional.ofNullable(dictionary).map(DataDictionary::getCode).orElse("");
}
return "";
}
private String batchSubmitOrUpdate(LinkedHashMap equipmentClassForm,LinkedHashMap equipmentInfoForm,LinkedHashMap equipmentParamsForm) { private String batchSubmitOrUpdate(LinkedHashMap equipmentClassForm,LinkedHashMap equipmentInfoForm,LinkedHashMap equipmentParamsForm) {
Date date = new Date(); Date date = new Date();
String record = null; String record = null;
...@@ -1256,11 +1275,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1256,11 +1275,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
iIdxBizJgConstructionInfoService.saveOrUpdateData(constructionInfo); iIdxBizJgConstructionInfoService.saveOrUpdateData(constructionInfo);
//注册登记 //注册登记
IdxBizJgRegisterInfo equipmentClassRegisterInfo = JSON.parseObject(JSON.toJSONString(equipmentClassForm), IdxBizJgRegisterInfo.class); // IdxBizJgRegisterInfo equipmentClassRegisterInfo = JSON.parseObject(JSON.toJSONString(equipmentClassForm), IdxBizJgRegisterInfo.class);
IdxBizJgRegisterInfo registerInfo = JSON.parseObject(JSON.toJSONString(equipmentInfoForm), IdxBizJgRegisterInfo.class); IdxBizJgRegisterInfo registerInfo = JSON.parseObject(JSON.toJSONString(equipmentInfoForm), IdxBizJgRegisterInfo.class);
Bean.copyExistPropertis(equipmentClassRegisterInfo, registerInfo); // Bean.copyExistPropertis(equipmentClassRegisterInfo, registerInfo);
registerInfo.setRecord(record); registerInfo.setRecord(record);
registerInfo.setRecDate(date); registerInfo.setRecDate(date);
registerInfo.setRegisterState(this.getRegCode());
registerInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? null : String.valueOf(equipmentInfoForm.get("REGISTERINFO_SEQ"))); registerInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? null : String.valueOf(equipmentInfoForm.get("REGISTERINFO_SEQ")));
this.saveOrUpdate(registerInfo); this.saveOrUpdate(registerInfo);
......
...@@ -5,8 +5,12 @@ import com.alibaba.fastjson.JSON; ...@@ -5,8 +5,12 @@ import com.alibaba.fastjson.JSON;
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.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
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.entity.DataDictionary;
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.module.jg.api.dto.JgUseRegistrationDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
...@@ -92,6 +96,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -92,6 +96,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
CmWorkflowServiceImpl cmWorkflowService; CmWorkflowServiceImpl cmWorkflowService;
@Autowired @Autowired
IdxBizJgSupervisionInfoMapper idxBizJgSupervisionInfoMapper; IdxBizJgSupervisionInfoMapper idxBizJgSupervisionInfoMapper;
@Autowired
DataDictionaryServiceImpl iDataDictionaryService;
private static final String DEFINITION_KEY = "useRegistration"; private static final String DEFINITION_KEY = "useRegistration";
...@@ -174,6 +180,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -174,6 +180,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 更新检验检测信息 // 更新检验检测信息
// inspectionDetectionInfo.setInspectReport(null); // inspectionDetectionInfo.setInspectReport(null);
inspectionDetectionInfoMapper.update(inspectionDetectionInfo, inspectionLambda); inspectionDetectionInfoMapper.update(inspectionDetectionInfo, inspectionLambda);
// 更新注册登记信息表
LambdaQueryWrapper<JgUseRegistrationEq> jgUseRegEqWrapper = new QueryWrapper<JgUseRegistrationEq>().lambda();
jgUseRegEqWrapper.eq(JgUseRegistrationEq::getEquipTransferId,currentDocumentId);
jgUseRegEqWrapper.eq(JgUseRegistrationEq::getIsDelete, false);
JgUseRegistrationEq jgUseRegistrationEq = jgRelationEquipMapper.selectOne(jgUseRegEqWrapper);
LambdaUpdateWrapper<IdxBizJgRegisterInfo> IdxBizJgRegLambda = new UpdateWrapper<IdxBizJgRegisterInfo>().lambda();
IdxBizJgRegLambda.eq(IdxBizJgRegisterInfo::getRecord, jgUseRegistrationEq.getEquId()).set(IdxBizJgRegisterInfo::getRegisterState, this.getRegCode());
idxBizJgRegisterInfoService.update(IdxBizJgRegLambda);
// 更新设备监管部门 // 更新设备监管部门
IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = new IdxBizJgSupervisionInfo(); IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = new IdxBizJgSupervisionInfo();
if (map.containsKey("orgBranchCode") && !ObjectUtils.isEmpty(map.get("orgBranchCode"))) { if (map.containsKey("orgBranchCode") && !ObjectUtils.isEmpty(map.get("orgBranchCode"))) {
...@@ -189,6 +203,23 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -189,6 +203,23 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
createCode(String.valueOf(map.get("equipId")), map, useInfo.getProvinceName() + "/" + useInfo.getCityName() + "/" + useInfo.getCountyName() + useInfo.getStreetName(), jgUseRegistration); createCode(String.valueOf(map.get("equipId")), map, useInfo.getProvinceName() + "/" + useInfo.getCityName() + "/" + useInfo.getCountyName() + useInfo.getStreetName(), jgUseRegistration);
} }
/**
* 获取类型为ZC的“已注册”的字典值
* @return code
*/
private String getRegCode(){
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "ZC");
queryWrapper.eq("name", "已注册");
queryWrapper.eq("is_delete", false);
List<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
if (!list.isEmpty() && list.get(0) != null) {
DataDictionary dictionary = list.get(0);
return Optional.ofNullable(dictionary).map(DataDictionary::getCode).orElse("");
}
return "";
}
public void updateHistory(JSONObject map, String equipId, String currentDocumentId, String supervisoryCode) { public void updateHistory(JSONObject map, String equipId, String currentDocumentId, String supervisoryCode) {
JgRegistrationHistory jgRegistrationHistory = new JgRegistrationHistory(); JgRegistrationHistory jgRegistrationHistory = new JgRegistrationHistory();
LambdaQueryWrapper<JgRegistrationHistory> lambda = new QueryWrapper<JgRegistrationHistory>().lambda(); LambdaQueryWrapper<JgRegistrationHistory> lambda = new QueryWrapper<JgRegistrationHistory>().lambda();
......
...@@ -52,12 +52,7 @@ import java.io.File; ...@@ -52,12 +52,7 @@ import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -182,6 +177,29 @@ public class EquipmentCategoryController extends BaseController { ...@@ -182,6 +177,29 @@ public class EquipmentCategoryController extends BaseController {
tree.add(menu); tree.add(menu);
return ResponseHelper.buildResponse(tree); return ResponseHelper.buildResponse(tree);
} }
/**
* 返回设备品种树第一个节点
*
* @return
* @throws Exception
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "装备分类列表全部数据查询", notes = "装备分类列表全部数据查询")
@GetMapping(value = "/firstNode")
public ResponseModel<Object> firstNode(@RequestParam(value = "code",required = false) String code) throws Exception {
if(ObjectUtils.isEmpty(code)){
return ResponseHelper.buildResponse(new ArrayList<>());
}
EquipmentCategory root = equipmentCategoryServiceImpl.getOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getCode, code));
QueryWrapper<EquipmentCategory> queryWrapper = new QueryWrapper<>();
queryWrapper.likeRight("code", code.replaceAll("0+$", ""));
Collection<EquipmentCategory> list = equipmentCategoryServiceImpl.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(root.getId(), list, EquipmentCategory.class.getName(), "getId", 0, "getName",
"getParentId", null, "getCode");
return ResponseHelper.buildResponse(menus.get(0));
}
/** /**
* 设备分类八大类 * 设备分类八大类
* *
......
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