opt:出库完成相关逻辑修改。
This commit is contained in:
@@ -27,12 +27,12 @@ public class PageQuery implements Serializable {
|
||||
/**
|
||||
* 分页大小
|
||||
*/
|
||||
private Integer size;
|
||||
private Integer size=100;
|
||||
|
||||
/**
|
||||
* 当前页数
|
||||
*/
|
||||
private Integer page;
|
||||
private Integer page=0;
|
||||
|
||||
/**
|
||||
* 排序列
|
||||
|
||||
@@ -8,9 +8,9 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.RsaUtils;
|
||||
import org.nl.common.utils.dto.CurrentUser;
|
||||
@@ -21,6 +21,7 @@ import org.nl.system.service.secutiry.dto.AuthUserDto;
|
||||
import org.nl.system.service.user.ISysUserService;
|
||||
import org.nl.system.service.user.dao.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -30,6 +31,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
@@ -38,14 +40,46 @@ import java.util.List;
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/mobile/auth")
|
||||
@RequestMapping("/api/bigScreenScreen")
|
||||
public class MobileAuthorizationController {
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
@Autowired
|
||||
private ISysRoleService roleService;
|
||||
|
||||
@PostMapping(value = "/login")
|
||||
@PostMapping("/login")
|
||||
@SaIgnore
|
||||
//("手持登陆验证")
|
||||
public ResponseEntity<Object> handLogin(@RequestBody Map<String, String> whereJson) {
|
||||
SysUser userInfo = userService.getOne(new QueryWrapper<SysUser>().eq("username", whereJson.get("user")));
|
||||
if (userInfo == null || !userInfo.getPassword().equals(SaSecureUtil.md5BySalt(RsaUtils.decryptByPrivateKey(RsaUtils.KEY, whereJson.get("password")), "salt"))) { // 这里需要密码加密
|
||||
throw new BadRequestException("账号或密码错误");
|
||||
}
|
||||
if (!userInfo.getIs_used()) {
|
||||
throw new BadRequestException("账号未激活");
|
||||
}
|
||||
List<String> permissionList = roleService.getPermissionList((JSONObject) JSON.toJSON(userInfo));
|
||||
// 登录输入,登出删除
|
||||
CurrentUser user = new CurrentUser();
|
||||
user.setId(userInfo.getUser_id());
|
||||
user.setUsername(userInfo.getUsername());
|
||||
user.setPresonName((userInfo.getPerson_name()));
|
||||
user.setUser(userInfo);
|
||||
user.setPermissions(permissionList);
|
||||
// SaLoginModel 配置登录相关参数
|
||||
StpUtil.login(userInfo.getUser_id(), new SaLoginModel()
|
||||
.setDevice("PC") // 此次登录的客户端设备类型, 用于[同端互斥登录]时指定此次登录的设备类型
|
||||
.setExtra("loginInfo", JSONObject.toJSONString(user)) // Token挂载的扩展参数 (此方法只有在集成jwt插件时才会生效)
|
||||
);
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("token", StpUtil.getTokenValue());
|
||||
result.put("roles", permissionList);
|
||||
result.put("user", user);
|
||||
return new ResponseEntity<>(TableDataInfo.buildJson(result), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = "/userLogin")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception {
|
||||
String salt = "salt";
|
||||
|
||||
@@ -30,8 +30,7 @@ public class AuthUserDto {
|
||||
|
||||
|
||||
private String username;
|
||||
|
||||
|
||||
private String user;
|
||||
private String password;
|
||||
|
||||
private String code;
|
||||
|
||||
@@ -27,18 +27,4 @@ public interface IMdPbStoragevehicleextService extends IService<MdPbStoragevehic
|
||||
*/
|
||||
IPage<JSONObject> queryAll(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 更新库存以及仓位状态
|
||||
* @param updateIvtList :{
|
||||
* type: 更新类型
|
||||
* storagevehicle_code: 载具编码
|
||||
* material_id: 物料标识
|
||||
* pcsn: 批次
|
||||
* qty_unit_id: 计量单位标识
|
||||
* qty_unit_name: 计量单位名称
|
||||
* change_qty: 变动数量
|
||||
* remark: 备注
|
||||
* }
|
||||
*/
|
||||
void updateIvt(List<JSONObject> updateIvtList);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<select id="getCanuseIvt" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
ext.storagevehicleext_id,
|
||||
ext.group_id as storagevehicleext_id,
|
||||
ext.storagevehicle_code,
|
||||
ext.material_id,
|
||||
material.material_code,
|
||||
@@ -12,7 +12,7 @@
|
||||
ext.pcsn,
|
||||
ext.qty_unit_id,
|
||||
ext.qty_unit_name,
|
||||
ext.canuse_qty AS qty,
|
||||
ext.qty,
|
||||
ext.frozen_qty,
|
||||
attr.sect_name AS turnout_sect_name,
|
||||
attr.sect_code AS turnout_sect_code,
|
||||
@@ -20,13 +20,13 @@
|
||||
attr.struct_id,
|
||||
attr.struct_code AS turnout_struct_code
|
||||
FROM
|
||||
md_pb_storagevehicleext ext
|
||||
md_pb_groupplate ext
|
||||
INNER JOIN md_me_materialbase material ON material.material_id = ext.material_id
|
||||
INNER JOIN st_ivt_structattr attr ON ext.storagevehicle_code = attr.storagevehicle_code
|
||||
<where>
|
||||
attr.lock_type = '0'
|
||||
AND attr.is_used = "1"
|
||||
AND ext.canuse_qty > 0
|
||||
AND ext.qty > 0
|
||||
<if test="param.stor_id != null and param.stor_id != ''">
|
||||
AND
|
||||
attr.stor_id LIKE #{param.stor_id}
|
||||
@@ -53,19 +53,19 @@
|
||||
</if>
|
||||
|
||||
</where>
|
||||
ORDER BY ext.insert_time Desc
|
||||
ORDER BY ext.create_time Desc
|
||||
</select>
|
||||
|
||||
<select id="queryAllByPage" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
ext.storagevehicleext_id,
|
||||
ext.group_id as storagevehicleext_id,
|
||||
ext.storagevehicle_code,
|
||||
ext.pcsn,
|
||||
ext.qty_unit_name,
|
||||
ext.canuse_qty,
|
||||
ext.qty,
|
||||
ext.frozen_qty,
|
||||
ext.remark,
|
||||
ext.insert_time,
|
||||
ext.create_time,
|
||||
attr.struct_code,
|
||||
attr.struct_name,
|
||||
attr.stor_name,
|
||||
@@ -73,7 +73,7 @@
|
||||
mater.material_code,
|
||||
mater.material_name
|
||||
FROM
|
||||
md_pb_storagevehicleext ext
|
||||
md_pb_groupplate ext
|
||||
INNER JOIN st_ivt_structattr attr ON ext.storagevehicle_code = attr.storagevehicle_code
|
||||
INNER JOIN md_me_materialbase mater ON mater.material_id = ext.material_id
|
||||
<where>
|
||||
@@ -105,14 +105,14 @@
|
||||
ext.pcsn LIKE #{param.pcsn}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ext.insert_time Desc
|
||||
ORDER BY ext.create_time Desc
|
||||
</select>
|
||||
|
||||
<select id="queryCanuseSum" resultType="java.math.BigDecimal">
|
||||
SELECT
|
||||
SUM(canuse_qty)
|
||||
SUM(qty)
|
||||
FROM
|
||||
md_pb_storagevehicleext ex
|
||||
md_pb_groupplate ex
|
||||
LEFT JOIN st_ivt_structattr st on ex.storagevehicle_code = st.storagevehicle_code
|
||||
<where>
|
||||
ex.material_id = #{material_id}
|
||||
@@ -127,7 +127,7 @@
|
||||
|
||||
<select id="queryOutAllocation" resultType="org.nl.wms.basedata_manage.service.dto.MdPbStoragevehicleextDto">
|
||||
SELECT ex.*,st.sect_id,st.sect_code,st.sect_name,st.struct_id,st.struct_code,st.struct_name
|
||||
FROM md_pb_storagevehicleext ex LEFT JOIN st_ivt_structattr st on ex.storagevehicle_code = st.storagevehicle_code
|
||||
FROM md_pb_groupplate ex LEFT JOIN st_ivt_structattr st on ex.storagevehicle_code = st.storagevehicle_code
|
||||
<where>
|
||||
material_id = #{material_id}
|
||||
AND
|
||||
@@ -152,19 +152,19 @@
|
||||
mater.material_code AS mater_code,
|
||||
mater.material_name AS mater_name,
|
||||
ext.pcsn AS batch_no,
|
||||
ext.canuse_qty AS quantity,
|
||||
ext.qty AS quantity,
|
||||
unit.unit_code AS unit_code,
|
||||
unit.unit_name AS unit_name,
|
||||
ext.insert_time AS in_time
|
||||
ext.create_time AS in_time
|
||||
FROM
|
||||
md_pb_storagevehicleext ext
|
||||
md_pb_groupplate ext
|
||||
INNER JOIN st_ivt_structattr attr ON ext.storagevehicle_code = attr.storagevehicle_code
|
||||
INNER JOIN md_me_materialbase mater ON mater.material_id = ext.material_id
|
||||
INNER JOIN md_pb_measureunit unit ON ext.qty_unit_id = unit.measure_unit_id
|
||||
<where>
|
||||
attr.lock_type = '0'
|
||||
AND attr.is_used = "1"
|
||||
AND ext.canuse_qty > 0
|
||||
AND ext.qty > 0
|
||||
<if test="param.mater_code != null and param.mater_code != ''">
|
||||
AND
|
||||
mater.material_code = #{param.mater_code}
|
||||
@@ -181,7 +181,7 @@
|
||||
</if>
|
||||
|
||||
</where>
|
||||
ORDER BY ext.insert_time Desc
|
||||
ORDER BY ext.create_time Desc
|
||||
</select>
|
||||
|
||||
<select id="getIosDtl" resultType="com.alibaba.fastjson.JSONObject">
|
||||
@@ -193,12 +193,12 @@
|
||||
mater.material_name,
|
||||
ext.storagevehicle_code,
|
||||
ext.pcsn,
|
||||
ext.canuse_qty AS qty,
|
||||
ext.qty,
|
||||
ext.qty_unit_name,
|
||||
ext.qty_unit_id,
|
||||
ext.storagevehicleext_id
|
||||
ext.group_id as storagevehicleext_id
|
||||
FROM
|
||||
md_pb_storagevehicleext ext
|
||||
md_pb_groupplate ext
|
||||
INNER JOIN sch_base_point point ON ext.storagevehicle_code = point.vehicle_code
|
||||
INNER JOIN st_ivt_iostorinvdis dis ON dis.iostorinvdis_id = point.ios_id
|
||||
INNER JOIN st_ivt_iostorinv mst ON dis.iostorinv_id = mst.iostorinv_id
|
||||
@@ -211,19 +211,19 @@
|
||||
</if>
|
||||
|
||||
</where>
|
||||
ORDER BY ext.insert_time Desc
|
||||
ORDER BY ext.create_time Desc
|
||||
</select>
|
||||
|
||||
<select id="queryAvailableInv" resultType="org.nl.wms.basedata_manage.service.dto.MdPbStoragevehicleextDto">
|
||||
SELECT
|
||||
ext.storagevehicleext_id,
|
||||
ext.group_id as storagevehicleext_id,
|
||||
ext.storagevehicle_code,
|
||||
ext.pcsn,
|
||||
ext.qty_unit_name,
|
||||
ext.canuse_qty,
|
||||
ext.qty,
|
||||
ext.frozen_qty,
|
||||
ext.remark,
|
||||
ext.insert_time,
|
||||
ext.create_time,
|
||||
attr.sect_id,
|
||||
attr.sect_code,
|
||||
attr.sect_name,
|
||||
@@ -233,7 +233,7 @@
|
||||
mater.material_code,
|
||||
mater.material_name
|
||||
FROM
|
||||
md_pb_storagevehicleext ext
|
||||
md_pb_groupplate ext
|
||||
INNER JOIN st_ivt_structattr attr ON ext.storagevehicle_code = attr.storagevehicle_code
|
||||
INNER JOIN md_me_materialbase mater ON mater.material_id = ext.material_id
|
||||
<where>
|
||||
@@ -263,6 +263,6 @@
|
||||
ext.pcsn LIKE #{params.pcsn}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ext.insert_time
|
||||
ORDER BY ext.create_time
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -26,11 +26,7 @@ import java.util.Map;
|
||||
@Service
|
||||
public class MdPbStoragevehicleextServiceImpl extends ServiceImpl<MdPbStoragevehicleextMapper, MdPbStoragevehicleext> implements IMdPbStoragevehicleextService {
|
||||
|
||||
/**
|
||||
* 更新库存工具类
|
||||
*/
|
||||
@Autowired
|
||||
private UpdateIvtUtils updateIvtUtils;
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<JSONObject> queryAll(Map whereJson, PageQuery page) {
|
||||
@@ -38,10 +34,5 @@ public class MdPbStoragevehicleextServiceImpl extends ServiceImpl<MdPbStorageveh
|
||||
whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateIvt(List<JSONObject> updateIvtList) {
|
||||
for (JSONObject json : updateIvtList) {
|
||||
updateIvtUtils.updateIvt(json);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -74,20 +74,8 @@ public class AlleyAveRuleHandler extends Decisioner<Structattr, JSONObject> {
|
||||
return 0;
|
||||
});
|
||||
List<Structattr> subList = list.subList(0, Math.min(list.size(), 10));
|
||||
Structattr result = iStructattrService.getOne(
|
||||
new LambdaQueryWrapper<Structattr>()
|
||||
.eq(Structattr::getStruct_code, subList.get(0).getStruct_code())
|
||||
);
|
||||
if (result.getStoragevehicle_code() != null || !"00".equals(result.getLock_type())) {
|
||||
log.error("均衡策略分配异常,出现流程节点完成库存延迟锁定,载具号" + param.getString("vehicle_code") + "分配异常,仓位: " + result.getStruct_code() + ",该仓位被其他任务的载具锁定或其锁类型锁住");
|
||||
subList = subList.stream().filter(r -> !r.getStruct_code().equals(result.getStruct_code())).collect(Collectors.toList());
|
||||
}
|
||||
log.info("均衡策略结果:载具号:" + param.getString("vehicle_code") + "分配结果: " + subList.stream().map(Structattr::getStruct_code).collect(Collectors.toList()));
|
||||
log.info("均衡策略:载具号:" + param.getString("vehicle_code") + "获取仓位耗时:{}", System.currentTimeMillis() - startTime1);
|
||||
if (subList.size() == 0) {
|
||||
log.error("均衡策略结果:载具号:" + param.getString("vehicle_code") + "当前分配策略货位数量为0");
|
||||
throw new BadRequestException("均衡策略结果:载具号:" + param.getString("vehicle_code") + "当前分配策略货位数量为0");
|
||||
}
|
||||
return subList;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,11 @@ import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.pda.ios_manage.service.PdaIosCheckService;
|
||||
import org.nl.wms.pda.ios_manage.service.PdaIosInService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -25,13 +28,14 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/pda/iosCheck")
|
||||
@RequestMapping("/api/groupMater")
|
||||
@Slf4j
|
||||
public class PdaIosCheckController {
|
||||
|
||||
@Autowired
|
||||
private PdaIosCheckService pdaIosCheckService;
|
||||
|
||||
@Autowired
|
||||
private PdaIosInService pdaIosInService;
|
||||
@PostMapping("/getDtl")
|
||||
@Log("获取盘点明细")
|
||||
@SaIgnore
|
||||
@@ -39,6 +43,16 @@ public class PdaIosCheckController {
|
||||
return new ResponseEntity<>(pdaIosCheckService.getDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 组盘获取物料列表
|
||||
*/
|
||||
@PostMapping("/maters")
|
||||
@Log("获取物料列表")
|
||||
@SaIgnore
|
||||
public ResponseEntity<TableDataInfo<MdMeMaterialbase>> getMaterialList(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaIosInService.getMaterialList(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("确认")
|
||||
@SaIgnore
|
||||
|
||||
@@ -99,7 +99,7 @@ public class PdaIosInController {
|
||||
@PostMapping("/confirmIn")
|
||||
@Log("组盘入库确认")
|
||||
public ResponseEntity<Object> confirmIn(@RequestBody JSONObject whereJson) {
|
||||
assertNotBlankJson(whereJson, "请求参数不能为空", "vehicle_code", "sect_id");
|
||||
assertNotBlankJson(whereJson, "请求参数不能为空", "vehicle_code", "sect_id", "site_code");
|
||||
return new ResponseEntity<>(pdaIosInService.confirmIn(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,13 @@ package org.nl.wms.pda.ios_manage.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.vo.SelectItemVo;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.pda.util.PdaResponse;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 手持IOS 服务类
|
||||
@@ -70,7 +73,7 @@ public interface PdaIosInService {
|
||||
*
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse getVehicleMaterial(JSONObject whereJson);
|
||||
JSONObject getVehicleMaterial(JSONObject whereJson);
|
||||
|
||||
|
||||
|
||||
@@ -79,7 +82,7 @@ public interface PdaIosInService {
|
||||
*
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse getSect(JSONObject whereJson);
|
||||
List<SelectItemVo> getSect(JSONObject whereJson);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.domain.vo.SelectItemVo;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
@@ -222,13 +223,14 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse getSect(JSONObject whereJson) {
|
||||
public List<SelectItemVo> getSect(JSONObject whereJson) {
|
||||
PageQuery pageQuery = new PageQuery();
|
||||
pageQuery.setPage(whereJson.getInteger("page") - 1);
|
||||
pageQuery.setSize(whereJson.getInteger("size"));
|
||||
IPage<SectattrDto> sectList = iSectattrService.queryAll(new HashMap(), pageQuery);
|
||||
sectList.getRecords().forEach(r -> r.setSect_name(r.getStor_name() + "-" + r.getSect_name()));
|
||||
return PdaResponse.requestParamOk(sectList);
|
||||
List<SelectItemVo> selectList = new ArrayList<>();
|
||||
sectList.getRecords().forEach(r ->
|
||||
selectList.add(SelectItemVo.builder().text(r.getStor_name() + "-" + r.getSect_name()).value(r.getSect_id()).build())
|
||||
);
|
||||
return selectList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -241,10 +243,14 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse getVehicleMaterial(JSONObject whereJson) {
|
||||
public JSONObject getVehicleMaterial(JSONObject whereJson) {
|
||||
whereJson.put("status", GROUP_PLATE_STATUS.code("组盘"));
|
||||
whereJson.put("vehicleCode", whereJson.getString("search"));
|
||||
return PdaResponse.requestParamOk(mdPbGroupplateMapper.getVehicleMaterial(whereJson));
|
||||
List<JSONObject> list = mdPbGroupplateMapper.getVehicleMaterial(whereJson);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
throw new BadRequestException("此载具未组盘,请检查!");
|
||||
}
|
||||
return list.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -321,7 +327,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
params.put("pcsn", whereJson.getString("pcsn"));
|
||||
Structattr attrDao = iRawAssistIStorService.getStructattr(whereJson);
|
||||
//确定起点
|
||||
SchBasePoint schBasePoint = iSchBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getVehicle_code, whereJson.getString("vehicle_code")));
|
||||
SchBasePoint schBasePoint = iSchBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, whereJson.getString("site_code")));
|
||||
if (ObjectUtil.isEmpty(schBasePoint)) {
|
||||
throw new BadRequestException("未找到载具所在的点位信息,请检查");
|
||||
}
|
||||
@@ -356,7 +362,10 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
//获取起点
|
||||
SchBasePoint schBasePoint = iSchBasePointService
|
||||
.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getVehicle_code, whereJson.getString("vehicle_code")));
|
||||
whereJson.put("point_code", schBasePoint.getPoint_code());
|
||||
if (ObjectUtil.isEmpty(schBasePoint)) {
|
||||
throw new BadRequestException("未找到载具所在的点位信息,请检查该载具是否绑定点位");
|
||||
}
|
||||
whereJson.put("point_code",whereJson.getString("site_code"));
|
||||
// 预组织出入库单据实体
|
||||
Map<String, Object> jsonMst = organizeInsertData(whereJson);
|
||||
// 调用服务新增出入库单
|
||||
@@ -422,21 +431,21 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
jsonMst.put("bill_status", IOSEnum.BILL_STATUS.code("生成"));
|
||||
jsonMst.put("total_qty", total_qty);
|
||||
jsonMst.put("detail_count", 1);
|
||||
jsonMst.put("bill_type", StatusEnum.IOBILL_TYPE_IN.code("生产出库"));
|
||||
jsonMst.put("bill_type", StatusEnum.IOBILL_TYPE_IN.code("生产入库"));
|
||||
jsonMst.put("biz_date", DateUtil.now());
|
||||
// 组织明细数据
|
||||
ArrayList<HashMap> tableData = new ArrayList<>();
|
||||
HashMap<String, String> dtl = new HashMap<>();
|
||||
GroupPlate plateDao = plateDaoList.get(0);
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(plateDao.getMaterial_id());
|
||||
dtl.put("storagevehicle_code", plateDao.getStoragevehicle_code());
|
||||
dtl.put("material_id", plateDao.getMaterial_id());
|
||||
dtl.put("material_id", materDao.getMaterial_id());
|
||||
dtl.put("material_code", materDao.getMaterial_code());
|
||||
dtl.put("material_name", materDao.getMaterial_name());
|
||||
dtl.put("pcsn", plateDao.getPcsn());
|
||||
dtl.put("qty_unit_id", plateDao.getQty_unit_id());
|
||||
dtl.put("qty_unit_name", plateDao.getQty_unit_name());
|
||||
dtl.put("qty", String.valueOf(total_qty));
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getById(plateDao.getMaterial_id());
|
||||
dtl.put("material_code", materDao.getMaterial_code());
|
||||
dtl.put("material_name", materDao.getMaterial_name());
|
||||
dtl.put("plan_qty", String.valueOf(total_qty));
|
||||
// 调用新增
|
||||
tableData.add(dtl);
|
||||
|
||||
@@ -49,6 +49,7 @@ public class PdaResponse<T> {
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
public static <T> TableDataInfo<T> build(IPage<T> page) {
|
||||
TableDataInfo<T> rspData = new TableDataInfo<>();
|
||||
rspData.setCode(String.valueOf(HttpStatus.HTTP_OK));
|
||||
|
||||
@@ -39,12 +39,12 @@
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
task.task_code,
|
||||
ext.insert_time
|
||||
ext.create_time as insert_time
|
||||
FROM
|
||||
st_ivt_iostorinvdis dis
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = dis.material_id
|
||||
LEFT JOIN sch_base_task task ON task.task_id = dis.task_id
|
||||
LEFT JOIN md_pb_storagevehicleext ext ON ext.storagevehicle_code = dis.storagevehicle_code
|
||||
LEFT JOIN md_pb_groupplate ext ON ext.storagevehicle_code = dis.storagevehicle_code
|
||||
where
|
||||
1=1
|
||||
<if test="params.iostorinvdtl_id != null">
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
dtl.mol_qty,
|
||||
dtl.status,
|
||||
dtl.source_bill_code,
|
||||
ext.canuse_qty AS ivt_qty
|
||||
ext.qty AS ivt_qty
|
||||
FROM
|
||||
st_ivt_moreorlessdtl dtl
|
||||
LEFT JOIN st_ivt_moreorlessmst ios ON ios.mol_id = dtl.mol_id
|
||||
LEFT JOIN md_me_materialbase material ON material.material_id = dtl.material_id
|
||||
INNER JOIN md_pb_storagevehicleext ext ON ext.storagevehicle_code = dtl.storagevehicle_code
|
||||
INNER JOIN md_pb_groupplate ext ON ext.storagevehicle_code = dtl.storagevehicle_code
|
||||
AND ext.material_id = dtl.material_id AND dtl.pcsn = ext.pcsn
|
||||
<where>
|
||||
ios.is_delete = '0'
|
||||
|
||||
@@ -452,7 +452,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
jsonIvt.put("qty_unit_name", outAllocation.getQty_unit_name());
|
||||
jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
||||
updateIvtList.add(jsonIvt);
|
||||
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
|
||||
iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
|
||||
//分配完成 结束分配
|
||||
if (unassign_qty==0){
|
||||
@@ -521,7 +521,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
jsonIvt.put("qty_unit_name", ioStorInvDis.getQty_unit_name());
|
||||
jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
||||
updateIvtList.add(jsonIvt);
|
||||
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
|
||||
iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
|
||||
//解锁库位
|
||||
JSONObject unlock_map = new JSONObject();
|
||||
@@ -667,7 +667,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
jsonIvt.put("qty_unit_name", outAllocation.getQty_unit_name());
|
||||
jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
||||
updateIvtList.add(jsonIvt);
|
||||
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
|
||||
iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
|
||||
//分配完成 结束分配
|
||||
if (unassign_qty==0){
|
||||
@@ -736,7 +736,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
jsonIvt.put("qty_unit_name", ioStorInvDis.getQty_unit_name());
|
||||
jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
||||
updateIvtList.add(jsonIvt);
|
||||
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
|
||||
iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
|
||||
//解锁库位
|
||||
JSONObject unlock_map = new JSONObject();
|
||||
@@ -885,7 +885,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
jsonIvt.put("qty_unit_name", dtl.getQty_unit_name());
|
||||
jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
||||
updateIvtList.add(jsonIvt);
|
||||
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
|
||||
iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
}
|
||||
|
||||
//更新详情
|
||||
@@ -944,7 +944,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
jsonIvt.put("qty_unit_name", ioStorInvDis.getQty_unit_name());
|
||||
jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
||||
updateIvtList.add(jsonIvt);
|
||||
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
|
||||
iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
|
||||
//解锁库位
|
||||
JSONObject unlock_map = new JSONObject();
|
||||
@@ -1119,7 +1119,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
jsonIvt.put("qty_unit_name", ioStorInvDis.getQty_unit_name());
|
||||
jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
||||
updateIvtList.add(jsonIvt);
|
||||
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
|
||||
iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
}
|
||||
|
||||
//更新分配明细数据
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.StInTask;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_management.service.IRawAssistIStorService;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInv;
|
||||
@@ -78,7 +79,7 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
private MdPbStoragevehicleinfoMapper mdPbStoragevehicleinfoMapper;
|
||||
|
||||
@Resource
|
||||
private IMdPbStoragevehicleextService iMdPbStoragevehicleextService;
|
||||
private IMdPbGroupplateService iMdPbGroupPlateService;
|
||||
|
||||
@Resource
|
||||
private MdPbGroupplateServiceImpl mdPbGroupplateService;
|
||||
@@ -588,7 +589,7 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
jsonIvt.put("qty_unit_name", ioStorInvDis.getQty_unit_name());
|
||||
jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
||||
updateIvtList.add(jsonIvt);
|
||||
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
|
||||
iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
}
|
||||
|
||||
//更新详情数据
|
||||
@@ -667,7 +668,7 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
jsonIvt.put("qty_unit_name", ioStorInvDis.getQty_unit_name());
|
||||
jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
||||
updateIvtList.add(jsonIvt);
|
||||
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
|
||||
iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
// 查询该明细下是否还有未完成的分配明细
|
||||
int countDis = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getIostorinvdtl_id,ioStorInvDis.getIostorinvdtl_id())
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.MoveTask;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtMoveinvService;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtMoveinvdtlService;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoveinv;
|
||||
@@ -32,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -53,10 +55,10 @@ public class StIvtMoveinvServiceImpl extends ServiceImpl<StIvtMoveinvMapper, StI
|
||||
private MdPbStoragevehicleextMapper mdPbStoragevehicleextMapper;
|
||||
|
||||
/**
|
||||
* 载具扩展属性服务类
|
||||
* 组盘信息表
|
||||
*/
|
||||
@Autowired
|
||||
private IMdPbStoragevehicleextService iMdPbStoragevehicleextService;
|
||||
@Resource
|
||||
private IMdPbGroupplateService iMdPbGroupPlateService;
|
||||
|
||||
/**
|
||||
* 移库单明细服务
|
||||
@@ -222,7 +224,7 @@ public class StIvtMoveinvServiceImpl extends ServiceImpl<StIvtMoveinvMapper, StI
|
||||
jsonIvtTwo.put("qty_unit_name", dtlDao.getQty_unit_name());
|
||||
jsonIvtTwo.put("change_qty", dtlDao.getQty());
|
||||
updateIvtList.add(jsonIvtTwo);
|
||||
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
|
||||
iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
|
||||
// 更新起点
|
||||
iStructattrService.update(
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.MoveTask;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_management.service.IStIvtMoveinvdtlService;
|
||||
import org.nl.wms.warehouse_management.service.dao.StIvtMoveinvdtl;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.StIvtMoveinvdtlMapper;
|
||||
@@ -25,6 +26,7 @@ import org.nl.wms.warehouse_management.service.dto.MoveInsertDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -41,10 +43,10 @@ import java.util.stream.Collectors;
|
||||
public class StIvtMoveinvdtlServiceImpl extends ServiceImpl<StIvtMoveinvdtlMapper, StIvtMoveinvdtl> implements IStIvtMoveinvdtlService {
|
||||
|
||||
/**
|
||||
* 载具扩展属性服务
|
||||
* 组盘信息表
|
||||
*/
|
||||
@Autowired
|
||||
private IMdPbStoragevehicleextService iMdPbStoragevehicleextService;
|
||||
@Resource
|
||||
private IMdPbGroupplateService iMdPbGroupPlateService;
|
||||
|
||||
/**
|
||||
* 仓位服务
|
||||
@@ -132,7 +134,7 @@ public class StIvtMoveinvdtlServiceImpl extends ServiceImpl<StIvtMoveinvdtlMappe
|
||||
updateAttrList.add(jsonAttrOut);
|
||||
}
|
||||
this.saveBatch(moveDtlList);
|
||||
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
|
||||
iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
// 锁定仓位
|
||||
iStructattrService.updateLock(updateAttrList);
|
||||
}
|
||||
@@ -194,7 +196,7 @@ public class StIvtMoveinvdtlServiceImpl extends ServiceImpl<StIvtMoveinvdtlMappe
|
||||
.eq(StIvtMoveinvdtl::getMoveinv_id, dto.getMoveinv_id())
|
||||
);
|
||||
// 更新库存
|
||||
iMdPbStoragevehicleextService.updateIvt(updateIvtList);
|
||||
iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||
// 更新仓位
|
||||
iStructattrService.update(
|
||||
new UpdateWrapper<Structattr>().lambda()
|
||||
|
||||
@@ -6,10 +6,8 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleextService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleext;
|
||||
import org.nl.wms.warehouse_management.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_management.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
|
||||
@@ -121,26 +119,27 @@ public class UpdateIvtUtils {
|
||||
* @param where 输入参数
|
||||
*/
|
||||
private void updateAddCanuseInsertIvt(JSONObject where) {
|
||||
throw new BadRequestException("当前载具已存在库存物料,请检查数据!");
|
||||
// 判断当前载具是否有物料
|
||||
MdPbStoragevehicleext extDao = iMdPbStoragevehicleextService.getOne(
|
||||
new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||
.eq(MdPbStoragevehicleext::getStoragevehicle_code, where.getString("storagevehicle_code"))
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(extDao)) {
|
||||
throw new BadRequestException("当前载具【"+extDao.getStoragevehicle_code()+"】已存在库存物料,请检查数据!");
|
||||
}
|
||||
|
||||
// 插入数据
|
||||
MdPbStoragevehicleext extParamDao = JSONObject.parseObject(JSONObject.toJSONString(where), MdPbStoragevehicleext.class);
|
||||
extParamDao.setStoragevehicleext_id(IdUtil.getStringId());
|
||||
extParamDao.setCanuse_qty(where.getBigDecimal("change_qty"));
|
||||
extParamDao.setFrozen_qty(BigDecimal.valueOf(0));
|
||||
extParamDao.setInsert_time(DateUtil.now());
|
||||
extParamDao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
extParamDao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
extParamDao.setUpdate_time(DateUtil.now());
|
||||
extParamDao.setRemark(where.getString("remark"));
|
||||
iMdPbStoragevehicleextService.save(extParamDao);
|
||||
// MdPbStoragevehicleext extDao = iMdPbStoragevehicleextService.getOne(
|
||||
// new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||
// .eq(MdPbStoragevehicleext::getStoragevehicle_code, where.getString("storagevehicle_code"))
|
||||
// );
|
||||
// if (ObjectUtil.isNotEmpty(extDao)) {
|
||||
// throw new BadRequestException("当前载具【"+extDao.getStoragevehicle_code()+"】已存在库存物料,请检查数据!");
|
||||
// }
|
||||
//
|
||||
// // 插入数据
|
||||
// MdPbStoragevehicleext extParamDao = JSONObject.parseObject(JSONObject.toJSONString(where), MdPbStoragevehicleext.class);
|
||||
// extParamDao.setStoragevehicleext_id(IdUtil.getStringId());
|
||||
// extParamDao.setCanuse_qty(where.getBigDecimal("change_qty"));
|
||||
// extParamDao.setFrozen_qty(BigDecimal.valueOf(0));
|
||||
// extParamDao.setInsert_time(DateUtil.now());
|
||||
// extParamDao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
// extParamDao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
// extParamDao.setUpdate_time(DateUtil.now());
|
||||
// extParamDao.setRemark(where.getString("remark"));
|
||||
// iMdPbStoragevehicleextService.save(extParamDao);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,30 +148,30 @@ public class UpdateIvtUtils {
|
||||
*/
|
||||
private void updateAddFrozenIvt(JSONObject where) {
|
||||
// 找当前托盘物料库存
|
||||
MdPbStoragevehicleext extDao = iMdPbStoragevehicleextService.getOne(
|
||||
new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||
.eq(MdPbStoragevehicleext::getStoragevehicle_code, where.getString("storagevehicle_code"))
|
||||
.eq(MdPbStoragevehicleext::getMaterial_id, where.getString("material_id"))
|
||||
.eq(MdPbStoragevehicleext::getPcsn, where.getString("pcsn"))
|
||||
GroupPlate extDao = iMdPbGroupPlateService.getOne(
|
||||
new QueryWrapper<GroupPlate>().lambda()
|
||||
.eq(GroupPlate::getStoragevehicle_code, where.getString("storagevehicle_code"))
|
||||
.eq(GroupPlate::getMaterial_id, where.getString("material_id"))
|
||||
.eq(GroupPlate::getPcsn, where.getString("pcsn"))
|
||||
);
|
||||
if (ObjectUtil.isEmpty(extDao)) {
|
||||
throw new BadRequestException("当前载具【"+extDao.getStoragevehicle_code()+"】不存在相关物料批次库存,请检查数据!");
|
||||
throw new BadRequestException("当前载具【" + extDao.getStoragevehicle_code() + "】不存在相关物料批次库存,请检查数据!");
|
||||
}
|
||||
// 减可用数
|
||||
double canuse_qty = NumberUtil.sub(extDao.getCanuse_qty(), where.getDoubleValue("change_qty")).doubleValue();
|
||||
double canuse_qty = NumberUtil.sub(extDao.getQty(), where.getDoubleValue("change_qty")).doubleValue();
|
||||
if (canuse_qty < 0) {
|
||||
throw new BadRequestException("可用数不能为负数,请检查变动数量!当前可用数为【"+extDao.getCanuse_qty()+"】当前变动数为【"+where.getDoubleValue("change_qty")+"】");
|
||||
throw new BadRequestException("可用数不能为负数,请检查变动数量!当前可用数为【" + extDao.getQty() + "】当前变动数为【" + where.getDoubleValue("change_qty") + "】");
|
||||
}
|
||||
// 加冻结数
|
||||
double frozen_qty = NumberUtil.add(extDao.getFrozen_qty(), where.getDoubleValue("change_qty")).doubleValue();
|
||||
|
||||
extDao.setCanuse_qty(BigDecimal.valueOf(canuse_qty));
|
||||
extDao.setQty(BigDecimal.valueOf(canuse_qty));
|
||||
extDao.setFrozen_qty(BigDecimal.valueOf(frozen_qty));
|
||||
extDao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
extDao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
extDao.setUpdate_time(DateUtil.now());
|
||||
extDao.setRemark(where.getString("remark"));
|
||||
iMdPbStoragevehicleextService.updateById(extDao);
|
||||
iMdPbGroupPlateService.updateById(extDao);
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -181,23 +180,23 @@ public class UpdateIvtUtils {
|
||||
*/
|
||||
private void updateSubFrozenIvt(JSONObject where) {
|
||||
// 找当前托盘物料库存
|
||||
MdPbStoragevehicleext extDao = iMdPbStoragevehicleextService.getOne(
|
||||
new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||
.eq(MdPbStoragevehicleext::getStoragevehicle_code, where.getString("storagevehicle_code"))
|
||||
.eq(MdPbStoragevehicleext::getMaterial_id, where.getString("material_id"))
|
||||
.eq(MdPbStoragevehicleext::getPcsn, where.getString("pcsn"))
|
||||
GroupPlate extDao = iMdPbGroupPlateService.getOne(
|
||||
new QueryWrapper<GroupPlate>().lambda()
|
||||
.eq(GroupPlate::getStoragevehicle_code, where.getString("storagevehicle_code"))
|
||||
.eq(GroupPlate::getMaterial_id, where.getString("material_id"))
|
||||
.eq(GroupPlate::getPcsn, where.getString("pcsn"))
|
||||
);
|
||||
if (ObjectUtil.isEmpty(extDao)) {
|
||||
throw new BadRequestException("当前载具【"+extDao.getStoragevehicle_code()+"】不存在相关物料批次库存,请检查数据!");
|
||||
throw new BadRequestException("当前载具【" + extDao.getStoragevehicle_code() + "】不存在相关物料批次库存,请检查数据!");
|
||||
}
|
||||
|
||||
// 减冻结
|
||||
double frozen_qty = NumberUtil.sub(extDao.getFrozen_qty(), where.getDoubleValue("change_qty")).doubleValue();
|
||||
if (frozen_qty < 0) {
|
||||
throw new BadRequestException("冻结数不能为负数,请检查变动数量!当前冻结数为【"+extDao.getFrozen_qty()+"】当前变动数为【"+where.getDoubleValue("change_qty")+"】");
|
||||
throw new BadRequestException("冻结数不能为负数,请检查变动数量!当前冻结数为【" + extDao.getFrozen_qty() + "】当前变动数为【" + where.getDoubleValue("change_qty") + "】");
|
||||
}
|
||||
|
||||
// 如果可用数和冻结数都为零则删除数据
|
||||
if (frozen_qty == 0 && extDao.getCanuse_qty().doubleValue() == 0) {
|
||||
if (frozen_qty == 0 && extDao.getQty().doubleValue() == 0) {
|
||||
iMdPbStoragevehicleextService.removeById(extDao);
|
||||
} else {
|
||||
extDao.setFrozen_qty(BigDecimal.valueOf(frozen_qty));
|
||||
@@ -205,7 +204,8 @@ public class UpdateIvtUtils {
|
||||
extDao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
extDao.setUpdate_time(DateUtil.now());
|
||||
extDao.setRemark(where.getString("remark"));
|
||||
iMdPbStoragevehicleextService.updateById(extDao);
|
||||
iMdPbGroupPlateService.updateById(extDao);
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,12 +215,6 @@ public class UpdateIvtUtils {
|
||||
*/
|
||||
private void updateSubFrozenAddIvt(JSONObject where) {
|
||||
// 找当前托盘物料库存
|
||||
// MdPbStoragevehicleext extDao = iMdPbStoragevehicleextService.getOne(
|
||||
// new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||
// .eq(MdPbStoragevehicleext::getStoragevehicle_code, where.getString("storagevehicle_code"))
|
||||
// .eq(MdPbStoragevehicleext::getMaterial_id, where.getString("material_id"))
|
||||
// .eq(MdPbStoragevehicleext::getPcsn, where.getString("pcsn"))
|
||||
// );
|
||||
GroupPlate extDao = iMdPbGroupPlateService.getOne(
|
||||
new QueryWrapper<GroupPlate>().lambda()
|
||||
.eq(GroupPlate::getStoragevehicle_code, where.getString("storagevehicle_code"))
|
||||
@@ -236,7 +230,7 @@ public class UpdateIvtUtils {
|
||||
throw new BadRequestException("冻结数不能为负数,请检查变动数量!当前冻结数为【" + extDao.getFrozen_qty() + "】当前变动数为【" + where.getDoubleValue("change_qty") + "】");
|
||||
}
|
||||
// 加可用
|
||||
// double canuse_qty = NumberUtil.add(extDao.getCanuse_qty(), where.getDoubleValue("change_qty")).doubleValue();
|
||||
// double canuse_qty = NumberUtil.add(extDao.getQty(), where.getDoubleValue("change_qty")).doubleValue();
|
||||
extDao.setFrozen_qty(BigDecimal.ZERO);
|
||||
extDao.setQty(BigDecimal.valueOf(qty));
|
||||
extDao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
@@ -251,23 +245,23 @@ public class UpdateIvtUtils {
|
||||
* @param where 输入参数
|
||||
*/
|
||||
private void updateAddCanuseIvt(JSONObject where) {
|
||||
MdPbStoragevehicleext extDao = iMdPbStoragevehicleextService.getOne(
|
||||
new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||
.eq(MdPbStoragevehicleext::getStoragevehicle_code, where.getString("storagevehicle_code"))
|
||||
.eq(MdPbStoragevehicleext::getMaterial_id, where.getString("material_id"))
|
||||
.eq(MdPbStoragevehicleext::getPcsn, where.getString("pcsn"))
|
||||
GroupPlate extDao = iMdPbGroupPlateService.getOne(
|
||||
new QueryWrapper<GroupPlate>().lambda()
|
||||
.eq(GroupPlate::getStoragevehicle_code, where.getString("storagevehicle_code"))
|
||||
.eq(GroupPlate::getMaterial_id, where.getString("material_id"))
|
||||
.eq(GroupPlate::getPcsn, where.getString("pcsn"))
|
||||
);
|
||||
if (ObjectUtil.isEmpty(extDao)) {
|
||||
throw new BadRequestException("当前载具【"+extDao.getStoragevehicle_code()+"】不存在相关物料批次库存,请检查数据!");
|
||||
throw new BadRequestException("当前载具【" + extDao.getStoragevehicle_code() + "】不存在相关物料批次库存,请检查数据!");
|
||||
}
|
||||
|
||||
double canuse_qty = NumberUtil.add(extDao.getCanuse_qty(), where.getDoubleValue("change_qty")).doubleValue();
|
||||
extDao.setCanuse_qty(BigDecimal.valueOf(canuse_qty));
|
||||
double canuse_qty = NumberUtil.add(extDao.getQty(), where.getDoubleValue("change_qty")).doubleValue();
|
||||
extDao.setQty(BigDecimal.valueOf(canuse_qty));
|
||||
extDao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
extDao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
extDao.setUpdate_time(DateUtil.now());
|
||||
extDao.setRemark(where.getString("remark"));
|
||||
iMdPbStoragevehicleextService.updateById(extDao);
|
||||
iMdPbGroupPlateService.updateById(extDao);
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -275,26 +269,25 @@ public class UpdateIvtUtils {
|
||||
* @param where 输入参数
|
||||
*/
|
||||
private void updateSubCanuseIvt(JSONObject where) {
|
||||
MdPbStoragevehicleext extDao = iMdPbStoragevehicleextService.getOne(
|
||||
new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||
.eq(MdPbStoragevehicleext::getStoragevehicle_code, where.getString("storagevehicle_code"))
|
||||
.eq(MdPbStoragevehicleext::getMaterial_id, where.getString("material_id"))
|
||||
.eq(MdPbStoragevehicleext::getPcsn, where.getString("pcsn"))
|
||||
GroupPlate extDao = iMdPbGroupPlateService.getOne(
|
||||
new QueryWrapper<GroupPlate>().lambda()
|
||||
.eq(GroupPlate::getStoragevehicle_code, where.getString("storagevehicle_code"))
|
||||
.eq(GroupPlate::getMaterial_id, where.getString("material_id"))
|
||||
.eq(GroupPlate::getPcsn, where.getString("pcsn"))
|
||||
);
|
||||
if (ObjectUtil.isEmpty(extDao)) {
|
||||
throw new BadRequestException("当前载具【"+extDao.getStoragevehicle_code()+"】不存在相关物料批次库存,请检查数据!");
|
||||
throw new BadRequestException("当前载具【" + extDao.getStoragevehicle_code() + "】不存在相关物料批次库存,请检查数据!");
|
||||
}
|
||||
|
||||
double canuse_qty = NumberUtil.sub(extDao.getCanuse_qty(), where.getDoubleValue("change_qty")).doubleValue();
|
||||
double canuse_qty = NumberUtil.sub(extDao.getQty(), where.getDoubleValue("change_qty")).doubleValue();
|
||||
if (canuse_qty < 0) {
|
||||
throw new BadRequestException("可用数不能为负数,请检查变动数量!当前可用数为【"+extDao.getCanuse_qty()+"】当前变动数为【"+where.getDoubleValue("change_qty")+"】");
|
||||
throw new BadRequestException("可用数不能为负数,请检查变动数量!当前可用数为【" + extDao.getQty() + "】当前变动数为【" + where.getDoubleValue("change_qty") + "】");
|
||||
}
|
||||
extDao.setCanuse_qty(BigDecimal.valueOf(canuse_qty));
|
||||
extDao.setQty(BigDecimal.valueOf(canuse_qty));
|
||||
extDao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
extDao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
extDao.setUpdate_time(DateUtil.now());
|
||||
extDao.setRemark(where.getString("remark"));
|
||||
iMdPbStoragevehicleextService.updateById(extDao);
|
||||
iMdPbGroupPlateService.updateById(extDao);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user