pc端对接问题修复
parent
404bb8547a
commit
d505ea199b
|
@ -50,7 +50,6 @@ public class AppImgFilesController extends BaseController {
|
|||
@RequestMapping(value = "/add", headers = "content-type=multipart/form-data")
|
||||
@ResponseBody
|
||||
@Transactional
|
||||
@DockAnnotation(hasAnnex = true)
|
||||
public Object finish(
|
||||
@RequestParam(value = "FFILE", required = false) MultipartFile[] files,
|
||||
@RequestParam(value = "TYPE", required = false) String TYPE,
|
||||
|
@ -118,7 +117,6 @@ public class AppImgFilesController extends BaseController {
|
|||
}
|
||||
}
|
||||
map.put("result", errInfo);
|
||||
map.put("dockData", "对接接口");
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
|
@ -103,6 +103,7 @@ public class HiddenApiController extends BaseController {
|
|||
@RequestMapping(value = "/addHidden")
|
||||
@RequiresPermissions("hidden:add")
|
||||
@ResponseBody
|
||||
@DockAnnotation
|
||||
public Object addHiddenApi() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
|
@ -165,13 +166,15 @@ public class HiddenApiController extends BaseController {
|
|||
/** 处理 隐患 部位的方法 .如果用户填入的隐患部位是输入的 */
|
||||
if ("value".equals(pd.getString("hiddenPartType"))) {
|
||||
PageData hiddenRegion = hiddenRegionService.saveHidden(pd.getString("HIDDENPART"));
|
||||
pd.put("saveHidden",JSON.toJSONString(hiddenRegion));
|
||||
pd.put("HIDDENPART", hiddenRegion.getString("HIDDENREGION_ID"));
|
||||
}
|
||||
/** 隐患的主要负责人 一条隐患 多个隐患发现人 ,把多个信息填入这个张表中 */
|
||||
hiddenUserApiService.saveRectificationo(pd.getString("findCreator"), pd.getString("HIDDEN_ID"), "1", Jurisdiction.getUSER_ID());
|
||||
PageData saveRectificationo = hiddenUserApiService.saveRectificationo(pd.getString("findCreator"), pd.getString("HIDDEN_ID"), "1", Jurisdiction.getUSER_ID());
|
||||
pd.put("saveRectificationo",JSON.toJSONString(saveRectificationo));
|
||||
/** 初始化隐患确认信息 记录隐患发现人的隐患等级等信息 */
|
||||
hiddenExamineApiService.saveConfirm(pd, "0");
|
||||
|
||||
PageData saveConfirm = hiddenExamineApiService.saveConfirm(pd, "0");
|
||||
pd.put("saveConfirm",JSON.toJSONString(saveConfirm));
|
||||
/* 隐患的立即整改 填入整改信息,其他的信息是一样的 */
|
||||
if ("1".equals(pd.getString("RECTIFICATIONTYPE"))) {
|
||||
pd.put("RECTIFICATIONTIME", DateUtil.getDay()); // 整改时间
|
||||
|
@ -180,16 +183,20 @@ public class HiddenApiController extends BaseController {
|
|||
pd.put("STATE", "-2");
|
||||
}
|
||||
/** 重大隐患管理 , 如果是重大隐患,隐患确认必须是部门负责人*/
|
||||
if (pd.getString("HIDDENLEVEL").equals("jdyh001") || pd.getString("HIDDENLEVEL").equals("hiddenLevel2002")) {//判断是否是重大隐患
|
||||
if (pd.getString("HIDDENLEVEL").equals("jdyh001") || pd.getString("HIDDENLEVEL").equals("hiddenLevel2002")) {
|
||||
//判断是否是重大隐患
|
||||
PageData loginDeptPd = new PageData();
|
||||
loginDeptPd.put("DEPARTMENT_ID", Jurisdiction.getDEPARTMENT_ID());
|
||||
PageData longinfoUserDept = departmentService.findById(loginDeptPd);//获取登录人部门信息
|
||||
if (Tools.isEmpty(longinfoUserDept) || Tools.isEmpty(longinfoUserDept.getString("HEADMAN"))) {// 查看部门是否有负责人
|
||||
if (Tools.isEmpty(longinfoUserDept) || Tools.isEmpty(longinfoUserDept.getString("HEADMAN"))) {
|
||||
// 查看部门是否有负责人
|
||||
return ResultCodeConstant.resMap(000201); //所在部门未维护部门负责人
|
||||
} else {//如何维护了,隐患确认人就要成为部门负责人
|
||||
} else {
|
||||
//如何维护了,隐患确认人就要成为部门负责人
|
||||
pd.put("CONFIRM_USER", longinfoUserDept.getString("HEADMAN"));//通过名字查询用户获取出ID
|
||||
}
|
||||
}
|
||||
pd.put("saveApi",JSON.toJSONString(pd));
|
||||
hiddenApiService.saveApi(pd);
|
||||
/* 发送隐患的通知公告 */
|
||||
Map<String, Object> notRepr = new HashMap<>();
|
||||
|
@ -215,9 +222,9 @@ public class HiddenApiController extends BaseController {
|
|||
* 整改期限 ,RECTIFICATIONDEADLINE
|
||||
*
|
||||
*/
|
||||
|
||||
map.put("result", errInfo);
|
||||
map.put("pd", pd);
|
||||
map.put("dockData",JSON.toJSONString(pd));
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,13 +64,15 @@ public interface HiddenUserApiService {
|
|||
|
||||
/**
|
||||
* 添加隐患相关人员信息 -- 有主要处理人
|
||||
*
|
||||
* @param findCreator 用户ids
|
||||
* @param hiddenId 隐患id
|
||||
* @param type 类别
|
||||
* @param loginUserId 登录人的ID
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public void saveRectificationo(String findCreator ,String hiddenId,String type,String loginUserId)throws Exception;
|
||||
public PageData saveRectificationo(String findCreator , String hiddenId, String type, String loginUserId)throws Exception;
|
||||
|
||||
/**
|
||||
* 根据隐患id获取隐患发现人
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.zcloud.service.hiddenApi.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.hiddenApi.HiddenUserApiMapper;
|
||||
|
@ -10,9 +11,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 说明:隐患 相关人员信息
|
||||
|
@ -94,13 +94,16 @@ public class HiddenUserApiServiceImpl implements HiddenUserApiService {
|
|||
}
|
||||
/**
|
||||
* 添加隐患相关人员信息 -- 有主要处理人
|
||||
*
|
||||
* @param findCreator 用户ids
|
||||
* @param hiddenId 隐患id
|
||||
* @param type 类别
|
||||
* @param loginUserId 登录人的ID
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public void saveRectificationo(String findCreator ,String hiddenId,String type,String loginUserId)throws Exception{
|
||||
public PageData saveRectificationo(String findCreator , String hiddenId, String type, String loginUserId)throws Exception{
|
||||
PageData pageData = new PageData();
|
||||
if(!Tools.isEmpty(hiddenId)){
|
||||
hiddenUserApiMapper.deleteByHidden(hiddenId); // 先删除后添加
|
||||
}
|
||||
|
@ -108,6 +111,7 @@ public class HiddenUserApiServiceImpl implements HiddenUserApiService {
|
|||
if(!Tools.isEmpty(findCreator)){
|
||||
String removeLoginUser = findCreator.replaceAll(loginUserId,""); //去除当前登录人的用户id
|
||||
String userID [] = removeLoginUser.split(",");
|
||||
ArrayList<PageData> hiddenUserList = new ArrayList<>();
|
||||
for (int i =0;i<userID.length;i++){
|
||||
if(!Tools.isEmpty(userID[i])){
|
||||
PageData pd = new PageData();
|
||||
|
@ -116,9 +120,11 @@ public class HiddenUserApiServiceImpl implements HiddenUserApiService {
|
|||
pd.put("USER_ID",userID[i]);
|
||||
pd.put("TYPE",type);
|
||||
pd.put("IS_MAIN","0");
|
||||
hiddenUserList.add(pd);
|
||||
hiddenUserApiMapper.save(pd);
|
||||
}
|
||||
}
|
||||
pageData.put("hiddenUserList", JSON.toJSONString(hiddenUserList));
|
||||
}
|
||||
}
|
||||
PageData pd = new PageData();
|
||||
|
@ -127,7 +133,9 @@ public class HiddenUserApiServiceImpl implements HiddenUserApiService {
|
|||
pd.put("USER_ID",loginUserId);
|
||||
pd.put("TYPE",type);
|
||||
pd.put("IS_MAIN","1");
|
||||
pageData.put("hiddenUser",JSON.toJSONString(pd));
|
||||
hiddenUserApiMapper.save(pd);
|
||||
return pageData;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue