重点工程流程修复

pull/4/head
zhangqihang 2024-02-20 14:26:09 +08:00
parent 98103d92f3
commit 6b46ce0337
7 changed files with 352 additions and 0 deletions

View File

@ -278,4 +278,131 @@ public class AppKeyProjectsController extends BaseController {
// map.put("result", errInfo);
// return map;
// }
/**
* @throws Exception
*/
@RequestMapping(value="/outSouceslistPage")
@ResponseBody
public Object outSouceslistPage(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());
String UserId = pd.getString("UserId");
if(!StringUtils.equals("1",UserId)){
String CORPINFO_ID = pd.getString("CORPINFO_ID");
// -- 河港机械 河港港工 河港检测
if(!StringUtils.equals(CORPINFO_ID,"1e6dbbe16004402f8d2c0e52afd9a676")
&&!StringUtils.equals(CORPINFO_ID,"3a854eefa7894e06aaa1a2611bca80f6")&&
!StringUtils.equals(CORPINFO_ID,"020578a4c1f04bc692ee25145c2efbe5")
&&!StringUtils.equals(CORPINFO_ID,"90966974de3c4b83aca6f8fd6432d5c2")){
pd.put("DeptId",outsourcedService.getDeptId(UserId));
pd.put("UserId",UserId);
}
}
page.setPd(pd);
List<PageData> varList = outsourcedService.outSouceslistPage(page); //列出OutSourced列表
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/getDingWeiSum")
@ResponseBody
public Object getDingWeiSum() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
Integer co = outsourcedService.getDingWeiSum(pd); //获取未定位的工程和视频总量 >1 则不让申请开工
if(co>0){
map.put("code", "500");
}else {
map.put("code", "0");
}
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/updateState")
@ResponseBody
public Object updateState() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
outsourcedService.updateState(pd); //获取同时绑定的重点工程信息如果大于1表示还有其他重点工程
map.put("result", errInfo);
return map;
}
/**
*
* @return
* @throws Exception
*/
@RequestMapping(value = "/checkEnd")
@ResponseBody
public Object jie() throws Exception {
Map<String, String> map = new HashMap<String, String>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
//校验当前重点工程是否存在未完成的隐患 包含未整改未处罚ai报警未处置的
PageData pageData = outsourcedService.jieshuOutSourced(pd);
if(!StringUtils.equals("0",pageData.getString("qr"))){
map.put("result", errInfo);
map.put("message","当前重点工程还有"+pageData.getString("qr")+"项待确认安全环保检查,请处理以后再结束");
map.put("code","500");
return map;
}
if(!StringUtils.equals("0",pageData.getString("zg"))){
map.put("result", errInfo);
map.put("message","当前重点工程还有"+pageData.getString("zg")+"项需整改的隐患,请处理以后再结束");
map.put("code","500");
return map;
}
if(!StringUtils.equals("0",pageData.getString("ys"))){
map.put("result", errInfo);
map.put("message","当前重点工程还有"+pageData.getString("ys")+"项待验收隐患,请处理以后再结束");
map.put("code","500");
return map;
}
if(!StringUtils.equals("0",pageData.getString("cf"))){
map.put("result", errInfo);
map.put("message","当前重点工程还有"+pageData.getString("cf")+"项待处罚隐患,请处理以后再结束");
map.put("code","500");
return map;
}
if(!StringUtils.equals("0",pageData.getString("fk"))){
map.put("result", errInfo);
map.put("message","当前重点工程还有"+pageData.getString("fk")+"项处罚待反馈隐患,请处理以后再结束");
map.put("code","500");
return map;
}
if(!StringUtils.equals("0",pageData.getString("ai"))){
map.put("result", errInfo);
map.put("message","当前重点工程还有"+pageData.getString("ai")+"项AI报警待处置,请处理以后再结束");
map.put("code","500");
return map;
}
map.put("code","0");
map.put("result", errInfo); //返回结果
return map;
}
}

View File

@ -544,4 +544,24 @@ public class OutSourcedController extends BaseController {
return mv;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/updateState")
@ResponseBody
public Object updateState() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("OPERATOR", Jurisdiction.getUsername());
outsourcedService.updateState(pd);
map.put("result", errInfo); //返回结果
return map;
}
}

View File

@ -63,6 +63,20 @@ public class UnitsController extends BaseController {
}
pd.put("UNITS_ID", pd.getString("UNITS_ID"));
List<PageData> list = unitsService.listAll(pd);
for (PageData pageData : list) {
if (pageData.get("CODE").equals(pd.get("CODE"))){
errInfo = "fail";
map.put("result", errInfo);
map.put("msg", "统一社会信用代码重复");
return map;
}
if (pageData.get("UNITS_NAME").equals(pd.get("UNITS_NAME"))){
errInfo = "fail";
map.put("result", errInfo);
map.put("msg", "相关方单位名称重复");
return map;
}
}
unitsService.save(pd);
map.put("result", errInfo);
return map;

View File

