|
|
@ -5,6 +5,7 @@ import com.dreamchaser.depository_manage.config.PublicConfig; |
|
|
import com.dreamchaser.depository_manage.config.QyWxConfig; |
|
|
import com.dreamchaser.depository_manage.config.QyWxConfig; |
|
|
import com.dreamchaser.depository_manage.entity.*; |
|
|
import com.dreamchaser.depository_manage.entity.*; |
|
|
import com.dreamchaser.depository_manage.entity.MaterialAndPlace; |
|
|
import com.dreamchaser.depository_manage.entity.MaterialAndPlace; |
|
|
|
|
|
import com.dreamchaser.depository_manage.exception.MyException; |
|
|
import com.dreamchaser.depository_manage.mapper.*; |
|
|
import com.dreamchaser.depository_manage.mapper.*; |
|
|
import com.dreamchaser.depository_manage.pojo.*; |
|
|
import com.dreamchaser.depository_manage.pojo.*; |
|
|
import com.dreamchaser.depository_manage.pojo.callBackXml.approvalCallBackXml.ApprovalInfo_Details; |
|
|
import com.dreamchaser.depository_manage.pojo.callBackXml.approvalCallBackXml.ApprovalInfo_Details; |
|
|
@ -751,7 +752,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, null, null); |
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, null, null); |
|
|
for (UserByPort userByPort : userByPortList) { |
|
|
for (UserByPort userByPort : userByPortList) { |
|
|
int emptype = userByPort.getEmptype(); |
|
|
int emptype = userByPort.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
approverId.append(userByPort.getId()).append(","); |
|
|
approverId.append(userByPort.getId()).append(","); |
|
|
@ -790,7 +791,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, null, null); |
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, null, null); |
|
|
for (UserByPort userByPort : userByPortList) { |
|
|
for (UserByPort userByPort : userByPortList) { |
|
|
int emptype = userByPort.getEmptype(); |
|
|
int emptype = userByPort.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
approverId.append(userByPort.getId()).append(","); |
|
|
approverId.append(userByPort.getId()).append(","); |
|
|
@ -2104,7 +2105,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
String materialUnit = inventoryById.getUnit(); |
|
|
String materialUnit = inventoryById.getUnit(); |
|
|
// 声明用于查询的map
|
|
|
// 声明用于查询的map
|
|
|
Map<String, Object> paramForSelect = new HashMap<>(); |
|
|
Map<String, Object> paramForSelect = new HashMap<>(); |
|
|
paramForSelect.put("depositoryId",inventoryById.getDepositoryId()); |
|
|
paramForSelect.put("depositoryId", inventoryById.getDepositoryId()); |
|
|
if (type == 1) { |
|
|
if (type == 1) { |
|
|
paramForSelect.put("mid", inventoryById.getMid()); |
|
|
paramForSelect.put("mid", inventoryById.getMid()); |
|
|
} else { |
|
|
} else { |
|
|
@ -2196,7 +2197,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
|
// 获取当前物料的单价
|
|
|
// 获取当前物料的单价
|
|
|
double price = ObjectFormatUtil.divide(inventoryById.getPrice(), 100.0, 2); |
|
|
double price = ObjectFormatUtil.divide(inventoryById.getPrice(), 100.0, 2); |
|
|
if(flagForSplit){ |
|
|
if (flagForSplit) { |
|
|
price = ObjectFormatUtil.divide(price, scale, 2); |
|
|
price = ObjectFormatUtil.divide(price, scale, 2); |
|
|
} |
|
|
} |
|
|
// 获取当前物料的总额
|
|
|
// 获取当前物料的总额
|
|
|
@ -2537,7 +2538,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); |
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); |
|
|
for (UserByPort userByPort1 : userByPortList) { |
|
|
for (UserByPort userByPort1 : userByPortList) { |
|
|
int emptype = userByPort1.getEmptype(); |
|
|
int emptype = userByPort1.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
Integer userId1 = userByPort1.getId(); |
|
|
Integer userId1 = userByPort1.getId(); |
|
|
@ -2620,7 +2621,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); |
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); |
|
|
for (UserByPort userByPort1 : userByPortList) { |
|
|
for (UserByPort userByPort1 : userByPortList) { |
|
|
int emptype = userByPort1.getEmptype(); |
|
|
int emptype = userByPort1.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
Integer userId1 = userByPort1.getId(); |
|
|
Integer userId1 = userByPort1.getId(); |
|
|
@ -2706,8 +2707,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
// 将当前redis中存储的spno删除
|
|
|
// 将当前redis中存储的spno删除
|
|
|
redisPool.getRedisTemplateByDb(14).delete("wms_QyWxMessage_" + spNo); |
|
|
redisPool.getRedisTemplateByDb(14).delete("wms_QyWxMessage_" + spNo); |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { |
|
|
else { |
|
|
|
|
|
// 如果是前两个审批节点
|
|
|
// 如果是前两个审批节点
|
|
|
|
|
|
|
|
|
//定义处理时间
|
|
|
//定义处理时间
|
|
|
@ -3336,7 +3336,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
UserByPort depositoryManage = PublicConfig.FindUserById(ObjectFormatUtil.toInteger(depositorymanager), userKey, token); |
|
|
UserByPort depositoryManage = PublicConfig.FindUserById(ObjectFormatUtil.toInteger(depositorymanager), userKey, token); |
|
|
// 获取用户的用工关系
|
|
|
// 获取用户的用工关系
|
|
|
int emptype = depositoryManage.getEmptype(); |
|
|
int emptype = depositoryManage.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
String departmentHeadWorkwechat = depositoryManage.getWorkwechat(); |
|
|
String departmentHeadWorkwechat = depositoryManage.getWorkwechat(); |
|
|
@ -3395,7 +3395,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
UserByPort userByPort = PublicConfig.FindUserById(ObjectFormatUtil.toInteger(s), userKey, token); |
|
|
UserByPort userByPort = PublicConfig.FindUserById(ObjectFormatUtil.toInteger(s), userKey, token); |
|
|
// 获取用户的用工关系
|
|
|
// 获取用户的用工关系
|
|
|
int emptype = userByPort.getEmptype(); |
|
|
int emptype = userByPort.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
String workwechat = userByPort.getWorkwechat(); |
|
|
String workwechat = userByPort.getWorkwechat(); |
|
|
@ -3433,7 +3433,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
for (UserByPort userByPort : departmentHeadByUser) { |
|
|
for (UserByPort userByPort : departmentHeadByUser) { |
|
|
depositoryManager.append(userByPort.getId()).append(","); |
|
|
depositoryManager.append(userByPort.getId()).append(","); |
|
|
int emptype = userByPort.getEmptype(); |
|
|
int emptype = userByPort.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
String workwechat = userByPort.getWorkwechat(); |
|
|
String workwechat = userByPort.getWorkwechat(); |
|
|
@ -3456,7 +3456,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
UserByPort depositoryManage = PublicConfig.FindUserById(ObjectFormatUtil.toInteger(depositorymanager), userKey, token); |
|
|
UserByPort depositoryManage = PublicConfig.FindUserById(ObjectFormatUtil.toInteger(depositorymanager), userKey, token); |
|
|
// 获取用户的用工关系
|
|
|
// 获取用户的用工关系
|
|
|
int emptype = depositoryManage.getEmptype(); |
|
|
int emptype = depositoryManage.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
String departmentHeadWorkwechat = depositoryManage.getWorkwechat(); |
|
|
String departmentHeadWorkwechat = depositoryManage.getWorkwechat(); |
|
|
@ -3515,7 +3515,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
UserByPort userByPort = PublicConfig.FindUserById(ObjectFormatUtil.toInteger(s), userKey, token); |
|
|
UserByPort userByPort = PublicConfig.FindUserById(ObjectFormatUtil.toInteger(s), userKey, token); |
|
|
// 获取用户的用工关系
|
|
|
// 获取用户的用工关系
|
|
|
int emptype = userByPort.getEmptype(); |
|
|
int emptype = userByPort.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
String workwechat = userByPort.getWorkwechat(); |
|
|
String workwechat = userByPort.getWorkwechat(); |
|
|
@ -3634,7 +3634,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); |
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); |
|
|
for (UserByPort userByPort : userByPortList) { |
|
|
for (UserByPort userByPort : userByPortList) { |
|
|
int emptype = userByPort.getEmptype(); |
|
|
int emptype = userByPort.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
Integer userId = userByPort.getId(); |
|
|
Integer userId = userByPort.getId(); |
|
|
@ -3657,7 +3657,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
UserByPort manager = PublicConfig.FindUserById(integer, userKey, token); |
|
|
UserByPort manager = PublicConfig.FindUserById(integer, userKey, token); |
|
|
// 获取用户的用工关系
|
|
|
// 获取用户的用工关系
|
|
|
int emptype = manager.getEmptype(); |
|
|
int emptype = manager.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
updateRedisDataForUserManager(integer, minRecordKey); |
|
|
updateRedisDataForUserManager(integer, minRecordKey); |
|
|
@ -3721,7 +3721,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); |
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); |
|
|
for (UserByPort userByPort : userByPortList) { |
|
|
for (UserByPort userByPort : userByPortList) { |
|
|
int emptype = userByPort.getEmptype(); |
|
|
int emptype = userByPort.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
Integer userId = userByPort.getId(); |
|
|
Integer userId = userByPort.getId(); |
|
|
@ -3746,7 +3746,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
UserByPort manager = PublicConfig.FindUserById(integer, userKey, token); |
|
|
UserByPort manager = PublicConfig.FindUserById(integer, userKey, token); |
|
|
// 获取用户的用工关系
|
|
|
// 获取用户的用工关系
|
|
|
int emptype = manager.getEmptype(); |
|
|
int emptype = manager.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
minRecordManage.append(integer).append(","); |
|
|
minRecordManage.append(integer).append(","); |
|
|
@ -3784,7 +3784,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
UserByPort userByPort = PublicConfig.FindUserById(ObjectFormatUtil.toInteger(s), userKey, token); |
|
|
UserByPort userByPort = PublicConfig.FindUserById(ObjectFormatUtil.toInteger(s), userKey, token); |
|
|
// 获取用户的用工关系
|
|
|
// 获取用户的用工关系
|
|
|
int emptype = userByPort.getEmptype(); |
|
|
int emptype = userByPort.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
String workwechat = userByPort.getWorkwechat(); |
|
|
String workwechat = userByPort.getWorkwechat(); |
|
|
@ -3831,7 +3831,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
UserByPort departHead = PublicConfig.FindUserById(ObjectFormatUtil.toInteger(record.getDepartmenthead()), userKey, token); |
|
|
UserByPort departHead = PublicConfig.FindUserById(ObjectFormatUtil.toInteger(record.getDepartmenthead()), userKey, token); |
|
|
// 获取用户的用工关系
|
|
|
// 获取用户的用工关系
|
|
|
int emptype = departHead.getEmptype(); |
|
|
int emptype = departHead.getEmptype(); |
|
|
if(emptype <= 10){ |
|
|
if (emptype <= 10) { |
|
|
String key = "user:" + departHead.getNumber() + ":QyWxOutId:" + id; |
|
|
String key = "user:" + departHead.getNumber() + ":QyWxOutId:" + id; |
|
|
String responseCode = (String) redisPool.getRedisTemplateByDb(15).opsForHash().get(key, "responseCode"); |
|
|
String responseCode = (String) redisPool.getRedisTemplateByDb(15).opsForHash().get(key, "responseCode"); |
|
|
qyWxOperationService.updateButtonTemplateCardToUnEnable(responseCode, userToken.getName(), finalResult, userAgent); |
|
|
qyWxOperationService.updateButtonTemplateCardToUnEnable(responseCode, userToken.getName(), finalResult, userAgent); |
|
|
@ -4026,7 +4026,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
UserByPort userById = PublicConfig.FindUserById(ObjectFormatUtil.toInteger(s), null, null); |
|
|
UserByPort userById = PublicConfig.FindUserById(ObjectFormatUtil.toInteger(s), null, null); |
|
|
// 获取用户的用工关系
|
|
|
// 获取用户的用工关系
|
|
|
int emptype = userById.getEmptype(); |
|
|
int emptype = userById.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
String workwechat = userById.getWorkwechat(); |
|
|
String workwechat = userById.getWorkwechat(); |
|
|
@ -4149,7 +4149,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); |
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); |
|
|
for (UserByPort userByPort1 : userByPortList) { |
|
|
for (UserByPort userByPort1 : userByPortList) { |
|
|
int emptype = userByPort1.getEmptype(); |
|
|
int emptype = userByPort1.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
Integer userId = userByPort1.getId(); |
|
|
Integer userId = userByPort1.getId(); |
|
|
@ -4172,7 +4172,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
UserByPort manager = PublicConfig.FindUserById(integer, userKey, token); |
|
|
UserByPort manager = PublicConfig.FindUserById(integer, userKey, token); |
|
|
// 获取用户的用工关系
|
|
|
// 获取用户的用工关系
|
|
|
int emptype = manager.getEmptype(); |
|
|
int emptype = manager.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
updateRedisDataForUserManager(integer, minRecordKey); |
|
|
updateRedisDataForUserManager(integer, minRecordKey); |
|
|
@ -4235,7 +4235,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); |
|
|
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); |
|
|
for (UserByPort userByPort1 : userByPortList) { |
|
|
for (UserByPort userByPort1 : userByPortList) { |
|
|
int emptype = userByPort1.getEmptype(); |
|
|
int emptype = userByPort1.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
Integer userId = userByPort1.getId(); |
|
|
Integer userId = userByPort1.getId(); |
|
|
@ -4260,7 +4260,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
UserByPort manager = PublicConfig.FindUserById(integer, userKey, token); |
|
|
UserByPort manager = PublicConfig.FindUserById(integer, userKey, token); |
|
|
// 获取用户的用工关系
|
|
|
// 获取用户的用工关系
|
|
|
int emptype = manager.getEmptype(); |
|
|
int emptype = manager.getEmptype(); |
|
|
if(emptype > 10){ |
|
|
if (emptype > 10) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
minRecordManage.append(integer).append(","); |
|
|
minRecordManage.append(integer).append(","); |
|
|
@ -5297,7 +5297,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
double sumCount = 0; |
|
|
double sumCount = 0; |
|
|
if (type == 1) { |
|
|
if (type == 1) { |
|
|
// 如果入库
|
|
|
// 如果入库
|
|
|
sumCount = ObjectFormatUtil.divide(depositoryRecordMapper.findApplicationInByMonthTest(map) , 100.0,2); |
|
|
sumCount = ObjectFormatUtil.divide(depositoryRecordMapper.findApplicationInByMonthTest(map), 100.0, 2); |
|
|
} else { |
|
|
} else { |
|
|
// 如果出库
|
|
|
// 如果出库
|
|
|
sumCount = ObjectFormatUtil.divide(depositoryRecordMapper.findApplicationOutByMonth(map), 100.0, 2); |
|
|
sumCount = ObjectFormatUtil.divide(depositoryRecordMapper.findApplicationOutByMonth(map), 100.0, 2); |
|
|
@ -5818,65 +5818,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 用于计算当前主记录下的总额与数量 |
|
|
|
|
|
*/ |
|
|
|
|
|
class CalcApplicationOutInfo implements Callable<Object> { |
|
|
|
|
|
|
|
|
|
|
|
ApplicationOutRecord mainRecord; |
|
|
|
|
|
|
|
|
|
|
|
CalcApplicationOutInfo(ApplicationOutRecord mainRecord) { |
|
|
|
|
|
this.mainRecord = mainRecord; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Object call() throws Exception { |
|
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
|
|
// 获取当前订单的子订单
|
|
|
|
|
|
List<ApplicationOutRecordMin> minList = depositoryRecordMapper.findApplicationOutRecordMinByParent(mainRecord.getId()); |
|
|
|
|
|
// 额度
|
|
|
|
|
|
double price = 0.0; |
|
|
|
|
|
// 数量
|
|
|
|
|
|
double count = 0; |
|
|
|
|
|
for (ApplicationOutRecordMin recordMin : minList) { |
|
|
|
|
|
double quantity = (double) recordMin.getQuantity() / 100; |
|
|
|
|
|
count += quantity; |
|
|
|
|
|
// 获取当前出库物料
|
|
|
|
|
|
Inventory materialById = materialMapper.findInventoryById(recordMin.getMid()); |
|
|
|
|
|
// 计算当前出库金额
|
|
|
|
|
|
double price_out = 0.0; |
|
|
|
|
|
if (recordMin.getUnit().equals(materialById.getUnit()) || "-1".equals(recordMin.getUnit())) { |
|
|
|
|
|
if (materialById.getPrice() != null) { |
|
|
|
|
|
price_out = materialById.getPrice() * quantity; |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
Map<String, Object> paramForSplitInfo = new HashMap<>(); |
|
|
|
|
|
paramForSplitInfo.put("newUnit", recordMin.getUnit()); |
|
|
|
|
|
paramForSplitInfo.put("mid", materialById.getMid()); |
|
|
|
|
|
SplitInfo splitInfo = splitUnitMapper.findSplitInfoByMidAndUnit(paramForSplitInfo); |
|
|
|
|
|
int scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1); |
|
|
|
|
|
if (materialById.getPrice() != null) { |
|
|
|
|
|
price_out = materialById.getPrice() / scale * quantity; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BigDecimal bg = new BigDecimal(price_out / 100); |
|
|
|
|
|
price_out = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
|
|
|
|
|
price = ObjectFormatUtil.sum(price, price_out); |
|
|
|
|
|
} |
|
|
|
|
|
result.put("count", count); |
|
|
|
|
|
result.put("price", price); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 获取折线图数据 |
|
|
* 获取折线图数据 |
|
|
|
|
|
* |
|
|
* @param depositoryId 待获取仓库Id |
|
|
* @param depositoryId 待获取仓库Id |
|
|
* @param type 查看类型(1入库2出库) |
|
|
* @param type 查看类型(1入库2出库) |
|
|
* @param dateType 日期类型(day按天month按月) |
|
|
* @param dateType 日期类型(day按天month按月) |
|
|
@ -5911,14 +5855,15 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
} |
|
|
} |
|
|
// 每天仓库出入库数目
|
|
|
// 每天仓库出入库数目
|
|
|
Map<Object, Object> show_data = new HashMap<>(); |
|
|
Map<Object, Object> show_data = new HashMap<>(); |
|
|
Map<String, Object> applicationRecordByDate = getLineOrBarChartDataForApplicationRecord(type, dayTimeSpaces, depositoryId,echartType); |
|
|
Map<String, Object> applicationRecordByDate = getLineOrBarChartDataForApplicationRecord(type, dayTimeSpaces, depositoryId, echartType); |
|
|
show_data.put("data",applicationRecordByDate); |
|
|
show_data.put("data", applicationRecordByDate); |
|
|
show_data.put("dayNames",dayNames); |
|
|
show_data.put("dayNames", dayNames); |
|
|
return show_data; |
|
|
return show_data; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 获取当前折线图的具体数据 |
|
|
* 获取当前折线图的具体数据 |
|
|
|
|
|
* |
|
|
* @param type 查看类型(1入库2出库) |
|
|
* @param type 查看类型(1入库2出库) |
|
|
* @param days 查询日期 |
|
|
* @param days 查询日期 |
|
|
* @param depositoryId 仓库id |
|
|
* @param depositoryId 仓库id |
|
|
@ -5926,11 +5871,11 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
*/ |
|
|
*/ |
|
|
public Map<String, Object> getLineOrBarChartDataForApplicationRecord(String type, List<Long> days, Integer depositoryId, String echartType) { |
|
|
public Map<String, Object> getLineOrBarChartDataForApplicationRecord(String type, List<Long> days, Integer depositoryId, String echartType) { |
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
if("line".equals(echartType)){ |
|
|
if ("line".equals(echartType)) { |
|
|
map.put("type", "line"); |
|
|
map.put("type", "line"); |
|
|
Map<String, Object> areaStyleItem = new HashMap<>(); |
|
|
Map<String, Object> areaStyleItem = new HashMap<>(); |
|
|
map.put("areaStyle", areaStyleItem); |
|
|
map.put("areaStyle", areaStyleItem); |
|
|
}else if("bar".equals(echartType)){ |
|
|
} else if ("bar".equals(echartType)) { |
|
|
map.put("type", "bar"); |
|
|
map.put("type", "bar"); |
|
|
Map<String, Object> emphasisItem = new HashMap<>(); |
|
|
Map<String, Object> emphasisItem = new HashMap<>(); |
|
|
emphasisItem.put("focus", "series"); |
|
|
emphasisItem.put("focus", "series"); |
|
|
@ -5952,17 +5897,17 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
return map; |
|
|
return map; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 用于获取出入库的旭日图数据 |
|
|
* 用于获取出入库的旭日图数据 |
|
|
* @param dateName 当前月份名称 |
|
|
* |
|
|
|
|
|
* @param name 当前月份名称 |
|
|
* @param type 查看类型 |
|
|
* @param type 查看类型 |
|
|
* @param start 开始时间 |
|
|
* @param start 开始时间 |
|
|
* @param end 结束时间 |
|
|
* @param end 结束时间 |
|
|
* @param materialTypeAll 当前查看物料类型 |
|
|
* @param materialTypeAll 当前查看物料类型 |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
public Map<String, Object> getSunBurstDataByForApplication(String dateName, String type, Long start, Long end, List<MaterialType> materialTypeAll,Integer depositoryId) { |
|
|
public Map<String, Object> getSunBurstDataByForApplication(String name, String type, Long start, Long end, List<MaterialType> materialTypeAll, Integer depositoryId) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
@ -5981,7 +5926,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
List<Object> resultForData = new ArrayList<>(); |
|
|
List<Object> resultForData = new ArrayList<>(); |
|
|
for (MaterialType materialType : materialTypeAll) { |
|
|
for (MaterialType materialType : materialTypeAll) { |
|
|
// 测试
|
|
|
// 测试
|
|
|
Future<Object> future = completionService.submit(new getSunBurstDataForApplicationByDepository(type, start, end, materialType,depositoryId)); |
|
|
Future<Object> future = completionService.submit(new getSunBurstDataForApplicationByDepository(type, start, end, materialType, depositoryId)); |
|
|
futureList.add(future); |
|
|
futureList.add(future); |
|
|
} |
|
|
} |
|
|
double sum = 0.0; |
|
|
double sum = 0.0; |
|
|
@ -5998,7 +5943,88 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
result.put("children", resultForData); |
|
|
result.put("children", resultForData); |
|
|
result.put("name", dateName); |
|
|
result.put("name", name); |
|
|
|
|
|
result.remove("month"); |
|
|
|
|
|
result.put("value", sum); |
|
|
|
|
|
// 用于生产随机的颜色
|
|
|
|
|
|
Random random = new Random(); |
|
|
|
|
|
Map<String, String> itemStyle = new HashMap<>(); |
|
|
|
|
|
int r = random.nextInt(256); |
|
|
|
|
|
int g = random.nextInt(256); |
|
|
|
|
|
int b = random.nextInt(256); |
|
|
|
|
|
itemStyle.put("color", "rgb(" + r + "," + g + "," + b + ")"); |
|
|
|
|
|
result.put("itemStyle", itemStyle); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 用于获取当前类别名称下当前月份的出入库的旭日图数据 |
|
|
|
|
|
* |
|
|
|
|
|
* @param name 当前月份 |
|
|
|
|
|
* @param type 类型(1入库2出库) |
|
|
|
|
|
* @param start 开始 |
|
|
|
|
|
* @param end 结束 |
|
|
|
|
|
* @param mtName 类别名称 |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
public Map<String, Object> getSunBurstDataByMtName(String name, String type, Long start, Long end, String mtName, Integer depositoryId) { |
|
|
|
|
|
List<MaterialType> materialTypeByNames = materialTypeMapper.findMaterialTypeByName(mtName); |
|
|
|
|
|
MaterialType materialType = null; |
|
|
|
|
|
if (materialTypeByNames.size() > 0) { |
|
|
|
|
|
materialType = materialTypeByNames.get(0); |
|
|
|
|
|
} else { |
|
|
|
|
|
throw new MyException("错误,不存在当前名称的类型"); |
|
|
|
|
|
} |
|
|
|
|
|
List<MaterialType> childMaterialTypeList = materialTypeMapper.findMaterialTypeByParent(materialType.getOldId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double sum = 0.0; |
|
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
|
|
if (childMaterialTypeList != null && childMaterialTypeList.size() > 0) { |
|
|
|
|
|
int threadSize = PublicConfig.availableVirtualMachine; |
|
|
|
|
|
|
|
|
|
|
|
int maxThreadSize = childMaterialTypeList.size(); |
|
|
|
|
|
if (maxThreadSize < threadSize) { |
|
|
|
|
|
maxThreadSize = threadSize * 2; |
|
|
|
|
|
} |
|
|
|
|
|
ExecutorService exs = new ThreadPoolExecutor(threadSize, maxThreadSize, 100, TimeUnit.SECONDS, new LinkedBlockingQueue<>(maxThreadSize)); |
|
|
|
|
|
|
|
|
|
|
|
// 结果集
|
|
|
|
|
|
List<Future<Object>> futureList = new ArrayList<Future<Object>>(); |
|
|
|
|
|
// 1.定义CompletionService
|
|
|
|
|
|
CompletionService<Object> completionService = new ExecutorCompletionService<Object>(exs); |
|
|
|
|
|
|
|
|
|
|
|
int runThreadSize = 0; |
|
|
|
|
|
for (MaterialType value : childMaterialTypeList) { |
|
|
|
|
|
Future<Object> submit = completionService.submit(new getSunBurstDataForApplicationByDepository(type, start, end, value, depositoryId)); |
|
|
|
|
|
runThreadSize++; |
|
|
|
|
|
futureList.add(submit); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Object> resultForData = new ArrayList<>(); |
|
|
|
|
|
for (int i = 0; i < runThreadSize; i++) { |
|
|
|
|
|
Object obj = null; |
|
|
|
|
|
try { |
|
|
|
|
|
obj = completionService.take().get(); |
|
|
|
|
|
resultForData.add(obj); |
|
|
|
|
|
sum = ObjectFormatUtil.sum(sum, ObjectFormatUtil.toDouble(ObjectFormatUtil.objToMap(obj, String.class, Object.class).get("value"))); |
|
|
|
|
|
} catch (InterruptedException | ExecutionException e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
result.put("children", resultForData); |
|
|
|
|
|
}else{ |
|
|
|
|
|
try { |
|
|
|
|
|
Object call = new getSunBurstDataForApplicationByDepository(type, start, end, materialType, depositoryId).call(); |
|
|
|
|
|
sum = ObjectFormatUtil.sum(sum, ObjectFormatUtil.toDouble(ObjectFormatUtil.objToMap(call, String.class, Object.class).get("value"))); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
result.put("name", name); |
|
|
result.remove("month"); |
|
|
result.remove("month"); |
|
|
result.put("value", sum); |
|
|
result.put("value", sum); |
|
|
// 用于生产随机的颜色
|
|
|
// 用于生产随机的颜色
|
|
|
@ -6012,6 +6038,59 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 用于计算当前主记录下的总额与数量 |
|
|
|
|
|
*/ |
|
|
|
|
|
class CalcApplicationOutInfo implements Callable<Object> { |
|
|
|
|
|
|
|
|
|
|
|
ApplicationOutRecord mainRecord; |
|
|
|
|
|
|
|
|
|
|
|
CalcApplicationOutInfo(ApplicationOutRecord mainRecord) { |
|
|
|
|
|
this.mainRecord = mainRecord; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Object call() throws Exception { |
|
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
|
|
// 获取当前订单的子订单
|
|
|
|
|
|
List<ApplicationOutRecordMin> minList = depositoryRecordMapper.findApplicationOutRecordMinByParent(mainRecord.getId()); |
|
|
|
|
|
// 额度
|
|
|
|
|
|
double price = 0.0; |
|
|
|
|
|
// 数量
|
|
|
|
|
|
double count = 0; |
|
|
|
|
|
for (ApplicationOutRecordMin recordMin : minList) { |
|
|
|
|
|
double quantity = (double) recordMin.getQuantity() / 100; |
|
|
|
|
|
count += quantity; |
|
|
|
|
|
// 获取当前出库物料
|
|
|
|
|
|
Inventory materialById = materialMapper.findInventoryById(recordMin.getMid()); |
|
|
|
|
|
// 计算当前出库金额
|
|
|
|
|
|
double price_out = 0.0; |
|
|
|
|
|
if (recordMin.getUnit().equals(materialById.getUnit()) || "-1".equals(recordMin.getUnit())) { |
|
|
|
|
|
if (materialById.getPrice() != null) { |
|
|
|
|
|
price_out = materialById.getPrice() * quantity; |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
Map<String, Object> paramForSplitInfo = new HashMap<>(); |
|
|
|
|
|
paramForSplitInfo.put("newUnit", recordMin.getUnit()); |
|
|
|
|
|
paramForSplitInfo.put("mid", materialById.getMid()); |
|
|
|
|
|
SplitInfo splitInfo = splitUnitMapper.findSplitInfoByMidAndUnit(paramForSplitInfo); |
|
|
|
|
|
int scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1); |
|
|
|
|
|
if (materialById.getPrice() != null) { |
|
|
|
|
|
price_out = materialById.getPrice() / scale * quantity; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BigDecimal bg = new BigDecimal(price_out / 100); |
|
|
|
|
|
price_out = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
|
|
|
|
|
price = ObjectFormatUtil.sum(price, price_out); |
|
|
|
|
|
} |
|
|
|
|
|
result.put("count", count); |
|
|
|
|
|
result.put("price", price); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 用于具体执行查询旭日图的多线程类 |
|
|
* 用于具体执行查询旭日图的多线程类 |
|
|
*/ |
|
|
*/ |
|
|
@ -6024,7 +6103,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
MaterialType materialType; |
|
|
MaterialType materialType; |
|
|
Integer depositoryId; |
|
|
Integer depositoryId; |
|
|
|
|
|
|
|
|
public getSunBurstDataForApplicationByDepository(String type, Long start, Long end, MaterialType materialType,Integer depositoryId) { |
|
|
public getSunBurstDataForApplicationByDepository(String type, Long start, Long end, MaterialType materialType, Integer depositoryId) { |
|
|
this.type = type; |
|
|
this.type = type; |
|
|
this.start = start; |
|
|
this.start = start; |
|
|
this.end = end; |
|
|
this.end = end; |
|
|
@ -6057,7 +6136,4 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|