add:入库分配
This commit is contained in:
@@ -1,9 +1,23 @@
|
|||||||
package org.nl.wms.storage_manage.basedata.controller.storage;
|
package org.nl.wms.storage_manage.basedata.controller.storage;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.nl.common.TableDataInfo;
|
||||||
|
import org.nl.common.anno.Log;
|
||||||
|
import org.nl.wms.storage_manage.basedata.service.storage.IStIvtSectattrService;
|
||||||
|
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtBsrealstorattr;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 库区属性表 前端控制器
|
* 库区属性表 前端控制器
|
||||||
@@ -13,8 +27,18 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
* @since 2023-05-04
|
* @since 2023-05-04
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/stIvtSectattr")
|
@RequestMapping("/api/stIvtSectattr")
|
||||||
public class StIvtSectattrController {
|
public class StIvtSectattrController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected IStIvtSectattrService iStIvtSectattrService;
|
||||||
|
|
||||||
|
@PostMapping("/getSect")
|
||||||
|
@Log("仓库库区多级下拉框")
|
||||||
|
@ApiOperation("仓库库区多级下拉框")
|
||||||
|
public ResponseEntity<Object> queryStor(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(iStIvtSectattrService.getSect(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ package org.nl.wms.storage_manage.basedata.service.storage;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtBsrealstorattr;
|
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtBsrealstorattr;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 实物库属性表 服务类
|
* 实物库属性表 服务类
|
||||||
@@ -13,4 +16,5 @@ import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtBsrealstoratt
|
|||||||
*/
|
*/
|
||||||
public interface IStIvtBsrealstorattrService extends IService<StIvtBsrealstorattr> {
|
public interface IStIvtBsrealstorattrService extends IService<StIvtBsrealstorattr> {
|
||||||
|
|
||||||
|
List<Map> queryStor(Map<String,Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.wms.storage_manage.basedata.service.storage;
|
package org.nl.wms.storage_manage.basedata.service.storage;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtSectattr;
|
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtSectattr;
|
||||||
|
|
||||||
@@ -13,4 +14,10 @@ import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtSectattr;
|
|||||||
*/
|
*/
|
||||||
public interface IStIvtSectattrService extends IService<StIvtSectattr> {
|
public interface IStIvtSectattrService extends IService<StIvtSectattr> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库库区多级下拉框
|
||||||
|
* @param whereJson /
|
||||||
|
* @return Object
|
||||||
|
*/
|
||||||
|
Object getSect(JSONObject whereJson);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ package org.nl.wms.storage_manage.basedata.service.storage.dao.mapper;
|
|||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtBsrealstorattr;
|
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtBsrealstorattr;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 实物库属性表 Mapper 接口
|
* 实物库属性表 Mapper 接口
|
||||||
@@ -13,4 +16,5 @@ import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtBsrealstoratt
|
|||||||
*/
|
*/
|
||||||
public interface StIvtBsrealstorattrMapper extends BaseMapper<StIvtBsrealstorattr> {
|
public interface StIvtBsrealstorattrMapper extends BaseMapper<StIvtBsrealstorattr> {
|
||||||
|
|
||||||
|
List<Map> queryStor(Map<String,Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,29 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.nl.wms.storage_manage.basedata.service.storage.dao.mapper.StIvtBsrealstorattrMapper">
|
<mapper namespace="org.nl.wms.storage_manage.basedata.service.storage.dao.mapper.StIvtBsrealstorattrMapper">
|
||||||
|
<select id="queryStor" resultType="java.util.Map">
|
||||||
|
SELECT
|
||||||
|
arrt.*
|
||||||
|
FROM
|
||||||
|
ST_IVT_BSRealStorAttr arrt
|
||||||
|
WHERE 1=1
|
||||||
|
<if test="stor_id != null and stor_id != ''">
|
||||||
|
and arrt.stor_id = #{stor_id}
|
||||||
|
</if>
|
||||||
|
<if test="stor_code != null and stor_code != ''">
|
||||||
|
and arrt.stor_code = #{stor_code}
|
||||||
|
</if>
|
||||||
|
<if test="stor_type_scode != null and stor_type_scode != ''">
|
||||||
|
and arrt.stor_type_scode = #{stor_type_scode}
|
||||||
|
</if>
|
||||||
|
<if test="stor_type != null and stor_type != ''">
|
||||||
|
and arrt.stor_type = #{stor_type}
|
||||||
|
</if>
|
||||||
|
<if test="is_used != null and is_used != ''">
|
||||||
|
and arrt.is_used = #{is_used}
|
||||||
|
</if>
|
||||||
|
<if test="whstate_scode != null and whstate_scode != ''">
|
||||||
|
and arrt.whstate_scode = #{whstate_scode}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtBsrealstoratt
|
|||||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.mapper.StIvtBsrealstorattrMapper;
|
import org.nl.wms.storage_manage.basedata.service.storage.dao.mapper.StIvtBsrealstorattrMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 实物库属性表 服务实现类
|
* 实物库属性表 服务实现类
|
||||||
@@ -17,4 +20,8 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class StIvtBsrealstorattrServiceImpl extends ServiceImpl<StIvtBsrealstorattrMapper, StIvtBsrealstorattr> implements IStIvtBsrealstorattrService {
|
public class StIvtBsrealstorattrServiceImpl extends ServiceImpl<StIvtBsrealstorattrMapper, StIvtBsrealstorattr> implements IStIvtBsrealstorattrService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map> queryStor(Map<String, Object> map) {
|
||||||
|
return baseMapper.queryStor(map);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,20 @@
|
|||||||
package org.nl.wms.storage_manage.basedata.service.storage.impl;
|
package org.nl.wms.storage_manage.basedata.service.storage.impl;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.nl.wms.storage_manage.basedata.service.storage.IStIvtBsrealstorattrService;
|
||||||
import org.nl.wms.storage_manage.basedata.service.storage.IStIvtSectattrService;
|
import org.nl.wms.storage_manage.basedata.service.storage.IStIvtSectattrService;
|
||||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtSectattr;
|
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtSectattr;
|
||||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.mapper.StIvtSectattrMapper;
|
import org.nl.wms.storage_manage.basedata.service.storage.dao.mapper.StIvtSectattrMapper;
|
||||||
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvCpService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 库区属性表 服务实现类
|
* 库区属性表 服务实现类
|
||||||
@@ -17,4 +26,40 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class StIvtSectattrServiceImpl extends ServiceImpl<StIvtSectattrMapper, StIvtSectattr> implements IStIvtSectattrService {
|
public class StIvtSectattrServiceImpl extends ServiceImpl<StIvtSectattrMapper, StIvtSectattr> implements IStIvtSectattrService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtBsrealstorattrService iStIvtBsrealstorattrService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtSectattrService iStIvtSectattrService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getSect(JSONObject whereJson) {
|
||||||
|
List<Map> maps = iStIvtBsrealstorattrService.queryStor(whereJson);
|
||||||
|
|
||||||
|
JSONArray result = new JSONArray();
|
||||||
|
|
||||||
|
maps.forEach(item -> {
|
||||||
|
JSONObject jsonStor = new JSONObject();
|
||||||
|
jsonStor.put("value", item.get("stor_id"));
|
||||||
|
jsonStor.put("label", item.get("stor_name"));
|
||||||
|
|
||||||
|
List<StIvtSectattr> attrList = iStIvtSectattrService.list(new QueryWrapper<StIvtSectattr>().eq("stor_id", item.get("stor_id")));
|
||||||
|
|
||||||
|
JSONArray objects = new JSONArray();
|
||||||
|
if (attrList.size()>0) {
|
||||||
|
attrList.forEach(json -> {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("value", json.getSect_id());
|
||||||
|
jsonObject.put("label", json.getSect_name());
|
||||||
|
objects.add(jsonObject);
|
||||||
|
});
|
||||||
|
jsonStor.put("children", objects);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.add(jsonStor);
|
||||||
|
});
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
jo.put("content", result);
|
||||||
|
return jo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,4 +90,12 @@ public class IStivtlostorivnCpInController {
|
|||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/divStruct")
|
||||||
|
@Log("分配")
|
||||||
|
@ApiOperation("分配")
|
||||||
|
public ResponseEntity<Object> divStruct(@RequestBody JSONObject whereJson){
|
||||||
|
iStIvtIostorinvCpService.divStruct(whereJson);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,4 +108,13 @@ public interface IStIvtIostorinvCpService extends IService<StIvtIostorinvCp> {
|
|||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
void vehicleCheck(JSONObject whereJson);
|
void vehicleCheck(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分配
|
||||||
|
* @param whereJson
|
||||||
|
* {
|
||||||
|
* 分配明细
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
void divStruct(JSONObject whereJson);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package org.nl.wms.storage_manage.productmanage.service.iostorInv.dao;
|
package org.nl.wms.storage_manage.productmanage.service.iostorInv.dao;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.*;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -16,7 +16,7 @@ import java.math.BigDecimal;
|
|||||||
* @since 2023-05-04
|
* @since 2023-05-04
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@Accessors(chain = true)
|
||||||
@TableName("st_ivt_iostorinvdtl_cp")
|
@TableName("st_ivt_iostorinvdtl_cp")
|
||||||
public class StIvtIostorinvdtlCp implements Serializable {
|
public class StIvtIostorinvdtlCp implements Serializable {
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,9 @@ import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleext;
|
|||||||
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleinfo;
|
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleinfo;
|
||||||
import org.nl.wms.storage_manage.IOSEnum;
|
import org.nl.wms.storage_manage.IOSEnum;
|
||||||
import org.nl.wms.storage_manage.basedata.service.storage.IStIvtBsrealstorattrService;
|
import org.nl.wms.storage_manage.basedata.service.storage.IStIvtBsrealstorattrService;
|
||||||
|
import org.nl.wms.storage_manage.basedata.service.storage.IStIvtStructattrService;
|
||||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtBsrealstorattr;
|
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtBsrealstorattr;
|
||||||
|
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtStructattr;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvCpService;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvCpService;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisCpService;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisCpService;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisdtlCpService;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisdtlCpService;
|
||||||
@@ -33,8 +35,11 @@ import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinv
|
|||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvCp;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvCp;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdisCp;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdisCp;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdisdtlCp;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdisdtlCp;
|
||||||
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdtlCp;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.mapper.StIvtIostorinvCpMapper;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.mapper.StIvtIostorinvCpMapper;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dto.IostorInvQuery;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dto.IostorInvQuery;
|
||||||
|
import org.nl.wms.storage_manage.productmanage.util.DivRuleCpService;
|
||||||
|
import org.nl.wms.storage_manage.productmanage.util.RuleUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -72,6 +77,12 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
|||||||
@Autowired
|
@Autowired
|
||||||
protected IMdPbStoragevehicleextService iMdPbStoragevehicleextService; // 载具扩展属性信息表服务
|
protected IMdPbStoragevehicleextService iMdPbStoragevehicleextService; // 载具扩展属性信息表服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected DivRuleCpService divRuleCpService; // 成品分配规则服务类
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected IStIvtStructattrService iStIvtStructattrService; // 仓位属性服务
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object pageQuery(IostorInvQuery query, PageQuery page) {
|
public Object pageQuery(IostorInvQuery query, PageQuery page) {
|
||||||
@@ -227,9 +238,9 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
|||||||
// 5.回显分配明细表iostorinvdis_id标识
|
// 5.回显分配明细表iostorinvdis_id标识
|
||||||
iStIvtIostorinvdisdtlCpService.update(
|
iStIvtIostorinvdisdtlCpService.update(
|
||||||
new StIvtIostorinvdisdtlCp().setIostorinvdis_id(disDao.getIostorinvdis_id()),
|
new StIvtIostorinvdisdtlCp().setIostorinvdis_id(disDao.getIostorinvdis_id()),
|
||||||
new QueryWrapper<StIvtIostorinvdisdtlCp>()
|
new QueryWrapper<StIvtIostorinvdisdtlCp>().lambda()
|
||||||
.eq("iostorinvdis_id", param.getString("iostorinvdis_id"))
|
.eq(StIvtIostorinvdisdtlCp::getIostorinvdis_id, param.getString("iostorinvdis_id"))
|
||||||
.eq("storagevehicle_code", disDao.getStoragevehicle_code())
|
.eq(StIvtIostorinvdisdtlCp::getStoragevehicle_code, disDao.getStoragevehicle_code())
|
||||||
);
|
);
|
||||||
|
|
||||||
// 6.更新载具扩展属性表
|
// 6.更新载具扩展属性表
|
||||||
@@ -240,7 +251,8 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
|||||||
vehicleDao.setUpdate_time(new Date());
|
vehicleDao.setUpdate_time(new Date());
|
||||||
|
|
||||||
iMdPbStoragevehicleextService.update(
|
iMdPbStoragevehicleextService.update(
|
||||||
vehicleDao,new QueryWrapper<MdPbStoragevehicleext>().eq("storagevehicle_code", disDtlDao.getStoragevehicle_code())
|
vehicleDao,new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||||
|
.eq(MdPbStoragevehicleext::getStoragevehicle_code, disDtlDao.getStoragevehicle_code())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -279,17 +291,17 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
|||||||
|
|
||||||
// 1.校验载具是否存在
|
// 1.校验载具是否存在
|
||||||
MdPbStoragevehicleinfo daoVehicle = iMdPbStoragevehicleinfoService.getOne(
|
MdPbStoragevehicleinfo daoVehicle = iMdPbStoragevehicleinfoService.getOne(
|
||||||
new QueryWrapper<MdPbStoragevehicleinfo>()
|
new QueryWrapper<MdPbStoragevehicleinfo>().lambda()
|
||||||
.eq("storagevehicle_code", whereJson.getString("storagevehicle_code"))
|
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, whereJson.getString("storagevehicle_code"))
|
||||||
.eq("is_used", true)
|
.eq(MdPbStoragevehicleinfo::getIs_used, true)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(daoVehicle)) throw new BadRequestException("此载具不存在或未启用");
|
if (ObjectUtil.isEmpty(daoVehicle)) throw new BadRequestException("此载具不存在或未启用");
|
||||||
|
|
||||||
// 2.校验载具是否已组盘
|
// 2.校验载具是否已组盘
|
||||||
MdPbStoragevehicleext daoVehicleExt = iMdPbStoragevehicleextService.getOne(
|
MdPbStoragevehicleext daoVehicleExt = iMdPbStoragevehicleextService.getOne(
|
||||||
new QueryWrapper<MdPbStoragevehicleext>()
|
new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||||
.eq("storagevehicle_code", whereJson.getString("storagevehicle_code"))
|
.eq(MdPbStoragevehicleext::getStoragevehicle_code, whereJson.getString("storagevehicle_code"))
|
||||||
);
|
);
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(daoVehicleExt)) {
|
if (ObjectUtil.isEmpty(daoVehicleExt)) {
|
||||||
@@ -300,6 +312,48 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void divStruct(JSONObject whereJson) {
|
||||||
|
/*
|
||||||
|
1.判断此分配明细是否指定货位
|
||||||
|
2.自动分配:
|
||||||
|
1).根据分配规则找出一个货位
|
||||||
|
3.更新此托盘上的所有分配明细
|
||||||
|
4.更新单据状态
|
||||||
|
5.更新点位状态
|
||||||
|
6.更新库存、日物流表等、
|
||||||
|
*/
|
||||||
|
|
||||||
|
String struct_id = whereJson.getString("struct_id");
|
||||||
|
StIvtStructattr attrDao = new StIvtStructattr();
|
||||||
|
|
||||||
|
// 1.根据仓库、库区找出一个仓位
|
||||||
|
if (ObjectUtil.isEmpty(struct_id)) {
|
||||||
|
/* 自动分配 */
|
||||||
|
|
||||||
|
whereJson.put("rule_type", RuleUtil.PRODUCTION_IN);
|
||||||
|
attrDao = divRuleCpService.divRuleIn(whereJson);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
/* 手动分配 */
|
||||||
|
|
||||||
|
// 查出对应仓位
|
||||||
|
attrDao = iStIvtStructattrService.getOne(
|
||||||
|
new QueryWrapper<StIvtStructattr>().lambda()
|
||||||
|
.eq(StIvtStructattr::getStruct_id,struct_id)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(attrDao.getStruct_code())) throw new BadRequestException("未找到仓位!");
|
||||||
|
|
||||||
|
// 2.更新分配明细、分配、明细、主表
|
||||||
|
updateDivIos(attrDao,whereJson);
|
||||||
|
|
||||||
|
// TODO 更新点位
|
||||||
|
// TODO 更新库存、物流等
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private StIvtIostorinvCp packageMstForm(StIvtIostorinvCp stIvtIostorinvCp,JSONObject whereJson,Boolean isUpdate) {
|
private StIvtIostorinvCp packageMstForm(StIvtIostorinvCp stIvtIostorinvCp,JSONObject whereJson,Boolean isUpdate) {
|
||||||
JSONArray rows = whereJson.getJSONArray("tableData");
|
JSONArray rows = whereJson.getJSONArray("tableData");
|
||||||
@@ -328,8 +382,10 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
|||||||
stIvtIostorinvCp.setBiz_date(whereJson.getString("biz_date").substring(0,10));
|
stIvtIostorinvCp.setBiz_date(whereJson.getString("biz_date").substring(0,10));
|
||||||
// 获取仓库信息
|
// 获取仓库信息
|
||||||
QueryWrapper<StIvtBsrealstorattr> wrapper = new QueryWrapper<>();
|
QueryWrapper<StIvtBsrealstorattr> wrapper = new QueryWrapper<>();
|
||||||
wrapper.eq("stor_id", whereJson.getString("stor_id"));
|
wrapper.lambda()
|
||||||
wrapper.eq("is_used", true);
|
.eq(StIvtBsrealstorattr::getStor_id,whereJson.getString("stor_id"))
|
||||||
|
.eq(StIvtBsrealstorattr::getIs_used, true);
|
||||||
|
|
||||||
StIvtBsrealstorattr bsrealDao = stIvtBsrealstorattrService.getOne(wrapper);
|
StIvtBsrealstorattr bsrealDao = stIvtBsrealstorattrService.getOne(wrapper);
|
||||||
if (ObjectUtil.isEmpty(bsrealDao)) throw new BadRequestException("仓库不存在或未启用!");
|
if (ObjectUtil.isEmpty(bsrealDao)) throw new BadRequestException("仓库不存在或未启用!");
|
||||||
|
|
||||||
@@ -343,4 +399,96 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
|||||||
return stIvtIostorinvCp;
|
return stIvtIostorinvCp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private void updateDivIos(StIvtStructattr attrDao,JSONObject whereJson) {
|
||||||
|
/* 分配货位更新:
|
||||||
|
更新分配明细、分配、明细、主表
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 1.更新此托盘下的所有分配明细表
|
||||||
|
iStIvtIostorinvdisdtlCpService.update(
|
||||||
|
new StIvtIostorinvdisdtlCp()
|
||||||
|
.setSect_id(attrDao.getSect_id())
|
||||||
|
.setSect_code(attrDao.getSect_code())
|
||||||
|
.setSect_name(attrDao.getSect_name())
|
||||||
|
.setStruct_id(attrDao.getStruct_id())
|
||||||
|
.setStruct_code(attrDao.getStruct_code())
|
||||||
|
.setStruct_name(attrDao.getStruct_name()),
|
||||||
|
new QueryWrapper<StIvtIostorinvdisdtlCp>().lambda()
|
||||||
|
.eq(StIvtIostorinvdisdtlCp::getIostorinvdis_id, whereJson.getString("iostorinvdis_id"))
|
||||||
|
.eq(StIvtIostorinvdisdtlCp::getStoragevehicle_code, whereJson.getString("storagevehicle_code"))
|
||||||
|
);
|
||||||
|
|
||||||
|
// 2.更新分配表
|
||||||
|
iostorinvdisCpService.update(
|
||||||
|
new StIvtIostorinvdisCp()
|
||||||
|
.setSect_id(attrDao.getSect_id())
|
||||||
|
.setSect_code(attrDao.getSect_code())
|
||||||
|
.setSect_name(attrDao.getSect_name())
|
||||||
|
.setStruct_id(attrDao.getStruct_id())
|
||||||
|
.setStruct_code(attrDao.getStruct_code())
|
||||||
|
.setStruct_name(attrDao.getStruct_name()),
|
||||||
|
new QueryWrapper<StIvtIostorinvdisCp>().lambda()
|
||||||
|
.eq(StIvtIostorinvdisCp::getIostorinvdtl_id, whereJson.getString("iostorinvdtl_id"))
|
||||||
|
);
|
||||||
|
|
||||||
|
// 3.更新明细表
|
||||||
|
BigDecimal unassign_qty = iostorinvdtlCpService.getOne(
|
||||||
|
new QueryWrapper<StIvtIostorinvdtlCp>().lambda()
|
||||||
|
.eq(StIvtIostorinvdtlCp::getIostorinvdtl_id, whereJson.getString("iostorinvdtl_id"))
|
||||||
|
).getUnassign_qty();
|
||||||
|
|
||||||
|
iostorinvdtlCpService.update(
|
||||||
|
new StIvtIostorinvdtlCp()
|
||||||
|
.setBill_status(IOSEnum.BILL_STATUS.code("分配完"))
|
||||||
|
.setAssign_qty(unassign_qty)
|
||||||
|
.setUnassign_qty(new BigDecimal(0)),
|
||||||
|
new QueryWrapper<StIvtIostorinvdtlCp>().lambda()
|
||||||
|
.eq(StIvtIostorinvdtlCp::getIostorinvdtl_id, whereJson.getString("iostorinvdtl_id"))
|
||||||
|
);
|
||||||
|
|
||||||
|
// 4.更新主表
|
||||||
|
updateMst(whereJson.getString("iostorinv_id"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public void updateMst(String iostorinv_id) {
|
||||||
|
/*
|
||||||
|
更新主表
|
||||||
|
*/
|
||||||
|
|
||||||
|
StIvtIostorinvCp mstDao = this.baseMapper.selectOne(
|
||||||
|
new QueryWrapper<StIvtIostorinvCp>().lambda()
|
||||||
|
.eq(StIvtIostorinvCp::getIostorinv_id, iostorinv_id)
|
||||||
|
);
|
||||||
|
mstDao.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||||
|
mstDao.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||||
|
mstDao.setUpdate_time(new Date());
|
||||||
|
mstDao.setDis_id(SecurityUtils.getCurrentUserId());
|
||||||
|
mstDao.setDis_name(SecurityUtils.getCurrentNickName());
|
||||||
|
mstDao.setDis_time(DateUtil.now());
|
||||||
|
|
||||||
|
// 查询主表下所有明细
|
||||||
|
List<StIvtIostorinvdtlCp> dtlDaoList = iostorinvdtlCpService.list(
|
||||||
|
new QueryWrapper<StIvtIostorinvdtlCp>().lambda()
|
||||||
|
.eq(StIvtIostorinvdtlCp::getIostorinv_id, iostorinv_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 判断是否都为分配完
|
||||||
|
boolean is_true = dtlDaoList
|
||||||
|
.stream()
|
||||||
|
.allMatch(row -> row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完")));
|
||||||
|
|
||||||
|
if (is_true) {
|
||||||
|
// 更新主表为分配完
|
||||||
|
mstDao.setBill_status(IOSEnum.BILL_STATUS.code("分配完"));
|
||||||
|
} else {
|
||||||
|
// 更新主表为分配中
|
||||||
|
mstDao.setBill_status(IOSEnum.BILL_STATUS.code("分配中"));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.updateById(mstDao);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.nl.wms.storage_manage.productmanage.util;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtStructattr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 成品分配规则 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Liuxy
|
||||||
|
* @since 2023-05-11
|
||||||
|
*/
|
||||||
|
public interface DivRuleCpService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库分配规则
|
||||||
|
* @param whereJson
|
||||||
|
* {
|
||||||
|
* "stor_id":仓库标识
|
||||||
|
* "sect_id":库区标识
|
||||||
|
* "rule_type":规则类型(后续优化)
|
||||||
|
* }
|
||||||
|
* @return StIvtStructattr /
|
||||||
|
*/
|
||||||
|
StIvtStructattr divRuleIn(JSONObject whereJson);
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package org.nl.wms.storage_manage.productmanage.util;
|
||||||
|
|
||||||
|
public class RuleUtil {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 按照仓位顺序找一个仓位
|
||||||
|
*/
|
||||||
|
public static final String PRODUCTION_IN = "1";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package org.nl.wms.storage_manage.productmanage.util.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.wms.storage_manage.basedata.service.storage.IStIvtStructattrService;
|
||||||
|
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtStructattr;
|
||||||
|
import org.nl.wms.storage_manage.productmanage.util.DivRuleCpService;
|
||||||
|
import org.nl.wms.storage_manage.productmanage.util.RuleUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 成品分配规则 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Liuxy
|
||||||
|
* @since 2023-05-11
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DivRuleCpServiceImpl implements DivRuleCpService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected IStIvtStructattrService iStIvtStructattrService; // 仓位属性服务
|
||||||
|
|
||||||
|
private StIvtStructattr attrDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StIvtStructattr divRuleIn(JSONObject whereJson) {
|
||||||
|
|
||||||
|
String stor_id = whereJson.getString("stor_id");
|
||||||
|
String sect_id = whereJson.getString("sect_id");
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(stor_id)) throw new BadRequestException("仓库不能为空!");
|
||||||
|
if (ObjectUtil.isEmpty(sect_id)) throw new BadRequestException("库区不能为空!");
|
||||||
|
|
||||||
|
switch (whereJson.getString("rule_type")) {
|
||||||
|
case RuleUtil.PRODUCTION_IN :
|
||||||
|
attrDao = iStIvtStructattrService.getOne(
|
||||||
|
new QueryWrapper<StIvtStructattr>().lambda()
|
||||||
|
.eq(StIvtStructattr::getStor_id, stor_id)
|
||||||
|
.eq(StIvtStructattr::getSect_id, sect_id)
|
||||||
|
.isNull(StIvtStructattr::getStoragevehicle_code)
|
||||||
|
.eq(StIvtStructattr::getIs_used, "1") //TODO 暂时写死
|
||||||
|
.eq(StIvtStructattr::getIs_delete, "0") //TODO 暂时写死
|
||||||
|
.eq(StIvtStructattr::getLock_type, "1") //TODO 暂时写死
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return attrDao;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -222,7 +222,6 @@ import CRUD, { crud } from '@crud/crud'
|
|||||||
import StructDiv from '@/views/wms/pub/StructDialog'
|
import StructDiv from '@/views/wms/pub/StructDialog'
|
||||||
import crudProductIn from '@/views/wms/storage_manage/product/productIn/productin'
|
import crudProductIn from '@/views/wms/storage_manage/product/productIn/productin'
|
||||||
import crudPoint from '@/api/wms/sch/point'
|
import crudPoint from '@/api/wms/sch/point'
|
||||||
import crudRegion from '@/api/wms/sch/region'
|
|
||||||
import AddBox from '@/views/wms/storage_manage/product/productIn/AddBox'
|
import AddBox from '@/views/wms/storage_manage/product/productIn/AddBox'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -286,7 +285,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open() {
|
open() {
|
||||||
crudRegion.getRegionSelect({ 'stor_id': this.storId }).then(res => {
|
crudProductIn.getSect({ 'stor_id': this.storId }).then(res => {
|
||||||
this.sects = res.content
|
this.sects = res.content
|
||||||
})
|
})
|
||||||
const area_type = 'A1_RK01'
|
const area_type = 'A1_RK01'
|
||||||
@@ -511,25 +510,25 @@ export default {
|
|||||||
this.crud.notify('请先选择一条分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('请先选择一条分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (!this.sect_id) {
|
||||||
|
this.crud.notify('请先选择区域!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
// 如果勾选了,直接跳后台
|
// 如果勾选了,直接跳后台
|
||||||
if (this.form.checked) {
|
if (this.form.checked) {
|
||||||
if (!this.sect_id) {
|
|
||||||
this.crud.notify('请先选择区域!', CRUD.NOTIFICATION_TYPE.INFO)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.divBtn = true
|
this.divBtn = true
|
||||||
this.form.sect_id = this.sect_id
|
|
||||||
this.form.stor_id = this.stor_id
|
this.dis_row.stor_id = this.stor_id
|
||||||
this.form.is_pc = '1'
|
this.dis_row.sect_id = this.sect_id
|
||||||
crudProductIn.divStruct(this.form).then(res => {
|
crudProductIn.divStruct(this.dis_row).then(res => {
|
||||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id, 'open_flag': '1' }).then(res => {
|
/* crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id, 'open_flag': '1' }).then(res => {
|
||||||
this.openParam = res
|
this.openParam = res
|
||||||
})
|
})
|
||||||
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
|
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
|
||||||
this.form.tableMater = res
|
this.form.tableMater = res
|
||||||
this.divBtn = false
|
this.divBtn = false
|
||||||
this.crud.notify('分配货位成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
this.crud.notify('分配货位成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
})
|
})*/
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.divBtn = false
|
this.divBtn = false
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -310,12 +310,12 @@ export default {
|
|||||||
buttonChange(currentRow) {
|
buttonChange(currentRow) {
|
||||||
if (currentRow !== null) {
|
if (currentRow !== null) {
|
||||||
this.currentRow = currentRow
|
this.currentRow = currentRow
|
||||||
if (currentRow.bill_status === '1' || currentRow.bill_status === '2' || currentRow.bill_status === '3') {
|
if (currentRow.bill_status === '10' || currentRow.bill_status === '20' || currentRow.bill_status === '30') {
|
||||||
this.dis_flag = false
|
this.dis_flag = false
|
||||||
} else {
|
} else {
|
||||||
this.dis_flag = true
|
this.dis_flag = true
|
||||||
}
|
}
|
||||||
if (currentRow.bill_status === '3') {
|
if (currentRow.bill_status === '30') {
|
||||||
this.confirm_flag = false
|
this.confirm_flag = false
|
||||||
} else {
|
} else {
|
||||||
this.confirm_flag = true
|
this.confirm_flag = true
|
||||||
@@ -352,7 +352,7 @@ export default {
|
|||||||
divOpen() {
|
divOpen() {
|
||||||
crudProductIn.getIosInvDtl({ 'bill_code': this.currentRow.bill_code }).then(res => {
|
crudProductIn.getIosInvDtl({ 'bill_code': this.currentRow.bill_code }).then(res => {
|
||||||
this.openParam = res
|
this.openParam = res
|
||||||
this.storId = this.currentRow.product_code
|
this.storId = this.currentRow.stor_id
|
||||||
this.billType = this.currentRow.bill_type
|
this.billType = this.currentRow.bill_type
|
||||||
this.divShow = true
|
this.divShow = true
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -56,6 +56,22 @@ export function confirmvehicle(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getSect(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtSectattr/getSect',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function divStruct(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtSectattr/divStruct',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
add,
|
add,
|
||||||
edit,
|
edit,
|
||||||
@@ -63,5 +79,7 @@ export default {
|
|||||||
getIosInvDtl,
|
getIosInvDtl,
|
||||||
getIosInvDis,
|
getIosInvDis,
|
||||||
vehicleCheck,
|
vehicleCheck,
|
||||||
confirmvehicle
|
confirmvehicle,
|
||||||
|
getSect,
|
||||||
|
divStruct
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user