Commit ef1ca7ae authored by 王果's avatar 王果

维保备案列表合并接口修改

parent e6ee03af
......@@ -138,7 +138,7 @@ public class JgMaintenanceContractDto extends BaseDto {
private List<String> roleIds;
/**
*工作流下一节点任务id
* 工作流下一节点任务id
*/
@TableField(value = "next_task_id")
private String nextTaskId;
......@@ -147,4 +147,14 @@ public class JgMaintenanceContractDto extends BaseDto {
* 下一节点可执行人
*/
private String nextExecuteUserIds;
@ApiModelProperty(value = "使用单位统一信用代码-数据隔离使用")
private String useUnitCodeFilter;
@ApiModelProperty(value = "维保单位统一信用代码-数据隔离使用")
private String maintenanceUnitCodeFilter;
@ApiModelProperty(value = "接收机构统一信用代码-数据隔离使用")
private String receiveOrgCodeFilter;
}
......@@ -133,28 +133,6 @@
<if test="contractDto.useUnitName != '' and contractDto.useUnitName != null">
and use_unit_name like concat('%',#{contractDto.useUnitName},'%')
</if>
<choose>
<when test="contractDto.useUnitCode != '' and contractDto.useUnitCode != null and
contractDto.maintenanceUnitCode != '' and contractDto.maintenanceUnitCode != null">
-- 同时有使用单位和维保单位用
and (use_unit_code = #{contractDto.useUnitCode}
or maintenance_unit_code = #{contractDto.maintenanceUnitCode})
</when>
<otherwise >
-- 只有使用单位或者维保单位用,或者都没有
<if test="contractDto.useUnitCode != '' and contractDto.useUnitCode != null">
and use_unit_code = #{contractDto.useUnitCode}
</if>
<if test="contractDto.maintenanceUnitCode != '' and contractDto.maintenanceUnitCode != null">
and maintenance_unit_code = #{contractDto.maintenanceUnitCode}
</if>
</otherwise>
</choose>
-- 监管单位用
<if test="contractDto.receiveOrgCode != '' and contractDto.receiveOrgCode != null">
and receive_org_code = #{contractDto.receiveOrgCode}
</if>
<if test="contractDto.roleIds != null">
<foreach collection='contractDto.roleIds' item='role' open='and (' close=')' separator='or'>
instance_status like concat('%',#{role},'%')
......@@ -163,6 +141,38 @@
<if test="contractDto.status != '' and contractDto.status != null">
and status = #{contractDto.status}
</if>
<if test="contractDto.useUnitCode != '' and contractDto.useUnitCode != null">
and use_unit_code = #{contractDto.useUnitCode}
</if>
<if test="contractDto.maintenanceUnitCode != '' and contractDto.maintenanceUnitCode != null">
and maintenance_unit_code = #{contractDto.maintenanceUnitCode}
</if>
<if test="contractDto.receiveOrgCode != '' and contractDto.receiveOrgCode != null">
and receive_org_code = #{contractDto.receiveOrgCode}
</if>
-- 数据过滤开始 ----------------------------------------------------
<choose>
<when test="contractDto.useUnitCodeFilter != '' and contractDto.useUnitCodeFilter != null and
contractDto.maintenanceUnitCodeFilter != '' and contractDto.maintenanceUnitCodeFilter != null">
-- 同时有使用单位和维保单位用
and (use_unit_code = #{contractDto.useUnitCodeFilter}
or maintenance_unit_code = #{contractDto.maintenanceUnitCodeFilter})
</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>
order by apply_no desc
</select>
......
......@@ -16,6 +16,7 @@ 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.enums.BusinessTypeEnum;
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.JgMaintenanceContractMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
......@@ -80,6 +81,9 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
@Autowired
IJgInstallationNoticeService jrmInstallationNoticeService;
@Autowired
private CommonMapper commonMapper;
/**
* 分页查询
*/
......@@ -103,16 +107,16 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
}
if ("supervision".equals(companyLevel)) {
//监管单位用"接收机构统一使用代码"匹配
dto.setReceiveOrgCode(company.getCompanyCode());
dto.setReceiveOrgCodeFilter(company.getCompanyCode());
} else if ("company".equals(companyLevel)) {
if (companyType.contains("use")) {
//使用单位用"使用单位统一信用代码"匹配数据
dto.setUseUnitCode(company.getCompanyCode());
dto.setUseUnitCodeFilter(company.getCompanyCode());
dto.setRoleIds(null);
}
if (companyType.contains("construction")) {
//维保单位用"维保单位统一信用代码"匹配数据
dto.setMaintenanceUnitCode(company.getCompanyCode());
dto.setMaintenanceUnitCodeFilter(company.getCompanyCode());
}
}
contractList = maintenanceContractMapper.getContractList(page, dto);
......@@ -161,8 +165,8 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
public void flowExecute(Long id, String instanceId, String operate, String comment, Boolean update) {
try {
JgMaintenanceContract jgMaintenanceContract = this.getBaseMapper().selectById(id);
String taskId = jgMaintenanceContract.getNextTaskId();
JgMaintenanceContract contract = this.getBaseMapper().selectById(id);
String taskId = contract.getNextTaskId();
//组装信息
TaskResultDTO dto = new TaskResultDTO();
dto.setResultCode("approvalStatus");
......@@ -170,7 +174,8 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
dto.setComment(comment);
HashMap<String, Object> map = new HashMap<>();
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", "提交");
}
dto.setVariable(map);
......@@ -180,7 +185,6 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
} catch (Exception e) {
e.printStackTrace();
}
}
/**
......@@ -378,7 +382,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
}
} else {
// 有InstanceId,执行一步
ProcessTaskDTO processTaskDTO = this.submit("0", contract.getNextTaskId());
ProcessTaskDTO processTaskDTO = this.submit("0", contract);
String nextTaskId = processTaskDTO.getNextTask().get(0).getId();
String taskName = processTaskDTO.getNextTask().get(0).getName();
this.buildRoleList(Collections.singletonList(processTaskDTO), roleListNext, roleListAll);
......@@ -402,16 +406,16 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
return true;
}
public ProcessTaskDTO submit(String op, String taskId) {
public ProcessTaskDTO submit(String op, JgMaintenanceContract contract) {
//组装信息
TaskResultDTO dto = new TaskResultDTO();
dto.setResultCode("approvalStatus");
dto.setTaskId(taskId);
dto.setTaskId(contract.getNextTaskId());
dto.setComment("提交流程");
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", op);
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) {
......
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