|
|
@ -78,8 +78,12 @@ public class StockTakingController { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
UserByPort departmentManager = PublicConfig.findUserByPortByNumber(s); |
|
|
UserByPort departmentManager = PublicConfig.findUserByPortByNumber(s); |
|
|
|
|
|
int emptype = departmentManager.getEmptype(); |
|
|
|
|
|
if (emptype > 10) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
String workwechat = departmentManager.getWorkwechat(); |
|
|
String workwechat = departmentManager.getWorkwechat(); |
|
|
if(workwechat == null ||"".equals(workwechat)){ |
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
workwechat = departmentManager.getWechat(); |
|
|
workwechat = departmentManager.getWechat(); |
|
|
} |
|
|
} |
|
|
// QyWxDepartmentManager.append(workwechat+",");
|
|
|
// QyWxDepartmentManager.append(workwechat+",");
|
|
|
@ -136,9 +140,9 @@ public class StockTakingController { |
|
|
Map<String, Object> QyWxApprovalMap = new HashMap<>(); |
|
|
Map<String, Object> QyWxApprovalMap = new HashMap<>(); |
|
|
QyWxApprovalMap.put("sp_no", sp_no); |
|
|
QyWxApprovalMap.put("sp_no", sp_no); |
|
|
QyWxApprovalMap.put("mainId", mainId.toString()); |
|
|
QyWxApprovalMap.put("mainId", mainId.toString()); |
|
|
redisPool.getRedisTemplateByDb(14).opsForHash().putAll("wms_QyWxMessage_"+sp_no, QyWxApprovalMap); |
|
|
redisPool.getRedisTemplateByDb(14).opsForHash().putAll("wms_QyWxMessage_" + sp_no, QyWxApprovalMap); |
|
|
// 设置过期时间为7天
|
|
|
// 设置过期时间为7天
|
|
|
redisPool.getRedisTemplateByDb(14).expire("wms_QyWxMessage_"+sp_no, 7, TimeUnit.DAYS); |
|
|
redisPool.getRedisTemplateByDb(14).expire("wms_QyWxMessage_" + sp_no, 7, TimeUnit.DAYS); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
@ -154,9 +158,9 @@ public class StockTakingController { |
|
|
Map<String, Object> QyWxApprovalMap = new HashMap<>(); |
|
|
Map<String, Object> QyWxApprovalMap = new HashMap<>(); |
|
|
QyWxApprovalMap.put("sp_no", sp_no); |
|
|
QyWxApprovalMap.put("sp_no", sp_no); |
|
|
QyWxApprovalMap.put("mainId", mainId.toString()); |
|
|
QyWxApprovalMap.put("mainId", mainId.toString()); |
|
|
redisPool.getRedisTemplateByDb(14).opsForHash().putAll("wms_QyWxMessage_"+sp_no, QyWxApprovalMap); |
|
|
redisPool.getRedisTemplateByDb(14).opsForHash().putAll("wms_QyWxMessage_" + sp_no, QyWxApprovalMap); |
|
|
// 设置过期时间为7天
|
|
|
// 设置过期时间为7天
|
|
|
redisPool.getRedisTemplateByDb(14).expire("wms_QyWxMessage_"+sp_no, 7, TimeUnit.DAYS); |
|
|
redisPool.getRedisTemplateByDb(14).expire("wms_QyWxMessage_" + sp_no, 7, TimeUnit.DAYS); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
@ -180,7 +184,7 @@ public class StockTakingController { |
|
|
} |
|
|
} |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
map.put("departmentHead", userToken.getNumber()); |
|
|
map.put("departmentHead", userToken.getNumber()); |
|
|
List<SimpleStockTakingP> myTask = stockTakingService.findMyTask(map, userKey,token); |
|
|
List<SimpleStockTakingP> myTask = stockTakingService.findMyTask(map, userKey, token); |
|
|
return new RestResponse(myTask, stockTakingService.findMyTaskCount(map), 200); |
|
|
return new RestResponse(myTask, stockTakingService.findMyTaskCount(map), 200); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -196,7 +200,7 @@ public class StockTakingController { |
|
|
userKey = (String) request.getSession().getAttribute("userKey"); |
|
|
userKey = (String) request.getSession().getAttribute("userKey"); |
|
|
} |
|
|
} |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
Map<String, Object> review = stockTakingService.review(map, userToken, crypt,userKey,token); |
|
|
Map<String, Object> review = stockTakingService.review(map, userToken, crypt, userKey, token); |
|
|
|
|
|
|
|
|
if (review.containsKey("errMsg")) { |
|
|
if (review.containsKey("errMsg")) { |
|
|
// 如果有出错情况
|
|
|
// 如果有出错情况
|
|
|
@ -219,7 +223,7 @@ public class StockTakingController { |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
String header = request.getHeader("user-agent"); |
|
|
String header = request.getHeader("user-agent"); |
|
|
String crypt = Md5.crypt(header); |
|
|
String crypt = Md5.crypt(header); |
|
|
Map<String, Object> complete = stockTakingService.completeStockTaking(map, userToken, crypt,userKey,token); |
|
|
Map<String, Object> complete = stockTakingService.completeStockTaking(map, userToken, crypt, userKey, token); |
|
|
if (complete.containsKey("errMsg")) { |
|
|
if (complete.containsKey("errMsg")) { |
|
|
// 如果有出错情况
|
|
|
// 如果有出错情况
|
|
|
return new RestResponse(complete, 666, new StatusInfo("有错误", "发现错误")); |
|
|
return new RestResponse(complete, 666, new StatusInfo("有错误", "发现错误")); |
|
|
@ -239,7 +243,7 @@ public class StockTakingController { |
|
|
} |
|
|
} |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
map.put("userId", userToken.getId()); |
|
|
map.put("userId", userToken.getId()); |
|
|
List<SimpleStockTakingP> myApply = stockTakingService.findMyApply(map,userKey,token); |
|
|
List<SimpleStockTakingP> myApply = stockTakingService.findMyApply(map, userKey, token); |
|
|
return new RestResponse(myApply, stockTakingService.findMyApplyCount(map), 200); |
|
|
return new RestResponse(myApply, stockTakingService.findMyApplyCount(map), 200); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -285,13 +289,14 @@ public class StockTakingController { |
|
|
} |
|
|
} |
|
|
map.put("minIds", minIdList); |
|
|
map.put("minIds", minIdList); |
|
|
|
|
|
|
|
|
Integer transfer = stockTakingService.stockTakingTransfer(map, userToken, crypt,userKey,token); |
|
|
Integer transfer = stockTakingService.stockTakingTransfer(map, userToken, crypt, userKey, token); |
|
|
return CrudUtil.insertHandle(transfer, minIdList.size()); |
|
|
return CrudUtil.insertHandle(transfer, minIdList.size()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 用于暂存当前盘点记录 |
|
|
* 用于暂存当前盘点记录 |
|
|
* @param map 存储数据 |
|
|
* |
|
|
|
|
|
* @param map 存储数据 |
|
|
* @param request |
|
|
* @param request |
|
|
*/ |
|
|
*/ |
|
|
@PostMapping("/temporaryStorageForTakingResult") |
|
|
@PostMapping("/temporaryStorageForTakingResult") |
|
|
@ -314,11 +319,12 @@ public class StockTakingController { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 用于删除暂存盘点记录 |
|
|
* 用于删除暂存盘点记录 |
|
|
* @param map 删除数据 |
|
|
* |
|
|
|
|
|
* @param map 删除数据 |
|
|
* @param request |
|
|
* @param request |
|
|
*/ |
|
|
*/ |
|
|
@PostMapping("/delTemporaryStorageForTakingResult") |
|
|
@PostMapping("/delTemporaryStorageForTakingResult") |
|
|
public RestResponse delTemporaryStorageForTakingResult(@RequestBody Map<String, Object> map,HttpServletRequest request){ |
|
|
public RestResponse delTemporaryStorageForTakingResult(@RequestBody Map<String, Object> map, HttpServletRequest request) { |
|
|
// 获取当前盘点人
|
|
|
// 获取当前盘点人
|
|
|
String token = request.getHeader("user-token"); |
|
|
String token = request.getHeader("user-token"); |
|
|
if (token == null) { |
|
|
if (token == null) { |
|
|
@ -331,7 +337,6 @@ public class StockTakingController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 获取当前用户当前库存的盘点记录 |
|
|
* 获取当前用户当前库存的盘点记录 |
|
|
* |
|
|
* |
|
|
@ -353,7 +358,7 @@ public class StockTakingController { |
|
|
Map<Object, Object> entries = redisPool.getRedisTemplateByDb(15).opsForHash().entries(key); |
|
|
Map<Object, Object> entries = redisPool.getRedisTemplateByDb(15).opsForHash().entries(key); |
|
|
if (entries.size() > 0) { |
|
|
if (entries.size() > 0) { |
|
|
return new RestResponse(entries); |
|
|
return new RestResponse(entries); |
|
|
}else{ |
|
|
} else { |
|
|
return new RestResponse(null); |
|
|
return new RestResponse(null); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -361,7 +366,8 @@ public class StockTakingController { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 用于提交申请 |
|
|
* 用于提交申请 |
|
|
* @param map 提交的数据 |
|
|
* |
|
|
|
|
|
* @param map 提交的数据 |
|
|
* @param request |
|
|
* @param request |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@ -448,8 +454,12 @@ public class StockTakingController { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
UserByPort departmentManager = PublicConfig.findUserByPortByNumber(s); |
|
|
UserByPort departmentManager = PublicConfig.findUserByPortByNumber(s); |
|
|
|
|
|
int emptype = departmentManager.getEmptype(); |
|
|
|
|
|
if (emptype > 10) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
String workwechat = departmentManager.getWorkwechat(); |
|
|
String workwechat = departmentManager.getWorkwechat(); |
|
|
if(workwechat == null ||"".equals(workwechat)){ |
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
workwechat = departmentManager.getWechat(); |
|
|
workwechat = departmentManager.getWechat(); |
|
|
} |
|
|
} |
|
|
// QyWxDepartmentManager.append(workwechat+",");
|
|
|
// QyWxDepartmentManager.append(workwechat+",");
|
|
|
@ -465,9 +475,9 @@ public class StockTakingController { |
|
|
Map<String, Object> QyWxApprovalMap = new HashMap<>(); |
|
|
Map<String, Object> QyWxApprovalMap = new HashMap<>(); |
|
|
QyWxApprovalMap.put("sp_no", sp_no); |
|
|
QyWxApprovalMap.put("sp_no", sp_no); |
|
|
QyWxApprovalMap.put("mainId", main.toString()); |
|
|
QyWxApprovalMap.put("mainId", main.toString()); |
|
|
redisPool.getRedisTemplateByDb(14).opsForHash().putAll("wms_QyWxMessage_"+sp_no, QyWxApprovalMap); |
|
|
redisPool.getRedisTemplateByDb(14).opsForHash().putAll("wms_QyWxMessage_" + sp_no, QyWxApprovalMap); |
|
|
// 设置过期时间为7天
|
|
|
// 设置过期时间为7天
|
|
|
redisPool.getRedisTemplateByDb(14).expire("wms_QyWxMessage_"+sp_no, 7, TimeUnit.DAYS); |
|
|
redisPool.getRedisTemplateByDb(14).expire("wms_QyWxMessage_" + sp_no, 7, TimeUnit.DAYS); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
@ -479,9 +489,9 @@ public class StockTakingController { |
|
|
Map<String, Object> QyWxApprovalMap = new HashMap<>(); |
|
|
Map<String, Object> QyWxApprovalMap = new HashMap<>(); |
|
|
QyWxApprovalMap.put("sp_no", sp_no); |
|
|
QyWxApprovalMap.put("sp_no", sp_no); |
|
|
QyWxApprovalMap.put("mainId", finalMainId.toString()); |
|
|
QyWxApprovalMap.put("mainId", finalMainId.toString()); |
|
|
redisPool.getRedisTemplateByDb(14).opsForHash().putAll("wms_QyWxMessage_"+sp_no, QyWxApprovalMap); |
|
|
redisPool.getRedisTemplateByDb(14).opsForHash().putAll("wms_QyWxMessage_" + sp_no, QyWxApprovalMap); |
|
|
// 设置过期时间为7天
|
|
|
// 设置过期时间为7天
|
|
|
redisPool.getRedisTemplateByDb(14).expire("wms_QyWxMessage_"+sp_no, 7, TimeUnit.DAYS); |
|
|
redisPool.getRedisTemplateByDb(14).expire("wms_QyWxMessage_" + sp_no, 7, TimeUnit.DAYS); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|