Commit 7511d4fc authored by lisong's avatar lisong

更新

parent af8d4eee
package com.yeejoin.amos.boot.module.jg.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum EquipTypeEnum {
锅炉("锅", "1"),
压力容器("容", "2"),
电梯("梯", "3"),
起重机械("起", "4"),
场内机动车辆("车", "5"),
大型游乐设施("游", "6"),
压力管道("管", "8"),
客运索道("索", "9");
private final String name;
private final String code;
public static String getMessage(String code) {
for (EquipTypeEnum constants : values()) {
if (constants.getCode().equals(code)) {
return constants.getName();
}
}
return null;
}
}
......@@ -10,8 +10,8 @@ import lombok.Getter;
@AllArgsConstructor
public enum MaintenceStatusEnum {
SUBMIT("使用单位提交", "submit", "使用单位待提交", "维保单位受理已驳回", "使用单位撤回"),
RECEIVE("维保单位审核确认", "receive", "维保单位待受理", "监管单位受理已驳回", "维保单位受理撤回"),
SUBMIT("使用单位提交", "submit", "使用单位待提交", "维保单位已驳回", "使用单位撤回"),
RECEIVE("维保单位审核确认", "receive", "维保单位待受理", "监管单位已驳回", "维保单位撤回"),
PRELIMINARY("监管单位审核", "preliminary", "监管单位待受理", "", "");
......
package com.yeejoin.amos.boot.module.jg.biz.controller;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -12,6 +13,7 @@ import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgMaintenanceContractSer
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -168,6 +170,28 @@ public class JgMaintenanceContractController extends BaseController {
@ApiOperation(httpMethod = "POST", value = "执行流程", notes = "执行流程")
public ResponseModel<Object> flowExecute(@RequestBody JSONObject map) {
jgMaintenanceContractServiceImpl.flowExecute(Long.valueOf(String.valueOf(map.get("sequenceNbr"))),String.valueOf(map.get("instanceId")), String.valueOf(map.get("operate")), String.valueOf(map.get("comment")), true);
if (map.containsKey("formData") && !ObjectUtils.isEmpty(map.get("formData"))){
JgMaintenanceContract dto = new JgMaintenanceContract();
Map<String, Object> formData = (Map<String, Object>)map.get("formData");
BeanUtil.copyProperties(formData, dto);
JgMaintenanceContract result = new JgMaintenanceContract();
if (!ObjectUtils.isEmpty(dto.getMaintenanceManagerOneId())) {
result.setSequenceNbr(dto.getSequenceNbr());
//维保人员一
String[] maintenanceManagerOneInfo = dto.getMaintenanceManagerOneId().split("_");
result.setMaintenanceManagerOneId(maintenanceManagerOneInfo[0]);
result.setMaintenanceManagerOneName(maintenanceManagerOneInfo[1]);
result.setMaintenanceManagerOnePhone(dto.getMaintenanceManagerOnePhone());
//维保人员二
String[] maintenanceManagerTwoInfo = dto.getMaintenanceManagerTwoId().split("_");
result.setMaintenanceManagerTwoId(maintenanceManagerTwoInfo[0]);
result.setMaintenanceManagerTwoName(maintenanceManagerTwoInfo[1]);
result.setMaintenanceManagerTwoPhone(dto.getMaintenanceManagerTwoPhone());
}
jgMaintenanceContractServiceImpl.getBaseMapper().updateById(result);
}
return ResponseHelper.buildResponse("ok");
}
......
......@@ -91,11 +91,11 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
contractList = maintenanceContractMapper.getContractList(page, dto);
} else if (MaintenanceEnum.WEIBAO.getCode().equals(phase)) {
//维保单位用"维保单位统一信用代码"匹配数据
dto.setMaintenanceUnitCode(company.getCompanyCode()+"_"+company.getCompanyName());
dto.setMaintenanceUnitCode(company.getCompanyCode());
contractList = maintenanceContractMapper.getContractList(page, dto);
} else if (MaintenanceEnum.JIANGUAN.getCode().equals(phase)) {
//监管单位用"接收机构统一使用代码"匹配
dto.setReceiveOrgCode(company.getOrgCode());
dto.setReceiveOrgCode(company.getCompanyCode());
contractList = maintenanceContractMapper.getContractList(page, dto);
}
BeanUtils.copyProperties(contractList, result);
......@@ -110,15 +110,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
JgMaintenanceContractVo vo = new JgMaintenanceContractVo();
BeanUtils.copyProperties(dto, vo);
vo.setMaintenanceContract(ObjectUtils.isEmpty(dto.getMaintenanceContract()) ? null : JSON.parseArray(dto.getMaintenanceContract()));
vo.setMaintenanceManagerOneName(ObjectUtils.isEmpty(dto.getMaintenanceManagerOneId()) ? null : dto.getMaintenanceManagerOneId().split("_")[1]);
vo.setMaintenanceManagerTwoName(ObjectUtils.isEmpty(dto.getMaintenanceManagerTwoId()) ? null : dto.getMaintenanceManagerTwoId().split("_")[1]);
List<Map<String, Object>> list = maintenanceContractMapper.selectEquipList(sequenceNbr);
// ArrayList<EquipMessageVo> equipMessageVos = new ArrayList<>();
// list.forEach(item ->{
// EquipMessageVo equipMessageVo = new EquipMessageVo();
// BeanUtil.copyProperties(item, equipMessageVo);
// equipMessageVos.add(equipMessageVo);
// });
if (!ObjectUtils.isEmpty(list)){
vo.setEquipmentLists(list);
}
......@@ -366,7 +358,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
contract.setUseUnitName(company.getCompanyName());
//管理员信息
String[] MaintenanceManager = dto.getMaintenanceManagerId().split("_");
contract.setMaintenanceManagerId(dto.getMaintenanceManagerId());
contract.setMaintenanceManagerId(MaintenanceManager[0]);
contract.setMaintenanceManagerName(MaintenanceManager[1]);
//接收机构信息
String[] splitReceiveOrgCode = dto.getReceiveOrgCode().split("_");
......@@ -374,7 +366,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
contract.setReceiveOrgName(splitReceiveOrgCode[1]);
//维保单位信息
String[] splitMaintenanceUnitCode = dto.getMaintenanceUnitCode().split("_");
contract.setMaintenanceUnitCode(dto.getMaintenanceUnitCode());
contract.setMaintenanceUnitCode(splitMaintenanceUnitCode[0]);
contract.setMaintenanceUnitName(splitMaintenanceUnitCode[1]);
contract.setApplyStatus(FlowStatusEnum.TO_BE_SUBMITTED.getName());
......@@ -402,9 +394,14 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
jgMaintenanceContractEqService.saveBatch(equipList);
if (SUBMIT_TYPE_FLOW.equals(submit)) {
String instanceId = null;
// 提交启动流程
String instanceId = startByVariable();
if (!ObjectUtils.isEmpty(instanceId)){
if (map.containsKey("instanceId") && !ObjectUtils.isEmpty(map.get("instanceId"))) {
instanceId = String.valueOf(map.get("instanceId"));
} else {
instanceId = startByVariable();
}
if (!ObjectUtils.isEmpty(instanceId)) {
// 修改数据信息
updateExecuteIds(instanceId, contract.getSequenceNbr(), "0");
// 默认执行流程
......
......@@ -13,10 +13,12 @@ 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.entity.JgUseRegistration;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq;
import com.yeejoin.amos.boot.module.jg.api.enums.EquipTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.UseStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgUseRegistrationService;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService;
import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.OtherInfo;
......@@ -36,6 +38,8 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -65,6 +69,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private ICreateCodeService iCreateCodeService;
@Autowired
RedisUtils redisUtils;
@Autowired
TzsServiceFeignClient tzsServiceFeignClient;
public Page<Map<String, Object>> getList(JgUseRegistrationDto dto, Page<Map<String, Object>> page ,List<String> roleIds) {
Page<Map<String, Object>> listPage = this.baseMapper.getListPage(page, dto, roleIds);
return listPage;
......@@ -291,4 +297,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
return detail;
}
public String getCode(String supervisoryCode) {
if (!ObjectUtils.isEmpty(supervisoryCode) && supervisoryCode.length() > 5) {
String name = EquipTypeEnum.getMessage(supervisoryCode.substring(1, 2));
String type = supervisoryCode.substring(2, 4);
String city = supervisoryCode.substring(0, 1);
ResponseModel<String> stringResponseModel = tzsServiceFeignClient.useRegistrationCode(name + type + "陕" + city);
return stringResponseModel.getResult();
}
return null;
}
}
\ No newline at end of file
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