feat:八项作业撤回上一步

0927cmt
dearLin 2024-09-27 14:24:12 +08:00
parent 98e6b46d2d
commit 05a14e2efc
7 changed files with 1719 additions and 1242 deletions

View File

@ -0,0 +1,48 @@
package com.zcloud.controller.gf;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.PageData;
import com.zcloud.service.gf.AppWorkBackService;
import com.zcloud.util.ReturnMap;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
/**
* 退
*
* @author lin
*/
@Controller
@RequestMapping("/app/eightWork")
public class AppWorkBackController extends BaseController {
@Resource
private AppWorkBackService appWorkBackService;
/**
* 退
*
* @author lin
*/
@RequestMapping(value = "/backWork")
@ResponseBody
public ReturnMap backWork() throws Exception {
PageData pageData = this.getPageData();
return appWorkBackService.backOtherWork(pageData);
}
/**
* 退
*
* @author lin
*/
@RequestMapping(value = "/backHotWork")
@ResponseBody
public String backHotWork() throws Exception {
return "gf/gf_limit_space_back";
}
}

View File

@ -73,5 +73,32 @@ public interface GFHighWorkMapper{
PageData countCheck(PageData pd);
PageData getCode(PageData pd);
void clearMasterTable(PageData pd);
void clearMeasures(PageData pd);
void clearAcceptUser(PageData pd);
PageData getInfoById(PageData pd);
void back5to2(PageData pd);
void back5to4(PageData pd);
void back5to3(PageData pd);
void back3to2(PageData pd);
void back4to3(PageData pd);
void back4to2(PageData pd);
void blindboardBack4to1(PageData pd);
void blindboardBack5to4(PageData pd);
void clearGasMonitoring(PageData pd);
void clearGasWhMonitoring(PageData pd);
}

View File

@ -0,0 +1,11 @@
package com.zcloud.service.gf;
import com.zcloud.entity.PageData;
import com.zcloud.util.ReturnMap;
public interface AppWorkBackService {
ReturnMap backHotWork(PageData pd) throws Exception;
ReturnMap backOtherWork(PageData pd) throws Exception;
}

View File

