add:成品入库取消组盘
This commit is contained in:
@@ -126,7 +126,7 @@ public class MdPbBucketrecord implements Serializable {
|
||||
/**
|
||||
* 存储载具标识
|
||||
*/
|
||||
private Long storagevehicle_id;
|
||||
private String storagevehicle_id;
|
||||
|
||||
/**
|
||||
* 存储载具编码
|
||||
|
||||
@@ -67,7 +67,7 @@ public class MdPbBucketrecordServiceImpl extends ServiceImpl<MdPbBucketrecordMap
|
||||
dao.setCreate_id(Long.valueOf(SecurityUtils.getCurrentUserId()));
|
||||
dao.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
dao.setCreate_time(DateUtil.now());
|
||||
dao.setStoragevehicle_id(Long.valueOf(vehicleDao.getStoragevehicle_id()));
|
||||
dao.setStoragevehicle_id(vehicleDao.getStoragevehicle_id());
|
||||
dao.setStoragevehicle_code(vehicleDao.getStoragevehicle_code());
|
||||
dao.setMakeup_optid(Long.valueOf(SecurityUtils.getCurrentUserId()));
|
||||
dao.setMakeup_optname(SecurityUtils.getCurrentNickName());
|
||||
|
||||
@@ -90,6 +90,14 @@ public class IStivtlostorivnCpInController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/cancelConfirmvehicle")
|
||||
@Log("取消组盘")
|
||||
@ApiOperation("取消组盘")
|
||||
public ResponseEntity<Object> cancelConfirmvehicle(@RequestBody JSONObject whereJson){
|
||||
iStIvtIostorinvCpService.cancelConfirmvehicle(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/divStruct")
|
||||
@Log("分配")
|
||||
@ApiOperation("分配")
|
||||
|
||||
@@ -91,6 +91,15 @@ public interface IStIvtIostorinvCpService extends IService<StIvtIostorinvCp> {
|
||||
*/
|
||||
void confirmvehicle(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 取消组盘
|
||||
* @param whereJson
|
||||
* {
|
||||
* "dtl_row":{明细对象..}
|
||||
* }
|
||||
*/
|
||||
void cancelConfirmvehicle(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids
|
||||
@@ -144,4 +153,5 @@ public interface IStIvtIostorinvCpService extends IService<StIvtIostorinvCp> {
|
||||
* }
|
||||
*/
|
||||
void confirm(JSONObject whereJson);
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
@@ -202,6 +203,14 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
||||
/*
|
||||
处理有箱号分配明细: 要插入分配明细表
|
||||
*/
|
||||
|
||||
// 校验是否已经组盘
|
||||
StIvtIostorinvdisCp disIs = iostorinvdisCpService.getOne(
|
||||
new QueryWrapper<StIvtIostorinvdisCp>().lambda()
|
||||
.eq(StIvtIostorinvdisCp::getIostorinvdtl_id, jsonDtl.getString("iostorinvdtl_id"))
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(disIs)) throw new BadRequestException("此明细已组盘");
|
||||
|
||||
List<JSONObject> disDtlList = tableDisDtl
|
||||
.stream()
|
||||
.map(row -> (JSONObject) row)
|
||||
@@ -302,6 +311,55 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancelConfirmvehicle(JSONObject whereJson) {
|
||||
|
||||
// 1.校验是否分配了货位
|
||||
List<StIvtIostorinvdisCp> disDaoList = iostorinvdisCpService.list(
|
||||
new QueryWrapper<StIvtIostorinvdisCp>().lambda()
|
||||
.eq(StIvtIostorinvdisCp::getIostorinvdtl_id, whereJson.getString("iostorinvdtl_id"))
|
||||
);
|
||||
|
||||
if (ObjectUtil.isEmpty(disDaoList)) throw new BadRequestException("没有可取消组盘的分配明细!");
|
||||
|
||||
boolean is_struct = disDaoList.stream()
|
||||
.anyMatch(row -> ObjectUtil.isNotEmpty(row.getStruct_id()));
|
||||
|
||||
if (is_struct) throw new BadRequestException("有分配明细已分配货位不可取消组盘!");
|
||||
|
||||
// 2.更新载具扩展属性、 箱记录
|
||||
Map<String, List<StIvtIostorinvdisCp>> collect = disDaoList.stream().collect(Collectors.groupingBy(StIvtIostorinvdisCp::getStoragevehicle_code));
|
||||
|
||||
for (String storagevehicle_code : collect.keySet()) {
|
||||
// 更新载具扩展属性
|
||||
iMdPbStoragevehicleextService.update(
|
||||
new UpdateWrapper<MdPbStoragevehicleext>().lambda()
|
||||
.set(MdPbStoragevehicleext::getMaterial_id, "")
|
||||
.set(MdPbStoragevehicleext::getStorage_qty, "0")
|
||||
.eq(MdPbStoragevehicleext::getStoragevehicle_code, storagevehicle_code)
|
||||
);
|
||||
|
||||
// 更新箱记录表
|
||||
iMdPbBucketrecordService.update(
|
||||
new UpdateWrapper<MdPbBucketrecord>().lambda()
|
||||
.set(MdPbBucketrecord::getStoragevehicle_code, "")
|
||||
.set(MdPbBucketrecord::getStatus, MasterEnum.BOX_STATUS.code("生成"))
|
||||
.set(MdPbBucketrecord::getStoragevehicle_id, "")
|
||||
.eq(MdPbBucketrecord::getStatus, MasterEnum.BOX_STATUS.code("组盘"))
|
||||
.eq(MdPbBucketrecord::getStoragevehicle_code, storagevehicle_code)
|
||||
);
|
||||
}
|
||||
|
||||
// 3.删除分配表
|
||||
iostorinvdisCpService.remove(
|
||||
new QueryWrapper<StIvtIostorinvdisCp>().lambda()
|
||||
.eq(StIvtIostorinvdisCp::getIostorinvdtl_id, whereJson.getString("iostorinvdtl_id"))
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Long[] ids) {
|
||||
|
||||
for (Long id : ids) {
|
||||
@@ -331,7 +389,7 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
||||
);
|
||||
|
||||
if (ObjectUtil.isEmpty(daoVehicleExt)) {
|
||||
// throw new BadRequestException("此载具扩展属性不存在,请维护!");
|
||||
throw new BadRequestException("此载具扩展属性不存在,请维护!");
|
||||
} else {
|
||||
if (ObjectUtil.isNotEmpty(daoVehicleExt.getMaterial_id()))
|
||||
throw new BadRequestException("此载具已组盘!");
|
||||
|
||||
@@ -103,7 +103,7 @@ public class StIvtIostorinvdisdtlCpServiceImpl extends ServiceImpl<StIvtIostorin
|
||||
// 更新箱记录表
|
||||
iMdPbBucketrecordService.update(
|
||||
MdPbBucketrecord.builder()
|
||||
.storagevehicle_id(Long.getLong(vehicleDao.getStoragevehicle_id()))
|
||||
.storagevehicle_id(vehicleDao.getStoragevehicle_id())
|
||||
.status(MasterEnum.BOX_STATUS.code("组盘"))
|
||||
.storagevehicle_code(vehicleDao.getStoragevehicle_code())
|
||||
.instor_optid(Long.getLong(SecurityUtils.getCurrentUserId()))
|
||||
|
||||
Reference in New Issue
Block a user