fix(企标稽查计划): 业务表查询
This commit is contained in:
+1
-1
@@ -171,7 +171,7 @@ public class ProcessEsInspectPlanController extends JeroController<ProcessEsInsp
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/importExcel")
|
||||
public Result<List<ProcessEsInspectPlan>> importExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
public Result<ProcessEsInspectPlan> importExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
return processEsInspectPlanService.importExcel(request, response);
|
||||
}
|
||||
|
||||
|
||||
+5
@@ -85,8 +85,13 @@ public class ProcessEsInspectPlan extends BaseEntity {
|
||||
@Excel(name = "备注", width = 15)
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
/**意见*/
|
||||
@ApiModelProperty(value = "意见")
|
||||
@TableField(exist = false)
|
||||
private List<ProcessEsInspectPlanOpinion> processEsInspectPlanOpinionList;
|
||||
/**节点id*/
|
||||
@ApiModelProperty(value = "节点id")
|
||||
@TableField(exist = false)
|
||||
private String nodeId;
|
||||
}
|
||||
|
||||
+1
-1
@@ -93,5 +93,5 @@ public interface IProcessEsInspectPlanService extends IService<ProcessEsInspectP
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
Result<List<ProcessEsInspectPlan>> importExcel(HttpServletRequest request, HttpServletResponse response) throws Exception;
|
||||
Result<ProcessEsInspectPlan> importExcel(HttpServletRequest request, HttpServletResponse response) throws Exception;
|
||||
}
|
||||
|
||||
+51
-10
@@ -24,6 +24,10 @@ import com.jero.modules.activiti.service.ProcessApprovalRecordService;
|
||||
import com.jero.modules.activiti.service.ProcessNodeLinkService;
|
||||
import com.jero.modules.activiti.service.ProcessNodeService;
|
||||
import com.jero.modules.laws.common.constant.MessageTemplateCodeCommon;
|
||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardInspect;
|
||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardInspectObject;
|
||||
import com.jero.modules.laws.enterprise.service.EnterpriseStandardInspectObjectService;
|
||||
import com.jero.modules.laws.enterprise.service.EnterpriseStandardInspectService;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -60,7 +64,8 @@ public class EsInspectPlanFlowServiceImpl implements IEsInspectPlanFlowService {
|
||||
private final ProcessNodeService processNodeService;
|
||||
private final ProcessNodeLinkService processNodeLinkService;
|
||||
private final SendMessageAPI sendMessageAPI;
|
||||
|
||||
private final EnterpriseStandardInspectService enterpriseStandardInspectService;
|
||||
private final EnterpriseStandardInspectObjectService enterpriseStandardInspectObjectService;
|
||||
public EsInspectPlanFlowServiceImpl(ProcessAllService processAllService,
|
||||
ProcessApprovalRecordService processApprovalRecordService,
|
||||
ProcessDraftService processDraftService,
|
||||
@@ -69,7 +74,9 @@ public class EsInspectPlanFlowServiceImpl implements IEsInspectPlanFlowService {
|
||||
ISysUserService sysUserService,
|
||||
ProcessNodeService processNodeService,
|
||||
ProcessNodeLinkService processNodeLinkService,
|
||||
SendMessageAPI sendMessageAPI) {
|
||||
SendMessageAPI sendMessageAPI,
|
||||
EnterpriseStandardInspectService enterpriseStandardInspectService,
|
||||
EnterpriseStandardInspectObjectService enterpriseStandardInspectObjectService) {
|
||||
this.processAllService = processAllService;
|
||||
this.processApprovalRecordService = processApprovalRecordService;
|
||||
this.processDraftService = processDraftService;
|
||||
@@ -79,6 +86,8 @@ public class EsInspectPlanFlowServiceImpl implements IEsInspectPlanFlowService {
|
||||
this.processNodeService = processNodeService;
|
||||
this.processNodeLinkService = processNodeLinkService;
|
||||
this.sendMessageAPI = sendMessageAPI;
|
||||
this.enterpriseStandardInspectService = enterpriseStandardInspectService;
|
||||
this.enterpriseStandardInspectObjectService = enterpriseStandardInspectObjectService;
|
||||
}
|
||||
|
||||
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
|
||||
@@ -91,7 +100,7 @@ public class EsInspectPlanFlowServiceImpl implements IEsInspectPlanFlowService {
|
||||
// 流程信息
|
||||
ProcessAll processAll = esInspectPlanFlowVO.getProcessAll();
|
||||
// 企标稽查计划业务表
|
||||
List<ProcessEsInspectPlan> processEsInspectPlanList = esInspectPlanFlowVO.getProcessEsInspectPlanList();
|
||||
// List<ProcessEsInspectPlan> processEsInspectPlanList = esInspectPlanFlowVO.getProcessEsInspectPlanList();
|
||||
// 流程审批信息
|
||||
ProcessApprovalRecord processApprovalRecord = esInspectPlanFlowVO.getProcessApprovalRecord();
|
||||
// map(参数)
|
||||
@@ -105,15 +114,15 @@ public class EsInspectPlanFlowServiceImpl implements IEsInspectPlanFlowService {
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
processAll.setPrcType(Integer.valueOf(ProcessType.ES_INSPECT_PLAN.getValue()));
|
||||
processAll.setCreateUserId(loginUser.getId());
|
||||
processAllService.update(
|
||||
processAllService.update(processAll,
|
||||
new LambdaUpdateWrapper<ProcessAll>()
|
||||
.eq(ProcessAll::getProcessInstanceId, processInstance.getId()));
|
||||
|
||||
// 更新企标稽查计划业务表
|
||||
for (ProcessEsInspectPlan processEsInspectPlan : processEsInspectPlanList) {
|
||||
processEsInspectPlan.setProjectId(processAll.getProjectId());
|
||||
}
|
||||
processEsInspectPlanService.saveOrUpdateBatch(processEsInspectPlanList);
|
||||
// for (ProcessEsInspectPlan processEsInspectPlan : processEsInspectPlanList) {
|
||||
// processEsInspectPlan.setProjectId(processAll.getProjectId());
|
||||
// }
|
||||
// processEsInspectPlanService.saveOrUpdateBatch(processEsInspectPlanList);
|
||||
|
||||
// 根据流程实例id查询
|
||||
Task task = taskService.createTaskQuery()
|
||||
@@ -246,8 +255,10 @@ public class EsInspectPlanFlowServiceImpl implements IEsInspectPlanFlowService {
|
||||
}
|
||||
|
||||
// 企标稽查计划业务表
|
||||
List<ProcessEsInspectPlan> processEsInspectPlanList = processEsInspectPlanService.list(new LambdaQueryWrapper<ProcessEsInspectPlan>()
|
||||
.eq(ProcessEsInspectPlan::getProjectId, projectId));
|
||||
List<ProcessEsInspectPlan> processEsInspectPlanList = processEsInspectPlanService.list(
|
||||
new LambdaQueryWrapper<ProcessEsInspectPlan>()
|
||||
.eq(ProcessEsInspectPlan::getProjectId, projectId)
|
||||
.eq(StringUtils.isNotBlank(taskId), ProcessEsInspectPlan::getObjectOfConsultation, loginUser.getId()));
|
||||
|
||||
esInspectPlanFlowVO.setProcessEsInspectPlanList(processEsInspectPlanList);
|
||||
esInspectPlanFlowVO.setProcessAll(processAll);
|
||||
@@ -319,6 +330,8 @@ public class EsInspectPlanFlowServiceImpl implements IEsInspectPlanFlowService {
|
||||
// 判断是否是最后一个节点
|
||||
if (isLastNode(processAll.getProcessInstanceId())
|
||||
&& map.containsKey("pass") && (boolean) map.get("pass")){
|
||||
// 企标稽查计划 生成数据 保存企标库
|
||||
saveDataToInspect(processAll.getProjectId());
|
||||
// 抄送消息 通过hiwork 给稽查联络人抄送消息
|
||||
List<ProcessNode> processNodeList = queryPersonInfo(EsInspectPlanCommon.NAME, processAll.getProcessInstanceId());
|
||||
if (!processNodeList.isEmpty()){
|
||||
@@ -339,6 +352,34 @@ public class EsInspectPlanFlowServiceImpl implements IEsInspectPlanFlowService {
|
||||
}
|
||||
}
|
||||
|
||||
private void saveDataToInspect(String projectId) {
|
||||
// 企标稽查计划业务表数据
|
||||
List<ProcessEsInspectPlan> processEsInspectPlanList = processEsInspectPlanService.list(
|
||||
new LambdaQueryWrapper<ProcessEsInspectPlan>()
|
||||
.eq(ProcessEsInspectPlan::getProjectId, projectId));
|
||||
|
||||
List<EnterpriseStandardInspect> list = new ArrayList<>();
|
||||
List<EnterpriseStandardInspectObject> objectList = new ArrayList<>();
|
||||
for (ProcessEsInspectPlan processEsInspectPlan : processEsInspectPlanList) {
|
||||
EnterpriseStandardInspect enterpriseStandardInspect = new EnterpriseStandardInspect();
|
||||
// 属性拷贝
|
||||
BeanUtils.copyProperties(processEsInspectPlan, enterpriseStandardInspect);
|
||||
// 计划稽查对象
|
||||
String inspectObject = processEsInspectPlan.getInspectObject();
|
||||
String[] inspectObjectList = inspectObject.split(",");
|
||||
for (String object : inspectObjectList) {
|
||||
EnterpriseStandardInspectObject enterpriseStandardInspectObject = new EnterpriseStandardInspectObject();
|
||||
enterpriseStandardInspectObject.setInspectId(processEsInspectPlan.getId());
|
||||
enterpriseStandardInspectObject.setPlanInspectObject(object);
|
||||
}
|
||||
list.add(enterpriseStandardInspect);
|
||||
}
|
||||
// 保存稽查
|
||||
enterpriseStandardInspectService.saveBatch(list);
|
||||
// 保存稽查对象
|
||||
enterpriseStandardInspectObjectService.saveBatch(objectList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flowTransfer(String taskId, String userId) {
|
||||
// 更新流程审批信息
|
||||
|
||||
+9
-2
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.BeanCopyUtils;
|
||||
import com.jero.common.util.ImportExcelUtil;
|
||||
import com.jero.modules.activiti.process.esinspectplan.entity.ProcessEsInspectPlan;
|
||||
@@ -23,6 +24,7 @@ import com.jero.modules.system.service.ISysDepartService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import org.apache.commons.beanutils.PropertyUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -109,8 +111,12 @@ public class ProcessEsInspectPlanServiceImpl extends ServiceImpl<ProcessEsInspec
|
||||
|
||||
@NotNull
|
||||
private static QueryWrapper<ProcessEsInspectPlan> getProcessEsInspectPlanQueryWrapper(ProcessEsInspectPlan processEsInspectPlan) {
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
QueryWrapper<ProcessEsInspectPlan> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(StringUtils.isNotBlank(processEsInspectPlan.getProjectId()), "project_id", processEsInspectPlan.getProjectId());
|
||||
if (StringUtils.isNotBlank(processEsInspectPlan.getNodeId()) && "Activity_0mnt8n8".equals(processEsInspectPlan.getNodeId())){
|
||||
queryWrapper.eq(StringUtils.isNotBlank(processEsInspectPlan.getNodeId()), "object_of_consultation", loginUser.getId());
|
||||
}
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
return queryWrapper;
|
||||
}
|
||||
@@ -181,7 +187,7 @@ public class ProcessEsInspectPlanServiceImpl extends ServiceImpl<ProcessEsInspec
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<ProcessEsInspectPlan>> importExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
public Result<ProcessEsInspectPlan> importExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
@@ -220,7 +226,8 @@ public class ProcessEsInspectPlanServiceImpl extends ServiceImpl<ProcessEsInspec
|
||||
if (errorMSG.length() > 0){
|
||||
throw new JeroBootException("文件导入失败:<br/>" + errorMSG);
|
||||
}else {
|
||||
return Result.OK("文件导入成功!数据行数:" + list.size(), list);
|
||||
saveBatch(list);
|
||||
return Result.OK("文件导入成功!数据行数:" + list.size());
|
||||
}
|
||||
}
|
||||
return Result.error("文件导入失败!");
|
||||
|
||||
Reference in New Issue
Block a user