|
|
|
@ -88,7 +88,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
param.put("mname", mname); |
|
|
|
List<Material> list = materialMapper.findMaterialByCondition(param); |
|
|
|
Material material = list.get(0); |
|
|
|
if (material.getPrice() != null) { |
|
|
|
map.put("price", (material.getPrice() / 100) * quantity * 100); |
|
|
|
} else { |
|
|
|
|
|
|
|
map.put("price", 0); |
|
|
|
} |
|
|
|
return depositoryRecordMapper.insertDepositoryRecord(map); |
|
|
|
} |
|
|
|
|
|
|
|
@ -111,7 +116,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
//构造单号
|
|
|
|
String code = createCode(depositoryRecordById.getDname(), "InOrderNumber", "in", ""); |
|
|
|
Double quantity = Double.parseDouble((String) map.get("quantity")); |
|
|
|
double price = Double.parseDouble((String) map.get("price")); |
|
|
|
Integer mid = ObjectFormatUtil.toInteger(map.get("mid")); |
|
|
|
// 根据物料id查询物料
|
|
|
|
Material material = materialMapper.findMaterialById(mid); |
|
|
|
@ -134,18 +138,8 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
param.put("mcode", material.getCode()); |
|
|
|
// 判断该仓库中有无该物物料
|
|
|
|
List<Inventory> materialByCondition = materialMapper.findInventory(param); |
|
|
|
// 获取当前入库金额
|
|
|
|
Double amounts = (quantity * price * 100); |
|
|
|
// 获取平均价格
|
|
|
|
double avgPrice = 0.0; |
|
|
|
if (quantity != 0) { |
|
|
|
avgPrice = (amounts) / (quantity); |
|
|
|
} else { |
|
|
|
avgPrice = price * 100; |
|
|
|
} |
|
|
|
|
|
|
|
map.put("amounts", amounts); |
|
|
|
map.put("price", price * 100); |
|
|
|
|
|
|
|
String simpleTime = DateUtil.getSimpleTime(new Date()); |
|
|
|
map.put("applicant_time", DateUtil.DateTimeToTimeStamp(simpleTime)); |
|
|
|
map.put("code", code); |
|
|
|
@ -155,11 +149,8 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
Integer newMid = 0; |
|
|
|
if (materialByCondition.size() > 0) { // 如果当前存在
|
|
|
|
Inventory mt = materialByCondition.get(0); |
|
|
|
map.put("oldPrice", mt.getPrice()); |
|
|
|
map.put("mid", mt.getMid()); |
|
|
|
mt.setAmounts(mt.getAmounts() + amounts); |
|
|
|
mt.setQuantity((int) (mt.getQuantity() + quantity)); |
|
|
|
mt.setPrice(avgPrice); |
|
|
|
mt.setProducedDate(producedDate); |
|
|
|
materialMapper.updateInventory(mt); |
|
|
|
newMid = mt.getId(); |
|
|
|
@ -167,9 +158,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
Map<String, Object> insert = new HashMap<>(); |
|
|
|
Material materialById = materialMapper.findMaterialById(mid); |
|
|
|
insert.put("depositoryId", depositoryId); |
|
|
|
insert.put("price", avgPrice); |
|
|
|
insert.put("quantity", quantity); |
|
|
|
insert.put("amounts", amounts); |
|
|
|
insert.put("shelfLife", materialById.getShelfLife()); |
|
|
|
insert.put("producedDate", producedDate); |
|
|
|
insert.put("mid", map.get("mid")); |
|
|
|
@ -218,8 +207,11 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
if (mid != null) { |
|
|
|
// 获取当前物料
|
|
|
|
Inventory materialById = materialMapper.findInventoryById(mid); |
|
|
|
map.put("price", 0); |
|
|
|
if (materialById.getPrice() != null) { |
|
|
|
int amounts = (int) ((materialById.getPrice() / 100) * quantity * 100); |
|
|
|
map.put("price", amounts); |
|
|
|
} |
|
|
|
Depository depositoryRecordById = depositoryMapper.findDepositoryById(materialById.getDepositoryId()); |
|
|
|
dname = depositoryRecordById.getDname(); |
|
|
|
} |
|
|
|
@ -362,12 +354,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
Map<String, Object> mapForToday = new HashMap<>(); |
|
|
|
mapForToday.put("start", nowTimeForCalc); |
|
|
|
mapForToday.put("end", now); |
|
|
|
mapForToday.put("list",list); |
|
|
|
mapForToday.put("list", list); |
|
|
|
// 用于查询昨天的入库记录
|
|
|
|
Map<String, Object> mapForYesterday = new HashMap<>(); |
|
|
|
mapForYesterday.put("start", yesterdayTimeForCalc); |
|
|
|
mapForYesterday.put("end", nowTimeForCalc); |
|
|
|
mapForYesterday.put("list",list); |
|
|
|
mapForYesterday.put("list", list); |
|
|
|
|
|
|
|
// 查询今天目前为止的入库
|
|
|
|
List<ApplicationInRecordP> applicationInRecordPForToday = depositoryRecordMapper.findApplicationInRecordPForAPeriodOfTime(mapForToday); |
|
|
|
@ -386,7 +378,11 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// 获取当前入库类型(1物料2组合)
|
|
|
|
Integer flagForGroup = applicationInRecordP.getFlagForGroup(); |
|
|
|
sumForToday += applicationInRecordP.getQuantity(); |
|
|
|
if (applicationInRecordP.getPrice() != null) { |
|
|
|
priceForToday += applicationInRecordP.getPrice() * applicationInRecordP.getQuantity(); |
|
|
|
} else { |
|
|
|
priceForToday += 0; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -394,7 +390,11 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
for (int i = 0; i < applicationInRecordPForYesterday.size(); i++) { |
|
|
|
ApplicationInRecordP applicationInRecordP = applicationInRecordPForYesterday.get(i); |
|
|
|
sumForYesterDay += applicationInRecordP.getQuantity(); |
|
|
|
if (applicationInRecordP.getPrice() != null) { |
|
|
|
priceForYesterDay += applicationInRecordP.getPrice() * applicationInRecordP.getQuantity(); |
|
|
|
} else { |
|
|
|
priceForYesterDay += 0; |
|
|
|
} |
|
|
|
} |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
result.put("total", sumForToday); |
|
|
|
@ -425,7 +425,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public Map<String, Object> CalculateAllApplicationOutCount(String state,List<Integer> list) { |
|
|
|
public Map<String, Object> CalculateAllApplicationOutCount(String state, List<Integer> list) { |
|
|
|
// 获取昨天出库订单
|
|
|
|
|
|
|
|
// 获取当前时间
|
|
|
|
@ -440,12 +440,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
Map<String, Object> mapForToday = new HashMap<>(); |
|
|
|
mapForToday.put("start", nowTimeForCalc); |
|
|
|
mapForToday.put("end", now); |
|
|
|
mapForToday.put("list",list); |
|
|
|
mapForToday.put("list", list); |
|
|
|
// 用于查询昨天的出库记录
|
|
|
|
Map<String, Object> mapForYesterday = new HashMap<>(); |
|
|
|
mapForYesterday.put("start", yesterdayTimeForCalc); |
|
|
|
mapForYesterday.put("end", nowTimeForCalc); |
|
|
|
mapForYesterday.put("list",list); |
|
|
|
mapForYesterday.put("list", list); |
|
|
|
|
|
|
|
// 用于最终的结果
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
@ -979,8 +979,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
restResponse.setData(""); |
|
|
|
restResponse.setStatusInfo(new StatusInfo("出库失败", "出库失败,库存不足")); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
// 如果是拆单后的出库
|
|
|
|
|
|
|
|
// 用于获取对应的拆单记录
|
|
|
|
@ -1121,9 +1120,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
inventory.setQuantity(inventory.getQuantity() - 1); |
|
|
|
|
|
|
|
|
|
|
|
// 重新计算总额
|
|
|
|
inventory.setAmounts(inventory.getQuantity() * inventory.getPrice()); |
|
|
|
|
|
|
|
// 修改库存记录
|
|
|
|
materialMapper.updateInventory(inventory); |
|
|
|
|
|
|
|
@ -1218,8 +1214,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// 令库存-1
|
|
|
|
inventory.setQuantity(inventory.getQuantity() - surplus_redundant); |
|
|
|
|
|
|
|
// 重新计算总额
|
|
|
|
inventory.setAmounts(inventory.getQuantity() * inventory.getPrice()); |
|
|
|
|
|
|
|
// 修改库存记录
|
|
|
|
materialMapper.updateInventory(inventory); |
|
|
|
@ -1258,8 +1252,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
// 如果拆单库存处理记录不存在
|
|
|
|
|
|
|
|
int scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1); |
|
|
|
@ -1267,22 +1260,20 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// 如果当前库存数量满足要求
|
|
|
|
|
|
|
|
// 获取当前出库的具体数目
|
|
|
|
int residue = (int) Math.ceil(trueOut / (double)splitInfo.getQuantity()); |
|
|
|
int residue = (int) Math.ceil(trueOut / (double) splitInfo.getQuantity()); |
|
|
|
// 获取剩余数目
|
|
|
|
int residue_realQuantity = residue * scale - trueOut; |
|
|
|
|
|
|
|
// 设置新总额
|
|
|
|
inventory.setAmounts(inventory.getAmounts() - residue * inventory.getPrice()); |
|
|
|
|
|
|
|
// 设置新库存
|
|
|
|
inventory.setQuantity(inventory.getQuantity() - residue ); |
|
|
|
inventory.setQuantity(inventory.getQuantity() - residue); |
|
|
|
|
|
|
|
//更新库存
|
|
|
|
materialMapper.updateInventory(inventory); |
|
|
|
|
|
|
|
// 更新对应库位的库存
|
|
|
|
// 修改当前库位存放物料的数量
|
|
|
|
placeAndMaterialByMidAndPid.setQuantity(placeAndMaterialByMidAndPid.getQuantity() - residue ); |
|
|
|
placeAndMaterialByMidAndPid.setQuantity(placeAndMaterialByMidAndPid.getQuantity() - residue); |
|
|
|
placeMapper.updateMaterialAndPlace(placeAndMaterialByMidAndPid); |
|
|
|
|
|
|
|
// 修改库位数量
|
|
|
|
@ -1292,15 +1283,20 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
|
|
|
|
// 插入拆单记录
|
|
|
|
Map<String,Object> insertForSplitInventory = new HashMap<>(); |
|
|
|
insertForSplitInventory.put("mid",inventory.getMid()); |
|
|
|
insertForSplitInventory.put("mcode",inventory.getCode()); |
|
|
|
insertForSplitInventory.put("price",inventory.getPrice() / scale); |
|
|
|
insertForSplitInventory.put("quantity",residue_realQuantity); |
|
|
|
insertForSplitInventory.put("unit",unit); |
|
|
|
insertForSplitInventory.put("depositoryId",applicationOutMinById.getDepositoryId()); |
|
|
|
insertForSplitInventory.put("placeId",placeAndMaterialByMidAndPid.getPid()); |
|
|
|
insertForSplitInventory.put("type","in"); |
|
|
|
Map<String, Object> insertForSplitInventory = new HashMap<>(); |
|
|
|
insertForSplitInventory.put("mid", inventory.getMid()); |
|
|
|
insertForSplitInventory.put("mcode", inventory.getCode()); |
|
|
|
if (inventory.getPrice() != null) { |
|
|
|
|
|
|
|
insertForSplitInventory.put("price", inventory.getPrice() / scale); |
|
|
|
} else { |
|
|
|
insertForSplitInventory.put("price", 0); |
|
|
|
} |
|
|
|
insertForSplitInventory.put("quantity", residue_realQuantity); |
|
|
|
insertForSplitInventory.put("unit", unit); |
|
|
|
insertForSplitInventory.put("depositoryId", applicationOutMinById.getDepositoryId()); |
|
|
|
insertForSplitInventory.put("placeId", placeAndMaterialByMidAndPid.getPid()); |
|
|
|
insertForSplitInventory.put("type", "in"); |
|
|
|
splitUnitService.addSplitInventory(insertForSplitInventory); |
|
|
|
Integer new_id = ObjectFormatUtil.toInteger(insertForSplitInventory.get("newInMid")); |
|
|
|
depositoryRecordMapper.deleteApplicationInRecordById(new_id); |
|
|
|
@ -1523,8 +1519,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
materialAndPlace.setQuantity(materialAndPlace.getQuantity() - inventory_quantity); |
|
|
|
inventory.setQuantity(inventory.getQuantity() - inventory_quantity); |
|
|
|
|
|
|
|
// 重新设置总额
|
|
|
|
inventory.setAmounts(inventory.getAmounts() - inventory_quantity * inventory.getPrice()); |
|
|
|
|
|
|
|
// 修改库存数量
|
|
|
|
materialMapper.updateInventory(inventory); |
|
|
|
@ -1554,8 +1548,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// 设置当前库存数量
|
|
|
|
materialAndPlace.setQuantity(materialAndPlace.getQuantity() - surplus_redundant); |
|
|
|
inventory.setQuantity(inventory.getQuantity() - surplus_redundant); |
|
|
|
// 设置当前总额
|
|
|
|
inventory.setAmounts(inventory.getPrice() * inventory.getQuantity()); |
|
|
|
|
|
|
|
// 修改库存数量
|
|
|
|
materialMapper.updateInventory(inventory); |
|
|
|
@ -1732,7 +1724,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
@Override |
|
|
|
public Integer reviewByQyWxApproval(String mainId, ApprovalInfo_Details approvalInfo_details, String userAgent, String spStatus, String spNo, boolean flagForFirst, int flagForDepository) { |
|
|
|
|
|
|
|
if(flagForDepository == 3){ |
|
|
|
if (flagForDepository == 3) { |
|
|
|
// 如果是仓库管理员审批,直接返回
|
|
|
|
return 0; |
|
|
|
} |
|
|
|
@ -1917,8 +1909,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// 将当前redis中存储的spno删除
|
|
|
|
redisTemplate.delete(spNo); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
// 如果是部门负责人
|
|
|
|
|
|
|
|
String departmentheadTime = recordP.getDepartmentheadTime(); |
|
|
|
@ -1999,6 +1990,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据主键查询转移记录 |
|
|
|
* |
|
|
|
* @param id |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@ -2024,7 +2016,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
map.put("state", "待部门负责人审核"); |
|
|
|
String simpleTime = DateUtil.getSimpleTime(new Date()); |
|
|
|
map.put("applicantTime", DateUtil.DateTimeToTimeStamp(simpleTime)); |
|
|
|
if (material.getPrice() != null) { |
|
|
|
|
|
|
|
map.put("price", material.getPrice() * quantity * 100); |
|
|
|
} else { |
|
|
|
map.put("price", 0); |
|
|
|
} |
|
|
|
map.put("istransfer", 1); |
|
|
|
map.put("fromId", material.getDepositoryId()); |
|
|
|
String fromPlaceId = (String) map.get("fromPlaceId"); |
|
|
|
@ -2168,7 +2165,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
}).start(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
// 如果没有通过
|
|
|
|
updateInventoryForOutRefused(record); |
|
|
|
@ -2211,8 +2207,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
qyWxOperationService.sendMessageForOtherUserByCard(ObjectFormatUtil.toInteger(id), s, userAgent, 1); |
|
|
|
} |
|
|
|
}).start(); |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
String result = ""; |
|
|
|
// 开启线程更改其他用户卡片模板样式
|
|
|
|
String simpleTime = DateUtil.getSimpleTime(new Date()); |
|
|
|
@ -2224,13 +2219,13 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// map.put("mid", record.getMid());
|
|
|
|
// Material material = materialMapper.findMaterialById(record.getMid());
|
|
|
|
Integer depositoryManagerPass = (Integer) map.get("depositoryManagerPass"); |
|
|
|
if(depositoryManagerPass == null){ |
|
|
|
if (depositoryManagerPass == null) { |
|
|
|
depositoryManagerPass = (Integer) map.get("departmentheadPass"); |
|
|
|
} |
|
|
|
String departmentheadTime = record.getDepartmentheadTime(); |
|
|
|
// 用于标识部门负责人是否审批
|
|
|
|
boolean flagFordepartmentTime = false; // 默认审批过
|
|
|
|
if("0".equals(departmentheadTime)){ |
|
|
|
if ("0".equals(departmentheadTime)) { |
|
|
|
flagFordepartmentTime = true; |
|
|
|
} |
|
|
|
if (depositoryManagerPass == 1) { |
|
|
|
@ -2645,7 +2640,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
if (inventories.size() > 0) { |
|
|
|
// 如果在该仓库
|
|
|
|
|
|
|
|
if (inventoryById.getPrice() != null) { |
|
|
|
|
|
|
|
map.put("price", inventoryById.getPrice().toString()); |
|
|
|
} else { |
|
|
|
map.put("price", "0"); |
|
|
|
} |
|
|
|
|
|
|
|
// 进行入库操作
|
|
|
|
applicationInPlace(map); |
|
|
|
@ -2656,14 +2656,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
Integer quantity = ObjectFormatUtil.toInteger(map.get("quantity")); |
|
|
|
// 转移到的仓库
|
|
|
|
insert.put("depositoryId", transferRecord.getToId()); |
|
|
|
// 单价
|
|
|
|
insert.put("price", inventoryById.getPrice()); |
|
|
|
// 库存物料
|
|
|
|
insert.put("mid", inventoryById.getMid()); |
|
|
|
// 数量
|
|
|
|
insert.put("quantity", quantity); |
|
|
|
// 总额
|
|
|
|
insert.put("amounts", quantity * inventoryById.getPrice()); |
|
|
|
// 仓库编码
|
|
|
|
insert.put("depositoryCode", inventoryById.getDepositoryCode()); |
|
|
|
// 生产日期
|
|
|
|
@ -2787,7 +2783,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
// 进行修改当前拆单库存数量
|
|
|
|
map.put("newInMid", placeAndMaterial.getId()); |
|
|
|
if (inventoryById.getPrice() != null) { |
|
|
|
|
|
|
|
map.put("price", inventoryById.getPrice() / scaleQuantity); |
|
|
|
} else { |
|
|
|
map.put("price", 0); |
|
|
|
} |
|
|
|
|
|
|
|
// 实际入库数量
|
|
|
|
map.put("realQuantity", quantity.toString()); |
|
|
|
@ -2859,7 +2860,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
// 进行修改当前拆单库存数量
|
|
|
|
map.put("newInMid", placeAndMaterial.getId()); |
|
|
|
if (inventoryById.getPrice() != null) { |
|
|
|
|
|
|
|
map.put("price", inventoryById.getPrice() / scaleQuantity); |
|
|
|
} else { |
|
|
|
map.put("price", 0); |
|
|
|
} |
|
|
|
|
|
|
|
// 实际入库数量
|
|
|
|
map.put("realQuantity", quantity.toString()); |
|
|
|
@ -2902,7 +2908,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
} else { |
|
|
|
// 如果不小于
|
|
|
|
|
|
|
|
if (inventoryById.getPrice() != null) { |
|
|
|
|
|
|
|
map.put("price", inventoryById.getPrice() / scaleQuantity); |
|
|
|
} else { |
|
|
|
map.put("price", 0); |
|
|
|
} |
|
|
|
updateSplitInventoryForMoreScale(inventoryById, map, splitInfo, quantity, insertForMaterialAndPlace, insertForSplitInventory); |
|
|
|
} |
|
|
|
|
|
|
|
@ -2915,10 +2926,8 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// 用于添加一条库存记录
|
|
|
|
Map<String, Object> insertForInventory = new HashMap<>(); |
|
|
|
insertForInventory.put("depositoryId", transferRecord.getToId()); |
|
|
|
insertForInventory.put("price", inventoryById.getPrice()); |
|
|
|
insertForInventory.put("mid", inventoryById.getMid()); |
|
|
|
insertForInventory.put("quantity", 0); |
|
|
|
insertForInventory.put("amounts", 0); |
|
|
|
insertForInventory.put("depositoryCode", inventoryById.getDepositoryCode()); |
|
|
|
insertForInventory.put("producedDate", inventoryById.getProducedDate()); |
|
|
|
// 添加一条库存记录
|
|
|
|
@ -2949,7 +2958,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
splitUnitMapper.addSplitInventory(insertForSplitInventory); |
|
|
|
} else { |
|
|
|
// 如果不小于
|
|
|
|
if (inventoryById.getPrice() != null) { |
|
|
|
|
|
|
|
map.put("price", inventoryById.getPrice() / scaleQuantity); |
|
|
|
} else { |
|
|
|
map.put("price", 0); |
|
|
|
} |
|
|
|
updateSplitInventoryForMoreScale(inventoryById, map, splitInfo, quantity, insertForMaterialAndPlace, insertForSplitInventory); |
|
|
|
} |
|
|
|
|
|
|
|
@ -3500,7 +3514,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
Integer count = 0; |
|
|
|
for (int i = 0; i < applicationInRecordPAll.size(); i++) { |
|
|
|
ApplicationInRecordP applicationInRecordP = applicationInRecordPAll.get(i); |
|
|
|
double price = applicationInRecordP.getPrice(); |
|
|
|
double price = 0.0; |
|
|
|
if (applicationInRecordP.getPrice() != null) { |
|
|
|
price = applicationInRecordP.getPrice(); |
|
|
|
} |
|
|
|
sum += price * applicationInRecordP.getQuantity() / 100; |
|
|
|
count += applicationInRecordP.getQuantity(); |
|
|
|
} |
|
|
|
@ -3533,7 +3550,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
ApplicationOutRecordMin applicationOutRecordMin = minByCondition.get(k); |
|
|
|
Integer mid = applicationOutRecordMin.getMid(); |
|
|
|
Material materialById = materialMapper.findMaterialById(mid); |
|
|
|
if (materialById.getPrice() != null) { |
|
|
|
|
|
|
|
sum += (materialById.getPrice() / 100) * applicationOutRecordMin.getQuantity(); |
|
|
|
} else { |
|
|
|
sum += 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -3544,8 +3566,13 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
ApplicationOutRecordMin recordMin = applicationOutMinForComplete.get(i); |
|
|
|
Integer mid = recordMin.getMid(); |
|
|
|
Material materialById = materialMapper.findMaterialById(mid); |
|
|
|
if (materialById.getPrice() != null) { |
|
|
|
sum += (materialById.getPrice() / 100) * recordMin.getQuantity(); |
|
|
|
} |
|
|
|
else{ |
|
|
|
sum += 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
BigDecimal bg = new BigDecimal(sum); |
|
|
|
sum = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
|
|
|
@ -3958,7 +3985,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// 获取当前出库物料
|
|
|
|
Inventory materialById = materialMapper.findInventoryById(recordMin.getMid()); |
|
|
|
// 计算当前出库金额
|
|
|
|
double price_out = materialById.getPrice() * recordMin.getQuantity(); |
|
|
|
double price_out = 0.0; |
|
|
|
if (materialById.getPrice() != null) { |
|
|
|
price_out = materialById.getPrice() * recordMin.getQuantity(); |
|
|
|
} |
|
|
|
BigDecimal bg = new BigDecimal(price_out / 100); |
|
|
|
price_out = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
|
|
|
price += price_out; |
|
|
|
|