add 开发
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv;
|
||||
@@ -101,6 +102,9 @@ public interface IStIvtIostorinvService extends IService<StIvtIostorinv> {
|
||||
*/
|
||||
void unDivStruct(Map whereJson);
|
||||
|
||||
|
||||
void allDivStruct(JSONObject form);
|
||||
|
||||
/**
|
||||
* 设置起点
|
||||
* @param whereJson {
|
||||
|
||||
@@ -297,17 +297,17 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
|
||||
StIvtIostorinv mstDao = this.getById(whereJson.getString("iostorinv_id"));
|
||||
|
||||
// 如果是发货出库则判断运费和物流公司不能为空
|
||||
if (mstDao.getBill_type().equals(IOSEnum.OUT_TYPE.code("发货出库"))) {
|
||||
|
||||
if (ObjectUtil.isEmpty(mstDao.getTrans_code())) {
|
||||
throw new BadRequestException("物流公司不能为空!");
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(mstDao.getEstimated_freight())) {
|
||||
throw new BadRequestException("预估运费不能为空!");
|
||||
}
|
||||
|
||||
}
|
||||
// if (mstDao.getBill_type().equals(IOSEnum.OUT_TYPE.code("发货出库"))) {
|
||||
//
|
||||
// if (ObjectUtil.isEmpty(mstDao.getTrans_code())) {
|
||||
// throw new BadRequestException("物流公司不能为空!");
|
||||
// }
|
||||
//
|
||||
// if (ObjectUtil.isEmpty(mstDao.getEstimated_freight())) {
|
||||
// throw new BadRequestException("预估运费不能为空!");
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
/*
|
||||
* 查询生成和未分配完的明细, 条件:明细状态小于等于分配中、未分配数大于0
|
||||
|
||||
@@ -54,6 +54,7 @@ import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
@@ -508,6 +509,62 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@SneakyThrows
|
||||
public void allDivStruct(JSONObject form) {
|
||||
String iostorinv_id = form.getString("iostorinv_id");
|
||||
String sect_id = form.getString("sect_id");
|
||||
String stor_id = form.getString("stor_id");
|
||||
|
||||
JSONObject sect_jo = WQLObject.getWQLObject("st_ivt_sectattr").query("sect_id = '" + sect_id + "'").uniqueResult(0);
|
||||
if (!"09".equals(sect_jo.getString("sect_type_attr"))) {
|
||||
throw new BadRequestException("只能对虚拟区的库区进行全部分配!");
|
||||
}
|
||||
//查询当前入库单状态为生成的入库单明细
|
||||
JSONArray dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "' AND work_status = '00'").getResultJSONArray(0);
|
||||
HashSet<String> vehicle_set = new HashSet<>();
|
||||
for (int j = 0; j < dis_rows.size(); j++) {
|
||||
JSONObject dtl_row = dis_rows.getJSONObject(j);
|
||||
vehicle_set.add(dtl_row.getString("box_no"));
|
||||
}
|
||||
|
||||
RLock lock = redissonClient.getLock("all_div");
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
|
||||
try {
|
||||
if (tryLock) {
|
||||
for (String vehicle_code : vehicle_set) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "4");
|
||||
map.put("iostorinv_id", iostorinv_id);
|
||||
map.put("package_box_sn", vehicle_code);
|
||||
JSONArray dtl_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(map).process().getResultJSONArray(0);
|
||||
List<Map> list = new ArrayList<>();
|
||||
for (int i = 0; i < dtl_rows.size(); i++) {
|
||||
JSONObject jo = dtl_rows.getJSONObject(i);
|
||||
list.add(JSON.parseObject(jo.toString(), Map.class));
|
||||
}
|
||||
Map<String, Object> dis_map = new HashMap<>();
|
||||
dis_map.put("tableMater", list);
|
||||
dis_map.put("sect_id", sect_id);
|
||||
dis_map.put("stor_id", stor_id);
|
||||
dis_map.put("checked", true);
|
||||
this.divStruct(dis_map);
|
||||
}
|
||||
} else {
|
||||
throw new BadRequestException("其他入库单当前正在分配货位,请等待几秒再进行操作!");
|
||||
}
|
||||
} finally {
|
||||
if (lock.isLocked() && lock.isHeldByCurrentThread()) {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void unDivStruct(Map whereJson) {
|
||||
|
||||
@@ -148,9 +148,7 @@ public class VirtualOutServiceImpl implements VirtualOutService {
|
||||
JSONArray dtlNoArr = dtlTab.query("iostorinv_id = '" + jsonDis.getString("iostorinv_id") + "' and bill_status <> '99'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(dtlNoArr)) {
|
||||
// 调用强制完成接口(判断是一期还是二期)
|
||||
if (jsonMst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
iStIvtIostorinvOutService.confirm(jsonMst);
|
||||
}
|
||||
iStIvtIostorinvOutService.confirm(jsonMst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.st.inbill.rest;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
@@ -150,10 +151,18 @@ public class RawAssistIStorController {
|
||||
|
||||
//@PreAuthorize("@el.check('materialtype:list')")
|
||||
public ResponseEntity<Object> unDivStruct(@RequestBody Map whereJson) {
|
||||
if (whereJson.get("stor_id").toString().equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
iStIvtIostorinvService.unDivStruct(whereJson);
|
||||
}
|
||||
iStIvtIostorinvService.unDivStruct(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/allDivStruct")
|
||||
@Log("全部分配货位")
|
||||
|
||||
//@PreAuthorize("@el.check('materialtype:list')")
|
||||
public ResponseEntity<Object> allDivStruct(@RequestBody JSONObject whereJson) {
|
||||
iStIvtIostorinvService.allDivStruct(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -351,9 +351,14 @@ public class OutChargeServiceImpl implements OutChargeService {
|
||||
needSaveDtlList.add(outDtl);
|
||||
disRow.setIostorinvdis_id(getStringId());
|
||||
disRow.setSeq_no(BigDecimal.ONE);
|
||||
disRow.setSect_id("");
|
||||
disRow.setSect_code("");
|
||||
disRow.setSect_name("");
|
||||
disRow.setIostorinv_id(manualInStorageOrderId);
|
||||
disRow.setIostorinvdtl_id(newDtlId);
|
||||
disRow.setMaterial_id(outDtl.getMaterial_id());
|
||||
disRow.setPcsn(outDtl.getPcsn());
|
||||
disRow.setQty_unit_id(outDtl.getQty_unit_id());
|
||||
disRow.setQty_unit_name(outDtl.getQty_unit_name());
|
||||
disRow.setWork_status("00");
|
||||
disRow.setReal_qty(BigDecimal.ZERO);
|
||||
disRow.setPoint_id("0");
|
||||
|
||||
Reference in New Issue
Block a user