|
|
@ -79,18 +79,18 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
private AdministrativeService administrativeService; |
|
|
private AdministrativeService administrativeService; |
|
|
|
|
|
|
|
|
//redis15 mysql同步 都查询
|
|
|
//redis15 mysql同步 都查询
|
|
|
@Autowired |
|
|
/*@Autowired |
|
|
private RedisfifteenUser redisfifteenUser; |
|
|
private RedisfifteenUser redisfifteenUser;*/ |
|
|
@Autowired |
|
|
@Autowired |
|
|
private RedisfifteenUserService redisfifteenUserService; |
|
|
private RedisfifteenUserService redisfifteenUserService; |
|
|
@Autowired |
|
|
/*@Autowired |
|
|
private RedisfifteenMinRecord redisfifteenMinRecord; |
|
|
private RedisfifteenMinRecord redisfifteenMinRecord;*/ |
|
|
@Autowired |
|
|
@Autowired |
|
|
private RedisfifteenMinRecordService redisfifteenMinRecordService; |
|
|
private RedisfifteenMinRecordService redisfifteenMinRecordService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private RedisfifteenRecordService redisfifteenRecordService; |
|
|
private RedisfifteenRecordService redisfifteenRecordService; |
|
|
@Autowired |
|
|
/*@Autowired |
|
|
private RedisfifteenRecord redisfifteenRecord; |
|
|
private RedisfifteenRecord redisfifteenRecord;*/ |
|
|
@Autowired |
|
|
@Autowired |
|
|
private RedisSynchronizeMysqlUtil redisSynchronizeMysqlUtil; |
|
|
private RedisSynchronizeMysqlUtil redisSynchronizeMysqlUtil; |
|
|
|
|
|
|
|
|
@ -325,9 +325,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
String minRecord = (String) redisPool.getRedisTemplateByDb(15).opsForHash().get(key, "minRecord"); |
|
|
String minRecord = (String) redisPool.getRedisTemplateByDb(15).opsForHash().get(key, "minRecord"); |
|
|
//mysql
|
|
|
//mysql
|
|
|
if(minRecord==null){//redis里查不到再去mysql查一次.
|
|
|
if(minRecord==null){//redis里查不到再去mysql查一次.
|
|
|
//redisfifteenUser.setUser(userToken.getId().toString());
|
|
|
RedisfifteenUser redisfifteenUser_6 = new RedisfifteenUser(); |
|
|
redisfifteenUser.setUser("714");//测试,当前登录用户先改成刘畅 上线要改回来,李文轩 liwenxuan
|
|
|
redisfifteenUser_6.setUser(recordP.getApplicantId().toString());//?????
|
|
|
List<RedisfifteenUser> redisfifteenUsers = redisfifteenUserService.queryRedisfifteenUser(redisfifteenUser); |
|
|
//redisfifteenUser.setUser("714");//测试,当前登录用户先改成刘畅 上线要改回来,李文轩 liwenxuan
|
|
|
|
|
|
List<RedisfifteenUser> redisfifteenUsers = redisfifteenUserService.queryRedisfifteenUser(redisfifteenUser_6); |
|
|
if(redisfifteenUsers.size()>0){ |
|
|
if(redisfifteenUsers.size()>0){ |
|
|
if(redisfifteenUsers.size()>1){ |
|
|
if(redisfifteenUsers.size()>1){ |
|
|
throw new MyException("redisfifteenUsers超过一条记录!"); |
|
|
throw new MyException("redisfifteenUsers超过一条记录!"); |
|
|
@ -349,28 +350,32 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
// 如果当前用户已经没有剩余订单,则删除
|
|
|
// 如果当前用户已经没有剩余订单,则删除
|
|
|
redisPool.getRedisTemplateByDb(15).delete(key); |
|
|
redisPool.getRedisTemplateByDb(15).delete(key); |
|
|
//mysql同步redis
|
|
|
//mysql同步redis
|
|
|
redisfifteenUser.setUser(Long.toString(recordP.getApplicantId())); |
|
|
RedisfifteenUser redisfifteenUser_7 = new RedisfifteenUser(); |
|
|
int redisfifteenUserdelCount = redisfifteenUserService.deleteRedisfifteenUser(redisfifteenUser); |
|
|
redisfifteenUser_7.setUser(Long.toString(recordP.getApplicantId())); |
|
|
|
|
|
int redisfifteenUserdelCount = redisfifteenUserService.deleteRedisfifteenUser(redisfifteenUser_7); |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
redisPool.getRedisTemplateByDb(15).opsForHash().put(key, "minRecord", minRecord); |
|
|
redisPool.getRedisTemplateByDb(15).opsForHash().put(key, "minRecord", minRecord); |
|
|
//mysql同步redis 查一下库里有没有记录,没有则新增,有则修改.
|
|
|
//mysql同步redis 查一下库里有没有记录,没有则新增,有则修改.
|
|
|
redisfifteenUser.setUser(Long.toString(recordP.getApplicantId())); |
|
|
RedisfifteenUser redisfifteenUser_8 = new RedisfifteenUser(); |
|
|
redisfifteenUser.setMinRecord(minRecord); |
|
|
redisfifteenUser_8.setUser(Long.toString(recordP.getApplicantId())); |
|
|
int redisfifteenUserdelCount = redisfifteenUserService.updateRedisfifteenUser(redisfifteenUser); |
|
|
redisfifteenUser_8.setMinRecord(minRecord); |
|
|
|
|
|
int redisfifteenUserdelCount = redisfifteenUserService.updateRedisfifteenUser(redisfifteenUser_8); |
|
|
} |
|
|
} |
|
|
redisPool.getRedisTemplateByDb(15).delete(redisMinRecordKey); |
|
|
redisPool.getRedisTemplateByDb(15).delete(redisMinRecordKey); |
|
|
//mysql同步reids 删除redisfifteen_min_record表中的相关数据
|
|
|
//mysql同步reids 删除redisfifteen_min_record表中的相关数据
|
|
|
redisfifteenMinRecord.setMinRecord(Long.toString(recordMin.getId())); |
|
|
RedisfifteenMinRecord redisfifteenMinRecord_9 = new RedisfifteenMinRecord(); |
|
|
redisfifteenMinRecordService.deleteRedisfifteenMinRecord(redisfifteenMinRecord); |
|
|
redisfifteenMinRecord_9.setMinRecord(Long.toString(recordMin.getId())); |
|
|
|
|
|
redisfifteenMinRecordService.deleteRedisfifteenMinRecord(redisfifteenMinRecord_9); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
String redisMainRecordKey = "record:" + id; // 设置redis中主订单键值
|
|
|
String redisMainRecordKey = "record:" + id; // 设置redis中主订单键值
|
|
|
redisPool.getRedisTemplateByDb(15).delete(redisMainRecordKey); |
|
|
redisPool.getRedisTemplateByDb(15).delete(redisMainRecordKey); |
|
|
//mysql同步reids 删除redisfifteen_record表中的相关数据
|
|
|
//mysql同步reids 删除redisfifteen_record表中的相关数据
|
|
|
redisfifteenRecord.setRecord(Long.toString(id)); |
|
|
RedisfifteenRecord redisfifteenRecord_10 = new RedisfifteenRecord(); |
|
|
redisfifteenRecordService.deleteRedisfifteenRecord(redisfifteenRecord); |
|
|
redisfifteenRecord_10.setRecord(Long.toString(id)); |
|
|
|
|
|
redisfifteenRecordService.deleteRedisfifteenRecord(redisfifteenRecord_10); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
@ -408,8 +413,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
// 删除redis中该子单记录
|
|
|
// 删除redis中该子单记录
|
|
|
redisTemplateByDb.delete(minRedisKey); |
|
|
redisTemplateByDb.delete(minRedisKey); |
|
|
//mysql同步reids 删除redisfifteen_min_record表中的相关数据
|
|
|
//mysql同步reids 删除redisfifteen_min_record表中的相关数据
|
|
|
redisfifteenMinRecord.setMinRecord(Long.toString(id)); |
|
|
RedisfifteenMinRecord redisfifteenMinRecord_11 = new RedisfifteenMinRecord(); |
|
|
redisfifteenMinRecordService.deleteRedisfifteenMinRecord(redisfifteenMinRecord); |
|
|
redisfifteenMinRecord_11.setMinRecord(Long.toString(id)); |
|
|
|
|
|
redisfifteenMinRecordService.deleteRedisfifteenMinRecord(redisfifteenMinRecord_11); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取redis中存储的当前单的出库人
|
|
|
// 获取redis中存储的当前单的出库人
|
|
|
@ -417,7 +423,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
//mysql同步redis
|
|
|
//mysql同步redis
|
|
|
if(manager==null){ |
|
|
if(manager==null){ |
|
|
//String managerStr = redisfifteenMinRecordService.queryRedisfifteenMinRecord(redisfifteenMinRecord).get(0).getManager();
|
|
|
//String managerStr = redisfifteenMinRecordService.queryRedisfifteenMinRecord(redisfifteenMinRecord).get(0).getManager();
|
|
|
List<RedisfifteenMinRecord> redisfifteenMinRecords = redisfifteenMinRecordService.queryRedisfifteenMinRecord(redisfifteenMinRecord); |
|
|
List<RedisfifteenMinRecord> redisfifteenMinRecords = redisfifteenMinRecordService.queryRedisfifteenMinRecord(redisfifteenMinRecord_11); |
|
|
if(redisfifteenMinRecords.size()>0){ |
|
|
if(redisfifteenMinRecords.size()>0){ |
|
|
if(redisfifteenMinRecords.size()>1){ |
|
|
if(redisfifteenMinRecords.size()>1){ |
|
|
throw new MyException("redisfifteenMinRecords.size>1"); |
|
|
throw new MyException("redisfifteenMinRecords.size>1"); |
|
|
@ -435,10 +441,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
String managerRedisKey = "user:" + s; |
|
|
String managerRedisKey = "user:" + s; |
|
|
Object minRecord = redisTemplateByDb.opsForHash().get(managerRedisKey, "minRecord"); |
|
|
Object minRecord = redisTemplateByDb.opsForHash().get(managerRedisKey, "minRecord"); |
|
|
//mysql同步redis
|
|
|
//mysql同步redis
|
|
|
|
|
|
RedisfifteenUser redisfifteenUser_12 = new RedisfifteenUser(); |
|
|
|
|
|
redisfifteenUser_12.setUser(s); |
|
|
if (minRecord==null) { |
|
|
if (minRecord==null) { |
|
|
redisfifteenUser.setUser(s); |
|
|
|
|
|
//String minRecordStr = redisfifteenUserService.queryRedisfifteenUser(redisfifteenUser).get(0).getMinRecord();
|
|
|
//String minRecordStr = redisfifteenUserService.queryRedisfifteenUser(redisfifteenUser).get(0).getMinRecord();
|
|
|
List<RedisfifteenUser> redisfifteenUsers = redisfifteenUserService.queryRedisfifteenUser(redisfifteenUser); |
|
|
List<RedisfifteenUser> redisfifteenUsers = redisfifteenUserService.queryRedisfifteenUser(redisfifteenUser_12); |
|
|
if(redisfifteenUsers.size()>0){ |
|
|
if(redisfifteenUsers.size()>0){ |
|
|
if(redisfifteenUsers.size()>1){ |
|
|
if(redisfifteenUsers.size()>1){ |
|
|
throw new MyException("redisfifteenUsers.size>1"); |
|
|
throw new MyException("redisfifteenUsers.size>1"); |
|
|
@ -459,13 +467,13 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
// 如果当前用户已经没有剩余订单,则删除
|
|
|
// 如果当前用户已经没有剩余订单,则删除
|
|
|
redisTemplateByDb.delete(managerRedisKey); |
|
|
redisTemplateByDb.delete(managerRedisKey); |
|
|
//mysql同步redis
|
|
|
//mysql同步redis
|
|
|
redisfifteenUserService.deleteRedisfifteenUser(redisfifteenUser); |
|
|
redisfifteenUserService.deleteRedisfifteenUser(redisfifteenUser_12); |
|
|
} else { |
|
|
} else { |
|
|
redisTemplateByDb.opsForHash().put(managerRedisKey, "minRecord", minRecordString); |
|
|
redisTemplateByDb.opsForHash().put(managerRedisKey, "minRecord", minRecordString); |
|
|
//mysql同步redis
|
|
|
//mysql同步redis
|
|
|
redisfifteenUser.setUser(s); |
|
|
redisfifteenUser_12.setUser(s); |
|
|
redisfifteenUser.setMinRecord(minRecordString); |
|
|
redisfifteenUser_12.setMinRecord(minRecordString); |
|
|
int redisfifteenUserdelCount = redisfifteenUserService.updateRedisfifteenUser(redisfifteenUser); |
|
|
int redisfifteenUserdelCount = redisfifteenUserService.updateRedisfifteenUser(redisfifteenUser_12); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -477,18 +485,21 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
// 获取删除结果
|
|
|
// 获取删除结果
|
|
|
Integer result = depositoryRecordMapper.deleteApplicationOutRecordMinById(id); |
|
|
Integer result = depositoryRecordMapper.deleteApplicationOutRecordMinById(id); |
|
|
String mainRedisKey = "record:" + parentId; |
|
|
String mainRedisKey = "record:" + parentId; |
|
|
|
|
|
RedisfifteenRecord redisfifteenRecord_13 = new RedisfifteenRecord(); |
|
|
|
|
|
redisfifteenRecord_13.setRecord(Long.toString(parentId)); |
|
|
if (recordMinList.size() <= 1) { |
|
|
if (recordMinList.size() <= 1) { |
|
|
// 如果主单的子单数小于等于1个,则删除主单
|
|
|
// 如果主单的子单数小于等于1个,则删除主单
|
|
|
Integer integer = depositoryRecordMapper.deleteApplicationOutRecordById(parentId); |
|
|
Integer integer = depositoryRecordMapper.deleteApplicationOutRecordById(parentId); |
|
|
redisTemplateByDb.delete(mainRedisKey); |
|
|
redisTemplateByDb.delete(mainRedisKey); |
|
|
//mysql同步redis
|
|
|
//mysql同步redis
|
|
|
redisfifteenRecord.setRecord(Long.toString(parentId)); |
|
|
|
|
|
redisfifteenRecordService.deleteRedisfifteenRecord(redisfifteenRecord); |
|
|
|
|
|
|
|
|
redisfifteenRecordService.deleteRedisfifteenRecord(redisfifteenRecord_13); |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
Object minRecord = redisTemplateByDb.opsForHash().get(mainRedisKey, "minRecord"); |
|
|
Object minRecord = redisTemplateByDb.opsForHash().get(mainRedisKey, "minRecord"); |
|
|
//mysql同步redis
|
|
|
//mysql同步redis
|
|
|
List<RedisfifteenRecord> redisfifteenRecords = redisfifteenRecordService.queryRedisfifteenRecord(redisfifteenRecord); |
|
|
List<RedisfifteenRecord> redisfifteenRecords = redisfifteenRecordService.queryRedisfifteenRecord(redisfifteenRecord_13); |
|
|
if(redisfifteenRecords.size()>0){ |
|
|
if(redisfifteenRecords.size()>0){ |
|
|
if(redisfifteenRecords.size()>1){ |
|
|
if(redisfifteenRecords.size()>1){ |
|
|
throw new MyException("redisfifteenRecords.size>1"); |
|
|
throw new MyException("redisfifteenRecords.size>1"); |
|
|
@ -507,8 +518,8 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
// 如果当前主单已经没有剩余订单,则删除
|
|
|
// 如果当前主单已经没有剩余订单,则删除
|
|
|
redisTemplateByDb.delete(mainRedisKey); |
|
|
redisTemplateByDb.delete(mainRedisKey); |
|
|
//mysql同步redis 删除Record
|
|
|
//mysql同步redis 删除Record
|
|
|
redisfifteenRecord.setRecord(Long.toString(parentId)); |
|
|
redisfifteenRecord_13.setRecord(Long.toString(parentId)); |
|
|
redisfifteenRecordService.deleteRedisfifteenRecord(redisfifteenRecord); |
|
|
redisfifteenRecordService.deleteRedisfifteenRecord(redisfifteenRecord_13); |
|
|
} else { |
|
|
} else { |
|
|
redisTemplateByDb.opsForHash().put(mainRedisKey, "minRecord", minRecordList); |
|
|
redisTemplateByDb.opsForHash().put(mainRedisKey, "minRecord", minRecordList); |
|
|
//mysql同步redis 新增或修改 record
|
|
|
//mysql同步redis 新增或修改 record
|
|
|
@ -980,6 +991,8 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
flagForApproval = true; |
|
|
flagForApproval = true; |
|
|
StringBuilder approverId = new StringBuilder(); |
|
|
StringBuilder approverId = new StringBuilder(); |
|
|
for (RoleAndDepository roleAndDepository : roleAndDepositoryByDid) { |
|
|
for (RoleAndDepository roleAndDepository : roleAndDepositoryByDid) { |
|
|
|
|
|
//liwenxuan 本地测试用 上线要改回去 将入库时的审批人设置为开发人员 直接注释/反注释就好
|
|
|
|
|
|
//roleAndDepository.setUserId(9458L);
|
|
|
// 获取该权限类型
|
|
|
// 获取该权限类型
|
|
|
int classes = roleAndDepository.getClasses(); |
|
|
int classes = roleAndDepository.getClasses(); |
|
|
// 获取userid
|
|
|
// 获取userid
|
|
|
@ -2488,8 +2501,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
String manager = (String) redisPool.getRedisTemplateByDb(15).opsForHash().get(redisMinRecordKey, "manager"); |
|
|
String manager = (String) redisPool.getRedisTemplateByDb(15).opsForHash().get(redisMinRecordKey, "manager"); |
|
|
//mysql同步redis query MinRecord
|
|
|
//mysql同步redis query MinRecord
|
|
|
if(manager==null){ |
|
|
if(manager==null){ |
|
|
redisfifteenMinRecord = redisSynchronizeMysqlUtil.queryRedis15Min(Long.toString(id)); |
|
|
RedisfifteenMinRecord redisfifteenMinRecord_15 = new RedisfifteenMinRecord(); |
|
|
manager = redisfifteenMinRecord.getManager(); |
|
|
redisfifteenMinRecord_15 = redisSynchronizeMysqlUtil.queryRedis15Min(Long.toString(id)); |
|
|
|
|
|
manager = redisfifteenMinRecord_15.getManager(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2501,7 +2515,11 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
managerSplit = new String[0]; |
|
|
managerSplit = new String[0]; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
//if(managerSplit!=null && managerSplit != "")
|
|
|
for (String item : managerSplit) { |
|
|
for (String item : managerSplit) { |
|
|
|
|
|
if(item.equals("")){ |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
// 删除其他管理员的订单记录
|
|
|
// 删除其他管理员的订单记录
|
|
|
String otherManager = "user:" + item; |
|
|
String otherManager = "user:" + item; |
|
|
String minRecord = (String) redisPool.getRedisTemplateByDb(15).opsForHash().get(otherManager, "minRecord"); |
|
|
String minRecord = (String) redisPool.getRedisTemplateByDb(15).opsForHash().get(otherManager, "minRecord"); |
|
|
@ -2559,7 +2577,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
// 删除用户中当前已完成的订单
|
|
|
// 删除用户中当前已完成的订单
|
|
|
minRecord = minRecord.replace(redisMinRecordKey + ",", ""); |
|
|
minRecord = minRecord.replace(redisMinRecordKey + ",", ""); |
|
|
if (minRecord.length() == 2) { |
|
|
if (minRecord.length() == 2) { |
|
|
// []
|
|
|
// []=====>bug原因:实际上,minRecord可以是[\r\n]????,更改判断方式为不含"minRecord"
|
|
|
// 如果当前用户已经没有剩余订单,则删除
|
|
|
// 如果当前用户已经没有剩余订单,则删除
|
|
|
redisPool.getRedisTemplateByDb(15).delete("user:" + userByPort.getId()); |
|
|
redisPool.getRedisTemplateByDb(15).delete("user:" + userByPort.getId()); |
|
|
//mysql同步redis user delete
|
|
|
//mysql同步redis user delete
|
|
|
@ -2601,11 +2619,11 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
for (String value : split) { |
|
|
for (String value : split) { |
|
|
// 获取所有子订单状态
|
|
|
// 获取所有子订单状态
|
|
|
String state = (String) redisPool.getRedisTemplateByDb(15).opsForHash().get(value, "state"); |
|
|
String state = (String) redisPool.getRedisTemplateByDb(15).opsForHash().get(value, "state"); |
|
|
//mysql同步redis MinRecord query
|
|
|
//mysql同步redis MinRecord query 出库后,状态未更正为已完成.看一下state--暂时通过注释掉了mysql同步redis的代码解决,
|
|
|
if(state==null){ |
|
|
/*if(state==null){ |
|
|
String minRecordStr = value.split(":")[1]; |
|
|
String minRecordStr = value.split(":")[1]; |
|
|
state = redisSynchronizeMysqlUtil.queryRedis15Min(minRecordStr).getState(); |
|
|
state = redisSynchronizeMysqlUtil.queryRedis15Min(minRecordStr).getState(); |
|
|
} |
|
|
}*/ |
|
|
if ("1".equals(state)) { |
|
|
if ("1".equals(state)) { |
|
|
// 如果有子订单未完成
|
|
|
// 如果有子订单未完成
|
|
|
pass = 3; // 设置主订单状态为处理中
|
|
|
pass = 3; // 设置主订单状态为处理中
|
|
|
@ -3455,7 +3473,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
//mysql同步redis query user
|
|
|
//mysql同步redis query user
|
|
|
if(userMinRecord==null){ |
|
|
if(userMinRecord==null){ |
|
|
RedisfifteenUser redisfifteenUser1 = redisSynchronizeMysqlUtil.queryRedis15User(integer.toString()); |
|
|
RedisfifteenUser redisfifteenUser1 = redisSynchronizeMysqlUtil.queryRedis15User(integer.toString()); |
|
|
|
|
|
System.out.println(redisfifteenUser1.toString()); |
|
|
userMinRecord = redisfifteenUser1.getMinRecord(); |
|
|
userMinRecord = redisfifteenUser1.getMinRecord(); |
|
|
|
|
|
System.out.println(userMinRecord); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (userMinRecord == null) { // 如果当前用户没有子订单
|
|
|
if (userMinRecord == null) { // 如果当前用户没有子订单
|
|
|
@ -3476,7 +3496,16 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
* |
|
|
* |
|
|
* @param map 仓库调度信息 |
|
|
* @param map 仓库调度信息 |
|
|
* @return 受影响的行数 |
|
|
* @return 受影响的行数 |
|
|
|
|
|
* |
|
|
|
|
|
* |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
* 对于带有平衡岗的审批流程,不在企业微信中的通知中审批,而是进入应用里面我的任务中进行审批的话,流程走不通, |
|
|
|
|
|
* 会陷入平衡岗无限循环审批bug,其实不算bug,我看了代码,这部分内容只开发了一半就上线了.这样的话,想在测试 |
|
|
|
|
|
* 涉及到平衡岗的流程只能在生产环境让所有相关人员协助测试,这样根本不现实.所以之前根本就不测试......接手 |
|
|
|
|
|
* 此系统后好多违反开发常识的绝不应该出现的事情接连发生,真是令我大开眼界... 2023.09.20 liwenxuan |
|
|
|
|
|
* */ |
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public Integer review(Map<String, Object> map, Long userid, UserByPort userToken, String userAgent, String userKey, String token) { |
|
|
public Integer review(Map<String, Object> map, Long userid, UserByPort userToken, String userAgent, String userKey, String token) { |
|
|
@ -3630,7 +3659,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QyWxUid.append("LiWenXuan,"); |
|
|
//QyWxUid.append("LiWenXuan,");
|
|
|
if (record.getDepositoryManager() == null) { |
|
|
if (record.getDepositoryManager() == null) { |
|
|
map.put("depositoryManager", depositoryManager.toString()); |
|
|
map.put("depositoryManager", depositoryManager.toString()); |
|
|
} else { |
|
|
} else { |
|
|
@ -3713,10 +3742,11 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
QyWxUid.append(workwechat).append(","); |
|
|
QyWxUid.append(workwechat).append(","); |
|
|
} |
|
|
} |
|
|
String s = QyWxUid.toString(); |
|
|
String s = QyWxUid.toString(); |
|
|
s = "LiWenXuan,"; |
|
|
//s = "LiWenXuan,";
|
|
|
qyWxOperationService.sendMessageForOtherUserByCard(ObjectFormatUtil.toLong(id), s, userAgent, 1, userKey, token); |
|
|
qyWxOperationService.sendMessageForOtherUserByCard(ObjectFormatUtil.toLong(id), s, userAgent, 1, userKey, token); |
|
|
}); |
|
|
}); |
|
|
} else if (map.containsKey("balancePosterPass") && !flagForHasOtherDepository) { |
|
|
} |
|
|
|
|
|
else if (map.containsKey("balancePosterPass") && !flagForHasOtherDepository) { |
|
|
// 如果是平衡岗人员审批且进入该流程
|
|
|
// 如果是平衡岗人员审批且进入该流程
|
|
|
|
|
|
|
|
|
String result = ""; |
|
|
String result = ""; |
|
|
@ -3836,7 +3866,341 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
// s = "LiWenXuan,";
|
|
|
// s = "LiWenXuan,";
|
|
|
qyWxOperationService.sendMessageForOtherUserByCard(ObjectFormatUtil.toLong(id), s, userAgent, 1, userKey, token); |
|
|
qyWxOperationService.sendMessageForOtherUserByCard(ObjectFormatUtil.toLong(id), s, userAgent, 1, userKey, token); |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
else if (map.containsKey("balancePosterPassM") && !flagForHasOtherDepository) {//liwenxuan 增加综合办负责人的流程处理.
|
|
|
|
|
|
// 如果是综合办负责人审批且可进入该流程
|
|
|
|
|
|
|
|
|
|
|
|
String result = ""; |
|
|
|
|
|
String simpleTime = DateUtil.getSimpleTime(new Date()); |
|
|
|
|
|
map.put("balancePosterPassMTime", DateUtil.DateTimeToTimeStamp(simpleTime)); |
|
|
|
|
|
map.put("balancePosterMid", userid); |
|
|
|
|
|
Integer balancePosterPassM = (Integer) map.get("balancePosterPassM"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* String result = ""; |
|
|
|
|
|
// 开启线程更改其他用户卡片模板样式
|
|
|
|
|
|
String simpleTime = DateUtil.getSimpleTime(new Date()); |
|
|
|
|
|
map.put("depositoryManagerTime", DateUtil.DateTimeToTimeStamp(simpleTime)); |
|
|
|
|
|
map.put("depositoryManager", userid); |
|
|
|
|
|
map.put("depositoryId", record.getDepositoryId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Integer depositoryManagerPass = (Integer) map.get("depositoryManagerPass");*/ |
|
|
|
|
|
if (balancePosterPassM == null) { |
|
|
|
|
|
balancePosterPassM = (Integer) map.get("balancePosterPassM"); |
|
|
|
|
|
} |
|
|
|
|
|
String departmentheadTime = record.getDepartmentheadTime(); |
|
|
|
|
|
// 用于标识部门负责人是否审批
|
|
|
|
|
|
boolean flagFordepartmentTime = false; // 默认审批过
|
|
|
|
|
|
if ("0".equals(departmentheadTime)) { |
|
|
|
|
|
flagFordepartmentTime = true; |
|
|
|
|
|
} |
|
|
|
|
|
if (balancePosterPassM == 1) { |
|
|
|
|
|
// 如果审核通过
|
|
|
|
|
|
result = "通过"; |
|
|
|
|
|
// 获取主单下的所有子单
|
|
|
|
|
|
|
|
|
|
|
|
// 根据仓库分类明细
|
|
|
|
|
|
Map<String, Object> minIdByMaterialType = new HashMap<>(); |
|
|
|
|
|
// 定义仓库列表
|
|
|
|
|
|
List<Long> materialTypeIdList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
// 定义类型列表
|
|
|
|
|
|
List<Long> depositoryIdList = new ArrayList<>(); |
|
|
|
|
|
StringBuilder minRecordByMain = new StringBuilder("[]"); |
|
|
|
|
|
List<ApplicationOutRecordMin> applicationOutRecordMinByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(record.getId()); |
|
|
|
|
|
List<Depository> depositoryAll = depositoryMapper.findDepositoryAll(); |
|
|
|
|
|
for (ApplicationOutRecordMin applicationOutRecordMin : applicationOutRecordMinByParent) { |
|
|
|
|
|
// 获取子单信息
|
|
|
|
|
|
// 获取对应的物料编号
|
|
|
|
|
|
Long mid = applicationOutRecordMin.getMid(); |
|
|
|
|
|
// 获取物料信息
|
|
|
|
|
|
Inventory inventory = materialMapper.findInventoryById(mid); |
|
|
|
|
|
|
|
|
|
|
|
//设置子订单在redis中的主键
|
|
|
|
|
|
String minRecordKey = "minRecord:" + applicationOutRecordMin.getId(); |
|
|
|
|
|
minRecordByMain.insert(1, minRecordKey + ","); // 将子订单主键插入到主订单的子订单列表
|
|
|
|
|
|
// 设置当前子订单对应仓库管理员记录
|
|
|
|
|
|
StringBuilder minRecordManage = new StringBuilder(); |
|
|
|
|
|
// 将要存储到redis中的子订单信息
|
|
|
|
|
|
Map<String, Object> minRecord = new HashMap<>(); |
|
|
|
|
|
minRecord.put("parentId", record.getId().toString()); // 当前子订单主订单
|
|
|
|
|
|
minRecord.put("state", "1"); // 当前子订单状态 1待处理2处理
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取出库仓库
|
|
|
|
|
|
Long depositoryId = applicationOutRecordMin.getDepositoryId(); |
|
|
|
|
|
Depository depositoryById = depositoryMapper.findDepositoryById(depositoryId); |
|
|
|
|
|
// 用于标志出库人员通过物料类型还说仓库获取 // 默认是仓库
|
|
|
|
|
|
boolean flagForMtOrDepository = true; |
|
|
|
|
|
Depository parentDepository = findParentDepository(depositoryById, depositoryAll); |
|
|
|
|
|
if (!parentDepository.getDname().contains("前置仓")) { |
|
|
|
|
|
// 如果不是前置仓下的仓库
|
|
|
|
|
|
flagForMtOrDepository = false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!flagForMtOrDepository) { |
|
|
|
|
|
// 如果是通过类型
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 用于存储企业微信uid
|
|
|
|
|
|
StringBuilder QyWxUid = new StringBuilder(); |
|
|
|
|
|
// 获取具体物料类型
|
|
|
|
|
|
Long materialTypeId = inventory.getMaterialTypeId(); |
|
|
|
|
|
if (!findThisIdIsExistForMaterialType(materialTypeIdList, materialTypeId)) { |
|
|
|
|
|
// 如果当前仓库id没有存入过
|
|
|
|
|
|
materialTypeIdList.add(materialTypeId); |
|
|
|
|
|
} |
|
|
|
|
|
List<Long> minIdList = new ArrayList<>(); |
|
|
|
|
|
Object o = minIdByMaterialType.get("materialType" + materialTypeId); |
|
|
|
|
|
if (o != null) { |
|
|
|
|
|
minIdList = (List<Long>) o; |
|
|
|
|
|
} |
|
|
|
|
|
// 将当前子订单添加到该仓库下的子订单列表中
|
|
|
|
|
|
minIdList.add(applicationOutRecordMin.getId()); |
|
|
|
|
|
minIdByMaterialType.put("materialType" + materialTypeId, minIdList); |
|
|
|
|
|
|
|
|
|
|
|
// 获取该物料所处类型的管理员
|
|
|
|
|
|
List<Long> userIdByDid = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
// 用于查询对应的管理员权限
|
|
|
|
|
|
Map<String, Object> paramForUserManager = new HashMap<>(); |
|
|
|
|
|
paramForUserManager.put("mtid", materialTypeId); |
|
|
|
|
|
|
|
|
|
|
|
List<RoleAndMaterialType> roleAndMaterialTypeByCondition = roleService.findRoleAndMaterialTypeByCondition(paramForUserManager); |
|
|
|
|
|
for (RoleAndMaterialType roleAndMaterialType : roleAndMaterialTypeByCondition) { |
|
|
|
|
|
int classes = roleAndMaterialType.getClasses(); |
|
|
|
|
|
if (classes == 1) { |
|
|
|
|
|
// 如果是对人设置的权限
|
|
|
|
|
|
userIdByDid.add(roleAndMaterialType.getUid()); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 如果是对岗位
|
|
|
|
|
|
|
|
|
|
|
|
// 定义用于获取当前岗位下的人的参数map
|
|
|
|
|
|
Map<String, Object> paramForGetUserByPost = new HashMap<>(); |
|
|
|
|
|
paramForGetUserByPost.put("position", roleAndMaterialType.getUid()); |
|
|
|
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); |
|
|
|
|
|
for (UserByPort userByPort : userByPortList) { |
|
|
|
|
|
int emptype = userByPort.getEmptype(); |
|
|
|
|
|
if (emptype > 10) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
Long userId = userByPort.getId(); |
|
|
|
|
|
// 修改redis中用户的数据
|
|
|
|
|
|
updateRedisDataForUserManager(userId, minRecordKey); |
|
|
|
|
|
minRecordManage.append(userId).append(","); |
|
|
|
|
|
// 获取企业微信id或微信id
|
|
|
|
|
|
String userByPortWorkwechat = userByPort.getWorkwechat(); |
|
|
|
|
|
if (userByPortWorkwechat == null || "".equals(userByPortWorkwechat)) { |
|
|
|
|
|
userByPortWorkwechat = userByPort.getWechat(); |
|
|
|
|
|
} |
|
|
|
|
|
QyWxUid.append(userByPortWorkwechat).append(","); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Long integer : userIdByDid) { |
|
|
|
|
|
// 获取仓库管理员信息
|
|
|
|
|
|
UserByPort manager = PublicConfig.FindUserById(integer, userKey, token); |
|
|
|
|
|
// 获取用户的用工关系
|
|
|
|
|
|
int emptype = manager.getEmptype(); |
|
|
|
|
|
if (emptype > 10) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
List<RedisfifteenUser> redisfifteenUsers111 = redisSynchronizeMysqlUtil.queryAllRedisUser(); |
|
|
|
|
|
updateRedisDataForUserManager(integer, minRecordKey); |
|
|
|
|
|
List<RedisfifteenUser> redisfifteenUsers112 = redisSynchronizeMysqlUtil.queryAllRedisUser(); |
|
|
|
|
|
minRecordManage.append(integer).append(","); |
|
|
|
|
|
String workwechat = manager.getWorkwechat(); |
|
|
|
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
|
|
|
workwechat = manager.getWechat(); |
|
|
|
|
|
} |
|
|
|
|
|
QyWxUid.append(workwechat+","); |
|
|
|
|
|
} |
|
|
|
|
|
// QyWxUid.append("LiWenXuan,");
|
|
|
|
|
|
minRecord.put("manager", minRecordManage.toString()); |
|
|
|
|
|
// 添加子订单到redis中
|
|
|
|
|
|
redisPool.getRedisTemplateByDb(15).opsForHash().putAll(minRecordKey, minRecord); |
|
|
|
|
|
//mysql同步redis addorupdate MinRecord
|
|
|
|
|
|
List<RedisfifteenMinRecord> redisfifteenMinRecords111 = redisSynchronizeMysqlUtil.queryAllRedisMin(); |
|
|
|
|
|
int addOrUpdateCount = redisSynchronizeMysqlUtil.addOrUpdateRedis15Min(minRecordKey,minRecord); |
|
|
|
|
|
List<RedisfifteenMinRecord> redisfifteenMinRecords121 = redisSynchronizeMysqlUtil.queryAllRedisMin(); |
|
|
|
|
|
// 开启线程向仓库管理员发送消息
|
|
|
|
|
|
SendQyWxMessageThreadPool.execute(() -> { |
|
|
|
|
|
JSONObject jsonObject = qyWxOperationService.sendNotificationToDepositoryManager(QyWxUid.toString(), applicationOutRecordMin.getId(), userAgent, userKey, token); |
|
|
|
|
|
String redisOutKey = "wms_notificationOut_" + applicationOutRecordMin.getId(); |
|
|
|
|
|
Map<String, String> stringObjectMap = PublicConfig.returnMapString(jsonObject); |
|
|
|
|
|
redisPool.getRedisTemplateByDb(14).opsForHash().putAll(redisOutKey, stringObjectMap); |
|
|
|
|
|
redisPool.getRedisTemplateByDb(14).expire(redisOutKey, 72, TimeUnit.HOURS); |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 如果是通过仓库
|
|
|
|
|
|
|
|
|
|
|
|
// 用于存储企业微信uid
|
|
|
|
|
|
StringBuilder QyWxUid = new StringBuilder(); |
|
|
|
|
|
|
|
|
|
|
|
if (!findThisIdIsExistForDepository(depositoryIdList, depositoryId)) { |
|
|
|
|
|
// 如果当前仓库id没有存入过
|
|
|
|
|
|
depositoryIdList.add(depositoryId); |
|
|
|
|
|
} |
|
|
|
|
|
List<Long> minIdList = new ArrayList<>(); |
|
|
|
|
|
Object o = minIdByMaterialType.get("depository" + depositoryId); |
|
|
|
|
|
if (o != null) { |
|
|
|
|
|
minIdList = ObjectFormatUtil.objToList(o, Long.class); |
|
|
|
|
|
} |
|
|
|
|
|
// 将当前子订单添加到该仓库下的子订单列表中
|
|
|
|
|
|
minIdList.add(applicationOutRecordMin.getId()); |
|
|
|
|
|
minIdByMaterialType.put("depository" + depositoryId, minIdList); |
|
|
|
|
|
|
|
|
|
|
|
// 获取该物料所处仓库的仓库管理员
|
|
|
|
|
|
List<Long> userIdByDid = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
// 用于查询对应的管理员权限
|
|
|
|
|
|
Map<String, Object> paramForUserManager = new HashMap<>(); |
|
|
|
|
|
paramForUserManager.put("depositoryId", depositoryId); |
|
|
|
|
|
|
|
|
|
|
|
List<RoleAndDepository> roleAndDepositoryByCondition = roleService.findRoleAndDepositoryByCondition(paramForUserManager); |
|
|
|
|
|
for (RoleAndDepository roleAndDepository : roleAndDepositoryByCondition) { |
|
|
|
|
|
int classes = roleAndDepository.getClasses(); |
|
|
|
|
|
if (classes == 1) { |
|
|
|
|
|
// 如果是对人设置的权限
|
|
|
|
|
|
userIdByDid.add(roleAndDepository.getUserId()); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 如果是对岗位
|
|
|
|
|
|
|
|
|
|
|
|
// 定义用于获取当前岗位下的人的参数map
|
|
|
|
|
|
Map<String, Object> paramForGetUserByPost = new HashMap<>(); |
|
|
|
|
|
paramForGetUserByPost.put("position", roleAndDepository.getUserId()); |
|
|
|
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); |
|
|
|
|
|
for (UserByPort userByPort : userByPortList) { |
|
|
|
|
|
int emptype = userByPort.getEmptype(); |
|
|
|
|
|
if (emptype > 10) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
Long userId = userByPort.getId(); |
|
|
|
|
|
// 修改redis中用户的数据
|
|
|
|
|
|
updateRedisDataForUserManager(userId, minRecordKey); |
|
|
|
|
|
minRecordManage.append(userId).append(","); |
|
|
|
|
|
// 获取企业微信id或微信id
|
|
|
|
|
|
String userByPortWorkwechat = userByPort.getWorkwechat(); |
|
|
|
|
|
if (userByPortWorkwechat == null || "".equals(userByPortWorkwechat)) { |
|
|
|
|
|
userByPortWorkwechat = userByPort.getWechat(); |
|
|
|
|
|
} |
|
|
|
|
|
QyWxUid.append(userByPortWorkwechat).append(","); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Long integer : userIdByDid) { |
|
|
|
|
|
// 修改redis中用户的数据
|
|
|
|
|
|
updateRedisDataForUserManager(integer, minRecordKey); |
|
|
|
|
|
// 获取仓库管理员信息
|
|
|
|
|
|
UserByPort manager = PublicConfig.FindUserById(integer, userKey, token); |
|
|
|
|
|
// 获取用户的用工关系
|
|
|
|
|
|
int emptype = manager.getEmptype(); |
|
|
|
|
|
if (emptype > 10) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
minRecordManage.append(integer).append(","); |
|
|
|
|
|
String workwechat = manager.getWorkwechat(); |
|
|
|
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
|
|
|
workwechat = manager.getWechat(); |
|
|
|
|
|
} |
|
|
|
|
|
QyWxUid.append(workwechat+","); |
|
|
|
|
|
} |
|
|
|
|
|
// QyWxUid.append("LiWenXuan,");
|
|
|
|
|
|
minRecord.put("manager", minRecordManage.toString()); |
|
|
|
|
|
// 添加子订单到redis中
|
|
|
|
|
|
redisPool.getRedisTemplateByDb(15).opsForHash().putAll(minRecordKey, minRecord); |
|
|
|
|
|
//mysql同步redis addorupdate minRecord
|
|
|
|
|
|
redisSynchronizeMysqlUtil.addRedis15Min(minRecordKey,minRecord); |
|
|
|
|
|
// 开启线程向仓库管理员发送消息
|
|
|
|
|
|
SendQyWxMessageThreadPool.execute(() -> { |
|
|
|
|
|
JSONObject jsonObject = qyWxOperationService.sendNotificationToDepositoryManager(QyWxUid.toString(), applicationOutRecordMin.getId(), userAgent, userKey, token); |
|
|
|
|
|
String redisOutKey = "wms_notificationOut_" + applicationOutRecordMin.getId(); |
|
|
|
|
|
Map<String, String> stringObjectMap = PublicConfig.returnMapString(jsonObject); |
|
|
|
|
|
redisPool.getRedisTemplateByDb(14).opsForHash().putAll(redisOutKey, stringObjectMap); |
|
|
|
|
|
redisPool.getRedisTemplateByDb(14).expire(redisOutKey, 72, TimeUnit.HOURS); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 开启流程通知其他人忽略审批流程
|
|
|
|
|
|
SendQyWxMessageThreadPool.execute(() -> { |
|
|
|
|
|
String depositoryManager = record.getDepositoryManager(); |
|
|
|
|
|
String[] split = depositoryManager.split(","); |
|
|
|
|
|
StringBuilder QyWxUid = new StringBuilder(); |
|
|
|
|
|
for (String s : split) { |
|
|
|
|
|
if ("".equals(s)) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
UserByPort userByPort = PublicConfig.FindUserById(ObjectFormatUtil.toLong(s), userKey, token); |
|
|
|
|
|
// 获取用户的用工关系
|
|
|
|
|
|
int emptype = userByPort.getEmptype(); |
|
|
|
|
|
if (emptype > 10) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
String workwechat = userByPort.getWorkwechat(); |
|
|
|
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
|
|
|
workwechat = userByPort.getWechat(); |
|
|
|
|
|
} |
|
|
|
|
|
QyWxUid.append(workwechat).append(","); |
|
|
|
|
|
} |
|
|
|
|
|
String s = QyWxUid.toString(); |
|
|
|
|
|
// s = "LiWenXuan,";
|
|
|
|
|
|
qyWxOperationService.sendMessageForOtherUserByCard(ObjectFormatUtil.toLong(id), s, userAgent, 1, userKey, token); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 将主订单插入到redis中
|
|
|
|
|
|
redisPool.getRedisTemplateByDb(15).opsForHash().put("record:" + record.getId(), "minRecord", minRecordByMain.toString()); |
|
|
|
|
|
//mysql同步redis addorupdate record
|
|
|
|
|
|
redisSynchronizeMysqlUtil.addOrUpdateRedis15Record(record.getId().toString(),minRecordByMain.toString()); |
|
|
|
|
|
map.put("state", userToken.getName() + "审核通过"); |
|
|
|
|
|
|
|
|
|
|
|
if (flagFordepartmentTime || flagForOpenDepository == 2) { |
|
|
|
|
|
map.put("state", userToken.getName() + "审核通过"); |
|
|
|
|
|
map.put("depositoryManagerTime", DateUtil.DateTimeToTimeStamp(simpleTime)); |
|
|
|
|
|
map.put("depositoryManagerPass", 1); |
|
|
|
|
|
/*map.put("departmenthead", userToken.getId()); |
|
|
|
|
|
map.put("departmentheadPass", 1);*/ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
|
|
|
updateInventoryForOutRefused(record); |
|
|
|
|
|
result = "驳回"; |
|
|
|
|
|
map.put("pass", 2); |
|
|
|
|
|
map.put("state", userToken.getName() + "审核未通过"); |
|
|
|
|
|
if (flagFordepartmentTime) { |
|
|
|
|
|
map.put("state", userToken.getName() + "审核未通过"); |
|
|
|
|
|
map.put("departmenthead", userToken.getId()); |
|
|
|
|
|
map.put("departmentheadPass", 2); |
|
|
|
|
|
map.put("departmentheadTime", DateUtil.DateTimeToTimeStamp(simpleTime)); |
|
|
|
|
|
map.put("depositoryManagerPass", 4); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// 开启线程更改其他用户卡片模板样式
|
|
|
|
|
|
String finalResult = result; |
|
|
|
|
|
SendQyWxMessageThreadPool.execute(() -> { |
|
|
|
|
|
// 获取responseCode(key为申请人number)
|
|
|
|
|
|
//获取部门负责人信息
|
|
|
|
|
|
UserByPort departHead = PublicConfig.FindUserById(ObjectFormatUtil.toLong(record.getDepartmenthead()), userKey, token); |
|
|
|
|
|
// 获取用户的用工关系
|
|
|
|
|
|
int emptype = departHead.getEmptype(); |
|
|
|
|
|
if (emptype <= 10) { |
|
|
|
|
|
String key = "user:" + departHead.getNumber() + ":QyWxOutId:" + id; |
|
|
|
|
|
String responseCode = (String) redisPool.getRedisTemplateByDb(15).opsForHash().get(key, "responseCode"); |
|
|
|
|
|
qyWxOperationService.updateButtonTemplateCardToUnEnable(responseCode, userToken.getName(), finalResult, userAgent); |
|
|
|
|
|
redisPool.getRedisTemplateByDb(15).delete(key); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
String result = ""; |
|
|
String result = ""; |
|
|
// 开启线程更改其他用户卡片模板样式
|
|
|
// 开启线程更改其他用户卡片模板样式
|
|
|
String simpleTime = DateUtil.getSimpleTime(new Date()); |
|
|
String simpleTime = DateUtil.getSimpleTime(new Date()); |
|
|
@ -4158,6 +4522,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
return depositoryRecordMapper.updateApplicationOutRecord(map); |
|
|
return depositoryRecordMapper.updateApplicationOutRecord(map); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 入库审核申请 |
|
|
* 入库审核申请 |
|
|
* |
|
|
* |
|
|
@ -4326,9 +4694,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
workwechat = byPort.getWechat(); |
|
|
workwechat = byPort.getWechat(); |
|
|
} |
|
|
} |
|
|
QyWxUid.append(workwechat).append(","); |
|
|
//QyWxUid.append(workwechat).append(",");
|
|
|
} |
|
|
} |
|
|
// QyWxUid.append("LiWenXuan" + ",");
|
|
|
QyWxUid.append("LiWenXuan" + ","); |
|
|
map.put("depositoryManager", depositoryManager.toString()); |
|
|
map.put("depositoryManager", depositoryManager.toString()); |
|
|
} else { |
|
|
} else { |
|
|
String[] split = depositoryManagerString.split(","); |
|
|
String[] split = depositoryManagerString.split(","); |
|
|
@ -4347,9 +4715,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
workwechat = userById.getWechat(); |
|
|
workwechat = userById.getWechat(); |
|
|
} |
|
|
} |
|
|
QyWxUid.append(workwechat + ","); |
|
|
//QyWxUid.append(workwechat + ",");
|
|
|
} |
|
|
} |
|
|
// QyWxUid.append("LiWenXuan").append(",");
|
|
|
QyWxUid.append("LiWenXuan").append(","); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 向仓储中心负责人发送新的消息
|
|
|
// 向仓储中心负责人发送新的消息
|
|
|
@ -4495,9 +4863,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
workwechat = manager.getWechat(); |
|
|
workwechat = manager.getWechat(); |
|
|
} |
|
|
} |
|
|
QyWxUid.append(workwechat+","); |
|
|
// QyWxUid.append(workwechat+",");
|
|
|
} |
|
|
} |
|
|
// QyWxUid.append("LiWenXuan,");
|
|
|
QyWxUid.append("LiWenXuan,"); |
|
|
minRecord.put("manager", minRecordManage.toString()); |
|
|
minRecord.put("manager", minRecordManage.toString()); |
|
|
// 添加子订单到redis中
|
|
|
// 添加子订单到redis中
|
|
|
redisPool.getRedisTemplateByDb(15).opsForHash().putAll(minRecordKey, minRecord); |
|
|
redisPool.getRedisTemplateByDb(15).opsForHash().putAll(minRecordKey, minRecord); |
|
|
@ -4584,9 +4952,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
workwechat = manager.getWechat(); |
|
|
workwechat = manager.getWechat(); |
|
|
} |
|
|
} |
|
|
QyWxUid.append(workwechat+","); |
|
|
// QyWxUid.append(workwechat+",");
|
|
|
} |
|
|
} |
|
|
// QyWxUid.append("LiWenXuan,");
|
|
|
QyWxUid.append("LiWenXuan,"); |
|
|
minRecord.put("manager", minRecordManage.toString()); |
|
|
minRecord.put("manager", minRecordManage.toString()); |
|
|
// 添加子订单到redis中
|
|
|
// 添加子订单到redis中
|
|
|
redisPool.getRedisTemplateByDb(15).opsForHash().putAll(minRecordKey, minRecord); |
|
|
redisPool.getRedisTemplateByDb(15).opsForHash().putAll(minRecordKey, minRecord); |
|
|
|