|
@@ -1,6 +1,9 @@
|
|
|
package com.abi.qms.platform.service.impl;
|
|
|
|
|
|
+import com.abi.qms.platform.dao.entity.BaseArea;
|
|
|
+import com.abi.qms.platform.dao.mapper.BaseAreaMapper;
|
|
|
import com.abi.qms.platform.dao.mapper.InspectionCaseNumberMapper;
|
|
|
+import com.abi.qms.platform.infrastructure.util.AssertUtil;
|
|
|
import com.abi.qms.platform.service.InspectionCaseNumberService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -18,12 +21,22 @@ public class InspectionCaseNumberServiceImpl implements InspectionCaseNumberServ
|
|
|
@Autowired
|
|
|
private InspectionCaseNumberMapper caseNumberMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private BaseAreaMapper areaMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 根据cityId获取案件编号
|
|
|
*/
|
|
|
@Override
|
|
|
- public Long getCaseNumber(Long cityId) {
|
|
|
- return caseNumberMapper.getCaseNumber(cityId);
|
|
|
+ public String getCaseNumber(Long cityId) {
|
|
|
+ BaseArea city = areaMapper.selectById(cityId);
|
|
|
+ AssertUtil.isNull(city, "城市不存在");
|
|
|
+
|
|
|
+ BaseArea province = areaMapper.selectById(city.getParentId());
|
|
|
+ AssertUtil.isNull(city, "省份不存在");
|
|
|
+
|
|
|
+ Long caseNumber = caseNumberMapper.getCaseNumber(cityId);
|
|
|
+ return new StringBuilder().append(province.getName()).append(city.getName()).append("#").append(caseNumber).toString();
|
|
|
}
|
|
|
|
|
|
}
|