Merge branch 'refs/heads/pet' into dev

dev-9.10-修复中台bug-xuyifeng
water_xu 2024-09-05 18:27:16 +08:00
commit 6e9a25d7f4
21 changed files with 1093 additions and 39 deletions

View File

@ -110,6 +110,7 @@ public class ArchivesFilesController extends BaseController {
pd = this.getPageData();
archivesfilesService.edit(pd);
map.put("result", errInfo);
// map.put("pd", pd);
return map;
}

View File

@ -9,6 +9,8 @@ import java.util.Map;
import com.zcloud.service.bus.CorpInfoRelatedService;
import com.zcloud.service.system.DictionariesService;
import com.zcloud.syncData.SyncPlatformAdvice;
import com.zcloud.syncData.SyncTypeEnum;
import com.zcloud.util.*;
import net.sf.json.JSONArray;
import org.apache.commons.io.FileUtils;
@ -79,6 +81,7 @@ public class CorpInfoController extends BaseController {
@RequiresPermissions("corpinfo:add")
@ResponseBody
@Transactional
@SyncPlatformAdvice(type = SyncTypeEnum.CORP, isInsert = true)
public Object add() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
@ -123,6 +126,8 @@ public class CorpInfoController extends BaseController {
map.put("pd",pd);
map.put("result", errInfo);
map.put("syncInfo", corpinfoService.findById(pd));
map.put("code", "0");
return map;
}
@ -133,13 +138,17 @@ public class CorpInfoController extends BaseController {
@RequestMapping(value="/delete")
@RequiresPermissions("corpinfo:del")
@ResponseBody
@SyncPlatformAdvice(type = SyncTypeEnum.CORP, isUpdate = true)
public Object delete() throws Exception{
Map<String,String> map = new HashMap<String,String>();
Map map = new HashMap();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
corpinfoService.delete(pd);
map.put("result", errInfo); //返回结果
pd.put("ISDELETE", "1");
map.put("syncInfo", pd);
map.put("code", "0");
return map;
}
@ -150,6 +159,7 @@ public class CorpInfoController extends BaseController {
@RequestMapping(value="/edit", headers = "content-type=multipart/form-data")
@ResponseBody
@Transactional
@SyncPlatformAdvice(type = SyncTypeEnum.CORP, isUpdate = true)
public Object edit(
@RequestParam(value="imgFiles",required=false) MultipartFile[] imgFiles,
@RequestParam(value="fourFiles",required=false) MultipartFile[] fourFiles) throws Exception{
@ -188,7 +198,8 @@ public class CorpInfoController extends BaseController {
corpinfoService.editCorpUserNew(pdNew);
corpinfoService.editCorpdeptNew(pdNew);
map.put("syncInfo", corpinfoService.findById(pd));
map.put("code", "0");
return map;
}
@RequestMapping(value="/editIsReceive")

View File

@ -6,6 +6,8 @@ import com.alibaba.fastjson.JSONObject;
import com.zcloud.entity.system.User;
import com.zcloud.service.system.PostService;
import com.zcloud.service.system.SupervisionDepartmentService;
import com.zcloud.syncData.SyncPlatformAdvice;
import com.zcloud.syncData.SyncTypeEnum;
import com.zcloud.util.DateUtil;
import com.zcloud.util.ObjectExcelView;
import net.sf.json.JSONArray;
@ -58,6 +60,7 @@ public class DepartmentController extends BaseController {
@RequestMapping(value = "/add")
@RequiresPermissions("department:add")
@ResponseBody
@SyncPlatformAdvice(type = SyncTypeEnum.DEPARTMENT, isInsert = true)
public Object add(Page page) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
@ -100,6 +103,8 @@ public class DepartmentController extends BaseController {
}
}
map.put("result", errInfo); //返回结果
map.put("syncInfo", departmentService.findById(pd));
map.put("code", "0");
return map;
}
@ -157,6 +162,7 @@ public class DepartmentController extends BaseController {
@RequestMapping(value = "/delete")
@RequiresPermissions("department:del")
@ResponseBody
@SyncPlatformAdvice(type = SyncTypeEnum.DEPARTMENT, isUpdate = true)
public Object delete(@RequestParam String DEPARTMENT_ID) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
@ -181,6 +187,9 @@ public class DepartmentController extends BaseController {
}
map.put("result", errInfo); //返回结果
pd.put("ISDELETE", "1");
map.put("syncInfo", pd);
map.put("code", "0");
return map;
}
@ -193,6 +202,7 @@ public class DepartmentController extends BaseController {
@RequestMapping(value = "/edit")
@RequiresPermissions("department:edit")
@ResponseBody
@SyncPlatformAdvice(type = SyncTypeEnum.DEPARTMENT, isUpdate = true)
public Object edit() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
@ -244,6 +254,8 @@ public class DepartmentController extends BaseController {
}
}
map.put("result", errInfo); //返回结果
map.put("syncInfo", departmentService.findById(pd));
map.put("code", "0");
return map;
}

View File

@ -798,7 +798,7 @@ public class UsersController extends BaseController {
usersService.editUserFuns(pd); //执行修改
map.put("result", errInfo);
map.put("code", "0");
map.put("syncInfo", JSONUtils.toJSONString(usersService.findById(pd)));
map.put("syncInfo", JSONUtil.toJsonStr(usersService.findById(pd)));
return map;
}
@ -830,7 +830,7 @@ public class UsersController extends BaseController {
FHLOG.save(Jurisdiction.getUsername(), "从个人资料中修改" + pd.getString("USERNAME") + "的资料"); //记录日志
map.put("result", errInfo);
map.put("code", "0");
map.put("syncInfo", JSONUtils.toJSONString(usersService.findById(pd)));
map.put("syncInfo", JSONUtil.toJsonStr(usersService.findById(pd)));
return map;
}
@ -1051,6 +1051,12 @@ public class UsersController extends BaseController {
pd = this.getPageData();
Map<String, String> returnMap = null;
if (pd.getString("ISPUSH").equals("1")) {
// ------联通人员定位删除人员用------
// 用于获取除UID ISDELETE外的其他信息
PageData detail = usersService.findById(pd);
pd.putAll(detail);
// -------------------------------
pd.put("ISDELETE","1");
HashMap<String, String> param = new HashMap<>();
Set set = pd.keySet();
@ -2584,4 +2590,115 @@ public class UsersController extends BaseController {
}
return returnMap;
}
static String CREATOR = null;
static String OPERATOR = null;
@RequestMapping(value = "/initCore")
@ResponseBody
public Object initCore() throws Exception {
PageData p1d = new PageData();
// pd = this.getPageData();
if (CREATOR == null) {
CREATOR = Jurisdiction.getUSER_ID();
OPERATOR = Jurisdiction.getUSER_ID();
}
List<PageData> pageData = usersService.listAllUser(p1d);
for (PageData pd : pageData) {
try {
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //创建时间
pd.put("CREATOR", CREATOR); //创建人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("OPERATOR", OPERATOR); //修改人
PageData sexPd = new PageData();
if (Tools.notEmpty(pd.getString("SEX"))) {
sexPd.put("DICTIONARIES_ID", pd.getString("SEX"));
PageData byId = dictionariesService.findById(sexPd);
if (Tools.notEmpty(byId)) {
pd.put("SEX", byId.getString("NAME"));
}
}
StringBuilder ORG_PATH = new StringBuilder();
boolean hasPid = true;
PageData department = departmentService.findById(pd);
if (department != null) {
ORG_PATH.insert(0, department.getString("NAME"));
String deptId = department.getString("PARENT_ID");
PageData deptPd = new PageData();
deptPd.put("DEPARTMENT_ID", deptId);
if (!"0".equals(department.get("PARENT_ID"))) {
while (hasPid) {
PageData dept = departmentService.findById(deptPd);
if ("0".equals(dept.get("PARENT_ID"))) {
hasPid = false;
} else {
deptId = dept.getString("PARENT_ID");
deptPd.put("DEPARTMENT_ID", deptId);
}
ORG_PATH.insert(0, dept.getString("NAME") + "/");
}
}
pd.put("ORG_PATH", ORG_PATH);
} else {
ORG_PATH.insert(0, "");
}
PageData CorpName = corpInfoService.findById(pd);
pd.put("CORPINFO_NAME", CorpName == null ? "" : CorpName.getString("CORP_NAME"));
pd.put("USER_TYPE", "1");
HashMap<String, Object> param = new HashMap<>();
Set set = pd.keySet();
for (Object key : set) {
param.put(key.toString(), pd.getString(key.toString()));
}
//要推送的照片集合
List<PageData> userPhotoDTOList = new ArrayList<>();
//人脸照片
PageData photoPd = new PageData();
photoPd.put("USER_PHOTO_ID", pd.getString("IMGFILES_ID"));
photoPd.put("USER_ID", pd.getString("FOREIGN_KEY"));
photoPd.put("PHOTO_URL", pd.getString("FILEPATH"));
photoPd.put("PHOTO_TYPE", "1");
photoPd.put("ISDELETE", "0");
userPhotoDTOList.add(photoPd);
param.put("userPhotoDTOList", userPhotoDTOList);
String userResult = HttpClientUtilDoGet.sendHttpGet(tongBuUrl + "/docking/core/user/getUserInfoById" + "?USER_ID=" + pd.getString("USER_ID"));
Map<String, Object> userReturnMap = (Map<String, Object>) JSON.parse(userResult);
if (userReturnMap.get("USERINFO") != null) { //有用户数据获取修改信息
PageData userInfoPd = JSON.parseObject(userReturnMap.get("USERINFO").toString(), PageData.class);
String updateDescription = UpdateEnum.getUpdateDescription(userInfoPd, pd);
param.put("REMARKS", updateDescription);
} else { //没有数据则获取新增信息
String insertDescription = UpdateEnum.getInsertDescription(pd);
param.put("REMARKS", insertDescription);
}
String UserDto = JSON.toJSONString(param);
String result = HttpClientUtilDoGet.sendHttpPost(tongBuUrl + "/docking/core/user/addOrUpdate", UserDto, null);
Map<String, String> returnMap = (Map<String, String>) JSON.parse(result);
if (returnMap.get("result").equals("success")) {
PageData pushPd = new PageData();
pushPd.put("ISPUSH", "1");
if (!Tools.isEmpty(pd.get("operateType")) && pd.getString("operateType").equals("delete")) {
pushPd.put("ISDELETE", "1");
} else {
pushPd.put("ISDELETE", "0");
}
pushPd.put("USER_ID", pd.getString("USER_ID"));
usersService.editPushStatus(pushPd);
}
}catch (Exception e){
}
}
return null;
}
}

View File

@ -0,0 +1,42 @@
package com.zcloud.mapper.datasource.core;
import com.zcloud.entity.PageData;
import java.util.List;
/**
* Mapper
*/
public interface CoreSyncCorpMapper {
/**()
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
/**
* @param pd
* @throws Exception
*/
void delete(PageData pd);
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findById(PageData pd);
}

View File

@ -0,0 +1,42 @@
package com.zcloud.mapper.datasource.core;
import com.zcloud.entity.PageData;
import java.util.List;
/**
* Mapper
*/
public interface CoreSyncDeptMapper {
/**()
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
/**
* @param pd
* @throws Exception
*/
void delete(PageData pd);
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findById(PageData pd);
}

View File

@ -0,0 +1,42 @@
package com.zcloud.mapper.datasource.core;
import com.zcloud.entity.PageData;
import java.util.List;
/**
* Mapper
*/
public interface CoreSyncUserMapper {
/**()
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
/**
* @param pd
* @throws Exception
*/
void delete(PageData pd);
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findById(PageData pd);
}

View File

@ -0,0 +1,39 @@
package com.zcloud.service.core;
import com.zcloud.entity.PageData;
import java.util.List;
public interface CoreSyncCorpService {
/**()
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
/**
* @param pd
* @throws Exception
*/
void delete(PageData pd);
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findById(PageData pd);
}

View File

@ -0,0 +1,39 @@
package com.zcloud.service.core;
import com.zcloud.entity.PageData;
import java.util.List;
public interface CoreSyncDeptService {
/**()
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
/**
* @param pd
* @throws Exception
*/
void delete(PageData pd);
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findById(PageData pd);
}

View File

@ -0,0 +1,39 @@
package com.zcloud.service.core;
import com.zcloud.entity.PageData;
import java.util.List;
public interface CoreSyncUserService {
/**()
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
/**
* @param pd
* @throws Exception
*/
void delete(PageData pd);
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findById(PageData pd);
}

View File

@ -0,0 +1,38 @@
package com.zcloud.service.core.impl;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.core.CoreSyncCorpMapper;
import com.zcloud.service.core.CoreSyncCorpService;
import javax.annotation.Resource;
import java.util.List;
public class CoreSyncCorpServiceImpl implements CoreSyncCorpService {
@Resource
private CoreSyncCorpMapper coreSyncCorpMapper;
@Override
public List<PageData> listAll(PageData pd) {
return coreSyncCorpMapper.listAll(pd);
}
@Override
public void delete(PageData pd) {
coreSyncCorpMapper.delete(pd);
}
@Override
public void save(PageData pd) {
coreSyncCorpMapper.save(pd);
}
@Override
public void edit(PageData pd) {
coreSyncCorpMapper.edit(pd);
}
@Override
public PageData findById(PageData pd) {
return coreSyncCorpMapper.findById(pd);
}
}

View File

@ -0,0 +1,38 @@
package com.zcloud.service.core.impl;
import com.zcloud.entity.PageData;
import com.zcloud.service.core.CoreSyncDeptService;
import javax.annotation.Resource;
import java.util.List;
public class CoreSyncDeptServiceImpl implements CoreSyncDeptService {
@Resource
private CoreSyncDeptService coreSyncDeptService;
@Override
public List<PageData> listAll(PageData pd) {
return coreSyncDeptService.listAll(pd);
}
@Override
public void delete(PageData pd) {
coreSyncDeptService.delete(pd);
}
@Override
public void save(PageData pd) {
coreSyncDeptService.save(pd);
}
@Override
public void edit(PageData pd) {
coreSyncDeptService.edit(pd);
}
@Override
public PageData findById(PageData pd) {
return coreSyncDeptService.findById(pd);
}
}

View File

@ -0,0 +1,39 @@
package com.zcloud.service.core.impl;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.core.CoreSyncUserMapper;
import com.zcloud.service.core.CoreSyncUserService;
import javax.annotation.Resource;
import java.util.List;
public class CoreSyncUserServiceImpl implements CoreSyncUserService {
@Resource
private CoreSyncUserMapper coreSyncUserMapper;
@Override
public List<PageData> listAll(PageData pd) {
return coreSyncUserMapper.listAll(pd);
}
@Override
public void delete(PageData pd) {
coreSyncUserMapper.delete(pd);
}
@Override
public void save(PageData pd) {
coreSyncUserMapper.save(pd);
}
@Override
public void edit(PageData pd) {
coreSyncUserMapper.edit(pd);
}
@Override
public PageData findById(PageData pd) {
return coreSyncUserMapper.findById(pd);
}
}

View File

@ -1197,7 +1197,8 @@ public class XgfUserServiceImpl implements XgfUserService {
// (河港检测 jtdw004 020578a4c1f04bc692ee25145c2efbe5
// (方宇物业 jtdw005 90966974de3c4b83aca6f8fd6432d5c2
// (河北港口集团数联科技(雄安)有限公司 5cee11f6152d42e0a08ae38dc6abcfdf)
String jituandanwei = "1e6dbbe16004402f8d2c0e52afd9a6763a854eefa7894e06aaa1a2611bca80f6020578a4c1f04bc692ee25145c2efbe590966974de3c4b83aca6f8fd6432d5c25cee11f6152d42e0a08ae38dc6abcfdf";
// (河港城发 f42d930a7e694123a2d6ad3e546ba695)
String jituandanwei = "1e6dbbe16004402f8d2c0e52afd9a6763a854eefa7894e06aaa1a2611bca80f6020578a4c1f04bc692ee25145c2efbe590966974de3c4b83aca6f8fd6432d5c25cee11f6152d42e0a08ae38dc6abcfdff42d930a7e694123a2d6ad3e546ba695";
if (jituandanwei.contains(corpInfoId)) {
return "1";
}

View File

@ -27,6 +27,7 @@ import java.util.Map;
*/
@Aspect
@Component
@SuppressWarnings("all")
public class SyncDataAdviceAspect {
@Pointcut(value = "@annotation(com.zcloud.syncData.SyncPlatformAdvice)")
@ -75,18 +76,38 @@ public class SyncDataAdviceAspect {
message.setTopic(sliceDataChangeTopic);
// 判断同步类型
/**
*
*/
if (syncPlatformAdvice.type().equals(SyncTypeEnum.HIDDEN)){
// 同步隐患
}
/**
*
*/
if (syncPlatformAdvice.type().equals(SyncTypeEnum.PERSONNEL)){
// 同步人员
dockSendMessageService.sendMessage(message);
}
if (syncPlatformAdvice.type().equals(SyncTypeEnum.SAFETY_ENVIRONMENTAL_CHECK)){
// 同步安全环保检查
/**
*
*/
if (syncPlatformAdvice.type().equals(SyncTypeEnum.SAFETY_ENVIRONMENTAL_CHECK)){ }
/**
*
*/
if (syncPlatformAdvice.type().equals(SyncTypeEnum.KEY_PROJECT)){ }
/**
*
*/
if (syncPlatformAdvice.type().equals(SyncTypeEnum.CORP)){
// 1. 发信
dockSendMessageService.sendMessage(message);
}
if (syncPlatformAdvice.type().equals(SyncTypeEnum.KEY_PROJECT)){
// 同步重点工程
/**
*
*/
if (syncPlatformAdvice.type().equals(SyncTypeEnum.DEPARTMENT)){
// 1. 发信
dockSendMessageService.sendMessage(message);
}

View File

@ -9,7 +9,9 @@ public enum SyncTypeEnum {
PERSONNEL("人员"),
HIDDEN("隐患"),
SAFETY_ENVIRONMENTAL_CHECK("安全环保检查"),
KEY_PROJECT("重点工程");
KEY_PROJECT("重点工程"),
DEPARTMENT("部门"),
CORP("企业");
private final String description;

View File

@ -4,8 +4,13 @@ import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.zcloud.dto.TenCorpDto;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.bus.CorpInfoMapper;
import com.zcloud.mapper.datasource.core.CoreSyncCorpMapper;
import com.zcloud.mapper.datasource.core.CoreSyncDeptMapper;
import com.zcloud.mapper.datasource.core.CoreSyncUserMapper;
import com.zcloud.mapper.datasource.mq.MqConsumptionErrorLogMapper;
import com.zcloud.mapper.datasource.mq.MqConsumptionLogMapper;
import com.zcloud.mapper.datasource.system.DepartmentMapper;
import com.zcloud.service.system.UsersService;
import com.zcloud.service.xgf.XgfUserService;
import com.zcloud.syncData.SyncTypeEnum;
@ -28,6 +33,7 @@ import java.util.Date;
topic = "${mq.consumer.dataChange.tongbu-data-change.topic}",
selectorType = SelectorType.TAG,
messageModel = MessageModel.BROADCASTING) // 添加广播模式
@SuppressWarnings("all")
public class SyncDataListener implements RocketMQListener<String> {
@Autowired
@ -39,6 +45,22 @@ public class SyncDataListener implements RocketMQListener<String> {
@Autowired
private XgfUserService xgfUserService;
@Autowired
private CorpInfoMapper corpinfoMapper;
@Autowired
private DepartmentMapper departmentMapper;
/* 本地中台同步 */
@Autowired
private CoreSyncUserMapper coreSyncUserMapper;
@Autowired
private CoreSyncCorpMapper coreSyncCorpMapper;
@Autowired
private CoreSyncDeptMapper coreSyncDeptMapper;
@Autowired
private static MqConsumptionErrorLogMapper mqConsumptionErrorLogMapper;
@ -81,11 +103,17 @@ public class SyncDataListener implements RocketMQListener<String> {
// 相关方推送
xgfUserService.edit4Mq(syncInfo);
}
PageData localData = usersService.findById(syncInfo);
if (localData != null && !localData.isEmpty()){
usersService.editUser(syncInfo);
// PageData localData = usersService.findById(syncInfo);
// if (localData != null && !localData.isEmpty()){
// usersService.editUser(syncInfo);
// }
// 2024.8.9 按郭跃鹏提出后期各公司从企业端分离后需要其他公司的用户进行SQL联查要求新增一张core_user的同步表用于记录中台的所有用户数据
PageData coreLocalData = coreSyncUserMapper.findById(syncInfo);
if (coreLocalData != null && !coreLocalData.isEmpty()){
coreSyncUserMapper.edit(syncInfo);
} else {
// 2024.8.9 按郭跃鹏提出后期各公司从企业端分离后需要其他公司的用户进行SQL联查要求新增一张core_user的同步表用于记录中台的所有用户数据
coreSyncUserMapper.save(syncInfo);
}
}
@ -101,6 +129,60 @@ public class SyncDataListener implements RocketMQListener<String> {
if (SyncTypeEnum.KEY_PROJECT.getDescription().equals(tenCorpDto.getMark())){
}
// 部门
if (SyncTypeEnum.DEPARTMENT.getDescription().equals(tenCorpDto.getMark())){
System.out.println("department");
String str = tenCorpDto.getData().getString("syncInfo");
PageData syncInfo = JSONUtil.toBean(str, PageData.class);
PageData localData = departmentMapper.findById(syncInfo);
// if (localData != null && !localData.isEmpty()){
// departmentMapper.edit(syncInfo);
// }
PageData coreLocalData = coreSyncDeptMapper.findById(syncInfo);
try {
if (!"1".equals(syncInfo.getString("ISDELETE"))) {
// 如果不是待删除的数据, 则进行排序字段的转换, 删除的数据只会传递ID和ISDELETE参数
syncInfo.put("DEP_ORDER", Integer.parseInt(syncInfo.getString("DEP_ORDER")));
}
}catch (Exception e){
System.out.println("========================排序字段为空 : " + syncInfo.getString("DEP_ORDER") + " ========================");
}
if (coreLocalData != null && !coreLocalData.isEmpty()){
syncInfo.put("ISDELETE", syncInfo.getString("ISDELETE") == null ? "0" : syncInfo.getString("ISDELETE"));
coreSyncDeptMapper.edit(syncInfo);
} else {
syncInfo.put("ISDELETE", "0");
coreSyncDeptMapper.save(syncInfo);
}
}
// 企业
if (SyncTypeEnum.CORP.getDescription().equals(tenCorpDto.getMark())){
System.out.println("corp");
String str = tenCorpDto.getData().getString("syncInfo");
PageData syncInfo = JSONUtil.toBean(str, PageData.class);
PageData localData = corpinfoMapper.findById(syncInfo);
// if (localData != null && !localData.isEmpty()){
// corpinfoMapper.edit(syncInfo);
// }
PageData coreLocalData = coreSyncCorpMapper.findById(syncInfo);
try {
if (!"1".equals(syncInfo.getString("ISDELETE"))) {
// 如果不是待删除的数据, 则进行排序字段的转换, 删除的数据只会传递ID和ISDELETE参数
syncInfo.put("COR_ORDER", Integer.parseInt(syncInfo.getString("COR_ORDER")));
}
}catch (Exception e){
System.out.println("========================排序字段为空 : " + syncInfo.getString("COR_ORDER") + " ========================");
}
if (coreLocalData != null && !coreLocalData.isEmpty()){
syncInfo.put("ISDELETE", syncInfo.getString("ISDELETE") == null ? "0" : syncInfo.getString("ISDELETE"));
coreSyncCorpMapper.edit(syncInfo);
} else {
syncInfo.put("ISDELETE", "0");
coreSyncCorpMapper.save(syncInfo);
}
}
mqConsumptionLogMapper.save(productionPD);
mqConsumptionLogMapper.save(pd);

View File

@ -0,0 +1,106 @@
<?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.core.CoreSyncCorpMapper">
<!--表名 -->
<sql id="tableName">
CORE_SYNC_CORPINFO
</sql>
<!-- 字段 -->
<sql id="Field">
f.CORPINFO_ID ,
f.CORP_NAME ,
f.COR_ORDER ,
f.ISDELETE,
f.CORP_FLAG
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
CORPINFO_ID ,
CORP_NAME ,
COR_ORDER ,
ISDELETE,
CORP_FLAG
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{CORPINFO_ID} ,
#{CORP_NAME} ,
#{COR_ORDER} ,
#{ISDELETE},
#{CORP_FLAG}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 查询 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.CORPINFO_ID = #{CORPINFO_ID}
</select>
<delete id="edit" parameterType="pd">
update
<include refid="tableName"></include>
<set>
<if test="CORP_NAME != null and CORP_NAME.trim() != ''">
CORP_NAME = #{CORP_NAME},
</if>
<if test="COR_ORDER != null">
COR_ORDER = #{COR_ORDER},
</if>
<if test="ISDELETE != null">
ISDELETE = #{ISDELETE},
</if>
<if test="CORP_FLAG != null">
CORP_FLAG = #{CORP_FLAG}
</if>
</set>
where
CORPINFO_ID = #{CORPINFO_ID}
</delete>
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set ISDELETE = '1'
where
CORPINFO_ID = #{CORPINFO_ID}
</delete>
<select id="listAll" resultType="com.zcloud.entity.PageData">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where 1=1
<if test="CORPINFO_ID != null and CORPINFO_ID.trim() != ''">
and f.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="CORP_NAME != null and CORP_NAME.trim() != ''">
and f.CORP_NAME like CONCAT('%', #{CORP_NAME},'%')
</if>
<if test="ISDELETE != null">
and f.ISDELETE = #{ISDELETE}
</if>
<if test="CORP_FLAG != null">
and f.CORP_FLAG = #{CORP_FLAG}
</if>
</select>
</mapper>

View File

@ -0,0 +1,136 @@
<?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.core.CoreSyncDeptMapper">
<!--表名 -->
<sql id="tableName">
CORE_SYNC_DEPARTMENT
</sql>
<!-- 字段 -->
<sql id="Field">
f.DEPARTMENT_ID ,
f.NAME ,
f.PARENT_ID ,
f.CORPINFO_ID ,
f.CORP_NAME ,
f.DEP_ORDER ,
f.DEPT_FLAG ,
f.ISDELETE
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
DEPARTMENT_ID ,
NAME ,
PARENT_ID ,
CORPINFO_ID ,
CORP_NAME ,
DEP_ORDER ,
DEPT_FLAG ,
ISDELETE
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{DEPARTMENT_ID} ,
#{NAME} ,
#{PARENT_ID} ,
#{CORPINFO_ID} ,
#{CORP_NAME} ,
#{DEP_ORDER} ,
#{DEPT_FLAG} ,
#{ISDELETE}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 查询 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.DEPARTMENT_ID = #{DEPARTMENT_ID}
</select>
<delete id="edit" parameterType="pd">
update
<include refid="tableName"></include>
<set>
<if test="NAME != null and NAME.trim() != ''">
NAME = #{NAME},
</if>
<if test="PARENT_ID != null and PARENT_ID.trim() != ''">
PARENT_ID = #{PARENT_ID},
</if>
<if test="CORPINFO_ID != null and CORPINFO_ID.trim() != ''">
CORPINFO_ID = #{CORPINFO_ID},
</if>
<if test="CORP_NAME != null and CORP_NAME.trim() != ''">
CORP_NAME = #{CORP_NAME},
</if>
<if test="DEP_ORDER != null">
DEP_ORDER = #{DEP_ORDER},
</if>
<if test="DEPT_FLAG != null and DEPT_FLAG.trim() != ''">
DEPT_FLAG = #{DEPT_FLAG},
</if>
<if test="ISDELETE != null">
ISDELETE = #{ISDELETE}
</if>
</set>
where
DEPARTMENT_ID = #{DEPARTMENT_ID}
</delete>
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set ISDELETE = '1'
where
DEPARTMENT_ID = #{DEPARTMENT_ID}
</delete>
<select id="listAll" resultType="com.zcloud.entity.PageData">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where 1=1
<if test="DEPARTMENT_ID != null and DEPARTMENT_ID.trim() != ''">
and f.DEPARTMENT_ID = #{DEPARTMENT_ID}
</if>
<if test="NAME != null and NAME.trim() != ''">
and f.NAME like CONCAT('%', #{NAME},'%')
</if>
<if test="PARENT_ID != null and PARENT_ID.trim() != ''">
and f.PARENT_ID = #{PARENT_ID}
</if>
<if test="CORPINFO_ID != null and CORPINFO_ID.trim() != ''">
and f.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="CORP_NAME != null and CORP_NAME.trim() != ''">
and f.CORP_NAME like CONCAT('%', #{CORP_NAME},'%')
</if>
<if test="DEP_ORDER != null">
and f.DEP_ORDER = #{DEP_ORDER}
</if>
<if test="DEPT_FLAG != null and DEPT_FLAG.trim() != ''">
and f.DEPT_FLAG = #{DEPT_FLAG}
</if>
<if test="ISDELETE != null">
and f.ISDELETE = #{ISDELETE}
</if>
</select>
</mapper>

View File

@ -0,0 +1,187 @@
<?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.core.CoreSyncUserMapper">
<!--表名 -->
<sql id="tableName">
CORE_SYNC_USER
</sql>
<!-- 字段 -->
<sql id="Field">
f.USER_ID ,
f.USERNAME ,
f.NAME ,
f.PHONE ,
f.CORPINFO_ID ,
f.CORPINFO_NAME ,
f.DEPARTMENT_ID ,
f.DEPARTMENT_NAME ,
f.POST_ID ,
f.POST_NAME ,
f.ROLE_ID ,
f.ROLE_NAME ,
f.USER_TYPE ,
f.ISDELETE
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
USER_ID ,
USERNAME ,
NAME ,
PHONE ,
CORPINFO_ID ,
CORPINFO_NAME ,
DEPARTMENT_ID ,
DEPARTMENT_NAME ,
POST_ID ,
POST_NAME ,
ROLE_ID ,
ROLE_NAME ,
USER_TYPE ,
ISDELETE
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{USER_ID} ,
#{USERNAME} ,
#{NAME} ,
#{PHONE} ,
#{CORPINFO_ID} ,
#{CORPINFO_NAME} ,
#{DEPARTMENT_ID} ,
#{DEPARTMENT_NAME} ,
#{POST_ID} ,
#{POST_NAME} ,
#{ROLE_ID} ,
#{ROLE_NAME} ,
#{USER_TYPE} ,
#{ISDELETE}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 查询 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.USER_ID = #{USER_ID}
</select>
<delete id="edit" parameterType="pd">
update
<include refid="tableName"></include>
<set>
<if test="USER_ID != null and USER_ID.trim() != ''">
USER_ID = #{USER_ID},
</if>
<if test="USERNAME != null and USERNAME.trim() != ''">
USERNAME = #{USERNAME},
</if>
<if test="NAME != null and NAME.trim() != ''">
NAME = #{NAME},
</if>
<if test="PHONE != null and PHONE.trim() != ''">
PHONE = #{PHONE},
</if>
<if test="CORPINFO_ID != null and CORPINFO_ID.trim() != ''">
CORPINFO_ID = #{CORPINFO_ID},
</if>
<if test="CORPINFO_NAME != null and CORPINFO_NAME.trim() != ''">
CORPINFO_NAME = #{CORPINFO_NAME},
</if>
<if test="DEPARTMENT_ID != null and DEPARTMENT_ID.trim() != ''">
DEPARTMENT_ID = #{DEPARTMENT_ID},
</if>
<if test="DEPARTMENT_NAME != null and DEPARTMENT_NAME.trim() != ''">
DEPARTMENT_NAME = #{DEPARTMENT_NAME},
</if>
<if test="POST_ID != null and POST_ID.trim() != ''">
POST_ID = #{POST_ID},
</if>
<if test="POST_NAME != null and POST_NAME.trim() != ''">
POST_NAME = #{POST_NAME},
</if>
<if test="ROLE_ID != null and ROLE_ID.trim() != ''">
ROLE_ID = #{ROLE_ID},
</if>
<if test="ROLE_NAME != null and ROLE_NAME.trim() != ''">
ROLE_NAME = #{ROLE_NAME},
</if>
<if test="USER_TYPE != null and USER_TYPE.trim() != ''">
USER_TYPE = #{USER_TYPE},
</if>
<if test="ISDELETE != null and ISDELETE.trim() != ''">
ISDELETE = #{ISDELETE}
</if>
</set>
where
USER_ID = #{USER_ID}
</delete>
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set ISDELETE = '1'
where
USER_ID = #{USER_ID}
</delete>
<select id="listAll" resultType="com.zcloud.entity.PageData">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where 1=1
<if test="USER_ID != null and USER_ID.trim() != ''">
and f.USER_ID = #{USER_ID}
</if>
<if test="USERNAME != null and USERNAME.trim() != ''">
and f.USERNAME like CONCAT('%', #{USERNAME}, '%')
</if>
<if test="CORPINFO_ID != null and CORPINFO_ID.trim() != ''">
and f.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="CORPINFO_NAME != null and CORPINFO_NAME.trim() != ''">
and f.CORPINFO_NAME like CONCAT('%', #{CORPINFO_NAME},'%')
</if>
<if test="DEPARTMENT_ID != null and DEPARTMENT_ID.trim() != ''">
and f.DEPARTMENT_ID = #{DEPARTMENT_ID}
</if>
<if test="DEPARTMENT_NAME != null and DEPARTMENT_NAME.trim() != ''">
and f.DEPARTMENT_NAME like CONCAT('%', #{DEPARTMENT_NAME},'%')
</if>
<if test="POST_ID != null and POST_ID.trim() != ''">
and f.POST_ID = #{POST_ID}
</if>
<if test="POST_NAME != null and POST_NAME.trim() != ''">
and f.POST_NAME like CONCAT('%', #{POST_NAME},'%')
</if>
<if test="ROLE_ID != null and ROLE_ID.trim() != ''">
and f.ROLE_ID = #{ROLE_ID}
</if>
<if test="ROLE_NAME != null and ROLE_NAME.trim() != ''">
and f.ROLE_NAME like CONCAT('%', #{ROLE_NAME},'%')
</if>
<if test="USER_TYPE != null and USER_TYPE.trim() != ''">
and f.USER_TYPE = #{USER_TYPE}
</if>
<if test="ISDELETE != null and ISDELETE.trim() != ''">
and f.ISDELETE = #{ISDELETE}
</if>
</select>
</mapper>

View File

@ -391,19 +391,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 修改 -->
<update id="editUser" parameterType="pd" >
update <include refid="tableName"></include>
set NAME = #{NAME},
DEPARTMENT_ID = #{DEPARTMENT_ID},
POST_ID =#{POST_ID},
ROLE_ID = #{ROLE_ID},
ROLE_IDS = #{ROLE_IDS},
BZ = #{BZ},
EMAIL = #{EMAIL},
NUMBER = #{NUMBER},
SORT = #{SORT},
PERSON_TYPE = #{PERSON_TYPE},
IS_HAZARDCONFIRMER = #{IS_HAZARDCONFIRMER},
IS_ONLINELEARNING = #{IS_ONLINELEARNING},
PHONE = #{PHONE}
set
<if test="NAME != null and NAME != ''">
NAME = #{NAME}
</if>
<if test="DEPARTMENT_ID != null and DEPARTMENT_ID != ''">
,DEPARTMENT_ID = #{DEPARTMENT_ID}
</if>
<if test="POST_ID != null and POST_ID != ''">
,POST_ID = #{POST_ID}
</if>
<if test="ROLE_ID != null and ROLE_ID != ''">
,ROLE_ID = #{ROLE_ID}
</if>
<if test="ROLE_IDS != null and ROLE_IDS != ''">
,ROLE_IDS = #{ROLE_IDS}
</if>
<if test="BZ != null and BZ != ''">
,BZ = #{BZ}
</if>
<if test="EMAIL != null and EMAIL != ''">
,EMAIL = #{EMAIL}
</if>
<if test="NUMBER != null and NUMBER != ''">
,NUMBER = #{NUMBER}
</if>
<if test="SORT != null">
,SORT = #{SORT}
</if>
<if test="PERSON_TYPE != null and PERSON_TYPE != ''">
,PERSON_TYPE = #{PERSON_TYPE}
</if>
<if test="IS_HAZARDCONFIRMER != null and IS_HAZARDCONFIRMER != ''">
,IS_HAZARDCONFIRMER = #{IS_HAZARDCONFIRMER}
</if>
<if test="IS_ONLINELEARNING != null and IS_ONLINELEARNING != ''">
,IS_ONLINELEARNING = #{IS_ONLINELEARNING}
</if>
<if test="PHONE != null and PHONE != ''">
,PHONE = #{PHONE}
</if>
<if test="ISPUSH != null and ISPUSH != ''">
,ISPUSH = #{ISPUSH}
</if>
@ -770,17 +797,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 用户列表(全部) -->
<select id="listAllUser" parameterType="pd" resultType="pd" >
select u.USER_ID,
u.USERNAME,
u.PASSWORD,
u.LAST_LOGIN,
u.NAME,
u.IP,
u.EMAIL,
u.NUMBER,
u.PHONE,
select u.*,
r.ROLE_ID,
u.DEPARTMENT_ID,
o.NAME as PID_NAME,
o.PARENT_ID,
d.NAME as DEPARTMENT_NAME,
@ -791,6 +810,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join OA_DEPARTMENT o ON o.DEPARTMENT_ID = d.PARENT_ID
where u.ROLE_ID = r.ROLE_ID
and u.USERNAME != 'admin' and u.ISDELETE = '0'
and (u.ISPUSH != '1' or u.ISPUSH is null)
<!-- and r.PARENT_ID = '1' -->
<if test="KEYWORDS != null and KEYWORDS != ''"><!-- 关键词检索 -->
and