rev:成品入库优化
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper;
|
package org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@@ -27,4 +28,11 @@ public interface StIvtIostorinvMapper extends BaseMapper<StIvtIostorinv> {
|
|||||||
* @return List<Map>
|
* @return List<Map>
|
||||||
*/
|
*/
|
||||||
List<Map> getPageQuery(@Param("query") Map query, @Param("pageQuery") Pageable pageQuery);
|
List<Map> getPageQuery(@Param("query") Map query, @Param("pageQuery") Pageable pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询木箱对应的单据
|
||||||
|
* @param whereJson: {package_box_sn: 木箱号}
|
||||||
|
* @return 、
|
||||||
|
*/
|
||||||
|
JSONObject queryBoxMst(JSONObject whereJson);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,4 +118,25 @@
|
|||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryBoxMst" resultType="com.alibaba.fastjson.JSONObject">
|
||||||
|
SELECT DISTINCT
|
||||||
|
CONVERT(ios.iostorinv_id , CHAR ) AS iostorinv_id
|
||||||
|
FROM
|
||||||
|
ST_IVT_IOStorInv ios
|
||||||
|
LEFT JOIN st_ivt_iostorinvdis dis ON dis.iostorinv_id = ios.iostorinv_id
|
||||||
|
<where>
|
||||||
|
ios.is_delete = '0'
|
||||||
|
AND
|
||||||
|
ios.io_type = '0'
|
||||||
|
AND
|
||||||
|
ios.bill_status != '99'
|
||||||
|
|
||||||
|
<if test="package_box_sn != null and package_box_sn != ''">
|
||||||
|
and dis.box_no = #{package_box_sn}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</where>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtIostorinvdtlServi
|
|||||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv;
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv;
|
||||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdis;
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdis;
|
||||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdtl;
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdtl;
|
||||||
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper.StIvtIostorinvMapper;
|
||||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InBussManageService;
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InBussManageService;
|
||||||
import org.nl.common.utils.MapOf;
|
import org.nl.common.utils.MapOf;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
@@ -44,6 +45,9 @@ public class InBussManageServiceImpl implements InBussManageService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IStIvtIostorinvService iStIvtIostorinvService;
|
private IStIvtIostorinvService iStIvtIostorinvService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StIvtIostorinvMapper stIvtIostorinvMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IStIvtIostorinvdtlService iStIvtIostorinvdtlService;
|
private IStIvtIostorinvdtlService iStIvtIostorinvdtlService;
|
||||||
|
|
||||||
@@ -207,7 +211,7 @@ public class InBussManageServiceImpl implements InBussManageService {
|
|||||||
List<String> pcsnList = Arrays.asList(material_barcode.split(","));
|
List<String> pcsnList = Arrays.asList(material_barcode.split(","));
|
||||||
|
|
||||||
// 查询子卷包装关系
|
// 查询子卷包装关系
|
||||||
List<JSONObject> subList = subTab.query("container_name in ('"+String.join("','", pcsnList)+"') and status = '0'")
|
List<JSONObject> subList = subTab.query("container_name in ('"+String.join("','", pcsnList)+"') and status IN ( '0', '1')")
|
||||||
.getResultJSONArray(0).toJavaList(JSONObject.class);
|
.getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(subList)) {
|
if (ObjectUtil.isEmpty(subList)) {
|
||||||
@@ -250,8 +254,19 @@ public class InBussManageServiceImpl implements InBussManageService {
|
|||||||
}
|
}
|
||||||
mst.put("tableData",tableData);
|
mst.put("tableData",tableData);
|
||||||
|
|
||||||
// 调用服务创建
|
// 判断是否已经生成过入库单
|
||||||
String iostorinv_id = iStIvtIostorinvService.insertMst(mst);
|
String package_box_sn = (String) tableData.get(0).get("package_box_sn");
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("package_box_sn",package_box_sn);
|
||||||
|
JSONObject iosMst = stIvtIostorinvMapper.queryBoxMst(param);
|
||||||
|
|
||||||
|
String iostorinv_id;
|
||||||
|
if (ObjectUtil.isNotEmpty(iosMst)) {
|
||||||
|
iostorinv_id = iosMst.getString("iostorinv_id");
|
||||||
|
} else {
|
||||||
|
// 调用服务创建
|
||||||
|
iostorinv_id = iStIvtIostorinvService.insertMst(mst);
|
||||||
|
}
|
||||||
|
|
||||||
// 调用分配货位并下发
|
// 调用分配货位并下发
|
||||||
JSONObject jsonDiv = new JSONObject();
|
JSONObject jsonDiv = new JSONObject();
|
||||||
|
|||||||
Reference in New Issue
Block a user