Commit e271d8b1 authored by 刘林's avatar 刘林

fix(jg):历史平台登记功能修改

parent 7e0bb270
......@@ -297,6 +297,18 @@ public class CommonController extends BaseController {
}
/**
* 历史平台登记业务发起公共接口
*
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/saveOrUpdateHistory")
@ApiOperation(httpMethod = "POST", value = "历史平台登记业务发起公共接口", notes = "历史平台登记业务发起公共接口")
public ResponseModel<Object> saveOrUpdateHistory(@RequestBody Map<String, Object> map) {
Object result = commonService.invokeBusinessType(map);
return ResponseHelper.buildResponse(result);
}
/**
* 根据公司id获取公司下人员
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
......@@ -589,8 +601,8 @@ public class CommonController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getLatestJgUseRegistrationManage")
@ApiOperation(httpMethod = "GET", value = "获取单位下的使用登记证编号", notes = "按照类型查询车载气瓶相关的字典值")
public ResponseModel<JgUseRegistrationManage> getLatestJgUseRegistrationManage(@RequestParam(value = "equCategoryCode") String equCategoryCode) {
public ResponseModel<JgUseRegistrationManage> getLatestJgUseRegistrationManage(@RequestParam(value = "equDefineCode") String equDefineCode) {
CompanyBo company = getSelectedOrgInfo().getCompany();
return ResponseHelper.buildResponse(commonService.getLatestJgUseRegistrationManage(company.getCompanyCode(),equCategoryCode));
return ResponseHelper.buildResponse(commonService.getLatestJgUseRegistrationManage(company.getCompanyCode(),equDefineCode));
}
}
......@@ -67,6 +67,8 @@ public interface ICommonService {
Object invokeBusinessProcess(String submitType, Map<String, Object> obj, ReginParams reginParams);
Object invokeBusinessType(Map<String, Object> obj);
Object getCompanyUser(Long companyId);
Object transfer(Map<String, Object> obj);
......
......@@ -1231,6 +1231,24 @@ public class CommonServiceImpl implements ICommonService {
}
@Override
public Object invokeBusinessType(Map<String, Object> map) {
Map<String, Object> basicObj = (Map<String, Object>) map.get(basic);
Map<String, Object> noticeObj = (Map<String, Object>) map.get(notice);
String type = (String) basicObj.get("type");
noticeObj.put("businessCode", type);
if (type.equals(ApplicationFormTypeEnum.SYDJ.getBusinessCode())) {
String businessScenarios = (String) basicObj.get("businessScenarios");
String code = (String) basicObj.get("code");
noticeObj.put("receiveOrgCode", !ObjectUtils.isEmpty(basicObj.get("receiveOrgCreditCode")) ? String.valueOf(basicObj.get("receiveOrgCreditCode")) : String.valueOf(basicObj.get("receiveOrgCreditCode1")));
JSONObject jsonObject = new JSONObject(noticeObj);
return "1".equals(businessScenarios) && CylinderTypeEnum.CYLINDER.getCode().equals(code) ?
jgVehicleInformationService.saveOrUpdateHisData(jsonObject) : jgUseRegistrationServiceImpl.handleHistoryEquip(jsonObject);
}
return null;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Object transfer(Map<String, Object> map) {
if (ObjectUtils.isEmpty(map.get("nextTaskId")) || map.get("nextTaskId") == null) {
......@@ -2072,20 +2090,18 @@ public class CommonServiceImpl implements ICommonService {
* 获取最新的使用登记证书
*
* @param useUnitCreditCode 使用单位统一信用代码
* @param equCategoryCode 设备类别编码
* @return
* @param equDefineCode 设备类别编码
* @return JgUseRegistrationManage
*/
@Override
public JgUseRegistrationManage getLatestJgUseRegistrationManage(String useUnitCreditCode, String equCategoryCode) {
LambdaQueryWrapper<JgUseRegistrationManage> lambdaQueryWrapper = new LambdaQueryWrapper();
lambdaQueryWrapper.eq(JgUseRegistrationManage::getUseUnitCreditCode, useUnitCreditCode);
lambdaQueryWrapper.eq(JgUseRegistrationManage::getEquCategoryCode, equCategoryCode);
lambdaQueryWrapper.eq(JgUseRegistrationManage::getCertificateStatus, CertificateStatusEnum.YIDENGJI.getName());
lambdaQueryWrapper.orderByDesc(JgUseRegistrationManage::getCertificateNo);
List<JgUseRegistrationManage> jgUseRegistrationManages = jgUseRegistrationManageMapper.selectList(lambdaQueryWrapper);
if (!CollectionUtils.isEmpty(jgUseRegistrationManages) && jgUseRegistrationManages.size() > 0) {
return jgUseRegistrationManages.get(0);
}
return null;
public JgUseRegistrationManage getLatestJgUseRegistrationManage(String useUnitCreditCode, String equDefineCode) {
LambdaQueryWrapper<JgUseRegistrationManage> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgUseRegistrationManage::getUseUnitCreditCode, useUnitCreditCode)
.eq(JgUseRegistrationManage::getEquDefineCode, equDefineCode)
.eq(JgUseRegistrationManage::getCertificateStatus, CertificateStatusEnum.YIDENGJI.getName())
.orderByDesc(JgUseRegistrationManage::getCertificateNo);
return jgUseRegistrationManageMapper.selectList(queryWrapper).stream()
.findFirst()
.orElse(null);
}
}
\ No newline at end of file
......@@ -880,11 +880,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
String useRegistrationCode = null;
Boolean flag = Boolean.FALSE;
String equCategoryCode = String.valueOf(mapData.get("EQU_CATEGORY_CODE"));
String equDefineCode = String.valueOf(mapData.get("EQU_DEFINE_CODE"));
//如果是气瓶或工业管道判断之前是否已经做过使用登记
if (CylinderTypeEnum.CYLINDER.getCode().equals(equCategoryCode) || PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(equCategoryCode)) {
// 获取最新的使用登记记录
String useUnitCreditCode = jgUseRegistration.getUseUnitCreditCode();
JgUseRegistrationManage jgUseRegistrationManage = commonServiceImpl.getLatestJgUseRegistrationManage(useUnitCreditCode, equCategoryCode);
JgUseRegistrationManage jgUseRegistrationManage = commonServiceImpl.getLatestJgUseRegistrationManage(useUnitCreditCode, equDefineCode);
useRegistrationCode = ObjectUtils.isEmpty(jgUseRegistrationManage) ? useRegistrationCode : jgUseRegistrationManage.getUseRegistrationCode();
flag = ObjectUtils.isEmpty(useRegistrationCode) ? flag : Boolean.TRUE;
}
......@@ -2448,7 +2449,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
* @param map
* @return
*/
private List<Map<String, Object>> handleHistoryEquip(JSONObject map) {
@Transactional(rollbackFor = Exception.class)
public List<Map<String, Object>> handleHistoryEquip(JSONObject map) {
try {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
CompanyBo company = reginParams.getCompany();
......
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