Browse Source

添加组合入库审批

lwx_dev
erdanergou 3 years ago
parent
commit
6a76aa74b8
  1. 12
      src/main/java/com/dreamchaser/depository_manage/controller/PlaceController.java
  2. 7
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  3. 13
      src/main/java/com/dreamchaser/depository_manage/service/impl/GroupServiceImpl.java
  4. 2
      src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html
  5. 2
      target/classes/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html

12
src/main/java/com/dreamchaser/depository_manage/controller/PlaceController.java

@ -104,7 +104,12 @@ public class PlaceController {
insert.put("min", 0);
}
if (!"".equals(max)) {
Double maxQuantity = ObjectFormatUtil.toDouble(max);
if (maxQuantity >= 999999999) {
insert.put("max", 999999999);
} else {
insert.put("max", map.get("max"));
}
} else {
insert.put("max", 0);
}
@ -142,7 +147,12 @@ public class PlaceController {
insert.put("did", map.get("depositoryId"));
insert.put("kingdeecode", kingdeeCode);
insert.put("min", min);
insert.put("max", max);
Double maxQuantity = ObjectFormatUtil.toDouble(max);
if (maxQuantity >= 999999999) {
insert.put("max", 999999999);
} else {
insert.put("max", map.get("max"));
}
insert.put("state", 1);
insert.put("quantity", 0);
insert.put("flagType", 1);

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

@ -725,9 +725,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
flagForApproval = false;
}
}
if(map.containsKey("isGroup")){
flagForApproval = isApprovalPass;
}
map.put("flagForApproval", flagForApproval);
if (placeById.getMax() - placeById.getQuantity() > quantity) {
if (placeById.getMax() - placeById.getQuantity() >= quantity) {
// 如果当前库位还能存放
// 入库
Integer integer = applicationIn(map);
@ -2757,7 +2760,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
paramForUpdateInventory.put("id", recordP.getId());
paramForUpdateInventory.put("producedDate", recordP.getMproducedDate());
Place placeById = placeMapper.findPlaceById(recordP.getPlaceId());
updateInventoryInfoForApproval(paramForUpdateInventory, recordP.getQuantity() / 100, materialById, placeById);
updateInventoryInfoForApproval(paramForUpdateInventory, recordP.getQuantity() / 100.0, materialById, placeById);
} else {
// 如果是拆单单位

13
src/main/java/com/dreamchaser/depository_manage/service/impl/GroupServiceImpl.java

@ -884,7 +884,7 @@ public class GroupServiceImpl implements GroupService {
insertForApplicationInRecord.put("applyRemark", map.get("applyRemark"));
// 用于标志该是否需要进行审批
boolean flagForApproval = false; // 默认不需要
// 循环当前组合信息
for (GroupInfo groupInfo :
groupInfoByGid) {
@ -893,9 +893,14 @@ public class GroupServiceImpl implements GroupService {
paramForMtRole.put("mtid", groupInfo.getMtid());
List<RoleAndMaterialType> roleAndMaterials = roleMapper.findRoleAndMaterialTypeByCondition(paramForMtRole);
if (roleAndMaterials.size() > 0 ) {
if (roleAndMaterials.size() > 0) {
flagForApproval = true; // 需要
}
}
// 循环当前组合信息
for (GroupInfo groupInfo :
groupInfoByGid) {
// 获取当前组合记录中的单位
String unit = groupInfo.getUnit();
@ -908,7 +913,8 @@ public class GroupServiceImpl implements GroupService {
// 如果是基础单位
insertForApplicationInRecord.put("price", String.valueOf(0));
insertForApplicationInRecord.put("unit", material.getUnit());
result += depositoryRecordService.applicationInPlace(insertForApplicationInRecord, false);
insertForApplicationInRecord.put("isGroup", "isGroup");
result += depositoryRecordService.applicationInPlace(insertForApplicationInRecord, flagForApproval);
if (!flagForApproval) {
// 当不需要审批时删除冗余订单
depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(insertForApplicationInRecord.get("applicationInId")));
@ -922,6 +928,7 @@ public class GroupServiceImpl implements GroupService {
insertForApplicationInRecord.put("price", String.valueOf(0));
insertForApplicationInRecord.put("unit", unit);
insertForApplicationInRecord.put("type", "in");
insertForApplicationInRecord.put("flagForApproval", flagForApproval);
result += splitUnitService.addSplitInventory(insertForApplicationInRecord);
if (!flagForApproval) {
// 当不需要审批时删除冗余订单

2
src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html

@ -83,7 +83,7 @@
}
});*/
var result = "1638361861757116416";//当needResult为1时返回处理结果
var result = "1638361349087338496";//当needResult为1时返回处理结果
var req = {};
req.qrCode = result;
outboundLogic(req);

2
target/classes/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html

@ -83,7 +83,7 @@
}
});*/
var result = "1638361861757116416";//当needResult为1时返回处理结果
var result = "1638361349087338496";//当needResult为1时返回处理结果
var req = {};
req.qrCode = result;
outboundLogic(req);

Loading…
Cancel
Save