|
|
|
@ -74,10 +74,10 @@ public class IoOrderMutiController {
|
|
|
|
|
|
|
|
|
|
//查询物资信息
|
|
|
|
|
UdiProductEntity udiProductEntity = udiProductService.selectUdiByName(udiEntity.getUdi());
|
|
|
|
|
if(udiProductEntity.getUseMuti()==null || udiProductEntity.getUseMuti()==false){
|
|
|
|
|
if (udiProductEntity.getUseMuti() == null || udiProductEntity.getUseMuti() == false) {
|
|
|
|
|
return ResultVOUtils.error(999, "该产品不允许多次出库!");
|
|
|
|
|
}else{
|
|
|
|
|
if(udiProductEntity.getZdcfsycs() == null || udiProductEntity.getZdcfsycs().equals(0)){
|
|
|
|
|
} else {
|
|
|
|
|
if (udiProductEntity.getZdcfsycs() == null || udiProductEntity.getZdcfsycs().equals(0)) {
|
|
|
|
|
return ResultVOUtils.error(999, "该产品库存不足!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -94,6 +94,18 @@ public class IoOrderMutiController {
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtils.success(ioOrderMutiEntityOne.getId());
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
if(StrUtil.isNotBlank(ioOrderMutiEntity.getMark())){
|
|
|
|
|
QueryWrapper<IoOrderMutiEntity> ew1=new QueryWrapper<>();
|
|
|
|
|
ew1.eq("mark",ioOrderMutiEntity.getMark());
|
|
|
|
|
long count = ioOrderMutiService.count(ew1);
|
|
|
|
|
if(count>0){
|
|
|
|
|
return ResultVOUtils.error(999, "标志位已存在!");
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
return ResultVOUtils.error(999, "标志位不能为空!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ioOrderMutiEntityOne = new IoOrderMutiEntity();
|
|
|
|
|
ioOrderMutiEntityOne.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
ioOrderMutiEntityOne.setRelIdFk(udiProductEntity.getRelId());
|
|
|
|
@ -153,14 +165,26 @@ public class IoOrderMutiController {
|
|
|
|
|
UdiEntity udiEntity = FilterUdiUtils.getUdi(ioOrderMutiEntity.getUdiCode());
|
|
|
|
|
//查询物资信息
|
|
|
|
|
UdiProductEntity udiProductEntity = udiProductService.selectUdiByName(udiEntity.getUdi());
|
|
|
|
|
if(udiProductEntity.getUseMuti()==null || udiProductEntity.getUseMuti()==false){
|
|
|
|
|
if (udiProductEntity.getUseMuti() == null || udiProductEntity.getUseMuti() == false) {
|
|
|
|
|
return ResultVOUtils.error(999, "该产品不允许多次出库!");
|
|
|
|
|
}else{
|
|
|
|
|
if(udiProductEntity.getZdcfsycs() == null || udiProductEntity.getZdcfsycs().equals(0)){
|
|
|
|
|
} else {
|
|
|
|
|
if (udiProductEntity.getZdcfsycs() == null || udiProductEntity.getZdcfsycs().equals(0)) {
|
|
|
|
|
return ResultVOUtils.error(999, "该产品库存不足!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(StrUtil.isNotBlank(ioOrderMutiEntity.getMark())){
|
|
|
|
|
QueryWrapper<IoOrderMutiEntity> ew=new QueryWrapper<>();
|
|
|
|
|
ew.eq("mark",ioOrderMutiEntity.getMark());
|
|
|
|
|
long count = ioOrderMutiService.count(ew);
|
|
|
|
|
if(count>0){
|
|
|
|
|
return ResultVOUtils.error(999, "标志位已存在!");
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
return ResultVOUtils.error(999, "标志位不能为空!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IoOrderMutiEntity ioOrderMutiEntity1 = new IoOrderMutiEntity();
|
|
|
|
|
ioOrderMutiEntity1.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
ioOrderMutiEntity1.setRelIdFk(udiProductEntity.getRelId());
|
|
|
|
@ -189,18 +213,19 @@ public class IoOrderMutiController {
|
|
|
|
|
@PostMapping("/udiwms/inout/order/muti/updateOrderMuti")
|
|
|
|
|
public BaseResponse updateOrderMuti(@RequestBody IoOrderMutiEntity ioOrderMutiEntity) {
|
|
|
|
|
|
|
|
|
|
String orderNo =ioOrderMutiEntity.getOrderIdFk();
|
|
|
|
|
String orderNo = ioOrderMutiEntity.getOrderIdFk();
|
|
|
|
|
//如果是第一次的话就插入
|
|
|
|
|
String mark=ioOrderMutiEntity.getMark();
|
|
|
|
|
int totalCount=ioOrderMutiEntity.getTotalCount();
|
|
|
|
|
int useCount=ioOrderMutiEntity.getUseCount();
|
|
|
|
|
int status=ioOrderMutiEntity.getStatus();
|
|
|
|
|
ioOrderMutiEntity= ioOrderMutiService.getById(ioOrderMutiEntity.getId());
|
|
|
|
|
String mark = ioOrderMutiEntity.getMark();
|
|
|
|
|
int totalCount = ioOrderMutiEntity.getTotalCount();
|
|
|
|
|
int useCount = ioOrderMutiEntity.getUseCount();
|
|
|
|
|
int status = ioOrderMutiEntity.getStatus();
|
|
|
|
|
ioOrderMutiEntity = ioOrderMutiService.getById(ioOrderMutiEntity.getId());
|
|
|
|
|
ioOrderMutiEntity.setMark(mark);
|
|
|
|
|
ioOrderMutiEntity.setTotalCount(totalCount);
|
|
|
|
|
ioOrderMutiEntity.setUseCount(useCount);
|
|
|
|
|
ioOrderMutiEntity.setStatus(status);
|
|
|
|
|
if (StrUtil.isBlank(ioOrderMutiEntity.getOrderIdFk())) {
|
|
|
|
|
System.out.println("1111111111111111");
|
|
|
|
|
if (StrUtil.isBlank(ioOrderMutiEntity.getOrderIdFk()) && ioOrderMutiEntity.getStatus() == 1) {
|
|
|
|
|
IoOrderEntity orderEntity = new IoOrderEntity();
|
|
|
|
|
//查询补单条件
|
|
|
|
|
AuthAdmin authAdmin = customerService.getUserBean();
|
|
|
|
@ -263,7 +288,7 @@ public class IoOrderMutiController {
|
|
|
|
|
ioOrderMutiEntity.setUpdateUser(customerService.getUserId() + "");
|
|
|
|
|
boolean falg = ioOrderMutiService.updateById(ioOrderMutiEntity);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("22222222222222222222222");
|
|
|
|
|
QueryWrapper<IoOrderMutiUseEntity> ew = new QueryWrapper<>();
|
|
|
|
|
ew.eq("mutiIdFk", ioOrderMutiEntity.getId());
|
|
|
|
|
List<IoOrderMutiUseEntity> ioOrderMutiUseEntityList = ioOrderMutiUseService.list(ew);
|
|
|
|
@ -271,7 +296,7 @@ public class IoOrderMutiController {
|
|
|
|
|
ioOrderMutiUseEntity.setStatus(1);
|
|
|
|
|
}
|
|
|
|
|
ioOrderMutiUseService.updateBatchById(ioOrderMutiUseEntityList);
|
|
|
|
|
|
|
|
|
|
System.out.println("33333333333333333333333");
|
|
|
|
|
if (falg) {
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
} else {
|
|
|
|
@ -285,24 +310,24 @@ public class IoOrderMutiController {
|
|
|
|
|
|
|
|
|
|
//判断是不是个人使用
|
|
|
|
|
AuthAdmin authAdmin = customerService.getUserBean();
|
|
|
|
|
QueryWrapper<IoOrderMutiSetEntity> setEw=new QueryWrapper<>();
|
|
|
|
|
setEw.eq("curInv",authAdmin.getLocInvCode());
|
|
|
|
|
IoOrderMutiSetEntity ioOrderMutiSetEntity=ioOrderMutiSetService.getOne(setEw);
|
|
|
|
|
if(ioOrderMutiSetEntity!=null){
|
|
|
|
|
if(ioOrderMutiSetEntity.getCheckUse()==1){
|
|
|
|
|
ioOrderMutiRequest.setCreateUser(authAdmin.getId()+"");
|
|
|
|
|
QueryWrapper<IoOrderMutiSetEntity> setEw = new QueryWrapper<>();
|
|
|
|
|
setEw.eq("curInv", authAdmin.getLocInvCode());
|
|
|
|
|
IoOrderMutiSetEntity ioOrderMutiSetEntity = ioOrderMutiSetService.getOne(setEw);
|
|
|
|
|
if (ioOrderMutiSetEntity != null) {
|
|
|
|
|
if (ioOrderMutiSetEntity.getCheckUse() == 1) {
|
|
|
|
|
ioOrderMutiRequest.setCreateUser(authAdmin.getId() + "");
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
return ResultVOUtils.error(999,"请先设置多次出库单据类型!");
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(999, "请先设置多次出库单据类型!");
|
|
|
|
|
}
|
|
|
|
|
ioOrderMutiRequest.setStatus(0);
|
|
|
|
|
|
|
|
|
|
List<IoOrderMutiResponse> ioOrderMutiEntityList = ioOrderMutiService.filterList(ioOrderMutiRequest);
|
|
|
|
|
if(ioOrderMutiEntityList.size()<=0){
|
|
|
|
|
return ResultVOUtils.error(999,"该产品不存在此标识!");
|
|
|
|
|
if (ioOrderMutiEntityList.size() <= 0) {
|
|
|
|
|
return ResultVOUtils.error(999, "该产品不存在此标识!");
|
|
|
|
|
}
|
|
|
|
|
if(ioOrderMutiEntityList.get(0).getReCount()<=0){
|
|
|
|
|
return ResultVOUtils.error(999,"该产品可使用数量不足!");
|
|
|
|
|
if (ioOrderMutiEntityList.get(0).getReCount() <= 0) {
|
|
|
|
|
return ResultVOUtils.error(999, "该产品可使用数量不足!");
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtils.success(ioOrderMutiEntityList.get(0));
|
|
|
|
|
}
|
|
|
|
@ -331,18 +356,18 @@ public class IoOrderMutiController {
|
|
|
|
|
|
|
|
|
|
//判断是不是个人使用
|
|
|
|
|
AuthAdmin authAdmin = customerService.getUserBean();
|
|
|
|
|
QueryWrapper<IoOrderMutiSetEntity> setEw=new QueryWrapper<>();
|
|
|
|
|
setEw.eq("curInv",authAdmin.getLocInvCode());
|
|
|
|
|
IoOrderMutiSetEntity ioOrderMutiSetEntity=ioOrderMutiSetService.getOne(setEw);
|
|
|
|
|
if(ioOrderMutiSetEntity!=null){
|
|
|
|
|
if(ioOrderMutiSetEntity.getCheckUse()==1){
|
|
|
|
|
IoOrderMutiEntity ioOrderMutiEntity=ioOrderMutiService.getById(ioOrderMutiUseEntity.getMutiIdFk());
|
|
|
|
|
if(!ioOrderMutiEntity.getCreateUser().equals(authAdmin.getId()+"")){
|
|
|
|
|
return ResultVOUtils.error(999,"该单设置了个人使用,添加失败!");
|
|
|
|
|
QueryWrapper<IoOrderMutiSetEntity> setEw = new QueryWrapper<>();
|
|
|
|
|
setEw.eq("curInv", authAdmin.getLocInvCode());
|
|
|
|
|
IoOrderMutiSetEntity ioOrderMutiSetEntity = ioOrderMutiSetService.getOne(setEw);
|
|
|
|
|
if (ioOrderMutiSetEntity != null) {
|
|
|
|
|
if (ioOrderMutiSetEntity.getCheckUse() == 1) {
|
|
|
|
|
IoOrderMutiEntity ioOrderMutiEntity = ioOrderMutiService.getById(ioOrderMutiUseEntity.getMutiIdFk());
|
|
|
|
|
if (!ioOrderMutiEntity.getCreateUser().equals(authAdmin.getId() + "")) {
|
|
|
|
|
return ResultVOUtils.error(999, "该单设置了个人使用,添加失败!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
return ResultVOUtils.error(999,"请先设置多次出库单据类型!");
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(999, "请先设置多次出库单据类型!");
|
|
|
|
|
}
|
|
|
|
|
int sum = 0;
|
|
|
|
|
QueryWrapper<IoOrderMutiUseEntity> ew = new QueryWrapper<>();
|
|
|
|
@ -391,9 +416,9 @@ public class IoOrderMutiController {
|
|
|
|
|
@PostMapping("/udiwms/inout/order/muti/auditMuti")
|
|
|
|
|
public BaseResponse auditMuti(@RequestBody IoOrderMutiEntity ioOrderMutiEntity) {
|
|
|
|
|
ioOrderMutiEntity.setUpdateTime(new Date());
|
|
|
|
|
ioOrderMutiEntity.setUpdateUser(customerService.getUserId()+"");
|
|
|
|
|
ioOrderMutiEntity.setUpdateUser(customerService.getUserId() + "");
|
|
|
|
|
ioOrderMutiEntity.setAuditTime(new Date());
|
|
|
|
|
ioOrderMutiEntity.setAuditUser(customerService.getUserId()+"");
|
|
|
|
|
ioOrderMutiEntity.setAuditUser(customerService.getUserId() + "");
|
|
|
|
|
ioOrderMutiService.updateById(ioOrderMutiEntity);
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|