|
@@ -6,6 +6,7 @@ package com.jeeplus.modules.act.service;
|
|
import java.io.InputStream;
|
|
import java.io.InputStream;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
|
+import com.jeeplus.common.utils.DateUtils;
|
|
import com.jeeplus.common.utils.SpringContextHolder;
|
|
import com.jeeplus.common.utils.SpringContextHolder;
|
|
import com.jeeplus.modules.oa.entity.OaNotify;
|
|
import com.jeeplus.modules.oa.entity.OaNotify;
|
|
import com.jeeplus.modules.oa.entity.OaNotifyRecord;
|
|
import com.jeeplus.modules.oa.entity.OaNotifyRecord;
|
|
@@ -16,6 +17,10 @@ import com.jeeplus.modules.sg.managementcenter.activiti.entity.Construction;
|
|
import com.jeeplus.modules.sg.managementcenter.activiti.entity.Disclose;
|
|
import com.jeeplus.modules.sg.managementcenter.activiti.entity.Disclose;
|
|
import com.jeeplus.modules.sg.managementcenter.activiti.service.ConstructionService;
|
|
import com.jeeplus.modules.sg.managementcenter.activiti.service.ConstructionService;
|
|
import com.jeeplus.modules.sg.managementcenter.activiti.utils.MyActiviUtils;
|
|
import com.jeeplus.modules.sg.managementcenter.activiti.utils.MyActiviUtils;
|
|
|
|
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialInfo;
|
|
|
|
+import com.jeeplus.modules.sg.managementcenter.materialinfo.mapper.MaterialInfoMapper;
|
|
|
|
+import com.jeeplus.modules.sg.managementcenter.materialproject.entity.MaterialProject;
|
|
|
|
+import com.jeeplus.modules.sg.managementcenter.materialproject.mapper.MaterialProjectMapper;
|
|
import com.jeeplus.modules.sg.managementcenter.project.entity.Project;
|
|
import com.jeeplus.modules.sg.managementcenter.project.entity.Project;
|
|
import com.jeeplus.modules.sg.managementcenter.project.entity.Project1;
|
|
import com.jeeplus.modules.sg.managementcenter.project.entity.Project1;
|
|
import com.jeeplus.modules.sg.materialmodule.activiti.entity.MaterialModule;
|
|
import com.jeeplus.modules.sg.materialmodule.activiti.entity.MaterialModule;
|
|
@@ -121,6 +126,15 @@ public class ActTaskService extends BaseService {
|
|
private OaNotifyService oaNotifyService;
|
|
private OaNotifyService oaNotifyService;
|
|
@Autowired
|
|
@Autowired
|
|
private PickIngService pickIngService;
|
|
private PickIngService pickIngService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ActProcessService actProcessService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ActTaskService actTaskService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private MaterialProjectMapper materialProjectMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private MaterialInfoMapper materialInfoMapper;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取待办任务列表
|
|
* 获取待办任务列表
|
|
@@ -2545,6 +2559,92 @@ public class ActTaskService extends BaseService {
|
|
* @param act
|
|
* @param act
|
|
*/
|
|
*/
|
|
@Transactional(readOnly = false)
|
|
@Transactional(readOnly = false)
|
|
|
|
+ public void materialReport(Act act,String selectNumber,String reserveName) {
|
|
|
|
+ // 设置意见
|
|
|
|
+ act.setComment(("yes".equals(act.getFlag()) ? "[同意] " : "[驳回] ") + act.getComment());
|
|
|
|
+ act.preUpdate();
|
|
|
|
+ // 对不同环节的业务逻辑进行操作
|
|
|
|
+ String taskDefKey = act.getTaskDefKey();
|
|
|
|
+ // 提交流程任务
|
|
|
|
+ Map<String, Object> vars = Maps.newHashMap();
|
|
|
|
+ vars.put("person", "shenc2");
|
|
|
|
+ PickApplication pickApplication = new PickApplication();
|
|
|
|
+ pickApplication.preInsert();
|
|
|
|
+ pickApplication.setProjectId(reserveName);
|
|
|
|
+ //保存流程定义
|
|
|
|
+ showListService.newSave(pickApplication);
|
|
|
|
+ ProcessDefinition p = actProcessService.getProcessDefinition(act.getProcDefId());
|
|
|
|
+ String title = UserUtils.getUser().getName() + "在" + DateUtils.getDateTime() + "发起" + p.getName();
|
|
|
|
+ String procInsId = actTaskService.startProcessNew(p.getKey(), "md_picking_application", pickApplication.getId(), title, vars);
|
|
|
|
+ List<ShowList> showLists = MyActiviUtils.finaList(selectNumber);
|
|
|
|
+ for (ShowList a : showLists) {
|
|
|
|
+ a.preInsert();
|
|
|
|
+ a.setProcInsId(procInsId);
|
|
|
|
+ a.setReserveName(reserveName);
|
|
|
|
+ }
|
|
|
|
+ pickIngService.processTemReportList(showLists);
|
|
|
|
+ //complete(act.getTaskId(), act.getProcInsId(), act.getComment(), vars);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 保存审核意见
|
|
|
|
+ *
|
|
|
|
+ * @param act
|
|
|
|
+ */
|
|
|
|
+ @Transactional(readOnly = false)
|
|
|
|
+ public void materialReportBillOff(Act act) {
|
|
|
|
+ // 设置意见
|
|
|
|
+ act.setComment(("yes".equals(act.getFlag()) ? "[同意] " : "[驳回] ") + act.getComment());
|
|
|
|
+ act.preUpdate();
|
|
|
|
+ // 对不同环节的业务逻辑进行操作
|
|
|
|
+ String taskDefKey = act.getTaskDefKey();
|
|
|
|
+ // 提交流程任务
|
|
|
|
+ Map<String, Object> vars = Maps.newHashMap();
|
|
|
|
+ complete(act.getTaskId(), act.getProcInsId(), act.getComment(), vars);
|
|
|
|
+
|
|
|
|
+ //获取当前流程的材料数据
|
|
|
|
+ List<ShowList> procInsIdMaterialReport = pickIngService.findProcInsIdMaterialReport(act.getProcInsId());
|
|
|
|
+ //赋值
|
|
|
|
+ List<MaterialProject> materialProjects = new ArrayList<MaterialProject>();
|
|
|
|
+ List<MaterialInfo> materialInfos = new ArrayList<MaterialInfo>();
|
|
|
|
+ MaterialProject materialProject = null;
|
|
|
|
+ MaterialInfo materialInfo = null;
|
|
|
|
+ String reserveProjectName = "";
|
|
|
|
+ for (ShowList showList:procInsIdMaterialReport){
|
|
|
|
+ //获取储备名称名字
|
|
|
|
+ reserveProjectName = showList.getReserveName();
|
|
|
|
+ //获取明细数据(此处可优化为反射)
|
|
|
|
+ materialInfo = new MaterialInfo();
|
|
|
|
+ materialInfo.setProjectName(showList.getReserveName());//项目名称
|
|
|
|
+ materialInfo.setMaterialCode(showList.getMaterialCode());//物料编码
|
|
|
|
+ materialInfo.setMaterialName(showList.getMaterialDescription());//物料描述
|
|
|
|
+ materialInfo.setExtendDescription(showList.getExtensionDescription());//扩展描述
|
|
|
|
+ materialInfo.setUnit(showList.getMdUnits());//单位
|
|
|
|
+ materialInfo.setTotalCount(showList.getMdTotalAmount());//总量
|
|
|
|
+ materialInfo.setWeightTon(showList.getMdSingleWeight());//单重kg
|
|
|
|
+ materialInfo.setSupplyType(showList.getMdTheParty());//甲乙供
|
|
|
|
+ materialInfo.setNote(showList.getMdText());//备注
|
|
|
|
+ materialInfo.preInsert();
|
|
|
|
+ materialInfos.add(materialInfo);
|
|
|
|
+ }
|
|
|
|
+ materialProject = new MaterialProject();
|
|
|
|
+ materialProject.setReserveProjectName(reserveProjectName);
|
|
|
|
+ materialProject.preInsert();
|
|
|
|
+ materialProjects.add(materialProject);
|
|
|
|
+ ////添加年度物料上报统计
|
|
|
|
+ materialProjectMapper.insertList(materialProjects);
|
|
|
|
+ //添加月度物资上报明细
|
|
|
|
+ materialInfoMapper.insertList(materialInfos);
|
|
|
|
+ //根据流程删除临时表
|
|
|
|
+ pickIngService.deleteProcInsIdMaterialReport(act.getProcInsId());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 保存审核意见
|
|
|
|
+ *
|
|
|
|
+ * @param act
|
|
|
|
+ */
|
|
|
|
+ @Transactional(readOnly = false)
|
|
public void managerExam(Act act) {
|
|
public void managerExam(Act act) {
|
|
// 设置意见
|
|
// 设置意见
|
|
act.setComment(("yes".equals(act.getFlag()) ? "[同意] " : "[驳回] ") + act.getComment());
|
|
act.setComment(("yes".equals(act.getFlag()) ? "[同意] " : "[驳回] ") + act.getComment());
|