Commit cd84a3e2 by liuyang

2024-09-14 优化批量派工

parent 8746e620
......@@ -69,11 +69,13 @@ public class ServiceHGSC006A extends ServiceBase {
String groupName = inInfo.getString("groupName");
HGSC006 hgsc006 = HGSCTools.THGSC006.getByOrderCode(orderCode);
List<HGPZ005> hgpz005List = DaoBase.getInstance().query(HGPZ005.QUERY,new HashMap<>());
for (String orderDetailId : orderDetailIds) {
// 校验主订单是否已分派
HGSC006A hgsc006A = HGSCTools.THGSC006A.getById(Long.parseLong(orderDetailId));
List<HGSC006A> hgsc006As= HGSCTools.THGSC006A.listByIds(Arrays.asList(orderDetailIds));
// 锁主单号
HGSCTools.THGSC006A.lock(hgsc006A.getId());
HGSCTools.THGSC006A.lock(Arrays.asList(orderDetailIds));
for (HGSC006A hgsc006A : hgsc006As) {
// 校验主订单是否已分派
//HGSC006A hgsc006A = HGSCTools.THGSC006A.getById(Long.parseLong(orderDetailId));
AssignStatusEnum assignStatusEnum = AssignStatusEnum.getEnumByCode(hgsc006A.getAssignStatus());
Integer assignQuantity = new Integer(0);
switch (assignStatusEnum){
......
......@@ -153,6 +153,9 @@
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
<select id="query_other" parameterClass="java.util.HashMap"
......
......@@ -1434,6 +1434,20 @@ public class HGSCTools {
queryMap.put(HGSC006A.FIELD_id, orderDetailId);
DaoBase.getInstance().update(HGSqlConstant.HGSC006A.LOCK, queryMap);
}
/**
* 锁
*
* @param orderDetailIds
* @return
*/
public static void lock(List<String> orderDetailIds) {
if (orderDetailIds.size() <= 0) {
return;
}
Map queryMap = new HashMap();
queryMap.put("ids", orderDetailIds);
DaoBase.getInstance().update(HGSqlConstant.HGSC006A.LOCK, queryMap);
}
public static HGSC006A getById(Long orderDetailId) {
AssertUtils.isTrue(Objects.isNull(orderDetailId) || orderDetailId <= 0, "订单明细ID不能为空!");
......@@ -1441,6 +1455,14 @@ public class HGSCTools {
return results;
}
public static List<HGSC006A> listByIds(List<String> orderDetailIds) {
AssertUtils.isEmpty(orderDetailIds, "订单明细ID不能为空!");
Map queryMap = new HashMap();
queryMap.put("ids", orderDetailIds);
List<HGSC006A> results = DaoBase.getInstance().query(HGSC006A.QUERY, queryMap);
return CollectionUtils.isEmpty(results)? null:results;
}
public static List<HGSC006A> constructObj(HGSC006 hgsc006, List<HGSC005A> hgsc005AList) {
List<HGSC006A> result = new ArrayList<>();
hgsc005AList.forEach(o -> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment