|
|
@ -893,8 +893,7 @@ public class GroupServiceImpl implements GroupService { |
|
|
depositoryIds.add(ObjectFormatUtil.toInteger(insertForApplicationInRecord.get("depositoryId"))); |
|
|
depositoryIds.add(ObjectFormatUtil.toInteger(insertForApplicationInRecord.get("depositoryId"))); |
|
|
insertForApplicationInRecord.remove("applicationInId"); |
|
|
insertForApplicationInRecord.remove("applicationInId"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { |
|
|
else { |
|
|
|
|
|
insertForApplicationInRecord.put("price", String.valueOf(0)); |
|
|
insertForApplicationInRecord.put("price", String.valueOf(0)); |
|
|
insertForApplicationInRecord.put("unit", unit); |
|
|
insertForApplicationInRecord.put("unit", unit); |
|
|
insertForApplicationInRecord.put("type", "in"); |
|
|
insertForApplicationInRecord.put("type", "in"); |
|
|
@ -921,7 +920,16 @@ public class GroupServiceImpl implements GroupService { |
|
|
insertForApplicationInRecord.put("applicant_time", System.currentTimeMillis()); |
|
|
insertForApplicationInRecord.put("applicant_time", System.currentTimeMillis()); |
|
|
// 添加一个组合订单用于展示
|
|
|
// 添加一个组合订单用于展示
|
|
|
depositoryRecordMapper.insertApplicationInRecord(insertForApplicationInRecord); |
|
|
depositoryRecordMapper.insertApplicationInRecord(insertForApplicationInRecord); |
|
|
showRecordIds.add(ObjectFormatUtil.toInteger(insertForApplicationInRecord.get("id"))); |
|
|
Object parentId = insertForApplicationInRecord.get("id"); |
|
|
|
|
|
|
|
|
|
|
|
// 用于修改组合入库时物料订单的toGroupId字段
|
|
|
|
|
|
if (recordIds.size() > 0) { |
|
|
|
|
|
Map<String, Object> paramForUpdateInRecordToGroupId = new HashMap<>(); |
|
|
|
|
|
paramForUpdateInRecordToGroupId.put("toGroupId", parentId); |
|
|
|
|
|
paramForUpdateInRecordToGroupId.put("list", recordIds); |
|
|
|
|
|
depositoryRecordMapper.updateApplicationInRecordForToGroupId(paramForUpdateInRecordToGroupId); |
|
|
|
|
|
} |
|
|
|
|
|
showRecordIds.add(ObjectFormatUtil.toInteger(parentId)); |
|
|
insertForApplicationInRecord.remove("id"); |
|
|
insertForApplicationInRecord.remove("id"); |
|
|
|
|
|
|
|
|
ResultForGroupReturn resultForGroupReturn = new ResultForGroupReturn(); |
|
|
ResultForGroupReturn resultForGroupReturn = new ResultForGroupReturn(); |
|
|
@ -1075,15 +1083,42 @@ public class GroupServiceImpl implements GroupService { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 入库审核申请 |
|
|
* 入库审核申请 |
|
|
|
|
|
* |
|
|
* @param map 仓库调度信息 |
|
|
* @param map 仓库调度信息 |
|
|
* @return 受影响的行数 |
|
|
* @return 受影响的行数 |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public Integer reviewIn(Map<String, Object> map, Integer userId, UserByPort userToken, String userAgent) { |
|
|
public Integer reviewIn(Map<String, Object> map, Integer userId, UserByPort userToken, String userAgent) { |
|
|
|
|
|
Integer result = 0; |
|
|
|
|
|
|
|
|
Object id = map.get("id"); // 主订单编号
|
|
|
Object id = map.get("id"); // 主订单编号
|
|
|
// 获取当前主订单
|
|
|
// 获取当前主订单
|
|
|
ApplicationInRecordP mainRecordP = depositoryRecordMapper.findApplicationInRecordPById(ObjectFormatUtil.toInteger(id)); |
|
|
ApplicationInRecordP mainRecordP = depositoryRecordMapper.findApplicationInRecordPById(ObjectFormatUtil.toInteger(id)); |
|
|
return null; |
|
|
|
|
|
|
|
|
// 获取当前审批结果
|
|
|
|
|
|
Integer approverPass = ObjectFormatUtil.toInteger(map.get("approverPass")); |
|
|
|
|
|
map.put("approverId", userToken.getId()); |
|
|
|
|
|
map.put("approverTime", System.currentTimeMillis()); |
|
|
|
|
|
// 根据当前主订单获取产生的对应子订单
|
|
|
|
|
|
List<ApplicationInRecordP> minInRecordList = depositoryRecordMapper.findApplicationInRecordPByToGroupId(mainRecordP.getId()); |
|
|
|
|
|
if (Integer.compare(approverPass, 1) == 0) { |
|
|
|
|
|
for (ApplicationInRecordP minRecordP : |
|
|
|
|
|
minInRecordList) { |
|
|
|
|
|
map.put("id", minRecordP.getId()); |
|
|
|
|
|
result += depositoryRecordService.reviewIn(map, userId, userToken, userAgent); |
|
|
|
|
|
} |
|
|
|
|
|
map.put("id", id); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 如果是要驳回
|
|
|
|
|
|
map.put("state", "驳回"); |
|
|
|
|
|
List<Integer> deleteIds = new ArrayList<>(); |
|
|
|
|
|
for (ApplicationInRecordP minRecordP : |
|
|
|
|
|
minInRecordList) { |
|
|
|
|
|
deleteIds.add(minRecordP.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
depositoryRecordMapper.deleteApplicationInRecordByIds(deleteIds); |
|
|
|
|
|
} |
|
|
|
|
|
return depositoryRecordMapper.updateApplicationInRecord(map); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|