forked from integrated_whb/integrated_whb
动火作业 service层方法
parent
2f1ef51627
commit
d4e586d700
|
@ -5,11 +5,13 @@ import com.zcloud.controller.base.BaseController;
|
||||||
import com.zcloud.dto.Response;
|
import com.zcloud.dto.Response;
|
||||||
import com.zcloud.dto.TenCorpConst;
|
import com.zcloud.dto.TenCorpConst;
|
||||||
import com.zcloud.dto.TenCorpDto;
|
import com.zcloud.dto.TenCorpDto;
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
import com.zcloud.logs.LogAnno;
|
import com.zcloud.logs.LogAnno;
|
||||||
import com.zcloud.service.eightwork.HotworkService;
|
import com.zcloud.service.eightwork.HotworkService;
|
||||||
import com.zcloud.service.mq.SendMessageService;
|
import com.zcloud.service.mq.SendMessageService;
|
||||||
import com.zcloud.util.DateUtil;
|
import com.zcloud.util.DateUtil;
|
||||||
|
import com.zcloud.util.Tools;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
@ -66,4 +68,26 @@ public class AppHotworkController extends BaseController {
|
||||||
map.put("result", errInfo); //返回结果
|
map.put("result", errInfo); //返回结果
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/list")
|
||||||
|
@ResponseBody
|
||||||
|
@LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "列表")
|
||||||
|
public Object list(Page page) throws Exception{
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||||
|
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||||||
|
page.setPd(pd);
|
||||||
|
List<PageData> varList = hotworkService.list(page); //列出hotwork列表
|
||||||
|
map.put("varList", varList);
|
||||||
|
map.put("page", page);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
package com.zcloud.mapper.datasource.eightwork;
|
package com.zcloud.mapper.datasource.eightwork;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author fangjiakai
|
* @author fangjiakai
|
||||||
* @date 2024/01/17 11:31
|
* @date 2024/01/17 11:31
|
||||||
|
@ -10,5 +13,8 @@ public interface HotworkMapper {
|
||||||
PageData getCode(PageData pd);
|
PageData getCode(PageData pd);
|
||||||
void save(PageData pd);
|
void save(PageData pd);
|
||||||
void delete(PageData pd);
|
void delete(PageData pd);
|
||||||
|
void edit(PageData pd);
|
||||||
|
void editStep(PageData pd);
|
||||||
|
List<PageData> datalistPage(Page page);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.zcloud.mapper.datasource.eightwork;
|
package com.zcloud.mapper.datasource.eightwork;
|
||||||
|
|
||||||
import com.zcloud.entity.Page;
|
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -25,9 +24,12 @@ public interface HotworkSignMapper {
|
||||||
void edit(PageData pd);
|
void edit(PageData pd);
|
||||||
|
|
||||||
/**根据动火ID查询签字列表
|
/**根据动火ID查询签字列表
|
||||||
* @param page
|
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
List<PageData> listById(Page page);
|
List<PageData> listById(PageData pd);
|
||||||
|
|
||||||
|
/**根据动火ID查询未签字列表
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> checkUnsigned(PageData sign);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.zcloud.mapper.datasource.eightwork;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:动火措施中间表
|
||||||
|
* 作者:luoxiaobao
|
||||||
|
* 时间:2021-09-18
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
public interface HotworkToMeasuresMapper {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void save(PageData pd);
|
||||||
|
|
||||||
|
void saveBatch(List<PageData> signers);
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void delete(PageData pd);
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void edit(PageData pd);
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> listAll(PageData pd);
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
PageData findById(PageData pd);
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void deleteAll(String[] ArrayDATA_IDS);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
package com.zcloud.service.eightwork;
|
package com.zcloud.service.eightwork;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author fangjiakai
|
* @author fangjiakai
|
||||||
|
@ -11,5 +15,10 @@ public interface HotworkService {
|
||||||
|
|
||||||
void delete(PageData pd)throws Exception;
|
void delete(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
List<PageData> list(Page page) throws Exception;
|
||||||
|
|
||||||
|
void nextStep(PageData pd, MultipartFile file) throws Exception;
|
||||||
|
|
||||||
|
void accept(PageData pd)throws Exception;
|
||||||
void cancel(PageData pd)throws Exception;
|
void cancel(PageData pd)throws Exception;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,18 +4,19 @@ import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.zcloud.dto.TenCorpConst;
|
import com.zcloud.dto.TenCorpConst;
|
||||||
import com.zcloud.dto.TenCorpDto;
|
import com.zcloud.dto.TenCorpDto;
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
import com.zcloud.mapper.datasource.eightwork.EightWorkFlowLogMapper;
|
import com.zcloud.mapper.datasource.eightwork.*;
|
||||||
import com.zcloud.mapper.datasource.eightwork.EightWorkTaskFlowMapper;
|
|
||||||
import com.zcloud.mapper.datasource.eightwork.HotworkMapper;
|
|
||||||
import com.zcloud.mapper.datasource.eightwork.HotworkSignMapper;
|
|
||||||
import com.zcloud.service.eightwork.HotworkService;
|
import com.zcloud.service.eightwork.HotworkService;
|
||||||
import com.zcloud.service.mq.SendMessageService;
|
import com.zcloud.service.mq.SendMessageService;
|
||||||
|
import com.zcloud.util.Const;
|
||||||
import com.zcloud.util.DateUtil;
|
import com.zcloud.util.DateUtil;
|
||||||
|
import com.zcloud.util.Smb;
|
||||||
import com.zcloud.util.UuidUtil;
|
import com.zcloud.util.UuidUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -31,14 +32,17 @@ public class HotworkServiceImpl implements HotworkService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private HotworkMapper hotworkMapper;
|
private HotworkMapper hotworkMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SendMessageService sendMessageService;
|
|
||||||
@Autowired
|
|
||||||
private EightWorkTaskFlowMapper eightWorkTaskFlowMapper;
|
private EightWorkTaskFlowMapper eightWorkTaskFlowMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private EightWorkFlowLogMapper eightWorkFlowLogMapper;
|
private EightWorkFlowLogMapper eightWorkFlowLogMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private HotworkSignMapper hotworkSignMapper;
|
private HotworkSignMapper hotworkSignMapper;
|
||||||
|
@Autowired
|
||||||
|
private HotworkToMeasuresMapper hotworkToMeasuresMapper;
|
||||||
|
@Autowired
|
||||||
|
private Smb smb;
|
||||||
|
|
||||||
|
private final static String primary_key = "HOTWORK_ID";
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void save(PageData pd) throws Exception {
|
public void save(PageData pd) throws Exception {
|
||||||
|
@ -53,37 +57,16 @@ public class HotworkServiceImpl implements HotworkService {
|
||||||
pd2 = hotworkMapper.getCode(pd2); //根据ID读取
|
pd2 = hotworkMapper.getCode(pd2); //根据ID读取
|
||||||
String code = "DH" + year + month + day + dft.format((Integer.parseInt(pd2.get("code").toString()) + 1));
|
String code = "DH" + year + month + day + dft.format((Integer.parseInt(pd2.get("code").toString()) + 1));
|
||||||
pd.put("CHECK_NO", code);
|
pd.put("CHECK_NO", code);
|
||||||
pd.put("HOTWORK_ID", UuidUtil.get32UUID()); //主键
|
pd.put(primary_key, UuidUtil.get32UUID()); //主键
|
||||||
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
|
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
|
||||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||||
pd.put("ISDELETE", "0"); //是否删除 1-是 0-否
|
pd.put("ISDELETE", "0"); //是否删除 1-是 0-否
|
||||||
hotworkMapper.save(pd);
|
hotworkMapper.save(pd);
|
||||||
|
|
||||||
List<PageData> signers = new ArrayList<>();
|
|
||||||
if (pd.get("PREPARERS") != null && !pd.get("PREPARERS").equals("")) {
|
|
||||||
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.get("PREPARERS").toString());
|
|
||||||
Object STEP_ID = getStepId(1,"PREPARE_USER_ID");
|
|
||||||
for (JSONObject json : list) {
|
|
||||||
if (json.get("DEPARTMENT_ID") != null && json.get("DEPARTMENT_ID") != "" && json.get("USER_ID") != null
|
|
||||||
&& json.get("USER_ID") != "") {
|
|
||||||
PageData preparer = new PageData();
|
|
||||||
preparer.put("HOTWORK_SIGN_ID", UuidUtil.get32UUID()); // 主键
|
|
||||||
preparer.put("HOTWORK_ID", pd.get("HOTWORK_ID"));
|
|
||||||
preparer.put("CORPINFO_ID", pd.get("CORPINFO_ID"));
|
|
||||||
preparer.put("SIGN_USER_DEPARTMENT_ID", json.get("DEPARTMENT_ID"));
|
|
||||||
preparer.put("SIGN_USER_ID", json.get("USER_ID"));
|
|
||||||
preparer.put("STEP_ID", STEP_ID);
|
|
||||||
signers.add(preparer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(signers.size() > 0){
|
|
||||||
hotworkSignMapper.saveBatch(signers);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pd.get("APPLY_STATUS").equals("1")) {
|
if (pd.get("APPLY_STATUS").equals("1")) {
|
||||||
saveLog(pd);
|
// PageData flow = getStep(pd.get("TASK_ID"),"1");
|
||||||
sendMq(pd);
|
saveLog(pd,pd.getString("CREATOR"),"1");
|
||||||
|
// saveNext(pd,flow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,39 +76,152 @@ public class HotworkServiceImpl implements HotworkService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cancel(PageData pd)throws Exception{
|
public List<PageData> list(Page page) throws Exception {
|
||||||
|
return hotworkMapper.datalistPage(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Object getStepId(Integer TASK_ID, String ACTOR_FIELD) throws Exception {
|
/*
|
||||||
|
* 下一步
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void nextStep(PageData pd, MultipartFile file) throws Exception {
|
||||||
|
//保存签名文件
|
||||||
|
String ffile = DateUtil.getDays();
|
||||||
|
String fileName = UuidUtil.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||||
|
smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
|
||||||
|
String filePath = Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName;
|
||||||
|
|
||||||
|
//保存签名信息
|
||||||
|
PageData sign = new PageData();
|
||||||
|
sign.put(primary_key, pd.get(primary_key));
|
||||||
|
sign.put("STEP_ID", pd.get("STEP_ID"));
|
||||||
|
sign.put("SIGN_USER_ID", pd.get("USER_ID"));
|
||||||
|
sign.put("SIGN_USER_DEPARTMENT_ID", pd.get("DEPARTMENT_ID"));
|
||||||
|
sign.put("SIGN_TIME", DateUtil.date2Str(new Date()));
|
||||||
|
sign.put("SIGN_PATH", filePath);
|
||||||
|
sign.put("DESCR", pd.get("DESCR"));
|
||||||
|
|
||||||
|
hotworkSignMapper.edit(sign);
|
||||||
|
|
||||||
|
if (pd.get("PREPARERS") != null && !pd.get("PREPARERS").equals("")) {
|
||||||
|
savePreparers(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pd.get("MEASURES") != null && !pd.get("MEASURES").equals("")) {
|
||||||
|
saveMeasures(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<PageData> unsignedList = hotworkSignMapper.checkUnsigned(sign);//当前步骤未签名人列表
|
||||||
|
if(unsignedList == null || unsignedList.size() == 0){//如果没有未签人 则跳转下一步
|
||||||
|
PageData flow = getStep(pd.get("TASK_ID"), pd.get("STEP_ID"));
|
||||||
|
pd.put("STEP_ID",flow.get("NEXT_STEP_ID"));
|
||||||
|
hotworkMapper.edit(pd);
|
||||||
|
|
||||||
|
//提前保存下一步签字人
|
||||||
|
List<PageData> signers = new ArrayList<>();
|
||||||
|
PageData signer = new PageData();
|
||||||
|
signer.put("HOTWORK_SIGN_ID", UuidUtil.get32UUID()); // 主键
|
||||||
|
signer.put(primary_key, pd.get(primary_key));
|
||||||
|
signer.put("CORPINFO_ID", pd.get("CORPINFO_ID"));
|
||||||
|
signer.put("SIGN_USER_DEPARTMENT_ID", pd.get(flow.get("NEXT_ACTOR_FIELD")));
|
||||||
|
signer.put("SIGN_USER_ID", pd.get(flow.get("NEXT_ACTOR_FIELD")));
|
||||||
|
signer.put("STEP_ID", flow.get("NEXT_STEP_ID"));
|
||||||
|
signers.add(signer);
|
||||||
|
if(signers.size() > 0){
|
||||||
|
hotworkSignMapper.saveBatch(signers);
|
||||||
|
}
|
||||||
|
//保存日志
|
||||||
|
saveLog(pd,pd.getString(flow.get("ACTOR_FIELD")),"1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void saveMeasures(PageData pd) {
|
||||||
|
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.get("PREPARERS").toString());
|
||||||
|
for (JSONObject json : list) {
|
||||||
|
if (json.get("DEPARTMENT_ID") != null && json.get("DEPARTMENT_ID") != "" && json.get("USER_ID") != null
|
||||||
|
&& json.get("USER_ID") != "") {
|
||||||
|
PageData measure = new PageData();
|
||||||
|
measure.put("HOTWORKTOMEASURES_ID",json.get("BUS_HOTWORK_MEASURES_ID"));
|
||||||
|
measure.put("STATUS", json.get("STATUS"));
|
||||||
|
measure.put("ANSWER1", json.get("ANSWER1"));
|
||||||
|
measure.put("ANSWER2", json.get("ANSWER2"));
|
||||||
|
measure.put("ANSWER3", json.get("ANSWER3"));
|
||||||
|
measure.put("ANSWER4", json.get("ANSWER4"));
|
||||||
|
measure.put("SIGN_PATH", json.get("SIGN_PATH"));
|
||||||
|
measure.put("IMG_PATH", json.get("IMG_PATH"));
|
||||||
|
hotworkToMeasuresMapper.edit(measure);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void savePreparers(PageData pd) {
|
||||||
|
List<PageData> signers = new ArrayList<>();
|
||||||
|
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.get("PREPARERS").toString());
|
||||||
|
for (JSONObject json : list) {
|
||||||
|
if (json.get("DEPARTMENT_ID") != null && json.get("DEPARTMENT_ID") != "" && json.get("USER_ID") != null
|
||||||
|
&& json.get("USER_ID") != "") {
|
||||||
|
PageData preparer = new PageData();
|
||||||
|
preparer.put("HOTWORKTOMEASURES_ID", UuidUtil.get32UUID()); // 主键
|
||||||
|
preparer.put("HOTWORK_ID", pd.get("HOTWORK_ID"));
|
||||||
|
preparer.put("BUS_HOTWORK_MEASURES_ID", json.get("BUS_HOTWORK_MEASURES_ID"));
|
||||||
|
preparer.put("CONFIRM_ID", json.get("USER_ID"));
|
||||||
|
signers.add(preparer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(signers.size() > 0){
|
||||||
|
hotworkToMeasuresMapper.saveBatch(signers);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验收归档
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void accept(PageData pd)throws Exception{
|
||||||
|
PageData flow = getStep(pd.get("TASK_ID"), 99);
|
||||||
|
hotworkMapper.edit(pd);
|
||||||
|
saveLog(pd,pd.getString(flow.get("ACTOR_FIELD")),"1");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void cancel(PageData pd)throws Exception{
|
||||||
|
PageData flow = getStep(pd.get("TASK_ID"), pd.get("STEP_ID"));
|
||||||
|
hotworkMapper.edit(pd);
|
||||||
|
saveLog(pd,pd.getString(flow.get("ACTOR_FIELD")),"-1");
|
||||||
|
}
|
||||||
|
|
||||||
|
private PageData getStep(Object TASK_ID, Object STEP_ID) throws Exception {
|
||||||
PageData flow = new PageData();
|
PageData flow = new PageData();
|
||||||
flow.put("TASK_ID", TASK_ID);
|
flow.put("TASK_ID", TASK_ID);
|
||||||
flow.put("ACTOR_FIELD", ACTOR_FIELD);
|
flow.put("STEP_ID", STEP_ID);
|
||||||
flow = eightWorkTaskFlowMapper.getStep(flow);
|
flow = eightWorkTaskFlowMapper.getStep(flow);
|
||||||
return flow.get("STEP_ID");
|
return flow;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveLog(PageData pd) throws Exception {
|
private void saveLog(PageData pd,String act_user,String status) throws Exception {
|
||||||
PageData log = new PageData();
|
PageData log = new PageData();
|
||||||
log.put("LOG_ID", UuidUtil.get32UUID());
|
log.put("LOG_ID", UuidUtil.get32UUID());
|
||||||
log.put("WORK_ID", pd.get("HOTWORK_ID"));
|
log.put("WORK_ID", pd.get(primary_key));
|
||||||
log.put("TASK_ID", pd.get("TASK_ID"));
|
log.put("TASK_ID", pd.get("TASK_ID"));
|
||||||
log.put("STEP_ID", pd.get("STEP_ID"));
|
log.put("STEP_ID", pd.get("STEP_ID"));
|
||||||
log.put("ACT_USER", pd.get("HOTWORK_ID"));
|
log.put("ACT_USER", act_user);
|
||||||
log.put("ACT_TIME", pd.get("CREATTIME"));
|
log.put("ACT_TIME", DateUtil.date2Str(new Date()));
|
||||||
log.put("STATUS", "1");
|
log.put("STATUS", status);
|
||||||
eightWorkFlowLogMapper.save(log);
|
eightWorkFlowLogMapper.save(log);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendMq(PageData pd) throws Exception {
|
// private void saveNext(PageData pd,PageData flow) throws Exception {
|
||||||
TenCorpDto tenCorpDto = new TenCorpDto();
|
// PageData log = new PageData();
|
||||||
tenCorpDto.setMark(pd.getString("HOTWORK_ID"));
|
// log.put("LOG_ID", UuidUtil.get32UUID());
|
||||||
tenCorpDto.setMark_name("HOTWORK_ID");
|
// log.put("WORK_ID", pd.get(primary_key));
|
||||||
tenCorpDto.setTime_stamp(pd.getString("WORK_START_DATE") + ":00:000");
|
// log.put("TASK_ID", pd.get("TASK_ID"));
|
||||||
tenCorpDto.setTopic("eightWork");
|
// log.put("STEP_ID", flow.get("NEXT_STEP_ID"));
|
||||||
tenCorpDto.setData(pd);
|
// log.put("STATUS", "0");
|
||||||
tenCorpDto.setMessage(TenCorpConst.hotWork);
|
// eightWorkFlowLogMapper.save(log);
|
||||||
|
// }
|
||||||
|
|
||||||
sendMessageService.sendDelayQueue(tenCorpDto);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,13 +55,19 @@
|
||||||
|
|
||||||
<select id="getStep" parameterType="pd" resultType="pd" >
|
<select id="getStep" parameterType="pd" resultType="pd" >
|
||||||
select
|
select
|
||||||
<include refid="Field"></include>
|
<include refid="Field"></include>,
|
||||||
|
n.STEP_ID as NEXT_STEP_ID,
|
||||||
|
n.ACTOR_FIELD as NEXT_ACTOR_FIELD
|
||||||
from
|
from
|
||||||
<include refid="tableName"></include>
|
<include refid="tableName"></include> f
|
||||||
|
left join
|
||||||
|
<include refid="tableName"></include> n
|
||||||
|
on
|
||||||
|
f.NEXT_STEP_ID = n.STEP_ID and f.TASK_ID = n.TASK_ID
|
||||||
where
|
where
|
||||||
TASK_ID = #{TASK_ID}
|
f.TASK_ID = #{TASK_ID}
|
||||||
and
|
and
|
||||||
ACTOR_FIELD = #{ACTOR_FIELD}
|
f.STEP_ID = #{STEP_ID}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<mapper namespace="com.zcloud.mapper.datasource.eightwork.HotworkMapper">
|
<mapper namespace="com.zcloud.mapper.datasource.eightwork.HotworkMapper">
|
||||||
<!--表名 -->
|
<!--表名 -->
|
||||||
<sql id="tableName">
|
<sql id="tableName">
|
||||||
BUS_HIGHWORK
|
BUS_HOTWORK
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 字段 -->
|
<!-- 字段 -->
|
||||||
|
@ -220,4 +220,38 @@
|
||||||
where
|
where
|
||||||
HIGHWORK_ID = #{HIGHWORK_ID}
|
HIGHWORK_ID = #{HIGHWORK_ID}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<!-- 修改 -->
|
||||||
|
<update id="editStep" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
STEP_ID = #{pd.STEP_ID}
|
||||||
|
where
|
||||||
|
HIGHWORK_ID = #{HIGHWORK_ID}
|
||||||
|
</update>
|
||||||
|
<!-- 列表 -->
|
||||||
|
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where f.ISDELETE = '0'
|
||||||
|
<if test="pd.STEP_NAME != null and pd.STEP_NAME != ''"><!-- 关键词检索 -->
|
||||||
|
and exists (
|
||||||
|
select 1 from bus_hotwork_sign sign
|
||||||
|
left join bus_eightwork_step step on step.STEP_ID = sign.STEP_ID
|
||||||
|
where sign.HIGHWORK_ID = f.HIGHWORK_ID
|
||||||
|
and sign.SIGN_TIME is null
|
||||||
|
and sign.SIGN_USER_ID = #{pd.USER_ID}
|
||||||
|
and step.STEP_NAME = #{pd.STEP_NAME}
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="pd.CREATOR != null and pd.CREATOR != ''"><!-- 关键词检索 -->
|
||||||
|
and f.CREATOR = #{pd.CREATOR}
|
||||||
|
</if>
|
||||||
|
<if test="pd.GASCHECK != null and pd.GASCHECK != ''"><!-- 关键词检索 -->
|
||||||
|
and f.
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -66,17 +66,21 @@
|
||||||
insert into
|
insert into
|
||||||
<include refid="tableName"></include>
|
<include refid="tableName"></include>
|
||||||
(
|
(
|
||||||
<include refid="Field2"></include>
|
HOTWORK_SIGN_ID,
|
||||||
) values (
|
HOTWORK_ID,
|
||||||
|
CORPINFO_ID,
|
||||||
|
SIGN_USER_DEPARTMENT_ID,
|
||||||
|
SIGN_USER_ID,
|
||||||
|
STEP_ID
|
||||||
|
) values
|
||||||
<foreach collection="list" item="item" index="index" separator="," >
|
<foreach collection="list" item="item" index="index" separator="," >
|
||||||
#{item.HOTWORK_SIGN_ID},
|
(#{item.HOTWORK_SIGN_ID},
|
||||||
#{item.HOTWORK_ID},
|
#{item.HOTWORK_ID},
|
||||||
#{item.CORPINFO_ID},
|
#{item.CORPINFO_ID},
|
||||||
#{item.SIGN_USER_DEPARTMENT_ID},
|
#{item.SIGN_USER_DEPARTMENT_ID},
|
||||||
#{item.SIGN_USER_ID},
|
#{item.SIGN_USER_ID},
|
||||||
#{item.STEP_ID}
|
#{item.STEP_ID})
|
||||||
</foreach>
|
</foreach>
|
||||||
)
|
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<!-- 修改 -->
|
<!-- 修改 -->
|
||||||
|
@ -88,10 +92,10 @@
|
||||||
SIGN_PATH = #{SIGN_PATH},
|
SIGN_PATH = #{SIGN_PATH},
|
||||||
SIGN_TIME= #{SIGN_TIME},
|
SIGN_TIME= #{SIGN_TIME},
|
||||||
where
|
where
|
||||||
HOTWORK_ID = #{HOTWORK_ID} and SIGN_USER_ID = #{SIGN_USER_ID}
|
HOTWORK_ID = #{HOTWORK_ID} and SIGN_USER_ID = #{SIGN_USER_ID} and STEP_ID = #{STEP_ID}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="listById" parameterType="page" resultType="pd">
|
<select id="listById" parameterType="pd" resultType="pd">
|
||||||
select
|
select
|
||||||
<include refid="Field"></include>
|
<include refid="Field"></include>
|
||||||
from
|
from
|
||||||
|
@ -101,4 +105,16 @@
|
||||||
order by f.SIGN_TIME desc
|
order by f.SIGN_TIME desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="checkUnsigned" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where
|
||||||
|
f.HOTWORK_ID = #{pd.HOTWORK_ID}
|
||||||
|
and
|
||||||
|
f.SIGN_TIME is null
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -0,0 +1,145 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zcloud.mapper.datasource.eightwork.HotworkToMeasuresMapper">
|
||||||
|
|
||||||
|
<!--表名 -->
|
||||||
|
<sql id="tableName">
|
||||||
|
BUS_HOTWORKTOMEASURES
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!--数据字典表名 -->
|
||||||
|
<sql id="dicTableName">
|
||||||
|
SYS_DICTIONARIES
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段 -->
|
||||||
|
<sql id="Field">
|
||||||
|
f.HOTWORK_ID,
|
||||||
|
f.BUS_HOTWORK_MEASURES_ID,
|
||||||
|
f.STATUS,
|
||||||
|
f.ANSWER1,
|
||||||
|
f.ANSWER2,
|
||||||
|
f.ANSWER3,
|
||||||
|
f.ANSWER4,
|
||||||
|
f.HOTWORKTOMEASURES_ID,
|
||||||
|
f.CONFIRM_ID,
|
||||||
|
f.SIGN_PATH,
|
||||||
|
f.IMG_PATH
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段用于新增 -->
|
||||||
|
<sql id="Field2">
|
||||||
|
HOTWORK_ID,
|
||||||
|
BUS_HOTWORK_MEASURES_ID,
|
||||||
|
STATUS,
|
||||||
|
ANSWER1,
|
||||||
|
ANSWER2,
|
||||||
|
ANSWER3,
|
||||||
|
ANSWER4,
|
||||||
|
HOTWORKTOMEASURES_ID,
|
||||||
|
CONFIRM_ID,
|
||||||
|
SIGN_PATH,
|
||||||
|
IMG_PATH
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段值 -->
|
||||||
|
<sql id="FieldValue">
|
||||||
|
#{HOTWORK_ID},
|
||||||
|
#{BUS_HOTWORK_MEASURES_ID},
|
||||||
|
#{STATUS},
|
||||||
|
#{ANSWER1},
|
||||||
|
#{ANSWER2},
|
||||||
|
#{ANSWER3},
|
||||||
|
#{ANSWER4},
|
||||||
|
#{HOTWORKTOMEASURES_ID},
|
||||||
|
#{CONFIRM_ID},
|
||||||
|
#{SIGN_PATH},
|
||||||
|
#{IMG_PATH}
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 新增-->
|
||||||
|
<insert id="save" parameterType="pd">
|
||||||
|
insert into
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
(
|
||||||
|
<include refid="Field2"></include>
|
||||||
|
) values (
|
||||||
|
<include refid="FieldValue"></include>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveBatch" parameterType="pd">
|
||||||
|
insert into
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
(
|
||||||
|
HOTWORK_ID,
|
||||||
|
BUS_HOTWORK_MEASURES_ID,
|
||||||
|
HOTWORKTOMEASURES_ID,
|
||||||
|
CONFIRM_ID
|
||||||
|
) values
|
||||||
|
<foreach collection="list" item="item" index="index" open="(" separator="),(" close=")">
|
||||||
|
(
|
||||||
|
#{item.HOTWORK_ID},
|
||||||
|
#{item.BUS_HOTWORK_MEASURES_ID},
|
||||||
|
#{item.HOTWORKTOMEASURES_ID},
|
||||||
|
#{item.CONFIRM_ID}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 删除-->
|
||||||
|
<delete id="delete" parameterType="pd">
|
||||||
|
delete from
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
where
|
||||||
|
HOTWORK_ID = #{HOTWORK_ID}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 修改 -->
|
||||||
|
<update id="edit" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
STATUS = #{STATUS},
|
||||||
|
ANSWER1 = #{ANSWER1},
|
||||||
|
ANSWER2 = #{ANSWER2},
|
||||||
|
ANSWER3 = #{ANSWER3},
|
||||||
|
ANSWER4 = #{ANSWER4},
|
||||||
|
SIGN_PATH = #{SIGN_PATH},
|
||||||
|
IMG_PATH = #{IMG_PATH}
|
||||||
|
where
|
||||||
|
HOTWORKTOMEASURES_ID = #{HOTWORKTOMEASURES_ID}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 通过ID获取数据 -->
|
||||||
|
<select id="findById" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where
|
||||||
|
f.HOTWORKTOMEASURES_ID = #{HOTWORKTOMEASURES_ID}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(全部) -->
|
||||||
|
<select id="listAll" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 批量删除 -->
|
||||||
|
<delete id="deleteAll" parameterType="String">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1'
|
||||||
|
where
|
||||||
|
HOTWORKTOMEASURES_ID in
|
||||||
|
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue