forked from I3-YF/i3plus-mes-pcn-yfai
tags/yfai-pcn-ext-v1.0
parent
d7fd02ca2f
commit
599a4456fd
@ -0,0 +1,20 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.api.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartShippingGroup;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @CreateDate 2024/04/16
|
||||||
|
* @Author mingliang.li
|
||||||
|
*/
|
||||||
|
public interface IMesPartShippingGroupService {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询发运组数据")
|
||||||
|
public List<MesPartShippingGroup> findAll(DdlPackBean packBean);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.api.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingLoadingCheckModel;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesLoadingVehiclesOrder;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author :
|
||||||
|
* @CreateDate : 2024-04-26 15:37
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public interface IMesShippingLoadingCheckService {
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询装车单")
|
||||||
|
public MesShippingLoadingCheckModel queryLoadingOrderNo(MesLoadingVehiclesOrder loadingVehiclesOrder);
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询装车单-自动推单")
|
||||||
|
public MesLoadingVehiclesOrder queryLoadingOrderNoByAutoPushOrder(String shippingGroupNo, String org);
|
||||||
|
|
||||||
|
@ApiOperation(value = "扫描发运单")
|
||||||
|
public MesShippingLoadingCheckModel saveVehiclesOrderAndDetail(MesShippingLoadingCheckModel model, String org);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.api.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesSortShippingCheckModel;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesShippingOrderManagement;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author :
|
||||||
|
* @CreateDate : 2024-04-26 15:37
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public interface IMesSortShippingCheckService {
|
||||||
|
|
||||||
|
@ApiOperation(value = "扫描发运单")
|
||||||
|
public MesSortShippingCheckModel queryShippingOrderNo(MesShippingOrderManagement shippingOrderManagement);
|
||||||
|
|
||||||
|
@ApiOperation(value = "保存条码")
|
||||||
|
public MesSortShippingCheckModel saveSn(MesSortShippingCheckModel model, String org);
|
||||||
|
|
||||||
|
@ApiOperation(value = "保存条码和位置码")
|
||||||
|
public MesSortShippingCheckModel saveSnAndLocationCode(MesSortShippingCheckModel model, String org);
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询发运单-自动推单")
|
||||||
|
public MesShippingOrderManagement queryShippingOrderNoByAutoPushOrder(String shippingGroupNo, String org);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesPartShippingGroupService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartShippingGroup;
|
||||||
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author :
|
||||||
|
* @CreateDate : 2024-05-06 16:25
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Api("零件发运组")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/part-shipping-group")
|
||||||
|
public class MesPartShippingGroupController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesPartShippingGroupService shippingGroupService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation(value = "查询所有")
|
||||||
|
public ResultBean list(MesPartShippingGroup partShippingGroup) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
//默认查询所有
|
||||||
|
// DdlPackBean listAllPackBean = DdlPackBean.getDdlPackBean("CK01");
|
||||||
|
DdlPackBean listAllPackBean = DdlPackBean.getDdlPackBean(AuthUtil.getOrganizeCode());
|
||||||
|
;
|
||||||
|
return ResultBean.success("查询成功").setResultList(shippingGroupService.findAll(listAllPackBean));
|
||||||
|
} catch (ImppBusiException imppException) {
|
||||||
|
return ResultBean.fail(imppException);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,105 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesShippingLoadingCheckService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesRedisLockUtil;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingLoadingCheckModel;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesLoadingVehiclesOrder;
|
||||||
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@Api(tags = "装车校验")
|
||||||
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/shipping-loading-check")
|
||||||
|
@Slf4j
|
||||||
|
public class MesShippingLoadingCheckController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesShippingLoadingCheckService shippingLoadingCheckService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MesRedisLockUtil redisLockUtil;
|
||||||
|
|
||||||
|
@GetMapping("/query-loading-order")
|
||||||
|
@ApiOperation(value = "查询装车单")
|
||||||
|
public ResultBean queryLoadingOrderNo(MesLoadingVehiclesOrder loadingVehiclesOrder) {
|
||||||
|
|
||||||
|
String moduleKey = "shipping:loadingOrderNo:" + loadingVehiclesOrder.getLoadingOrderNo();
|
||||||
|
|
||||||
|
//加锁
|
||||||
|
boolean lockFlg = false;
|
||||||
|
try {
|
||||||
|
|
||||||
|
//加锁
|
||||||
|
lockFlg = redisLockUtil.redisLock(moduleKey);
|
||||||
|
|
||||||
|
// 数据校验
|
||||||
|
ValidatorBean.checkNotNull(loadingVehiclesOrder.getLoadingOrderNo(), "装车单不能为空");
|
||||||
|
loadingVehiclesOrder.setOrganizeCode(AuthUtil.getOrganizeCode());
|
||||||
|
|
||||||
|
MesShippingLoadingCheckModel model = shippingLoadingCheckService.queryLoadingOrderNo(loadingVehiclesOrder);
|
||||||
|
return ResultBean.success("查询成功").setResultObject(model);
|
||||||
|
} catch (ImppBusiException imppException) {
|
||||||
|
return ResultBean.fail(imppException);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
} finally {
|
||||||
|
//解锁
|
||||||
|
redisLockUtil.redisUnLock(lockFlg, moduleKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/scan-loading-order-detail")
|
||||||
|
@ApiOperation(value = "扫描装车单明细-发运单号")
|
||||||
|
public ResultBean saveLoadingOrderNoDetail(@RequestBody MesShippingLoadingCheckModel model) {
|
||||||
|
|
||||||
|
String moduleKey = "shipping:shippingOrderNo:" + model.getShippingOrderNo();
|
||||||
|
|
||||||
|
//加锁
|
||||||
|
boolean lockFlg = false;
|
||||||
|
try {
|
||||||
|
|
||||||
|
//加锁
|
||||||
|
lockFlg = redisLockUtil.redisLock(moduleKey);
|
||||||
|
|
||||||
|
// 数据校验
|
||||||
|
ValidatorBean.checkNotNull(model.getShippingOrderNo(), "发运单号不能为空");
|
||||||
|
ValidatorBean.checkNotNull(model.getVehiclesOrderDetailList(), "装车单明细不能为空");
|
||||||
|
String org = AuthUtil.getOrganizeCode();
|
||||||
|
shippingLoadingCheckService.saveVehiclesOrderAndDetail(model, org);
|
||||||
|
return ResultBean.success("查询成功").setResultObject(model);
|
||||||
|
} catch (ImppBusiException imppException) {
|
||||||
|
return ResultBean.fail(imppException);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
} finally {
|
||||||
|
//解锁
|
||||||
|
redisLockUtil.redisUnLock(lockFlg, moduleKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/query-auto-push-order")
|
||||||
|
@ApiOperation(value = "自动推单")
|
||||||
|
public ResultBean queryAutoPushOrder(String shippingGroupNo) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
MesLoadingVehiclesOrder order = shippingLoadingCheckService.queryLoadingOrderNoByAutoPushOrder(shippingGroupNo, AuthUtil.getOrganizeCode());
|
||||||
|
return ResultBean.success("查询成功").setResultObject(order);
|
||||||
|
} catch (ImppBusiException imppException) {
|
||||||
|
return ResultBean.fail(imppException);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,138 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesSortShippingCheckService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesRedisLockUtil;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesSortShippingCheckModel;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesShippingOrderManagement;
|
||||||
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@Api(tags = "排序发运校验")
|
||||||
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/sort-shipping-check")
|
||||||
|
@Slf4j
|
||||||
|
public class MesSortShippingCheckController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesSortShippingCheckService sortShippingCheckService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MesRedisLockUtil redisLockUtil;
|
||||||
|
|
||||||
|
@GetMapping("/query-loading-order")
|
||||||
|
@ApiOperation(value = "查询发运单")
|
||||||
|
public ResultBean queryLoadingOrderNo(MesShippingOrderManagement shippingOrderManagement) {
|
||||||
|
|
||||||
|
String moduleKey = "sortShippingCheck:loadingOrderNo:" + shippingOrderManagement.getShippingOrderNo();
|
||||||
|
|
||||||
|
//加锁
|
||||||
|
boolean lockFlg = false;
|
||||||
|
try {
|
||||||
|
|
||||||
|
//加锁
|
||||||
|
lockFlg = redisLockUtil.redisLock(moduleKey);
|
||||||
|
|
||||||
|
// 数据校验
|
||||||
|
ValidatorBean.checkNotNull(shippingOrderManagement.getShippingOrderNo(), "发运单不能为空");
|
||||||
|
shippingOrderManagement.setOrganizeCode(AuthUtil.getOrganizeCode());
|
||||||
|
|
||||||
|
MesSortShippingCheckModel model = sortShippingCheckService.queryShippingOrderNo(shippingOrderManagement);
|
||||||
|
return ResultBean.success("查询成功").setResultObject(model);
|
||||||
|
} catch (ImppBusiException imppException) {
|
||||||
|
return ResultBean.fail(imppException);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
} finally {
|
||||||
|
//解锁
|
||||||
|
redisLockUtil.redisUnLock(lockFlg, moduleKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/scan-sn")
|
||||||
|
@ApiOperation(value = "扫描条码")
|
||||||
|
public ResultBean saveSn(@RequestBody MesSortShippingCheckModel model) {
|
||||||
|
|
||||||
|
String moduleKey = "sortShippingCheck:sn:" + model.getSn();
|
||||||
|
|
||||||
|
//加锁
|
||||||
|
boolean lockFlg = false;
|
||||||
|
try {
|
||||||
|
|
||||||
|
//加锁
|
||||||
|
lockFlg = redisLockUtil.redisLock(moduleKey);
|
||||||
|
|
||||||
|
// 数据校验
|
||||||
|
ValidatorBean.checkNotNull(model.getShippingOrderNo(), "发运单不能为空");
|
||||||
|
ValidatorBean.checkNotNull(model.getDetailList(), "发运明细不能为空");
|
||||||
|
ValidatorBean.checkNotNull(model.getSn(), "条码不能为空");
|
||||||
|
|
||||||
|
sortShippingCheckService.saveSn(model, AuthUtil.getOrganizeCode());
|
||||||
|
return ResultBean.success("查询成功").setResultObject(model);
|
||||||
|
} catch (ImppBusiException imppException) {
|
||||||
|
return ResultBean.fail(imppException);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
} finally {
|
||||||
|
//解锁
|
||||||
|
redisLockUtil.redisUnLock(lockFlg, moduleKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/scan-location-code")
|
||||||
|
@ApiOperation(value = "扫描位置码")
|
||||||
|
public ResultBean saveLocationCode(@RequestBody MesSortShippingCheckModel model) {
|
||||||
|
|
||||||
|
String moduleKey = "sortShippingCheck:sn:" + model.getSn();
|
||||||
|
|
||||||
|
//加锁
|
||||||
|
boolean lockFlg = false;
|
||||||
|
try {
|
||||||
|
|
||||||
|
//加锁
|
||||||
|
lockFlg = redisLockUtil.redisLock(moduleKey);
|
||||||
|
|
||||||
|
// 数据校验
|
||||||
|
ValidatorBean.checkNotNull(model.getShippingOrderNo(), "发运单不能为空");
|
||||||
|
ValidatorBean.checkNotNull(model.getDetailList(), "发运明细不能为空");
|
||||||
|
ValidatorBean.checkNotNull(model.getSn(), "条码不能为空");
|
||||||
|
ValidatorBean.checkNotNull(model.getLocationCode(), "位置码不能为空");
|
||||||
|
|
||||||
|
sortShippingCheckService.saveSnAndLocationCode(model, AuthUtil.getOrganizeCode());
|
||||||
|
return ResultBean.success("查询成功").setResultObject(model);
|
||||||
|
} catch (ImppBusiException imppException) {
|
||||||
|
return ResultBean.fail(imppException);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
} finally {
|
||||||
|
//解锁
|
||||||
|
redisLockUtil.redisUnLock(lockFlg, moduleKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/query-auto-push-order")
|
||||||
|
@ApiOperation(value = "自动推单")
|
||||||
|
public ResultBean queryAutoPushOrder(String shippingGroupNo) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
MesShippingOrderManagement order = sortShippingCheckService.queryShippingOrderNoByAutoPushOrder(shippingGroupNo, AuthUtil.getOrganizeCode());
|
||||||
|
return ResultBean.success("查询成功").setResultObject(order);
|
||||||
|
} catch (ImppBusiException imppException) {
|
||||||
|
return ResultBean.fail(imppException);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesPartShippingGroupService;
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
||||||
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartShippingGroup;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.repository.MesPartShippingGroupRepository;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class MesPartShippingGroupService implements IMesPartShippingGroupService {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MesPartShippingGroupRepository shippingGroupRepository;
|
||||||
|
|
||||||
|
public List<MesPartShippingGroup> findAll( DdlPackBean packBean) {
|
||||||
|
List<MesPartShippingGroup> detailDeleteList = shippingGroupRepository.findByHqlWhere(packBean);
|
||||||
|
return detailDeleteList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.util;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ImppRedis;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author :
|
||||||
|
* @CreateDate : 2023-01-04 17:51
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
public class MesRedisLockUtil {
|
||||||
|
@Resource(name = "redisMesPcn")
|
||||||
|
private ImppRedis redisMes;
|
||||||
|
|
||||||
|
public Boolean redisLock(String moduleKey) {
|
||||||
|
//加锁
|
||||||
|
boolean lockFlg = redisMes.setIfAbsent(moduleKey, MesCommonConstant.EXPIRE_TIME);
|
||||||
|
//成功则返回true 失败则提示消息
|
||||||
|
if (!lockFlg) {
|
||||||
|
throw new ImppBusiException(MesCommonConstant.REDIS_LOCK_MESSAGE);
|
||||||
|
}
|
||||||
|
redisMes.expire(moduleKey, MesCommonConstant.EXPIRE_TIME);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void redisUnLock(boolean lockFlg, String moduleKey) {
|
||||||
|
//解锁
|
||||||
|
if (lockFlg) {
|
||||||
|
redisMes.deleteKey(moduleKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.pojo.constant;
|
||||||
|
|
||||||
|
|
||||||
|
public class MesCommonConstant {
|
||||||
|
|
||||||
|
//yanfeng
|
||||||
|
public static final String MES_YANFEN = "/mes-pcn/ext";
|
||||||
|
|
||||||
|
public static final Long EXPIRE_TIME = 60L;
|
||||||
|
|
||||||
|
public static final String REDIS_LOCK_MESSAGE = "已有人正在执行,请稍后再试";
|
||||||
|
|
||||||
|
public static final String TRUE_STRING = "1";
|
||||||
|
|
||||||
|
public static final String FALSE_STRING = "2";
|
||||||
|
|
||||||
|
public static final Integer TRUE_INTEGER = 1;
|
||||||
|
|
||||||
|
public static final Integer FALSE_INTEGER = 2;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.pojo.model;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesLoadingVehiclesOrderDetail;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author :
|
||||||
|
* @CreateDate : 2024-04-26 15:44
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class MesShippingLoadingCheckModel {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiParam("装车单")
|
||||||
|
private String loadingOrderNo;
|
||||||
|
|
||||||
|
@ApiParam("最近扫描完成的装车单号")
|
||||||
|
private String recentlyScanVehiclesOrder;
|
||||||
|
|
||||||
|
@ApiParam("发运单号")
|
||||||
|
private String shippingOrderNo;
|
||||||
|
|
||||||
|
@ApiParam("已扫描数量")
|
||||||
|
private Integer isScanCount = 0;
|
||||||
|
|
||||||
|
@ApiParam("装车单明细")
|
||||||
|
private List<MesLoadingVehiclesOrderDetail> vehiclesOrderDetailList;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.pojo.model;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesShippingOrderManagementDetail;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author :
|
||||||
|
* @CreateDate : 2024-04-26 15:44
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class MesSortShippingCheckModel {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiParam("发运单号")
|
||||||
|
private String shippingOrderNo;
|
||||||
|
@ApiParam("最近扫描完成的装车单号")
|
||||||
|
private String recentlyScanShippingOrderNo;
|
||||||
|
@ApiParam("条码")
|
||||||
|
private String sn;
|
||||||
|
@ApiParam("位置码")
|
||||||
|
private String locationCode;
|
||||||
|
|
||||||
|
@ApiParam("是否需要扫描槽位码")
|
||||||
|
private Boolean isScanLocationCode = false;
|
||||||
|
|
||||||
|
@ApiParam("发运组明细数据")
|
||||||
|
private List<MesShippingOrderManagementDetail> detailList;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,5 +1,259 @@
|
|||||||
package cn.estsh.i3plus.ext.mes.pcn.pojo.util;
|
package cn.estsh.i3plus.ext.mes.pcn.pojo.util;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
public class MesPcnExtEnumUtil {
|
public class MesPcnExtEnumUtil {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装车单-状态
|
||||||
|
*/
|
||||||
|
@JsonFormat(
|
||||||
|
shape = JsonFormat.Shape.OBJECT
|
||||||
|
)
|
||||||
|
public static enum LOADING_ORDER_STATUS {
|
||||||
|
CREATE(10, "创建"),
|
||||||
|
LOADING(15, "装车中"),
|
||||||
|
LOADED(20, "已装车"),
|
||||||
|
SHIPPING(30, "已发运"),
|
||||||
|
CLOSE(40, "关闭");
|
||||||
|
|
||||||
|
private int value;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
|
||||||
|
private LOADING_ORDER_STATUS(int value, String description) {
|
||||||
|
this.value = value;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String valueOfDescription(int val) {
|
||||||
|
String tmp = null;
|
||||||
|
|
||||||
|
for (int i = 0; i < values().length; ++i) {
|
||||||
|
if (values()[i].value == val) {
|
||||||
|
tmp = values()[i].description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return this.description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装车单明细-状态
|
||||||
|
*/
|
||||||
|
@JsonFormat(
|
||||||
|
shape = JsonFormat.Shape.OBJECT
|
||||||
|
)
|
||||||
|
public static enum LOADING_DETAIL_ORDER_STATUS {
|
||||||
|
CREATE(10, "创建"),
|
||||||
|
LOADED(20, "已装车"),
|
||||||
|
SHIPPING(30, "已发运"),
|
||||||
|
CLOSE(40, "关闭");
|
||||||
|
|
||||||
|
private int value;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
|
||||||
|
private LOADING_DETAIL_ORDER_STATUS(int value, String description) {
|
||||||
|
this.value = value;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String valueOfDescription(int val) {
|
||||||
|
String tmp = null;
|
||||||
|
|
||||||
|
for (int i = 0; i < values().length; ++i) {
|
||||||
|
if (values()[i].value == val) {
|
||||||
|
tmp = values()[i].description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return this.description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发运单状态
|
||||||
|
*/
|
||||||
|
@JsonFormat(
|
||||||
|
shape = JsonFormat.Shape.OBJECT
|
||||||
|
)
|
||||||
|
public static enum SHIPPING_ORDER_STATUS {
|
||||||
|
CREATE(10, "创建"),
|
||||||
|
PUBLISHED(20, "已发布"),
|
||||||
|
SHIPPED(30, "已发运"),
|
||||||
|
VERIFYING(35, "校验中"),
|
||||||
|
VERIFICATION_COMPLETED(40, "校验完成");
|
||||||
|
|
||||||
|
private int value;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private SHIPPING_ORDER_STATUS(int value, String description) {
|
||||||
|
this.value = value;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String valueOfDescription(int val) {
|
||||||
|
String tmp = null;
|
||||||
|
|
||||||
|
for (int i = 0; i < values().length; ++i) {
|
||||||
|
if (values()[i].value == val) {
|
||||||
|
tmp = values()[i].description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return this.description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装车单明细-发运状态
|
||||||
|
*/
|
||||||
|
@JsonFormat(
|
||||||
|
shape = JsonFormat.Shape.OBJECT
|
||||||
|
)
|
||||||
|
public static enum LOADING_ORDER_DETAIL_SHIPPING_STATUS {
|
||||||
|
PUBLISHED(10, "Published"),
|
||||||
|
SHIPPINGED(20, "Shippinged");
|
||||||
|
|
||||||
|
private int value;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private LOADING_ORDER_DETAIL_SHIPPING_STATUS(int value, String description) {
|
||||||
|
this.value = value;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String valueOfDescription(int val) {
|
||||||
|
String tmp = null;
|
||||||
|
|
||||||
|
for (int i = 0; i < values().length; ++i) {
|
||||||
|
if (values()[i].value == val) {
|
||||||
|
tmp = values()[i].description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return this.description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 零件发运组-扫描确认零件方式
|
||||||
|
*/
|
||||||
|
@JsonFormat(
|
||||||
|
shape = JsonFormat.Shape.OBJECT
|
||||||
|
)
|
||||||
|
public static enum PRODUCE_SN_STATUS {
|
||||||
|
CREATE(10, "创建"),
|
||||||
|
OFFLINE(20, "已完成"),
|
||||||
|
ASSEMBLY(30, "已装配"),
|
||||||
|
CHECKED(40, "已校验"),
|
||||||
|
SHIPPED(50, "发运");
|
||||||
|
|
||||||
|
private int value;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private PRODUCE_SN_STATUS(int value, String description) {
|
||||||
|
this.value = value;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String valueOfDescription(int val) {
|
||||||
|
String tmp = null;
|
||||||
|
|
||||||
|
for (int i = 0; i < values().length; ++i) {
|
||||||
|
if (values()[i].value == val) {
|
||||||
|
tmp = values()[i].description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return this.description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 零件发运组-扫描确认零件方式
|
||||||
|
*/
|
||||||
|
@JsonFormat(
|
||||||
|
shape = JsonFormat.Shape.OBJECT
|
||||||
|
)
|
||||||
|
public static enum PRODUCE_QC_STATUS {
|
||||||
|
QUALIFIED(10, "合格"),
|
||||||
|
SUSPICIOUS(20, "可疑"),
|
||||||
|
SCRAP(30, "报废");
|
||||||
|
|
||||||
|
private int value;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private PRODUCE_QC_STATUS(int value, String description) {
|
||||||
|
this.value = value;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String valueOfDescription(int val) {
|
||||||
|
String tmp = null;
|
||||||
|
|
||||||
|
for (int i = 0; i < values().length; ++i) {
|
||||||
|
if (values()[i].value == val) {
|
||||||
|
tmp = values()[i].description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return this.description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue