单据详情修改,库存,预验收库存等创建

master
anthonywj 2 years ago
parent 3124dd50cb
commit 83868df12c

@ -0,0 +1,103 @@
package com.glxp.api.controller.inout;
import cn.hutool.core.util.StrUtil;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.Constant;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.req.inout.AddBizProductReqeust;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.service.basic.UdiRelevanceService;
import com.glxp.api.service.inout.IoOrderDetailBizService;
import com.glxp.api.service.inout.IoOrderService;
import com.glxp.api.util.GennerOrderUtils;
import com.glxp.api.util.OrderNoTypeBean;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Date;
/**
*
*/
@RestController
public class IoOrderDetailBizController extends BaseController {
@Resource
IoOrderService orderService;
@Resource
IoOrderDetailBizService orderDetailBizService;
@Resource
UdiRelevanceService udiRelevanceService;
@Resource
GennerOrderUtils gennerOrderUtils;
@Resource
private IBasicBussinessTypeService basicBussinessTypeService;
//录入业务单据详情
@AuthRuleAnnotation("")
@PostMapping("/udiwms/inout/order/addBizProduct")
public BaseResponse addBizProduct(@RequestBody AddBizProductReqeust addBizProductReqeust) {
AuthAdmin authAdmin = getUser();
if (addBizProductReqeust.getRelId() == null)
return ResultVOUtils.error(500, "未选择产品信息");
if (addBizProductReqeust.getOrderEntity() == null)
return ResultVOUtils.error(500, "未指定订单");
IoOrderEntity orderEntity = addBizProductReqeust.getOrderEntity();
if (StrUtil.isEmpty(orderEntity.getBillNo())) {
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd"));
orderEntity.setBillNo(orderNo);
orderEntity.setCreateUser(authAdmin.getId() + "");
orderEntity.setCreateTime(new Date());
}
UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(addBizProductReqeust.getRelId());
IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity();
ioOrderDetailBizEntity.setOrderIdFk(orderEntity.getBillNo());
ioOrderDetailBizEntity.setBindRlFk(udiRelevanceResponse.getId());
ioOrderDetailBizEntity.setUuidFk(udiRelevanceResponse.getUuid());
ioOrderDetailBizEntity.setCoName(udiRelevanceResponse.getCpmctymc());
ioOrderDetailBizEntity.setCertCode(udiRelevanceResponse.getZczbhhzbapzbh());
ioOrderDetailBizEntity.setYlqxzcrbarmc(udiRelevanceResponse.getYlqxzcrbarmc());
ioOrderDetailBizEntity.setManufacturer(udiRelevanceResponse.getManufactory());
ioOrderDetailBizEntity.setMeasname(udiRelevanceResponse.getMeasname());
ioOrderDetailBizEntity.setSpec(udiRelevanceResponse.getGgxh());
ioOrderDetailBizEntity.setPrice(udiRelevanceResponse.getPrice());
orderDetailBizService.insert(ioOrderDetailBizEntity);
orderEntity.setUpdateTime(new Date());
orderEntity.setUpdateUser(authAdmin.getId() + "");
orderService.insertOrUpdate(orderEntity);
return ResultVOUtils.success(orderEntity);
}
//修改业务单据详情
@AuthRuleAnnotation("")
@PostMapping("/udiwms/inout/order/updateBizProduct")
public BaseResponse updateBizProduct(@RequestBody IoOrderDetailBizEntity orderDetailBizEntity) {
boolean isExit = orderDetailBizService.isExit(orderDetailBizEntity.getBindRlFk(), orderDetailBizEntity.getBatchNo());
if (isExit) {
return ResultVOUtils.error(500, "存在相同产品,相同批次号,请检查后保存!");
}
return orderDetailBizService.update(orderDetailBizEntity) > 0 ? ResultVOUtils.success("保存成功!") : ResultVOUtils.error(500, "保存失败");
}
@AuthRuleAnnotation("")
@PostMapping("/udiwms/inout/order/delBizProduct")
public BaseResponse delBizProduct(@RequestBody DeleteRequest deleteRequest) {
return orderDetailBizService.deleteById(Integer.parseInt(deleteRequest.getId())) > 0 ? ResultVOUtils.success("保存成功!") : ResultVOUtils.error(500, "保存失败");
}
}

@ -4,9 +4,14 @@ import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.dao.inout.IoOrderDetailCodeDao;
import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
import com.glxp.api.entity.inout.IoOrderDetailCodeEntity;
import com.glxp.api.req.basic.UdiCombineRequest;
import com.glxp.api.req.inout.AddBizProductReqeust;
import com.glxp.api.res.PageSimpleResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@ -31,6 +36,6 @@ public class IoOrderDetailController {
}
//录入业务单据详情
}

