Commit e271d8b1 authored by 刘林's avatar 刘林

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

parent 7e0bb270
...@@ -297,6 +297,18 @@ public class CommonController extends BaseController { ...@@ -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获取公司下人员 * 根据公司id获取公司下人员
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -589,8 +601,8 @@ public class CommonController extends BaseController { ...@@ -589,8 +601,8 @@ public class CommonController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getLatestJgUseRegistrationManage") @GetMapping(value = "/getLatestJgUseRegistrationManage")
@ApiOperation(httpMethod = "GET", value = "获取单位下的使用登记证编号", notes = "按照类型查询车载气瓶相关的字典值") @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(); 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 { ...@@ -67,6 +67,8 @@ public interface ICommonService {
Object invokeBusinessProcess(String submitType, Map<String, Object> obj, ReginParams reginParams); Object invokeBusinessProcess(String submitType, Map<String, Object> obj, ReginParams reginParams);
Object invokeBusinessType(Map<String, Object> obj);
Object getCompanyUser(Long companyId); Object getCompanyUser(Long companyId);
Object transfer(Map<String, Object> obj); Object transfer(Map<String, Object> obj);
......
...@@ -1231,6 +1231,24 @@ public class CommonServiceImpl implements ICommonService { ...@@ -1231,6 +1231,24 @@ public class CommonServiceImpl implements ICommonService {
} }
@Override @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) @Transactional(rollbackFor = Exception.class)
public Object transfer(Map<String, Object> map) { public Object transfer(Map<String, Object> map) {
if (ObjectUtils.isEmpty(map.get("nextTaskId")) || map.get("nextTaskId") == null) { if (ObjectUtils.isEmpty(map.get("nextTaskId")) || map.get("nextTaskId") == null) {
...@@ -2072,20 +2090,18 @@ public class CommonServiceImpl implements ICommonService { ...@@ -2072,20 +2090,18 @@ public class CommonServiceImpl implements ICommonService {
* 获取最新的使用登记证书 * 获取最新的使用登记证书
* *
* @param useUnitCreditCode 使用单位统一信用代码 * @param useUnitCreditCode 使用单位统一信用代码
* @param equCategoryCode 设备类别编码 * @param equDefineCode 设备类别编码
* @return * @return JgUseRegistrationManage
*/ */
@Override @Override
public JgUseRegistrationManage getLatestJgUseRegistrationManage(String useUnitCreditCode, String equCategoryCode) { public JgUseRegistrationManage getLatestJgUseRegistrationManage(String useUnitCreditCode, String equDefineCode) {
LambdaQueryWrapper<JgUseRegistrationManage> lambdaQueryWrapper = new LambdaQueryWrapper(); LambdaQueryWrapper<JgUseRegistrationManage> queryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(JgUseRegistrationManage::getUseUnitCreditCode, useUnitCreditCode); queryWrapper.eq(JgUseRegistrationManage::getUseUnitCreditCode, useUnitCreditCode)
lambdaQueryWrapper.eq(JgUseRegistrationManage::getEquCategoryCode, equCategoryCode); .eq(JgUseRegistrationManage::getEquDefineCode, equDefineCode)
lambdaQueryWrapper.eq(JgUseRegistrationManage::getCertificateStatus, CertificateStatusEnum.YIDENGJI.getName()); .eq(JgUseRegistrationManage::getCertificateStatus, CertificateStatusEnum.YIDENGJI.getName())
lambdaQueryWrapper.orderByDesc(JgUseRegistrationManage::getCertificateNo); .orderByDesc(JgUseRegistrationManage::getCertificateNo);
List<JgUseRegistrationManage> jgUseRegistrationManages = jgUseRegistrationManageMapper.selectList(lambdaQueryWrapper); return jgUseRegistrationManageMapper.selectList(queryWrapper).stream()
if (!CollectionUtils.isEmpty(jgUseRegistrationManages) && jgUseRegistrationManages.size() > 0) { .findFirst()
return jgUseRegistrationManages.get(0); .orElse(null);
}
return null;
} }
} }
\ No newline at end of file
...@@ -880,11 +880,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -880,11 +880,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
String useRegistrationCode = null; String useRegistrationCode = null;
Boolean flag = Boolean.FALSE; Boolean flag = Boolean.FALSE;
String equCategoryCode = String.valueOf(mapData.get("EQU_CATEGORY_CODE")); 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)) { if (CylinderTypeEnum.CYLINDER.getCode().equals(equCategoryCode) || PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(equCategoryCode)) {
// 获取最新的使用登记记录 // 获取最新的使用登记记录
String useUnitCreditCode = jgUseRegistration.getUseUnitCreditCode(); String useUnitCreditCode = jgUseRegistration.getUseUnitCreditCode();
JgUseRegistrationManage jgUseRegistrationManage = commonServiceImpl.getLatestJgUseRegistrationManage(useUnitCreditCode, equCategoryCode); JgUseRegistrationManage jgUseRegistrationManage = commonServiceImpl.getLatestJgUseRegistrationManage(useUnitCreditCode, equDefineCode);
useRegistrationCode = ObjectUtils.isEmpty(jgUseRegistrationManage) ? useRegistrationCode : jgUseRegistrationManage.getUseRegistrationCode(); useRegistrationCode = ObjectUtils.isEmpty(jgUseRegistrationManage) ? useRegistrationCode : jgUseRegistrationManage.getUseRegistrationCode();
flag = ObjectUtils.isEmpty(useRegistrationCode) ? flag : Boolean.TRUE; flag = ObjectUtils.isEmpty(useRegistrationCode) ? flag : Boolean.TRUE;
} }
...@@ -2448,7 +2449,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -2448,7 +2449,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
* @param map * @param map
* @return * @return
*/ */
private List<Map<String, Object>> handleHistoryEquip(JSONObject map) { @Transactional(rollbackFor = Exception.class)
public List<Map<String, Object>> handleHistoryEquip(JSONObject map) {
try { try {
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);
CompanyBo company = reginParams.getCompany(); 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