Commit 7284bc56 authored by 韩桐桐's avatar 韩桐桐

fix(jg):新增设备支持撬装式承压设备

parent fc8399aa
......@@ -254,6 +254,20 @@ public class CommonController extends BaseController {
return ResponseHelper.buildResponse(commonService.superviseBusinessCategory(type));
}
/**
* 查询各类型业务场景
* 使用单位:按照设备种类,按照应用场景
* 安装改造维修单位:按照设备种类
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询监管业务名称列表", notes = "查询监管业务名称列表")
@GetMapping(value = "/businessScenarios")
public ResponseModel<Object> businessScenarios(String type) {
return ResponseHelper.buildResponse(commonService.businessScenarios(type));
}
@Autowired
private IJgInstallationNoticeService iJgInstallationNoticeService;
......
......@@ -123,8 +123,9 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/equ-category/listByPersonAndEquList")
@ApiOperation(httpMethod = "GET", value = "按照人员身份、设备种类查询设备类别", notes = "按照人员身份、设备种类查询设备类别")
public ResponseModel<List<DictionarieValueModel>> equCategoryList(@RequestParam(value = "equList") String equList) {
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.equCategoryListByCompanyType(getSelectedOrgInfo(), equList));
public ResponseModel<List<DictionarieValueModel>> equCategoryList(@RequestParam(value = "equList") String equList,
@RequestParam(value = "businessScenarios") String businessScenarios) {
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.equCategoryListByCompanyType(getSelectedOrgInfo(), equList,businessScenarios));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
......@@ -51,6 +51,8 @@ public interface ICommonService {
List<Map<String, Object>> superviseBusinessCategory(String type);
List<Map<String, Object>> businessScenarios(String type);
Object invokeBusinessProcess(String submitType, Map<String, Object> obj, ReginParams reginParams);
Object getCompanyUser(Long companyId);
......
......@@ -30,7 +30,7 @@ public interface IIdxBizJgRegisterInfoService {
Map<String, Object> getDetailFieldCamelCaseByRecord(String record);
List<DictionarieValueModel> equCategoryListByCompanyType(ReginParams selectedOrgInfo, String equList);
List<DictionarieValueModel> equCategoryListByCompanyType(ReginParams selectedOrgInfo, String equList,String businessScenarios);
Page<JSONObject> queryForUnitEquipmentPage(JSONObject jsonObject);
......
......@@ -27,10 +27,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.EquipTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.PrintingTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.*;
import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationTransferService;
import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
......@@ -137,8 +134,6 @@ public class CommonServiceImpl implements ICommonService {
private static final String XZSB = "XZSB";
private static final String CODE = "code";
private static final String PL_DR = "PL_DR";
private static final String SAFETYANDMAINTENANCEUNIT = "安装改造维修单位";
// 管辖机构
private static final String REGULATOR_UNIT = "监管机构";
// 行政审批局
......@@ -168,6 +163,11 @@ public class CommonServiceImpl implements ICommonService {
private static final String SELECTED_ROLE_SEQS = "selectRoleSeqs";
public static final String YWCJ = "YWCJ";
public static final String DICT_DATA_KEY = "dictDataKey";
@Value("${redis.cache.failure.time}")
private Long redisRegionTimeSecond;
......@@ -614,7 +614,7 @@ public class CommonServiceImpl implements ICommonService {
public List<Map<String, Object>> superviseBusinessCategory(String type) {
ReginParams reginParams = getSelectedOrgInfo();
Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(superviseBusinessCategory);
if (XZSB.equals(type) && SAFETYANDMAINTENANCEUNIT.equals(reginParams.getCompany().getCompanyType())){
if (XZSB.equals(type) && CompanyTypeEnum.CONSTRUCTION.getName().equals(reginParams.getCompany().getCompanyType())){
Iterator<Map<String, Object>> iterator = resourceJson.get(type).iterator();
while (iterator.hasNext()) {
Map<String, Object> item = iterator.next();
......@@ -627,6 +627,25 @@ public class CommonServiceImpl implements ICommonService {
return resourceJson.get(type);
}
@Override
public List<Map<String, Object>> businessScenarios(String type) {
ReginParams reginParams = getSelectedOrgInfo();
Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(superviseBusinessCategory);
//新增设备 或者 安改维单位 只有按照设备种类选择的业务
if (PL_DR.equals(type) || CompanyTypeEnum.CONSTRUCTION.getName().equals(reginParams.getCompany().getCompanyType())){
Iterator<Map<String, Object>> iterator = resourceJson.get(YWCJ).iterator();
while (iterator.hasNext()) {
Map<String, Object> item = iterator.next();
if (item.get(DICT_DATA_KEY).equals("1")) {
iterator.remove();
}
}
return resourceJson.get(YWCJ);
}
return resourceJson.get(YWCJ);
}
private List<LinkedHashMap> deleteTreeData(List<LinkedHashMap> result, String companyType) {
Iterator it = result.iterator();
while (it.hasNext()) {
......
......@@ -482,14 +482,15 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
@Override
public List<DictionarieValueModel> equCategoryListByCompanyType(ReginParams selectedOrgInfo, String equList) {
public List<DictionarieValueModel> equCategoryListByCompanyType(ReginParams selectedOrgInfo, String equList,String businessScenarios) {
String companyType = selectedOrgInfo.getCompany().getCompanyType();
String dictCodePrefix = getDictCodePrefix(companyType, equList);
if (StringUtils.isEmpty(dictCodePrefix)) {
return new ArrayList<>();
}
String dictCode = String.format("%s_%s", dictCodePrefix, equipAddDictCodeSuffix);
return FeignUtil.remoteCall(() -> Systemctl.dictionarieClient.dictValues(dictCode));
List<DictionarieValueModel> result = FeignUtil.remoteCall(() -> Systemctl.dictionarieClient.dictValues(dictCode));
return result;
}
private String getDictCodePrefix(String companyType, String equList) {
......@@ -1635,6 +1636,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
registerInfo.setRecDate(date);
registerInfo.setRegisterState(this.getRegCode());
registerInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? null : String.valueOf(equipmentInfoForm.get("REGISTERINFO_SEQ")));
// 补丁:saveOrUpdate在update数据时不会更新字段为null的字段,但是编辑设备的代码时,从有改成无,equCode解析成null,但是此时需要将equcode删掉
registerInfo.setEquCode(ObjectUtils.isEmpty(registerInfo.getEquCode()) ? "" : registerInfo.getEquCode());
if (isCopy) {
// 使用登记证号置空
registerInfo.setUseOrgCode(null);
......
{
"YWCJ": [
{
"dictDataKey": "0",
"dictDataValue": "按设备种类",
"dictDataDesc": "upload/tzs/common/image/按照设备种类选择.png"
},
{
"dictDataKey": "1",
"dictDataValue": "按应用场景",
"dictDataDesc": "upload/tzs/common/image/按照应用场景选择.png"
}
],
"SGGZ": [
{
"name": "安装告知",
......@@ -21,7 +33,7 @@
"image": "upload/tzs/common/image/移装告知.png"
}
],
"DJGL":[
"DJGL": [
{
"name": "使用登记",
"code": "DJ_SY",
......@@ -48,21 +60,21 @@
"image": "upload/tzs/common/image/更名变更登记.png"
}
],
"WBBA":[
"WBBA": [
{
"name": "维保备案",
"code": "WB_BA",
"image": "upload/tzs/common/image/维保备案.png"
}
],
"SBYJ":[
"SBYJ": [
{
"name": "设备移交",
"code": "SB_YJ",
"image": "upload/tzs/common/image/设备移交.png"
}
],
"QTBF":[
"QTBF": [
{
"name": "设备启用",
"code": "SB_QY",
......@@ -84,7 +96,7 @@
"image": "upload/tzs/common/image/注销报废.png"
}
],
"XZSB":[
"XZSB": [
{
"name": "新增设备",
"code": "SB_XZ",
......
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