Browse Source

完成入库功能修改

lwx_dev
erdanergou 3 years ago
parent
commit
6ac64be0d9
  1. 4
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java
  2. 6
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java

4
src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java

@ -1345,7 +1345,7 @@ public class DepositoryRecordController {
// 获取当前仓库编号 // 获取当前仓库编号
Integer depositoryId = depositoryIds.get(i); Integer depositoryId = depositoryIds.get(i);
// 获取当前申请数量 // 获取当前申请数量
Integer integer = ObjectFormatUtil.toInteger(quantitys.get(i)); Double integer = ObjectFormatUtil.toDouble(quantitys.get(i));
String quantity = integer.toString(); String quantity = integer.toString();
// 先定义最终要使用的库位,默认是默认库位 // 先定义最终要使用的库位,默认是默认库位
Integer placeId = 0; Integer placeId = 0;
@ -1366,7 +1366,7 @@ public class DepositoryRecordController {
inRecord.put("applyRemark", applyRemark); inRecord.put("applyRemark", applyRemark);
inRecord.put("unit", unit); inRecord.put("unit", unit);
if (!"-1".equals(unit)) { if (!"-1".equals(unit)) {
map.put("type", "in"); inRecord.put("type", "in");
Integer addSplitInventory = splitUnitService.addSplitInventory(inRecord); Integer addSplitInventory = splitUnitService.addSplitInventory(inRecord);
if (addSplitInventory != -1) { if (addSplitInventory != -1) {
success += addSplitInventory; success += addSplitInventory;

6
src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java

@ -240,7 +240,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
if (placeId == null || "".equals(placeId) || "0".equals(placeId)) { if (placeId == null || "".equals(placeId) || "0".equals(placeId)) {
map.put("placeId", 0); map.put("placeId", 0);
} }
double quantity = Double.parseDouble((String) map.get("quantity")); double quantity = Double.parseDouble((String) map.get("quantity")) * 100;
Long time = DateUtil.DateTimeToTimeStamp(DateUtil.getSimpleTime(new Date())); Long time = DateUtil.DateTimeToTimeStamp(DateUtil.getSimpleTime(new Date()));
map.put("applicantTime", time); map.put("applicantTime", time);
Integer mid = ObjectFormatUtil.toInteger(map.get("mid")); Integer mid = ObjectFormatUtil.toInteger(map.get("mid"));
@ -252,7 +252,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
Inventory materialById = materialMapper.findInventoryById(mid); Inventory materialById = materialMapper.findInventoryById(mid);
map.put("price", 0); map.put("price", 0);
if (materialById.getPrice() != null) { if (materialById.getPrice() != null) {
int amounts = (int) ((materialById.getPrice() / 100) * quantity * 100); int amounts = (int) ((materialById.getPrice() / 100) * quantity);
map.put("price", amounts); map.put("price", amounts);
} }
Depository depositoryRecordById = depositoryMapper.findDepositoryById(materialById.getDepositoryId()); Depository depositoryRecordById = depositoryMapper.findDepositoryById(materialById.getDepositoryId());
@ -262,6 +262,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
String code = createCode(dname, "outOrderNumber", "out", company.getName()); String code = createCode(dname, "outOrderNumber", "out", company.getName());
map.put("code", code); map.put("code", code);
map.put("pass", 3); map.put("pass", 3);
map.put("quantity",quantity);
return depositoryRecordMapper.insertApplicationOutRecord(map); return depositoryRecordMapper.insertApplicationOutRecord(map);
} }
@ -853,6 +854,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 修改库存记录 // 修改库存记录
materialMapper.updateInventory(inventoryById); materialMapper.updateInventory(inventoryById);
} }
map.put("quantity",ObjectFormatUtil.toDouble(map.get("quantity")) * 100);
return depositoryRecordMapper.insertApplicationOutRecordMin(map); return depositoryRecordMapper.insertApplicationOutRecordMin(map);
} }

Loading…
Cancel
Save