rev: 成品出库:新增出库单时将同一货位上的所有物料带出、设置任务时同一货位的任务不在生成、发货单状态修改
This commit is contained in:
@@ -16,6 +16,8 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "成品出库")
|
||||
@@ -142,6 +144,13 @@ public class IStivtlostorivnCpOutController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryStructAll")
|
||||
@Log("查找此货位上的所有库存")
|
||||
//("查找此货位上的所有库存")
|
||||
public ResponseEntity<Object> queryStructAll(@RequestBody Map whereJson) {
|
||||
return new ResponseEntity<>(iStIvtIostorinvCpOutService.queryStructAll(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/initAttr")
|
||||
@Log("初始化仓位")
|
||||
//("初始化仓位")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.storage_manage.productmanage.service.iostorInv;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
@@ -7,6 +8,7 @@ import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostor
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dto.IostorInvQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -185,4 +187,13 @@ public interface IStIvtIostorinvCpOutService extends IService<StIvtIostorinvCp>
|
||||
初始化仓位
|
||||
*/
|
||||
void initAttr();
|
||||
|
||||
/**
|
||||
* 查找此货位上的所有库存
|
||||
* @param whereJson
|
||||
* {
|
||||
* 数组
|
||||
* }
|
||||
*/
|
||||
JSONArray queryStructAll(Map whereJson);
|
||||
}
|
||||
|
||||
@@ -405,6 +405,16 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
||||
|
||||
if (ObjectUtil.isNotEmpty(disDao.getPoint_id())) throw new BadRequestException("此明细已生成任务!");
|
||||
|
||||
StIvtIostorinvdisCp disIsnull = iostorinvdisCpService.getOne(
|
||||
new QueryWrapper<StIvtIostorinvdisCp>().lambda()
|
||||
.eq(StIvtIostorinvdisCp::getIostorinv_id, disDao.getIostorinv_id())
|
||||
.eq(StIvtIostorinvdisCp::getStoragevehicle_code, disDao.getStoragevehicle_code())
|
||||
.ne(StIvtIostorinvdisCp::getWork_status, IOSEnum.WORK_STATUS.code("未生成"))
|
||||
, false
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(disIsnull)) throw new BadRequestException("此货位已生成任务!");
|
||||
|
||||
// 2.下发任务
|
||||
SchBasePoint pointDao = iSchBasePointService.getOne(
|
||||
new QueryWrapper<SchBasePoint>().lambda()
|
||||
@@ -727,6 +737,20 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray queryStructAll(Map whereJson) {
|
||||
List<Map> data = (List) whereJson.get("data");
|
||||
|
||||
// 拼接字符串
|
||||
List<String> struct_code = data.stream()
|
||||
.map(row -> row.get("struct_code").toString())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<Map> result = iStIvtStructivtCpService.getStructAll(struct_code);
|
||||
|
||||
return JSONArray.parseArray(JSON.toJSONString(result));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private StIvtIostorinvCp packageMstForm(StIvtIostorinvCp stIvtIostorinvCp,JSONObject whereJson,Boolean isUpdate) {
|
||||
JSONArray rows = whereJson.getJSONArray("tableData");
|
||||
@@ -797,10 +821,10 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
||||
.eq(StIvtIostorinvdtlCp::getIostorinv_id, iostorinv_id)
|
||||
);
|
||||
|
||||
// 判断是否都为分配完
|
||||
// 判断是否都为分配完 或者为完成
|
||||
boolean is_true = dtlDaoList
|
||||
.stream()
|
||||
.allMatch(row -> row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完")));
|
||||
.allMatch(row -> row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完")) || row.getBill_status().equals(IOSEnum.BILL_STATUS.code("完成")));
|
||||
|
||||
if (is_true) {
|
||||
// 更新主表为分配完
|
||||
|
||||
@@ -786,6 +786,11 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
||||
|
||||
if (ObjectUtil.isNotEmpty(orderDao)) {
|
||||
orderDao.setProduct_qty(NumberUtil.add(orderDao.getProduct_qty(),dao.getAssign_qty()));
|
||||
|
||||
if (orderDao.getSale_qty().doubleValue() <= orderDao.getProduct_qty().doubleValue()) {
|
||||
orderDao.setStatus(IOSEnum.ORDER_STATUS.code("提交"));
|
||||
}
|
||||
|
||||
iMpsSaleOrderService.updateById(orderDao);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ public class StIvtIostorinvdtlCpServiceImpl extends ServiceImpl<StIvtIostorinvdt
|
||||
if (IOSEnum.IO_TYPE.code("入库").equals(mstDao.getIo_type())){
|
||||
// 入库: 更新销售单状态
|
||||
if (orderDao!=null){
|
||||
orderDao.setStatus(IOSEnum.ORDER_STATUS.code("提交"));
|
||||
// orderDao.setStatus(IOSEnum.ORDER_STATUS.code("提交"));
|
||||
iMpsSaleOrderService.updateById(orderDao);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -68,4 +68,13 @@ public interface IStIvtStructivtCpService extends IService<StIvtStructivtCp> {
|
||||
*/
|
||||
List<Map> getStructIvtMore(StructIvtYLQuery whereJson);
|
||||
|
||||
/**
|
||||
* 获取此货位下所有库存
|
||||
* @param whereJson
|
||||
* {
|
||||
* struct_code: '拼接货位'
|
||||
* }
|
||||
*/
|
||||
List<Map> getStructAll(List<String> whereJson);
|
||||
|
||||
}
|
||||
|
||||
@@ -30,4 +30,7 @@ public interface StIvtStructivtCpMapper extends BaseMapper<StIvtStructivtCp> {
|
||||
List<Map> getStructIvtMoreBox(JSONObject json);
|
||||
|
||||
List<Map> packageQuery(@Param("query") CpIvtQuery query);
|
||||
|
||||
List<Map> getStructAll(@Param("chanList") List<String> list);
|
||||
|
||||
}
|
||||
|
||||
@@ -198,4 +198,41 @@
|
||||
order by ivt.instorage_time DESC,attr.struct_code ASC
|
||||
</select>
|
||||
|
||||
<select id="getStructAll" resultType="java.util.Map">
|
||||
SELECT
|
||||
attr.stor_name,
|
||||
attr.sect_name,
|
||||
ivt.struct_code,
|
||||
ivt.struct_name,
|
||||
mater.material_id,
|
||||
mater.material_name,
|
||||
mater.material_code,
|
||||
mater.material_spec,
|
||||
attr.storagevehicle_code,
|
||||
ivt.canuse_qty,
|
||||
ivt.frozen_qty,
|
||||
ivt.ivt_qty,
|
||||
ivt.warehousing_qty,
|
||||
unit.unit_name,
|
||||
unit.measure_unit_id,
|
||||
ivt.instorage_time,
|
||||
sale.sale_code,
|
||||
sale.seq_no,
|
||||
sale.sale_id,
|
||||
sale.sale_type
|
||||
FROM
|
||||
st_ivt_structivt_cp ivt
|
||||
LEFT JOIN md_me_materialbase mater ON ivt.material_id = mater.material_id
|
||||
LEFT JOIN st_ivt_structattr attr ON attr.struct_id = ivt.struct_id
|
||||
LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = ivt.qty_unit_id
|
||||
LEFT JOIN mps_sale_order sale ON sale.sale_id = ivt.sale_id
|
||||
<where>
|
||||
attr.struct_code in
|
||||
<foreach collection="chanList" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -144,6 +144,11 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
|
||||
return structIvtList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> getStructAll(List<String> whereJson) {
|
||||
return this.baseMapper.getStructAll(whereJson);
|
||||
}
|
||||
|
||||
/*
|
||||
加待入
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user