Commit 6365f8e7 authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register
parents d4e48a65 25029b75
...@@ -138,7 +138,7 @@ public class JgMaintenanceContractDto extends BaseDto { ...@@ -138,7 +138,7 @@ public class JgMaintenanceContractDto extends BaseDto {
private List<String> roleIds; private List<String> roleIds;
/** /**
*工作流下一节点任务id * 工作流下一节点任务id
*/ */
@TableField(value = "next_task_id") @TableField(value = "next_task_id")
private String nextTaskId; private String nextTaskId;
...@@ -147,4 +147,14 @@ public class JgMaintenanceContractDto extends BaseDto { ...@@ -147,4 +147,14 @@ public class JgMaintenanceContractDto extends BaseDto {
* 下一节点可执行人 * 下一节点可执行人
*/ */
private String nextExecuteUserIds; private String nextExecuteUserIds;
@ApiModelProperty(value = "使用单位统一信用代码-数据隔离使用")
private String useUnitCodeFilter;
@ApiModelProperty(value = "维保单位统一信用代码-数据隔离使用")
private String maintenanceUnitCodeFilter;
@ApiModelProperty(value = "接收机构统一信用代码-数据隔离使用")
private String receiveOrgCodeFilter;
} }
...@@ -44,10 +44,13 @@ ...@@ -44,10 +44,13 @@
<if test="dto.equCode != null and dto.equCode != ''"> <if test="dto.equCode != null and dto.equCode != ''">
and jri.EQU_CODE like concat('%',#{dto.equCode},'%') and jri.EQU_CODE like concat('%',#{dto.equCode},'%')
</if> </if>
<if test="dto.useUnitName != null and dto.useUnitName != ''"> <if test="dto.useUnitCreditCode != null and dto.useUnitCreditCode != ''">
and crt.use_unit_name like concat('%',#{dto.useUnitName},'%') and crt.use_unit_credit_code = #{dto.useUnitCreditCode}
</if> </if>
<if test="roleIds != null and dto.dataType == 'jg'"> <if test="dto.receiveOrgCode != null and dto.receiveOrgCode != ''">
and crt.receive_company_code = #{dto.receiveOrgCode}
</if>
<if test="roleIds != null and type == 'supervision'">
<foreach collection='roleIds' item='role' open='and (' close=')' separator='or'> <foreach collection='roleIds' item='role' open='and (' close=')' separator='or'>
crt.execute_sequence like concat('%',#{role},'%') crt.execute_sequence like concat('%',#{role},'%')
</foreach> </foreach>
......
...@@ -133,6 +133,14 @@ ...@@ -133,6 +133,14 @@
<if test="contractDto.useUnitName != '' and contractDto.useUnitName != null"> <if test="contractDto.useUnitName != '' and contractDto.useUnitName != null">
and use_unit_name like concat('%',#{contractDto.useUnitName},'%') and use_unit_name like concat('%',#{contractDto.useUnitName},'%')
</if> </if>
<if test="contractDto.roleIds != null">
<foreach collection='contractDto.roleIds' item='role' open='and (' close=')' separator='or'>
instance_status like concat('%',#{role},'%')
</foreach>
</if>
<if test="contractDto.status != '' and contractDto.status != null">
and status = #{contractDto.status}
</if>
<if test="contractDto.useUnitCode != '' and contractDto.useUnitCode != null"> <if test="contractDto.useUnitCode != '' and contractDto.useUnitCode != null">
and use_unit_code = #{contractDto.useUnitCode} and use_unit_code = #{contractDto.useUnitCode}
</if> </if>
...@@ -142,14 +150,29 @@ ...@@ -142,14 +150,29 @@
<if test="contractDto.receiveOrgCode != '' and contractDto.receiveOrgCode != null"> <if test="contractDto.receiveOrgCode != '' and contractDto.receiveOrgCode != null">
and receive_org_code = #{contractDto.receiveOrgCode} and receive_org_code = #{contractDto.receiveOrgCode}
</if> </if>
<if test="contractDto.roleIds != null"> -- 数据过滤开始 ----------------------------------------------------
<foreach collection='contractDto.roleIds' item='role' open='and (' close=')' separator='or'> <choose>
instance_status like concat('%',#{role},'%') <when test="contractDto.useUnitCodeFilter != '' and contractDto.useUnitCodeFilter != null and
</foreach> contractDto.maintenanceUnitCodeFilter != '' and contractDto.maintenanceUnitCodeFilter != null">
</if> -- 同时有使用单位和维保单位用
<if test="contractDto.status != '' and contractDto.status != null"> and (use_unit_code = #{contractDto.useUnitCodeFilter}
and status = #{contractDto.status} or maintenance_unit_code = #{contractDto.maintenanceUnitCodeFilter})
</if> </when>
<otherwise >
-- 只有使用单位或者维保单位用,或者都没有
<if test="contractDto.useUnitCodeFilter != '' and contractDto.useUnitCodeFilter != null">
and use_unit_code = #{contractDto.useUnitCodeFilter}
</if>
<if test="contractDto.maintenanceUnitCodeFilter != '' and contractDto.maintenanceUnitCodeFilter != null">
and maintenance_unit_code = #{contractDto.maintenanceUnitCodeFilter}
</if>
</otherwise>
</choose>
-- 监管单位用
<if test="contractDto.receiveOrgCodeFilter != '' and contractDto.receiveOrgCodeFilter != null">
and receive_org_code = #{contractDto.receiveOrgCodeFilter}
</if>
-- 数据过滤结束 ----------------------------------------------------
</where> </where>
order by apply_no desc order by apply_no desc
</select> </select>
......
...@@ -170,13 +170,12 @@ public class JgMaintenanceContractController extends BaseController { ...@@ -170,13 +170,12 @@ public class JgMaintenanceContractController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "维保合同备案分页查询", notes = "分页查询维保合同备案") @ApiOperation(httpMethod = "GET", value = "维保合同备案分页查询", notes = "分页查询维保合同备案")
public ResponseModel<Page<JgMaintenanceContractVo>> queryForPage(@RequestParam(value = "current") int current, public ResponseModel<Page<JgMaintenanceContractVo>> queryForPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, @RequestParam(value = "size") int size,
@RequestParam(value = "phase") int phase,
Map<String,Object> map) { Map<String,Object> map) {
Page<JgMaintenanceContract> page = new Page<>(); Page<JgMaintenanceContract> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
Page<JgMaintenanceContractVo> contractDtoPage = jgMaintenanceContractServiceImpl.queryForPage(page, phase, map, reginParams); Page<JgMaintenanceContractVo> contractDtoPage = jgMaintenanceContractServiceImpl.queryForPage(page, map, reginParams);
return ResponseHelper.buildResponse(contractDtoPage); return ResponseHelper.buildResponse(contractDtoPage);
} }
......
...@@ -118,6 +118,8 @@ public class CommonServiceImpl implements ICommonService { ...@@ -118,6 +118,8 @@ public class CommonServiceImpl implements ICommonService {
private static final String basic = "basic"; private static final String basic = "basic";
// 业务通用发起——告知单详情 // 业务通用发起——告知单详情
private static final String notice = "notice"; private static final String notice = "notice";
// 业务通用发起——技术参数-改造变更登记使用
private static final String techInfo = "techInfo";
// 业务通用发起——安装告知表单key // 业务通用发起——安装告知表单key
private static final String AZGZ_FORM_ID = "1734141426742095873"; private static final String AZGZ_FORM_ID = "1734141426742095873";
// 业务通用发起——移装变更表单key // 业务通用发起——移装变更表单key
...@@ -529,6 +531,7 @@ public class CommonServiceImpl implements ICommonService { ...@@ -529,6 +531,7 @@ public class CommonServiceImpl implements ICommonService {
public void invokeBusinessProcess(String submitType, Map<String, Object> map, ReginParams reginParams) { public void invokeBusinessProcess(String submitType, Map<String, Object> map, ReginParams reginParams) {
Map<String, Object> basicObj = (Map<String, Object>) map.get(basic); Map<String, Object> basicObj = (Map<String, Object>) map.get(basic);
Map<String, Object> noticeObj = (Map<String, Object>) map.get(notice); Map<String, Object> noticeObj = (Map<String, Object>) map.get(notice);
Map<String, Object> techInfoObj = (Map<String, Object>) map.get(techInfo);
Map<String, Object> provideMap = new HashMap<>(); Map<String, Object> provideMap = new HashMap<>();
String type = (String) basicObj.get("type"); String type = (String) basicObj.get("type");
...@@ -573,6 +576,7 @@ public class CommonServiceImpl implements ICommonService { ...@@ -573,6 +576,7 @@ public class CommonServiceImpl implements ICommonService {
noticeObj.put("submit", "true"); noticeObj.put("submit", "true");
} }
noticeObj.put("receiveCompanyCode", !ObjectUtils.isEmpty(basicObj.get("receiveOrgCreditCode")) ? String.valueOf(basicObj.get("receiveOrgCreditCode")) : String.valueOf(basicObj.get("receiveOrgCreditCode1"))); noticeObj.put("receiveCompanyCode", !ObjectUtils.isEmpty(basicObj.get("receiveOrgCreditCode")) ? String.valueOf(basicObj.get("receiveOrgCreditCode")) : String.valueOf(basicObj.get("receiveOrgCreditCode1")));
noticeObj.put("techInfo",techInfoObj);
JSONObject jsonObject = new JSONObject(noticeObj); JSONObject jsonObject = new JSONObject(noticeObj);
jgChangeRegistrationReformServiceImpl.save(jsonObject); jgChangeRegistrationReformServiceImpl.save(jsonObject);
} else if (type.equals(ApplicationFormTypeEnum.YZBG.getBusinessCode())) { } else if (type.equals(ApplicationFormTypeEnum.YZBG.getBusinessCode())) {
......
...@@ -89,6 +89,9 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -89,6 +89,9 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
@Autowired @Autowired
private JgChangeRegistrationNameEqMapper jgChangeRegistrationNameEqMapper; private JgChangeRegistrationNameEqMapper jgChangeRegistrationNameEqMapper;
@Autowired
private CommonMapper commonMapper;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -205,7 +208,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -205,7 +208,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
jgChangeRegistrationReform.setCreateUserId(reginParams.getUserModel().getUserId()); jgChangeRegistrationReform.setCreateUserId(reginParams.getUserModel().getUserId());
jgChangeRegistrationReform.setCreateUserName(reginParams.getUserModel().getRealName()); jgChangeRegistrationReform.setCreateUserName(reginParams.getUserModel().getRealName());
jgChangeRegistrationReform.setCreateUserCompanyName(reginParams.getCompany().getCompanyName()); jgChangeRegistrationReform.setCreateUserCompanyName(reginParams.getCompany().getCompanyName());
ProcessTaskDTO processTaskDTO = startByVariable(); ProcessTaskDTO processTaskDTO = startByVariable(jgChangeRegistrationReform);
updateExecuteIds(instanceId, jgChangeRegistrationReform, "startWorkfow", processTaskDTO); updateExecuteIds(instanceId, jgChangeRegistrationReform, "startWorkfow", processTaskDTO);
List<TaskModelDto> taskModelDtoList = Arrays.asList(getTaskModelDtoList(jgChangeRegistrationReform, processTaskDTO)); List<TaskModelDto> taskModelDtoList = Arrays.asList(getTaskModelDtoList(jgChangeRegistrationReform, processTaskDTO));
commonServiceImpl.buildTaskModel(taskModelDtoList); commonServiceImpl.buildTaskModel(taskModelDtoList);
...@@ -220,7 +223,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -220,7 +223,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
} }
} }
public ProcessTaskDTO startByVariable() { public ProcessTaskDTO startByVariable(JgChangeRegistrationReform jgChangeRegistrationReform) {
ProcessTaskDTO processTaskDTO = new ProcessTaskDTO(); ProcessTaskDTO processTaskDTO = new ProcessTaskDTO();
//启动流程 //启动流程
try { try {
...@@ -228,6 +231,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -228,6 +231,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
dto.setProcessDefinitionKey("renovationRegistrationReviewNew"); dto.setProcessDefinitionKey("renovationRegistrationReviewNew");
dto.setBusinessKey("submit"); dto.setBusinessKey("submit");
dto.setCompleteFirstTask(Boolean.TRUE); dto.setCompleteFirstTask(Boolean.TRUE);
dto.setNextExecuteUserCompanyCode(commonMapper.getOrgCodeByCompanyCode(jgChangeRegistrationReform.getReceiveOrgCode()));
List<ActWorkflowStartDTO> actWorkflowStartDTOList = Arrays.asList(dto); List<ActWorkflowStartDTO> actWorkflowStartDTOList = Arrays.asList(dto);
ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO(); ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO();
actWorkflowBatchDTO.setProcess(actWorkflowStartDTOList); actWorkflowBatchDTO.setProcess(actWorkflowStartDTOList);
...@@ -342,6 +346,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -342,6 +346,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
map.put("approvalStatus", "提交"); map.put("approvalStatus", "提交");
} }
dto.setVariable(map); dto.setVariable(map);
dto.setNextExecuteUserCompanyCode(commonMapper.getOrgCodeByCompanyCode(jgChangeRegistrationReform.getReceiveOrgCode()));
//执行流程 //执行流程
processTaskDTO = iCmWorkflowService.complete(taskId, dto); processTaskDTO = iCmWorkflowService.complete(taskId, dto);
} catch (Exception e) { } catch (Exception e) {
...@@ -407,7 +412,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -407,7 +412,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
Map<String, Object> originalData = new HashMap<>(); Map<String, Object> originalData = new HashMap<>();
if ((detail.get("status").equals("已完成") || detail.get("status").equals("流程结束"))) { if ((detail.get("status").equals("已完成") || detail.get("status").equals("流程结束"))) {
originalData = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(equipId); originalData = idxBizJgRegisterInfoService.getDetailByRecord(equipId);
originalData.remove("sequenceNbr"); originalData.remove("sequenceNbr");
if (!ObjectUtils.isEmpty(detail.get("transformationQualityCertificate"))) { if (!ObjectUtils.isEmpty(detail.get("transformationQualityCertificate"))) {
detail.put("transformationQualityCertificate", JSONObject.parse(detail.get("transformationQualityCertificate").toString())); detail.put("transformationQualityCertificate", JSONObject.parse(detail.get("transformationQualityCertificate").toString()));
...@@ -464,7 +469,9 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR ...@@ -464,7 +469,9 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
//当前数据 //当前数据
String newData = jgRegistrationHistory.getChangeData(); String newData = jgRegistrationHistory.getChangeData();
//将历史数据更新到技术参数表中 //将历史数据更新到技术参数表中
IdxBizJgTechParamsElevator idxBizJgTechParamsElevatorNew = JSONObject.parseObject(newData, IdxBizJgTechParamsElevator.class); JSONObject allData = JSONObject.parseObject(newData);
Map<String,Object> techInfo = (Map<String, Object>) allData.get("techInfo");
IdxBizJgTechParamsElevator idxBizJgTechParamsElevatorNew = JSONObject.parseObject(JSONObject.toJSONString(techInfo), IdxBizJgTechParamsElevator.class);
BeanUtil.copyProperties(idxBizJgTechParamsElevatorNew, idxBizJgTechParamsElevator, "sequenceNbr", "record"); BeanUtil.copyProperties(idxBizJgTechParamsElevatorNew, idxBizJgTechParamsElevator, "sequenceNbr", "record");
idxBizJgTechParamsElevatorMapper.updateById(idxBizJgTechParamsElevator); idxBizJgTechParamsElevatorMapper.updateById(idxBizJgTechParamsElevator);
//将历史数据回填到历史记录表中 //将历史数据回填到历史记录表中
......
...@@ -319,13 +319,6 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -319,13 +319,6 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
TaskV2Model taskV2Model = new TaskV2Model(); TaskV2Model taskV2Model = new TaskV2Model();
if ("0".equals(operate)) { if ("0".equals(operate)) {
if (StringUtils.isEmpty(workflowResultDto.getNextExecutorRoleIds())) { if (StringUtils.isEmpty(workflowResultDto.getNextExecutorRoleIds())) {
LambdaQueryWrapper<JgEnableDisableEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgEnableDisableEq::getEnableDisableApplyId, id);
JgEnableDisableEq jgEnableDisableEq = jgEnableDisableEqMapper.selectOne(queryWrapper);
LambdaQueryWrapper<RegistrationInfo> queryWrapper2 = new LambdaQueryWrapper<>();
queryWrapper2.eq(RegistrationInfo::getRecord, jgEnableDisableEq.getEquId());
RegistrationInfo tzsJgRegistrationInfo = tzsJgRegistrationInfoMapper.selectOne(queryWrapper2);
jgEnableDisable.setPromoter(""); jgEnableDisable.setPromoter("");
jgEnableDisable.setAuditStatus(String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getName())); jgEnableDisable.setAuditStatus(String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getName()));
// 上个代办改为已办 // 上个代办改为已办
...@@ -336,7 +329,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -336,7 +329,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
taskMap.put("flowStatus", FlowStatusEnum.TO_BE_FINISHED.getCode()); taskMap.put("flowStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
taskMap.put("flowStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName()); taskMap.put("flowStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
taskMap.put("model", jgEnableDisable); taskMap.put("model", jgEnableDisable);
taskV2Model = commonService.updateTaskModel(taskMap); commonService.updateTaskModel(taskMap);
} else { } else {
jgEnableDisable.setNextExecutorIds(workflowResultDto.getNextExecutorRoleIds()); jgEnableDisable.setNextExecutorIds(workflowResultDto.getNextExecutorRoleIds());
if (!ObjectUtils.isEmpty(jgEnableDisable.getExecuteSequence())) { if (!ObjectUtils.isEmpty(jgEnableDisable.getExecuteSequence())) {
...@@ -414,11 +407,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -414,11 +407,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
workDto.setResultCode("approvalStatus"); workDto.setResultCode("approvalStatus");
workDto.setTaskId(jgEnableDisable.getNextTaskId()); workDto.setTaskId(jgEnableDisable.getNextTaskId());
HashMap<String, Object> commMap = new HashMap<>(); HashMap<String, Object> commMap = new HashMap<>();
if (jgEnableDisable.getAuditStatus().equals("已驳回") || jgEnableDisable.getAuditStatus().equals("已撤回")) { commMap.put("approvalStatus", op);
commMap.put("approvalStatus", "提交");
} else {
commMap.put("approvalStatus", op);
}
workDto.setVariable(commMap); workDto.setVariable(commMap);
workDto.setComment(opinion); workDto.setComment(opinion);
processTaskDTO = iCmWorkflowService.complete(jgEnableDisable.getNextTaskId(), workDto); processTaskDTO = iCmWorkflowService.complete(jgEnableDisable.getNextTaskId(), workDto);
......
...@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.dto.JgMaintenanceContractDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgMaintenanceContractDto;
import com.yeejoin.amos.boot.module.jg.api.dto.TaskModelDto; import com.yeejoin.amos.boot.module.jg.api.dto.TaskModelDto;
...@@ -16,10 +15,11 @@ import com.yeejoin.amos.boot.module.jg.api.dto.WorkflowResultDto; ...@@ -16,10 +15,11 @@ import com.yeejoin.amos.boot.module.jg.api.dto.WorkflowResultDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContract; import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContract;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContractEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContractEq;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.MaintenanceEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum; import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintenanceContractEqMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintenanceContractEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintenanceContractMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintenanceContractMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
import com.yeejoin.amos.boot.module.jg.api.service.IJgMaintenanceContractService; import com.yeejoin.amos.boot.module.jg.api.service.IJgMaintenanceContractService;
import com.yeejoin.amos.boot.module.jg.api.vo.JgMaintenanceContractVo; import com.yeejoin.amos.boot.module.jg.api.vo.JgMaintenanceContractVo;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient; import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
...@@ -78,10 +78,16 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -78,10 +78,16 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
@Autowired @Autowired
CommonServiceImpl commonService; CommonServiceImpl commonService;
@Autowired
IJgInstallationNoticeService jrmInstallationNoticeService;
@Autowired
private CommonMapper commonMapper;
/** /**
* 分页查询 * 分页查询
*/ */
public Page<JgMaintenanceContractVo> queryForPage(Page<JgMaintenanceContract> page, int phase, public Page<JgMaintenanceContractVo> queryForPage(Page<JgMaintenanceContract> page,
Map<String, Object> map, ReginParams reginParams) { Map<String, Object> map, ReginParams reginParams) {
JgMaintenanceContractDto dto = new JgMaintenanceContractDto(); JgMaintenanceContractDto dto = new JgMaintenanceContractDto();
if (map.containsKey("jgMaintenanceContractDto")) { if (map.containsKey("jgMaintenanceContractDto")) {
...@@ -90,20 +96,44 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -90,20 +96,44 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
Page<JgMaintenanceContractDto> contractList = new Page<>(); Page<JgMaintenanceContractDto> contractList = new Page<>();
Page<JgMaintenanceContractVo> result = new Page<>(); Page<JgMaintenanceContractVo> result = new Page<>();
CompanyBo company = reginParams.getCompany(); CompanyBo company = reginParams.getCompany();
if (MaintenanceEnum.SHIYONG.getCode().equals(phase)) { Map<String, Object> companyTypeMap = jrmInstallationNoticeService.getCompanyType();
//使用单位用"使用单位统一信用代码"匹配数据 String companyLevel = "";
dto.setUseUnitCode(company.getCompanyCode()); String companyType = "";
dto.setRoleIds(null); if (companyTypeMap.containsKey("companyLevel")) {
contractList = maintenanceContractMapper.getContractList(page, dto); companyLevel = companyTypeMap.get("companyLevel").toString();
} else if (MaintenanceEnum.WEIBAO.getCode().equals(phase)) { }
//维保单位用"维保单位统一信用代码"匹配数据 if (companyTypeMap.containsKey("companyType")) {
dto.setMaintenanceUnitCode(company.getCompanyCode()); companyType = companyTypeMap.get("companyType").toString();
contractList = maintenanceContractMapper.getContractList(page, dto); }
} else if (MaintenanceEnum.JIANGUAN.getCode().equals(phase)) { if ("supervision".equals(companyLevel)) {
//监管单位用"接收机构统一使用代码"匹配 //监管单位用"接收机构统一使用代码"匹配
dto.setReceiveOrgCode(company.getCompanyCode()); dto.setReceiveOrgCodeFilter(company.getCompanyCode());
contractList = maintenanceContractMapper.getContractList(page, dto); } else if ("company".equals(companyLevel)) {
if (companyType.contains("use")) {
//使用单位用"使用单位统一信用代码"匹配数据
dto.setUseUnitCodeFilter(company.getCompanyCode());
dto.setRoleIds(null);
}
if (companyType.contains("construction")) {
//维保单位用"维保单位统一信用代码"匹配数据
dto.setMaintenanceUnitCodeFilter(company.getCompanyCode());
}
} }
contractList = maintenanceContractMapper.getContractList(page, dto);
// if (MaintenanceEnum.SHIYONG.getCode().equals(phase)) {
// //使用单位用"使用单位统一信用代码"匹配数据
// dto.setUseUnitCode(company.getCompanyCode());
// dto.setRoleIds(null);
// contractList = maintenanceContractMapper.getContractList(page, dto);
// } else if (MaintenanceEnum.WEIBAO.getCode().equals(phase)) {
// //维保单位用"维保单位统一信用代码"匹配数据
// dto.setMaintenanceUnitCode(company.getCompanyCode());
// contractList = maintenanceContractMapper.getContractList(page, dto);
// } else if (MaintenanceEnum.JIANGUAN.getCode().equals(phase)) {
// //监管单位用"接收机构统一使用代码"匹配
// dto.setReceiveOrgCode(company.getCompanyCode());
// contractList = maintenanceContractMapper.getContractList(page, dto);
// }
BeanUtils.copyProperties(contractList, result); BeanUtils.copyProperties(contractList, result);
return result; return result;
} }
...@@ -135,8 +165,8 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -135,8 +165,8 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
public void flowExecute(Long id, String instanceId, String operate, String comment, Boolean update) { public void flowExecute(Long id, String instanceId, String operate, String comment, Boolean update) {
try { try {
JgMaintenanceContract jgMaintenanceContract = this.getBaseMapper().selectById(id); JgMaintenanceContract contract = this.getBaseMapper().selectById(id);
String taskId = jgMaintenanceContract.getNextTaskId(); String taskId = contract.getNextTaskId();
//组装信息 //组装信息
TaskResultDTO dto = new TaskResultDTO(); TaskResultDTO dto = new TaskResultDTO();
dto.setResultCode("approvalStatus"); dto.setResultCode("approvalStatus");
...@@ -144,7 +174,8 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -144,7 +174,8 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
dto.setComment(comment); dto.setComment(comment);
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", operate); map.put("approvalStatus", operate);
if (WorkFlowStatusEnum.MAIN_SUBMIT.getReject().equals(jgMaintenanceContract.getStatus()) || WorkFlowStatusEnum.MAIN_SUBMIT.getRollBack().equals(jgMaintenanceContract.getStatus())) { if (WorkFlowStatusEnum.MAIN_SUBMIT.getReject().equals(contract.getStatus()) ||
WorkFlowStatusEnum.MAIN_SUBMIT.getRollBack().equals(contract.getStatus())) {
map.put("approvalStatus", "提交"); map.put("approvalStatus", "提交");
} }
dto.setVariable(map); dto.setVariable(map);
...@@ -154,7 +185,6 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -154,7 +185,6 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
/** /**
...@@ -352,7 +382,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -352,7 +382,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
} }
} else { } else {
// 有InstanceId,执行一步 // 有InstanceId,执行一步
ProcessTaskDTO processTaskDTO = this.submit("0", contract.getNextTaskId()); ProcessTaskDTO processTaskDTO = this.submit("0", contract);
String nextTaskId = processTaskDTO.getNextTask().get(0).getId(); String nextTaskId = processTaskDTO.getNextTask().get(0).getId();
String taskName = processTaskDTO.getNextTask().get(0).getName(); String taskName = processTaskDTO.getNextTask().get(0).getName();
this.buildRoleList(Collections.singletonList(processTaskDTO), roleListNext, roleListAll); this.buildRoleList(Collections.singletonList(processTaskDTO), roleListNext, roleListAll);
...@@ -376,16 +406,16 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -376,16 +406,16 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
return true; return true;
} }
public ProcessTaskDTO submit(String op, String taskId) { public ProcessTaskDTO submit(String op, JgMaintenanceContract contract) {
//组装信息 //组装信息
TaskResultDTO dto = new TaskResultDTO(); TaskResultDTO dto = new TaskResultDTO();
dto.setResultCode("approvalStatus"); dto.setResultCode("approvalStatus");
dto.setTaskId(taskId); dto.setTaskId(contract.getNextTaskId());
dto.setComment("提交流程"); dto.setComment("提交流程");
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", op); map.put("approvalStatus", op);
dto.setVariable(map); dto.setVariable(map);
return workflowService.complete(taskId, dto); return workflowService.complete(contract.getNextTaskId(), dto);
} }
private void buildRoleList(List<ProcessTaskDTO> processTasks, List<String> roleListNext, List<String> roleListAll) { private void buildRoleList(List<ProcessTaskDTO> processTasks, List<String> roleListNext, List<String> roleListAll) {
......
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