@ -0,0 +1,194 @@
package com.zcloud.service.gf.impl;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.gf.GFHighWorkMapper;
import com.zcloud.service.gf.AppWorkBackService;
import com.zcloud.util.InitPageDataUtil;
import com.zcloud.util.ReturnMap;
import com.zcloud.util.Tools;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@Service
public class AppWorkBackServiceImpl implements AppWorkBackService {
static Map<String, String> tablePrimaryKey = new HashMap<String, String>() {{
// 高处
put("gf_highwork", "HIGHWORK_ID");
// 动土
put("gf_breakground", "BREAKGROUND_ID");
// 盲板
put("gf_blindboard", "BLINDBOARD_ID");
// 有限空间
put("gf_confinedspace", "CONFINEDSPACE_ID");
// 吊装
put("gf_hoisting", "HOISTING_ID");
// 用电
put("gf_electricity", "ELECTRICITY_ID");
// 断路
put("gf_cutroad", "CUTROAD_ID");
}};
@Resource
private GFHighWorkMapper gfHighWorkMapper;
@Resource
private InitPageDataUtil initPageDataUtil;
@Override
public ReturnMap backHotWork(PageData pd) throws Exception {
return ReturnMap.ok();
}
@Override
@Transactional
public ReturnMap backOtherWork(PageData pd) throws Exception {
if ("1".equals(pd.getString("APPLY_STATUS"))) return ReturnMap.error("审核中,无法撤回到上一步!");
if ("6".equals(pd.getString("APPLY_STATUS"))) return ReturnMap.error("已归档,无法撤回到上一步!");
pd.put("TABLE_ID_NAME", tablePrimaryKey.get(pd.getString("TYPE")));
PageData workInfo = gfHighWorkMapper.getInfoById(pd);
// 撤回上一步
if ("gf_highwork".equals(pd.getString("TYPE"))
|| "gf_breakground".equals(pd.getString("TYPE"))
|| "gf_hoisting".equals(pd.getString("TYPE"))
|| "gf_electricity".equals(pd.getString("TYPE"))
|| "gf_cutroad".equals(pd.getString("TYPE"))
) {
if ("2".equals(workInfo.getString("APPLY_STATUS"))) {
if ("gf_electricity".equals(pd.getString("TYPE")) && "1".equals(workInfo.getString("ISANALYZE"))) {
// 临时用电, 撤销 气体分析
clearGasMonitoring(pd);
}
back2to1(pd);
return ReturnMap.ok();
}
if ("5".equals(workInfo.getString("APPLY_STATUS"))) {
// 现在有3种情况
// 1.如有APPROVE_USER_ID和 AUDIT_USER_ID 则APPLY_STATUS变为4审批部门
if (Tools.notEmpty(workInfo.getString("APPROVE_USER_ID")) && Tools.notEmpty(workInfo.getString("AUDIT_USER_ID"))) {
back5to4(pd);
return ReturnMap.ok();
}
// 2.如有APPROVE_USER_ID 但是没AUDIT_USER_ID 则APPLY_STATUS变为3审核部门
if (Tools.notEmpty(workInfo.getString("APPROVE_USER_ID"))) {
back5to3(pd);
return ReturnMap.ok();
}
// 3.如没有APPROVE_USER_ID和AUDIT_USER_ID 则APPLY_STATUS变为2
if (Tools.isEmpty(workInfo.getString("APPROVE_USER_ID")) && Tools.isEmpty(workInfo.getString("AUDIT_USER_ID"))) {
back5to2(pd);
return ReturnMap.ok();
}
}
if ("4".equals(workInfo.getString("APPLY_STATUS"))) {
// 现在有2种情况
// 1.AUDIT_USER_ID
if (Tools.notEmpty(workInfo.getString("AUDIT_USER_ID"))) {
back4to3(pd);
return ReturnMap.ok();
}
back4to2(pd);
return ReturnMap.ok();
}
if ("3".equals(workInfo.getString("APPLY_STATUS"))) {
back3to2(pd);
return ReturnMap.ok();
}
}
// 盲板
if ("gf_blindboard".equals(pd.getString("TYPE"))) {
// 1-》 作业负责人待审核 4-》 所在单位待审核 5-》待验收
if ("4".equals(workInfo.getString("APPLY_STATUS"))) {
blindboardBack4to1(pd);
return ReturnMap.ok();
}
if ("5".equals(workInfo.getString("APPLY_STATUS"))) {
blindboardBack5to4(pd);
return ReturnMap.ok();
}
}
// 受限空间
if ("gf_confinedspace".equals(pd.getString("TYPE"))) {
// 1-》 作业负责人待审核 4-》 所在单位待审核 5-》待验收
if ("4".equals(workInfo.getString("APPLY_STATUS"))) {
// 清理 气体监测 数据
blindboardBack4to1(pd);
clearGasMonitoring(pd);
clearGasWhMonitoring(pd);
return ReturnMap.ok();
}
if ("5".equals(workInfo.getString("APPLY_STATUS"))) {
blindboardBack5to4(pd);
return ReturnMap.ok();
}
}
return ReturnMap.ok();
}
@Transactional
public void clearGasWhMonitoring(PageData pd) {
gfHighWorkMapper.clearGasWhMonitoring(pd);
}
@Transactional
public void clearGasMonitoring(PageData pd) {
gfHighWorkMapper.clearGasMonitoring(pd);
}
@Transactional
public void blindboardBack4to1(PageData pd) {
gfHighWorkMapper.blindboardBack4to1(pd);
}
@Transactional
public void blindboardBack5to4(PageData pd) {
gfHighWorkMapper.blindboardBack5to4(pd);
}
@Transactional
public void back3to2(PageData pd) {
gfHighWorkMapper.back3to2(pd);
}
@Transactional
public void back4to2(PageData pd) {
gfHighWorkMapper.back4to2(pd);
}
@Transactional
public void back4to3(PageData pd) {
gfHighWorkMapper.back4to3(pd);
}
@Transactional
public void back5to3(PageData pd) {
gfHighWorkMapper.back5to3(pd);
}
@Transactional
public void back5to4(PageData pd) {
gfHighWorkMapper.back5to4(pd);
}
@Transactional
public void back5to2(PageData pd) {
gfHighWorkMapper.back5to2(pd);
}
@Transactional
public void back2to1(PageData pd) {
gfHighWorkMapper.clearMasterTable(pd);
gfHighWorkMapper.clearMeasures(pd);
gfHighWorkMapper.clearAcceptUser(pd);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -432,6 +432,7 @@
LEFT JOIN `qa-cmt-prevention`.sys_dictionaries dic ON d.FIRE_DEVICE_TYPE_ID = dic.BIANMA
WHERE
d.ISDELETE = 0 and p.isdelete = 0
<!--用与app 查询 消防设备类型-->
<if test="pd.FIRE_DEVICE_TYPE_ID != null and pd.FIRE_DEVICE_TYPE_ID != ''">
and d.FIRE_DEVICE_TYPE_ID = #{pd.FIRE_DEVICE_TYPE_ID}
</if>

View File

@ -0,0 +1,46 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.FHmainApplication;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.bus.ListManagerMapper;
import com.zcloud.service.gf.AppWorkBackService;
import com.zcloud.service.system.UsersService;
import com.zcloud.util.DateUtil;
import com.zcloud.util.HttpRequestUtil;
import com.zcloud.util.ReturnMap;
import com.zcloud.util.SpringUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = FHmainApplication.class)
public class TestDemo {
@Resource
private AppWorkBackService appWorkBackService;
// gf_highwork 高处作业
// gf_breakground 动土作业
@Test
public void test() throws Exception {
PageData pageData = new PageData();
// 当前状态 回根据实际变成上一步
pageData.put("APPLY_STATUS",4);
pageData.put("TYPE","gf_electricity");
pageData.put("ID","275872ca47824d19ab659792f89bce85");
pageData.put("OPERATTIME", DateUtil.date2Str(new Date()));
pageData.put("OPERATOR","123");
appWorkBackService.backOtherWork(pageData);
}
}