@ -1,7 +1,6 @@
package com.glxp.api.dao.inout;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.inout.IoCodeEnttity;
import com.glxp.api.entity.inout.IoCodeTempEntity;
public interface IoCodeTempDao extends BaseMapperPlus<IoCodeTempDao, IoCodeTempEntity, IoCodeTempEntity> {

@ -1,7 +1,6 @@
package com.glxp.api.dao.inout;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.inout.IoCodeTempEntity;
import com.glxp.api.entity.inout.IoOrderDetailCodeEntity;
public interface IoOrderDetailCodeDao extends BaseMapperPlus<IoOrderDetailCodeDao, IoOrderDetailCodeEntity, IoOrderDetailCodeEntity> {

@ -1,11 +1,13 @@
package com.glxp.api.entity.basic;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
*
*/
@Data
public class UdiRlSupEntity {

@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;
@Data
@ -24,7 +26,7 @@ public class IoOrderDetailBizEntity implements Serializable {
* ID
*/
@TableField(value = "bindRlFk")
private String bindRlFk;
private Long bindRlFk;
/**
* DIUUID

@ -0,0 +1,79 @@
package com.glxp.api.entity.inv;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;
@Data
@TableName(value = "inv_prein_detail")
public class InvPreinDetailEntity implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
*
*/
@TableField(value = "code")
private String code;
/**
*
*/
@TableField(value = "orderId")
private String orderId;
/**
*
*/
@TableField(value = "nameCode")
private String nameCode;
/**
*
*/
@TableField(value = "batchNo")
private String batchNo;
/**
*
*/
@TableField(value = "produceDate")
private String produceDate;
/**
*
*/
@TableField(value = "expireDate")
private String expireDate;
/**
*
*/
@TableField(value = "serialNo")
private String serialNo;
/**
*
*/
@TableField(value = "relId")
private Integer relId;
/**
*
*/
@TableField(value = "`count`")
private Integer count;
/**
*
*/
@TableField(value = "reCount")
private Integer reCount;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,96 @@
package com.glxp.api.entity.inv;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
@Data
@TableName(value = "inv_prein_order")
public class InvPreinOrderEntity implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
*
*/
@TableField(value = "billNo")
private String billNo;
/**
*
*/
@TableField(value = "`action`")
private String action;
/**
*
*/
@TableField(value = "fromCorp")
private String fromCorp;
/**
*
*/
@TableField(value = "fromType")
private String fromType;
/**
*
*/
@TableField(value = "`createUser`")
private String createUser;
/**
*
*/
@TableField(value = "createTime")
private Date createTime;
/**
*
*/
@TableField(value = "updateUser")
private String updateUser;
/**
*
*/
@TableField(value = "updateTime")
private Date updateTime;
/**
*
*/
@TableField(value = "reviewUser")
private String reviewUser;
/**
*
*/
@TableField(value = "auditTime")
private Date auditTime;
/**
* ID
*/
@TableField(value = "customerId")
private Integer customerId;
/**
*
*/
@TableField(value = "invCode")
private String invCode;
/**
*
*/
@TableField(value = "remark")
private String remark;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,120 @@
package com.glxp.api.entity.inv;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
@Data
@TableName(value = "inv_product_detail")
public class InvProductDetailEntity implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
private Integer id;
/**
* UDI
*/
@TableField(value = "code")
private String code;
/**
*
*/
@TableField(value = "orderId")
private String orderId;
/**
* ID
*/
@TableField(value = "relId")
private String relId;
/**
*
*/
@TableField(value = "nameCode")
private String nameCode;
/**
*
*/
@TableField(value = "batchNo")
private String batchNo;
/**
*
*/
@TableField(value = "produceDate")
private Date produceDate;
/**
*
*/
@TableField(value = "expireDate")
private Date expireDate;
/**
*
*/
@TableField(value = "serialNo")
private String serialNo;
/**
*
*/
@TableField(value = "supId")
private Integer supId;
/**
*
*/
@TableField(value = "`count`")
private Integer count;
/**
*
*/
@TableField(value = "reCount")
private String reCount;
/**
*
*/
@TableField(value = "deptCode")
private String deptCode;
/**
*
*/
@TableField(value = "invCode")
private String invCode;
/**
*
*/
@TableField(value = "invSpaceCode")
private String invSpaceCode;
/**
*
*/
@TableField(value = "originCode")
private String originCode;
/**
*
*/
@TableField(value = "purchaseType")
private String purchaseType;
/**
*
*/
@TableField(value = "updateTime")
private Date updateTime;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,96 @@
package com.glxp.api.entity.inv;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
@Data
@TableName(value = "inv_product")
public class InvProductEntity implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
private Integer id;
/**
* ID
*/
@TableField(value = "relIdFk")
private String relIdFk;
/**
*
*/
@TableField(value = "nameCode")
private String nameCode;
/**
*
*/
@TableField(value = "batchNo")
private String batchNo;
/**
*
*/
@TableField(value = "productionDate")
private Date productionDate;
/**
*
*/
@TableField(value = "expireDate")
private Date expireDate;
/**
*
*/
@TableField(value = "inCount")
private String inCount;
/**
*
*/
@TableField(value = "outCount")
private String outCount;
/**
*
*/
@TableField(value = "reCount")
private String reCount;
/**
* ID
*/
@TableField(value = "customerId")
private Integer customerId;
/**
* ID
*/
@TableField(value = "supId")
private Integer supId;
/**
*
*/
@TableField(value = "deptCode")
private String deptCode;
/**
*
*/
@TableField(value = "invCode")
private String invCode;
/**
*
*/
@TableField(value = "updateTime")
private Date updateTime;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,13 @@
package com.glxp.api.req.inout;
import com.glxp.api.entity.inout.IoOrderEntity;
import lombok.Data;
@Data
public class AddBizProductReqeust {
private IoOrderEntity orderEntity;
private Long relId;
private String zczbhhzbapzbh;
}

@ -0,0 +1,10 @@
package com.glxp.api.req.inout;
import lombok.Data;
@Data
public class FilterOrderBizRequest {
private Long relId;
private String batchNo;
}

@ -1,9 +1,7 @@
package com.glxp.api.service.inout;
import com.glxp.api.entity.inout.IoCodeTempEntity;
import com.glxp.api.entity.inout.IoCodeTempEntity;
import com.glxp.api.req.inout.FilterIoCodeRequest;
import com.glxp.api.util.page.PageQuery;
import com.glxp.api.util.page.TableDataInfo;
import java.util.List;

@ -11,4 +11,8 @@ public interface IoOrderDetailBizService {
int insert(IoOrderDetailBizEntity orderDetailBizEntity);
int update(IoOrderDetailBizEntity orderDetailBizEntity);
int deleteById(Integer id);
boolean isExit(Long relId, String bacthNo);
}

@ -7,11 +7,13 @@ import java.util.List;
public interface IoOrderService {
List<IoOrderEntity> selectAll();
List<IoOrderEntity> selectAll();
IoOrderEntity findById(String orderId);
IoOrderEntity findByBillNo(String billNO);
int insertOrder(IoOrderEntity orderEntity);
int insertOrUpdate(IoOrderEntity orderEntity);
}

@ -5,13 +5,11 @@ import cn.hutool.core.util.StrUtil;
import com.glxp.api.constant.Constant;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.entity.basic.UdiEntity;
import com.glxp.api.entity.basic.UdiRlSupEntity;
import com.glxp.api.entity.inout.IoCodeEnttity;
import com.glxp.api.entity.inout.IoCodeTempEntity;
import com.glxp.api.entity.inout.IoOrderDetailCodeEntity;
import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.req.basic.CompanyProductRelevanceRequest;
import com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest;
import com.glxp.api.req.inout.PdaCodeEntity;
import com.glxp.api.req.inout.PostOrderRequest;
@ -19,18 +17,14 @@ import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.service.basic.UdiRelevanceService;
import com.glxp.api.service.basic.UdiRlSupService;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.util.CustomUtil;
import com.glxp.api.util.DateUtil;
import com.glxp.api.util.GennerOrderUtils;
import com.glxp.api.util.OrderNoTypeBean;
import com.glxp.api.util.udi.FilterUdiUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service

@ -1,10 +1,7 @@
package com.glxp.api.service.inout.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.glxp.api.dao.inout.IoCodeDao;
import com.glxp.api.dao.inout.IoCodeTempDao;
import com.glxp.api.entity.auth.SysDictData;
import com.glxp.api.entity.inout.IoCodeTempEntity;
import com.glxp.api.entity.inout.IoCodeTempEntity;
import com.glxp.api.req.inout.FilterIoCodeRequest;
import com.glxp.api.service.inout.IoCodeTempService;

@ -30,5 +30,16 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService {
return ioOrderDetailBizDao.updateById(orderDetailBizEntity);
}
@Override
public int deleteById(Integer id) {
return ioOrderDetailBizDao.deleteById(id);
}
@Override
public boolean isExit(Long relId, String bacthNo) {
return ioOrderDetailBizDao.exists(new QueryWrapper<IoOrderDetailBizEntity>().eq("bindRlFk", relId).eq("batchNo", bacthNo));
}
}

@ -2,6 +2,7 @@ package com.glxp.api.service.inout.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.glxp.api.dao.inout.IoOrderDao;
import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.service.inout.IoOrderService;
import org.springframework.stereotype.Service;
@ -34,4 +35,15 @@ public class IoOrderServiceImpl implements IoOrderService {
public int insertOrder(IoOrderEntity orderEntity) {
return orderDao.insert(orderEntity);
}
@Override
public int insertOrUpdate(IoOrderEntity orderEntity) {
IoOrderEntity temp = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().eq("billNo", orderEntity.getBillNo()));
if (temp == null) {
return orderDao.insert(orderEntity);
} else {
return orderDao.updateById(orderEntity);
}
}
}

Loading…
Cancel
Save