add:子卷包装解除功能

This commit is contained in:
zhangzq
2025-02-28 18:29:09 +08:00
parent 0d1852f1af
commit 54f83c435e
3 changed files with 43 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.nl.b_lms.pda.service.VehicleTwoService;
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
import org.nl.modules.logging.annotation.Log;
import org.springframework.beans.factory.annotation.Autowired;
@@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Map;
/**
* @author liuxy
@@ -29,8 +31,10 @@ public class VehicleTwoController {
@Autowired
private VehicleTwoService vehicleTwoService;
@Resource
@Autowired
private IbstIvtPackageinfoivtService bstIvtPackageInfoIvtService;
@Autowired
private IpdmBiSubpackagerelationService subpackagerelationService;
@PostMapping("/vehicleIn")
@@ -69,4 +73,11 @@ public class VehicleTwoController {
return new ResponseEntity<>(bstIvtPackageInfoIvtService.update(whereJson), HttpStatus.OK);
}
@PostMapping("/toEndSub")
@Log("二期子卷包装解绑")
@SaIgnore
public ResponseEntity<Object> toEndSub(@RequestBody JSONObject whereJson) {
Map result = subpackagerelationService.toEndSubpackagerelation(whereJson.getString("container_name"));
return new ResponseEntity<>(result, HttpStatus.OK);
}
}

View File

@@ -115,6 +115,13 @@ public interface IpdmBiSubpackagerelationService extends IService<PdmBiSubpackag
void createSubTest(JSONObject jo);
/**
* 解绑子卷包装
* @param code
*/
Map toEndSubpackagerelation(String code);
}

View File

@@ -27,6 +27,7 @@ import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper;
import org.nl.b_lms.pdm.subpackagerelation.dto.PdmBiSubpackagerelationDto;
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
import org.nl.b_lms.pdm_manage.enums.SUBEnum;
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
import org.nl.b_lms.sch.point.dao.mapper.BstIvtPackageinfoivtMapper;
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
@@ -45,6 +46,7 @@ import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.OutBoxMana
import org.nl.common.TableDataInfo;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.enums.PackageInfoIvtEnum;
import org.nl.common.utils.MapOf;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.core.bean.WQLObject;
@@ -58,6 +60,7 @@ import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@@ -701,6 +704,27 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
}
@Override
public Map toEndSubpackagerelation(String code) {
HashMap result = MapOf.of("status", HttpStatus.OK.value());
result.put("message", code+"子卷包装解除成功");
if (StringUtils.isEmpty(code)){
throw new BadRequestException("子卷编码不能为空");
}
PdmBiSubpackagerelation containerName = this.getOne(new QueryWrapper<PdmBiSubpackagerelation>().eq("container_name", code));
if (containerName==null){
throw new BadRequestException("当前子卷"+code+"还未生成子卷包装");
}
if (SUBEnum.STATUS.code("入库").equals(containerName.getStatus())
||SUBEnum.STATUS.code("出库").equals(containerName.getStatus())){
throw new BadRequestException("当前子卷"+code+"已完成出入库不允许手动解除");
}
if (StringUtils.isNotEmpty(containerName.getPackage_box_sn())){
result.put("message", code+"子卷包装解除成功,同时确认MES装箱以解绑定");
}
this.removeById(containerName.getWorkorder_id());
return result;
}
}