diff --git a/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java b/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java index 539d0b03..f37451b6 100644 --- a/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java +++ b/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java @@ -13,6 +13,9 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +/** + * created by liu jun 相关方人员同步接口 + */ @Controller @RequestMapping("/openApi/xfgUser") public class ApiXgfUserController extends BaseController { @@ -35,6 +38,27 @@ public class ApiXgfUserController extends BaseController { } } + @RequestMapping(value = "/syncPhoto") + @ResponseBody + public Object syncPhoto() throws Exception { + Map response = new HashMap(); + try { + PageData request = this.getPageData(); + xgfUserService.syncPhoto(request); + + response.put("code","0"); + response.put("result", "success"); + return response; + } catch (Exception e) { + e.printStackTrace(); + response.put("code","9999"); + response.put("result", "success"); + return response; + } + } + + + @RequestMapping(value = "/approvalApplication") @ResponseBody public Object approvalApplication() throws Exception { diff --git a/src/main/java/com/zcloud/controller/depository/TextLibraryController.java b/src/main/java/com/zcloud/controller/depository/TextLibraryController.java index 739f5228..d3b81c71 100644 --- a/src/main/java/com/zcloud/controller/depository/TextLibraryController.java +++ b/src/main/java/com/zcloud/controller/depository/TextLibraryController.java @@ -106,8 +106,7 @@ public class TextLibraryController extends BaseController { } else { pd.put("CATEGORY_ID", corp_info.getString("CORP_TYPE4")); } - if (StringUtils.isEmpty(pd.getString("CORPINFO_ID"))) - pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); + if (StringUtils.isEmpty(pd.getString("CORPINFO_ID")))pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); if ("3".equals(pd.getString("ASSOCIATION"))) { pd.put("TYPE_ONE", "43ed4012090d4614bb35da60d06c8264"); diff --git a/src/main/java/com/zcloud/controller/map/MapController.java b/src/main/java/com/zcloud/controller/map/MapController.java index 1226a031..2aae3e62 100644 --- a/src/main/java/com/zcloud/controller/map/MapController.java +++ b/src/main/java/com/zcloud/controller/map/MapController.java @@ -903,7 +903,7 @@ public class MapController extends BaseController { return map; } } - + // 一公司获取人员轨迹 @RequestMapping(value = "/getPersonTrace") @ResponseBody public Object getPersonTrace() throws Exception { diff --git a/src/main/java/com/zcloud/service/highriskwork/impl/HotWorkApplicationServiceImpl.java b/src/main/java/com/zcloud/service/highriskwork/impl/HotWorkApplicationServiceImpl.java index 5c13c373..439a4590 100644 --- a/src/main/java/com/zcloud/service/highriskwork/impl/HotWorkApplicationServiceImpl.java +++ b/src/main/java/com/zcloud/service/highriskwork/impl/HotWorkApplicationServiceImpl.java @@ -3,9 +3,12 @@ package com.zcloud.service.highriskwork.impl; import java.util.Date; import java.util.List; +import com.zcloud.entity.system.Dictionaries; import com.zcloud.service.highriskwork.HotWorkApplicationDelayedService; import com.zcloud.service.highriskwork.HotWorkApplicationUserService; +import com.zcloud.service.system.DictionariesService; import com.zcloud.util.DateUtil; +import com.zcloud.util.Tools; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -30,6 +33,8 @@ public class HotWorkApplicationServiceImpl implements HotWorkApplicationService{ private HotWorkApplicationUserService hotWorkApplicationUserService; @Autowired private HotWorkApplicationDelayedService hotWorkApplicationDelayedService; + @Autowired + private DictionariesService dictionariesService; /**新增 * @param pd @@ -87,7 +92,21 @@ public class HotWorkApplicationServiceImpl implements HotWorkApplicationService{ * @throws Exception */ public PageData findById(PageData pd)throws Exception{ - return hotworkapplicationMapper.findById(pd); + PageData data = hotworkapplicationMapper.findById(pd); + String workMethodId = data.getString("HOT_WORK_METHOD_ID"); + //动火方法 + if (Tools.notEmpty(workMethodId)) { + String[] split = workMethodId.split(","); + List dictionaries = dictionariesService.listSubDictByIds(split); + StringBuilder methodName = new StringBuilder(); + for (Dictionaries dictionary : dictionaries) { + methodName.append(dictionary.getNAME()).append(","); + } + methodName.deleteCharAt(methodName.length() - 1); + data.put("HOT_WORK_METHOD_NAME", methodName); + } + + return data; } /**批量删除 diff --git a/src/main/java/com/zcloud/service/xgf/XgfUserService.java b/src/main/java/com/zcloud/service/xgf/XgfUserService.java index 9e948b61..0509d206 100644 --- a/src/main/java/com/zcloud/service/xgf/XgfUserService.java +++ b/src/main/java/com/zcloud/service/xgf/XgfUserService.java @@ -44,4 +44,6 @@ public interface XgfUserService { void approveMax(PageData request, MultipartFile[] chengNuoShu) throws Exception; List getWorkTask(PageData condition) throws Exception; + + void syncPhoto(PageData request) throws Exception; } diff --git a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java index cc0e8d35..8d0cdc49 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java @@ -9,6 +9,7 @@ import com.zcloud.flow.xgf.util.XgfFlowDto; import com.zcloud.mapper.datasource.bus.CorpInfoMapper; import com.zcloud.mapper.datasource.xgf.*; import com.zcloud.service.system.DepartmentService; +import com.zcloud.service.system.UsersService; import com.zcloud.service.xgf.XgfUserService; import com.zcloud.util.*; import org.apache.commons.lang3.StringUtils; @@ -55,6 +56,9 @@ public class XgfUserServiceImpl implements XgfUserService { @Resource private FlowExecutor flowExecutor; + @Resource + private UsersService usersService; + @Override public void save(PageData pd) throws Exception { xgfUserMapper.save(pd); @@ -1018,10 +1022,19 @@ public class XgfUserServiceImpl implements XgfUserService { if (_list == null || _list.size() == 0) { throw new RuntimeException("请求数据异常"); } + PageData condition = new PageData(); + condition.put("USER_ID",request.getString("APPOINT_USER_ID")); + PageData userInfo = usersService.findById(condition); + if (userInfo != null && userInfo.size() > 0 && userInfo.get("ISMAIN") != null){ + if ("1".equals(userInfo.getString("ISMAIN"))){ + throw new RuntimeException("审批人不能指定主账号"); + } + } + List list = _list.stream().map(x -> x.getString("XGF_USER_ID")).collect(Collectors.toList()); - PageData condition = new PageData(); for (String x : list) { + condition.clear(); condition.put("FLOWS_ID", x); PageData flows = xgfFlowsMapper.findById(condition); if (flows == null || flows.size() == 0) { @@ -1064,6 +1077,18 @@ public class XgfUserServiceImpl implements XgfUserService { return xgfUserMapper.getWorkTask(condition); } + @Override + public void syncPhoto(PageData request) throws Exception { + PageData condition = new PageData(); + condition.put("XGF_USER_DETAILS_ID",request.get("USER_ID")); + PageData detailEntity = xgfUserDetailsMapper.findById(condition); + if (detailEntity == null || detailEntity.size() == 0){ + throw new RuntimeException("未找到该用户详细信息"); + } + detailEntity.put("PHOTO",request.get("PHOTO")); + xgfUserDetailsMapper.edit(detailEntity); + } + private String getType(String corpInfoId) { // created bu liu jun - 港务局要求,可以直接指定集团单位 if ("1".equals(corpInfoId)) { diff --git a/src/main/resources/mybatis/datasource/depository/TextLibraryMapper.xml b/src/main/resources/mybatis/datasource/depository/TextLibraryMapper.xml index 46ef1d8c..90e65317 100644 --- a/src/main/resources/mybatis/datasource/depository/TextLibraryMapper.xml +++ b/src/main/resources/mybatis/datasource/depository/TextLibraryMapper.xml @@ -178,6 +178,12 @@ and f.CORPINFO_ID != #{pd.ENTERPRISE_SIDE} + + and f.MIGRATION_FLAG = #{pd.MIGRATION_FLAG} + + + and (f.MIGRATION_FLAG = '0' or f.MIGRATION_FLAG is null) + order by f.ISTOPTIME desc,f.CREATED_TIME desc diff --git a/src/main/resources/mybatis/datasource/highriskwork/HotWorkApplicationMapper.xml b/src/main/resources/mybatis/datasource/highriskwork/HotWorkApplicationMapper.xml index 2df76a17..1f51a337 100644 --- a/src/main/resources/mybatis/datasource/highriskwork/HotWorkApplicationMapper.xml +++ b/src/main/resources/mybatis/datasource/highriskwork/HotWorkApplicationMapper.xml @@ -155,13 +155,13 @@ select , u.NAME CREATORNAME, - d.NAME DEPARTMENTNAME, - p.name as HOT_WORK_METHOD_NAME + d.NAME DEPARTMENTNAME + from f left join sys_user u on f.CREATOR = u.USER_ID left join oa_department d on d.DEPARTMENT_ID = u.DEPARTMENT_ID - left join sys_dictionaries p on f.HOT_WORK_METHOD_ID = p.DICTIONARIES_ID + where f.HOTWORKAPPLICATION_ID = #{HOTWORKAPPLICATION_ID}