@ -84,5 +84,11 @@ public interface OutSourcedMapper{
void jie(PageData pd);
void start(PageData pd);
void updateState(PageData pd);
List<PageData> outSouceslistPage(Page page);
Integer getDingWeiSum(PageData pd);
}

View File

@ -84,5 +84,16 @@ public interface OutSourcedService{
public void jie(PageData pd)throws Exception;
void start(PageData pd);
void updateState(PageData pd);
/**
*
* @param page
* @return
*/
List<PageData> outSouceslistPage(Page page);
Integer getDingWeiSum(PageData pd);
}

View File

@ -4,10 +4,13 @@ import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.relatedparty.OutSourcedMapper;
import com.zcloud.service.relatedparty.OutSourcedService;
import com.zcloud.util.DateUtil;
import com.zcloud.util.Jurisdiction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
/**
@ -127,6 +130,22 @@ public class OutSourcedServiceImpl implements OutSourcedService{
outsourcedMapper.start(pd);
}
@Override
public void updateState(PageData pd) {
pd.put("OPERATTIME", DateUtil.date2Str(new Date()));
outsourcedMapper.updateState(pd);
}
@Override
public List<PageData> outSouceslistPage(Page page) {
return outsourcedMapper.outSouceslistPage(page);
}
@Override
public Integer getDingWeiSum(PageData pd) {
return outsourcedMapper.getDingWeiSum(pd);
}
}

View File

@ -645,6 +645,134 @@
WHERE o.OUTSOURCED_ID=#{OUTSOURCED_ID}
</select>
<!-- 列表 -->
<select id="outSouceslistPage" parameterType="page" resultType="pd">
select
f.CONTRACT_PIC,
f.STARTTIME,
f.ENDTIME,
f.OUTSOURCED_NAME,
f.CONTRACT_STIME,
f.CONTRACT_ETIME,
f.CONTRACT_NUM,
f.UNITS_APTITUDE,
f.UNITS_PIC,
f.UNITS_PHONE,
f.MANAGE_NAME,
f.DESIGE,
f.MANAGE_APTITUDE,
f.MANAGE_PIC,
f.MANAGE_PHONE,
f.MEASURES,
f.ATTACHMENTS,
f.REMARKS,
f.TRAINING_NAME,
f.TRAINING_PIC,
f.TRAINING_STIME,
f.TRAINING_ETIME,
f.RECORDS,
f.SHEET,
f.EXAMINATION,
f.OATTACHMENTS,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.ISDELETE,
f.CORPINFO_ID,
f.APPLICANT,
f.STATE,
f.OUTSOURCED_ID,
f.UNITS_APTITUDEPATH,
f.MANAGE_APTITUDEPATH,
f.MEASURESPATH,
f.DESIGEPATH,
f.ATTACHMENTSPATH,
f.RECORDSPATH,
f.SHEETPATH,
f.EXAMINATIONPATH,
f.OATTACHMENTSPATH,
a.NAME as DEPARTMENT_ID,
pcij.NAME Q_DEPARTMENT_NAME,
isdd.NAME MANAGER_DEPARTMENT_NAME,
b.UNITS_NAME as UNITS_NAME,
vua.NAME OUTSOURCED_CREATOR_NAME,
pci.NAME Q_COMPETENT_DEPT_NAME,
( SELECT GROUP_CONCAT( t.NAME ) FROM oa_department t WHERE FIND_IN_SET( t.DEPARTMENT_ID, f.DEPARTMENT_ID ) ) AS DEPARTMENT_NAME,
( select count(1) from BUS_KEYPROJECTCHECK c where c.OUTSOURCED_ID = f.OUTSOURCED_ID) as CHECK_COUNT,
( select GROUP_CONCAT(t.CORP_NAME) from BUS_CORP_INFO t where FIND_IN_SET(t.CORPINFO_ID, f.MANAGE_NAME)) as MANAGE_CORPS_NAME,
( SELECT GROUP_CONCAT( t.NAME ) FROM oa_department t WHERE FIND_IN_SET( t.DEPARTMENT_ID, f.INVOLVING_CORPS_DEPART_ID ) ) AS INVOLVING_CORPS_DEPART_NAME,
(select GROUP_CONCAT(t.NAME) from ( SELECT CONCAT( CONCAT( c.CORP_NAME, '-' ), t.NAME ) NAME ,t.DEPARTMENT_ID FROM OA_DEPARTMENT t LEFT JOIN bus_corp_info c ON c.CORPINFO_ID = t.CORPINFO_ID) t where FIND_IN_SET(t.DEPARTMENT_ID, f.JURISDICTION_UNIT)) as JURISDICTION_UNIT_NAME,
ifnull(vac.CORP_NAME,'秦港股份有限公司') CORP_NAME,
p.`NAME` as UNITS_PIC_NAME
from
<include refid="tableName"></include> f
LEFT JOIN oa_department pci ON pci.DEPARTMENT_ID = f.COMPETENT_DEPT_ID
LEFT JOIN oa_department isdd ON isdd.DEPARTMENT_ID = f.MANAGER_DEPARTMENT_ID
LEFT JOIN oa_department pcij ON pcij.DEPARTMENT_ID = f.DEPARTMENT_ID
left join oa_department a on a.DEPARTMENT_ID = f.DEPARTMENT_ID
left join bus_units b using (UNITS_ID)
LEFT JOIN vi_user_all vua on f.CREATOR = vua.USERNAME
LEFT JOIN vi_all_corp vac on vua.CORPINFO_ID = vac.CORPINFO_ID
LEFT JOIN bus_personnelmanagement p on p.PERSONNELMANAGEMENT_ID = f.UNITS_PIC
where f.ISDELETE = '0'
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- 根据需求自己加检索条件-->
f.OUTSOURCED_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
b.UNITS_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
f.UNITS_PIC LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
pcij.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
)
</if>
<if test="pd.OUTSOURCED_NAME != null and pd.OUTSOURCED_NAME !=''">
and f.OUTSOURCED_NAME = #{pd.OUTSOURCED_NAME}
</if>
<if test="pd.UNITS_ID != null and pd.UNITS_ID !=''">
and f.UNITS_ID = #{pd.UNITS_ID}
</if>
<if test="pd.INVOLVING_CORP != null and pd.INVOLVING_CORP !=''">
and f.INVOLVING_CORPS LIKE CONCAT(CONCAT('%', #{pd.INVOLVING_CORP}),'%')
</if>
<if test="pd.DEPARTMENT_ID != null and pd.DEPARTMENT_ID !=''">
and f.DEPARTMENT_ID LIKE CONCAT(CONCAT('%', #{pd.DEPARTMENT_ID}),'%')
</if>
<if test="pd.COMPETENT_DEPT_ID != null and pd.COMPETENT_DEPT_ID !=''">
and f.COMPETENT_DEPT_ID LIKE CONCAT(CONCAT('%', #{pd.COMPETENT_DEPT_ID}),'%')
</if>
<if test="pd.GROUP_UNIT != null and pd.GROUP_UNIT !=''">
and f.GROUP_UNIT LIKE CONCAT(CONCAT('%', #{pd.GROUP_UNIT}),'%')
</if>
<if test="pd.CORP_NAME != null and pd.CORP_NAME !=''">
and vac.CORP_NAME LIKE CONCAT(CONCAT('%', #{pd.CORP_NAME}),'%')
</if>
<if test="pd.STATE != null and pd.STATE !=''">
and f.STATE = #{pd.STATE}
</if>
<if test="pd.CONTRACT_STIME != null and pd.CONTRACT_STIME !=''">
and (f.CONTRACT_STIME between #{pd.CONTRACT_STIME} and #{pd.CONTRACT_ETIME}
or f.CONTRACT_ETIME between #{pd.CONTRACT_STIME} and #{pd.CONTRACT_ETIME}
or (f.CONTRACT_STIME &lt; #{pd.CONTRACT_STIME} and f.CONTRACT_ETIME &gt; #{pd.CONTRACT_ETIME}))
</if>
<if test="pd.DeptId != null and pd.DeptId !=''">
and ( f.DEPARTMENT_ID LIKE CONCAT(CONCAT('%', #{pd.DeptId}),'%')
or f.COMPETENT_DEPT_ID LIKE CONCAT(CONCAT('%', #{pd.DeptId}),'%')
or f.INVOLVING_CORPS LIKE CONCAT(CONCAT('%', #{pd.DeptId}),'%')
or f.INVOLVING_CORPS_DEPART_ID LIKE CONCAT(CONCAT('%', #{pd.DeptId}),'%')
or f.JURISDICTION_UNIT LIKE CONCAT(CONCAT('%', #{pd.DeptId}),'%')
or f.PUNISH_THE_PERSON LIKE CONCAT(CONCAT('%', #{pd.UserId}),'%')
or f.CREATOR = #{pd.UserId}
)
</if>
ORDER BY
f.STATE,
f.OPERATTIME DESC
</select>
<!-- 修改 -->
<update id="jie" parameterType="pd">
update
@ -695,4 +823,31 @@
OUTSOURCED_ID = #{OUTSOURCED_ID}
</update>
<update id="updateState" parameterType="pd">
update
<include refid="tableName"></include>
set
STATE = #{STATE},
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
OUTSOURCED_ID = #{OUTSOURCED_ID}
</update>
<select id="getDingWeiSum" parameterType="pd" resultType="int">
SELECT
sum( c.co )
FROM
(
SELECT
COUNT( OUTSOURCED_ID ) co
FROM
bus_outsourced
WHERE
ISDELETE = '0'
AND OUTSOURCED_ID = #{OUTSOURCED_ID}
AND (WORK_LATITUDE IS NULL or WORK_LATITUDE = '' )
AND (WORK_LONGITUDE IS NULL or WORK_LONGITUDE = '' )
) c
</select>
</mapper>