Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
be83f08860
|
|
@ -176,6 +176,12 @@ public class OrderGoods extends BaseEntity {
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endDateTime;
|
||||
|
||||
@ApiModelProperty(value = "采购合同编号")
|
||||
private String contractCode;
|
||||
|
||||
@ApiModelProperty("是否全部入库 查询条件 非空即查入库量小于订单量的数据")
|
||||
private Integer ifTotalIntoInventory;
|
||||
|
||||
private List<OrderGoodsDetail> orderGoodsDetailList;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,10 @@ public class OrderGoodsDetail extends BaseEntity {
|
|||
@ApiModelProperty(value = "订货单id")
|
||||
private Long orderGoodsId;
|
||||
|
||||
@Excel(name = "订货单编号")
|
||||
@ApiModelProperty(value = "订货单编号")
|
||||
private String orderGoodsCode;
|
||||
|
||||
/** 原料id */
|
||||
@Excel(name = "原料id")
|
||||
@ApiModelProperty(value = "原料id")
|
||||
|
|
|
|||
|
|
@ -110,6 +110,10 @@ public class InspectGoodsUpdate implements Serializable {
|
|||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@Excel(name = "采购订单Id,逗号分隔存储")
|
||||
@ApiModelProperty(value = "采购订单Id,逗号分隔存储")
|
||||
private String orderGoodsId;
|
||||
|
||||
private List<InspectGoodsDetailUpdate> inspectGoodsDetails;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,6 +144,9 @@ public class OrderGoodsAdd implements Serializable {
|
|||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "采购合同编号")
|
||||
private String contractCode;
|
||||
|
||||
private List<OrderGoodsDetailAdd> orderGoodsDetailList;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,4 +68,6 @@ public class OrderGoodsQuery implements Serializable {
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endDateTime;
|
||||
|
||||
@ApiModelProperty("是否全部入库 查询条件 非空即查入库量小于订单量的数据")
|
||||
private Integer ifTotalIntoInventory;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,6 +145,13 @@ public class OrderGoodsUpdate implements Serializable {
|
|||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "采购合同编号")
|
||||
private String contractCode;
|
||||
|
||||
@Excel(name = "采购计划编号,逗号分隔存储")
|
||||
@ApiModelProperty(value = "采购计划编号,逗号分隔存储")
|
||||
private String purchasePlanCode;
|
||||
|
||||
private List<OrderGoodsDetailUpdate> orderGoodsDetailList;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -90,6 +91,11 @@ public class ProductionPlanUpdate extends BaseEntity {
|
|||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "货品类型(1 菜品 2 商品 )")
|
||||
@Excel(name = "货品类型(1 菜品 2 商品 )")
|
||||
@NotNull(message = "货品类型不能为空")
|
||||
private Integer goodsType;
|
||||
|
||||
@ApiModelProperty(value = "生成计划详情列表")
|
||||
private List<ProductionPlanDetailAdd> productionPlanDetailAddList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class PurchasePlanUpdate implements Serializable {
|
|||
/** 采购计划Id,逗号分隔存储 */
|
||||
@Excel(name = "采购计划Id,逗号分隔存储")
|
||||
@ApiModelProperty(value = "采购计划Id,逗号分隔存储")
|
||||
private String productionPlanId;
|
||||
private String productionPlanCode;
|
||||
|
||||
/** 采购审批状态(1待审批,2审批中,3审批同意,4审批拒绝) */
|
||||
@Excel(name = "采购审批状态(1待审批,2审批中,3审批同意,4审批拒绝)")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
package com.bonus.canteen.core.ims.domain.vo;
|
||||
|
||||
import com.bonus.canteen.core.ims.domain.InspectGoodsDetail;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 验货单对象 ims_inspect_goods
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-30
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class InspectGoodsSum {
|
||||
|
||||
/** 累计合格总数量 */
|
||||
@ApiModelProperty(value = "累计合格总数量")
|
||||
private BigDecimal totalQualifiedNum;
|
||||
|
||||
/** 累计合格总数量 */
|
||||
@ApiModelProperty(value = "货品累计合格总数量")
|
||||
private Map<Long, BigDecimal> individualTotalQualifiedNum;
|
||||
|
||||
}
|
||||
|
|
@ -29,6 +29,10 @@ public class OrderGoodsDetailVO extends BaseEntity {
|
|||
@ApiModelProperty(value = "订货单id")
|
||||
private Long orderGoodsId;
|
||||
|
||||
@Excel(name = "订货单编号")
|
||||
@ApiModelProperty(value = "订货单编号")
|
||||
private String orderGoodsCode;
|
||||
|
||||
/** 原料id */
|
||||
@Excel(name = "原料id")
|
||||
@ApiModelProperty(value = "原料id")
|
||||
|
|
@ -95,4 +99,7 @@ public class OrderGoodsDetailVO extends BaseEntity {
|
|||
@ApiModelProperty(value = "货品类型")
|
||||
private String materialTypeName;
|
||||
|
||||
@ApiModelProperty(value = "累计合格总数量")
|
||||
private BigDecimal totalQualifiedNum;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,6 +174,12 @@ public class OrderGoodsVO extends BaseEntity {
|
|||
@ApiModelProperty(value = "采购计划编号列表")
|
||||
private List<String> purchasePlanCodeList;
|
||||
|
||||
@ApiModelProperty(value = "采购合同编号")
|
||||
private String contractCode;
|
||||
|
||||
@ApiModelProperty(value = "累计合格总数量")
|
||||
private BigDecimal totalQualifiedNum;
|
||||
|
||||
private List<OrderGoodsDetailVO> orderGoodsDetailList;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,10 +45,10 @@ public interface ProductionPurchaseOrderMapper {
|
|||
/**
|
||||
* 删除生产-采购-订单关联
|
||||
*
|
||||
* @param id 生产-采购-订单关联主键
|
||||
* @param productionPurchaseOrder 生产-采购-订单关联主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProductionPurchaseOrderById(Long id);
|
||||
public int deleteProductionPurchaseOrderById(ProductionPurchaseOrder productionPurchaseOrder);
|
||||
|
||||
/**
|
||||
* 批量删除生产-采购-订单关联
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
import com.bonus.canteen.core.ims.domain.InspectGoods;
|
||||
import com.bonus.canteen.core.ims.domain.param.InspectGoodsAdd;
|
||||
import com.bonus.canteen.core.ims.domain.param.InspectGoodsUpdate;
|
||||
import com.bonus.canteen.core.ims.domain.vo.InspectGoodsSum;
|
||||
import com.bonus.canteen.core.ims.domain.vo.InspectGoodsVO;
|
||||
|
||||
/**
|
||||
|
|
@ -60,4 +61,6 @@ public interface IInspectGoodsService {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteInspectGoodsByInspectGoodsId(Long inspectGoodsId);
|
||||
|
||||
public InspectGoodsSum getInspectGoodsListByOrderGoodsCode(String orderGoodsCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,5 +56,5 @@ public interface IProductionPurchaseOrderService {
|
|||
* @param id 生产-采购-订单关联主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProductionPurchaseOrderById(Long id);
|
||||
public int deleteProductionPurchaseOrderById(ProductionPurchaseOrder productionPurchaseOrder);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,16 @@ import java.math.BigDecimal;
|
|||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.canteen.core.ims.domain.OrderGoods;
|
||||
import com.bonus.canteen.core.ims.domain.OrderGoodsDetail;
|
||||
import com.bonus.canteen.core.ims.domain.param.*;
|
||||
import com.bonus.canteen.core.ims.domain.vo.ImsIntoInventoryDetailVO;
|
||||
import com.bonus.canteen.core.ims.domain.vo.ImsIntoInventoryVO;
|
||||
import com.bonus.canteen.core.ims.service.IImsInventoryService;
|
||||
import com.bonus.canteen.core.ims.domain.vo.OrderGoodsDetailVO;
|
||||
import com.bonus.canteen.core.ims.domain.vo.OrderGoodsVO;
|
||||
import com.bonus.canteen.core.ims.mapper.OrderGoodsDetailMapper;
|
||||
import com.bonus.canteen.core.ims.mapper.OrderGoodsMapper;
|
||||
import com.bonus.canteen.core.ims.service.*;
|
||||
import com.bonus.canteen.core.ims.utils.NoGenerateUtils;
|
||||
import com.bonus.canteen.core.kitchen.domain.constants.CommonFlagEnum;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
|
|
@ -25,7 +31,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import com.bonus.canteen.core.ims.domain.ImsIntoInventoryDetail;
|
||||
import com.bonus.canteen.core.ims.mapper.ImsIntoInventoryMapper;
|
||||
import com.bonus.canteen.core.ims.domain.ImsIntoInventory;
|
||||
import com.bonus.canteen.core.ims.service.IImsIntoInventoryService;
|
||||
|
||||
/**
|
||||
* 入库记录Service业务层处理
|
||||
|
|
@ -40,6 +45,16 @@ public class ImsIntoInventoryServiceImpl implements IImsIntoInventoryService
|
|||
private ImsIntoInventoryMapper imsIntoInventoryMapper;
|
||||
@Autowired
|
||||
private IImsInventoryService imsInventoryService;
|
||||
@Autowired
|
||||
private OrderGoodsMapper orderGoodsMapper;
|
||||
@Autowired
|
||||
private OrderGoodsDetailMapper orderGoodsDetailMapper;
|
||||
@Autowired
|
||||
private IInspectGoodsService inspectGoodsService;
|
||||
@Autowired
|
||||
private IOrderGoodsService orderGoodsService;
|
||||
@Autowired
|
||||
private IOrderGoodsDetailService orderGoodsDetailService;
|
||||
|
||||
/**
|
||||
* 查询入库记录
|
||||
|
|
@ -83,7 +98,7 @@ public class ImsIntoInventoryServiceImpl implements IImsIntoInventoryService
|
|||
imsIntoInventory.setCreateBy(SecurityUtils.getUsername());
|
||||
imsIntoInventory.setIntoCode(NoGenerateUtils.generateIntoCode());
|
||||
int rows = imsIntoInventoryMapper.insertImsIntoInventory(imsIntoInventory);
|
||||
insertImsIntoInventoryDetail(imsIntoInventoryAdd.getImsIntoInventoryDetailAddList(), imsIntoInventory);
|
||||
insertImsIntoInventoryDetail(imsIntoInventoryAdd.getImsIntoInventoryDetailAddList(), imsIntoInventory, null);
|
||||
return rows;
|
||||
}
|
||||
|
||||
|
|
@ -113,7 +128,7 @@ public class ImsIntoInventoryServiceImpl implements IImsIntoInventoryService
|
|||
imsIntoInventory.setUpdateBy(SecurityUtils.getUsername());
|
||||
imsIntoInventory.setIntoCode(imsIntoInventoryVO.getIntoCode());
|
||||
imsIntoInventoryMapper.deleteImsIntoInventoryDetailByIntoId(imsIntoInventory.getIntoId());
|
||||
insertImsIntoInventoryDetail(imsIntoInventoryUpdate.getImsIntoInventoryDetailAddList(), imsIntoInventory);
|
||||
insertImsIntoInventoryDetail(imsIntoInventoryUpdate.getImsIntoInventoryDetailAddList(), imsIntoInventory, imsIntoInventoryVO);
|
||||
return imsIntoInventoryMapper.updateImsIntoInventory(imsIntoInventory);
|
||||
}
|
||||
|
||||
|
|
@ -157,7 +172,9 @@ public class ImsIntoInventoryServiceImpl implements IImsIntoInventoryService
|
|||
*
|
||||
* @param imsIntoInventory 入库记录对象
|
||||
*/
|
||||
public void insertImsIntoInventoryDetail(List<ImsIntoInventoryDetailAdd> imsIntoInventoryDetailAddList, ImsIntoInventory imsIntoInventory)
|
||||
public void insertImsIntoInventoryDetail(List<ImsIntoInventoryDetailAdd> imsIntoInventoryDetailAddList,
|
||||
ImsIntoInventory imsIntoInventory,
|
||||
ImsIntoInventoryVO imsIntoInventoryVO)
|
||||
{
|
||||
if (StringUtils.isNotNull(imsIntoInventoryDetailAddList))
|
||||
{
|
||||
|
|
@ -197,6 +214,8 @@ public class ImsIntoInventoryServiceImpl implements IImsIntoInventoryService
|
|||
imsInventoryAdd.setUnitId(imsIntoInventoryDetail.getUnitId());
|
||||
Long inventoryId = imsInventoryService.insertImsInventory(imsInventoryAdd);
|
||||
imsIntoInventoryDetail.setInventoryId(inventoryId);
|
||||
updateOrderGoodsDetail(imsIntoInventoryDetail, imsIntoInventory, imsIntoInventoryVO);
|
||||
updateOrderGoods(imsIntoInventory, imsIntoInventoryVO);
|
||||
}
|
||||
}
|
||||
if (!list.isEmpty())
|
||||
|
|
@ -205,4 +224,54 @@ public class ImsIntoInventoryServiceImpl implements IImsIntoInventoryService
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateOrderGoods(ImsIntoInventory imsIntoInventory,
|
||||
ImsIntoInventoryVO imsIntoInventoryVO) {
|
||||
if(Objects.isNull(imsIntoInventoryVO) || StringUtils.isBlank(imsIntoInventory.getRelateOrderGoodsId())) {
|
||||
return;
|
||||
}
|
||||
OrderGoods orderGoods = new OrderGoods();
|
||||
orderGoods.setOrderGoodsCode(imsIntoInventory.getRelateOrderGoodsId());
|
||||
orderGoods.setOrderStatus(2L);
|
||||
List<OrderGoodsVO> orderGoodsList = orderGoodsService.selectOrderGoodsList(orderGoods);
|
||||
if(CollUtil.isEmpty(orderGoodsList) || orderGoodsList.size() > 1) {
|
||||
throw new ServiceException("关联采购单错误, 采购单不存在或存在多条相同采购订单");
|
||||
}
|
||||
OrderGoodsVO orderGoodsVO = orderGoodsList.get(0);
|
||||
OrderGoods orderGoodsUpdate = new OrderGoods();
|
||||
orderGoodsUpdate.setTotalIntoNum(imsIntoInventory.getTotalNum());
|
||||
orderGoodsUpdate.setOrderGoodsId(orderGoodsVO.getOrderGoodsId());
|
||||
// if((orderGoodsVO.getTotalIntoNum().add(imsIntoInventory.getTotalNum())
|
||||
// .compareTo(orderGoodsVO.getTotalNum().multiply(BigDecimal.valueOf(0.95))
|
||||
// )) >= 0) {
|
||||
// orderGoodsUpdate.setIfAllInspect(1L);
|
||||
// }
|
||||
orderGoodsMapper.updateOrderGoods(orderGoodsUpdate);
|
||||
}
|
||||
|
||||
private void updateOrderGoodsDetail(ImsIntoInventoryDetail imsIntoInventoryDetail,
|
||||
ImsIntoInventory imsIntoInventory,
|
||||
ImsIntoInventoryVO imsIntoInventoryVO) {
|
||||
if(Objects.isNull(imsIntoInventoryVO) || StringUtils.isBlank(imsIntoInventory.getRelateOrderGoodsId())) {
|
||||
return;
|
||||
}
|
||||
OrderGoodsDetail orderGoodsDetailQuery = new OrderGoodsDetail();
|
||||
orderGoodsDetailQuery.setOrderGoodsCode(imsIntoInventory.getRelateOrderGoodsId());
|
||||
orderGoodsDetailQuery.setMaterialId(imsIntoInventoryDetail.getMaterialId());
|
||||
List<OrderGoodsDetailVO> orderGoodsDetailList = orderGoodsDetailService
|
||||
.selectOrderGoodsDetailList(orderGoodsDetailQuery);
|
||||
if(CollUtil.isEmpty(orderGoodsDetailList) || orderGoodsDetailList.size() > 1) {
|
||||
throw new ServiceException("关联采购单详情错误, 采购单详情不存在或存在多条相同采购订单详情");
|
||||
}
|
||||
OrderGoodsDetailVO orderGoodsDetailVO = orderGoodsDetailList.get(0);
|
||||
OrderGoodsDetail orderGoodsDetailsUpdate = new OrderGoodsDetail();
|
||||
orderGoodsDetailsUpdate.setIntoNum(imsIntoInventoryDetail.getPurNum());
|
||||
orderGoodsDetailsUpdate.setOrderGoodsDetailId(orderGoodsDetailVO.getOrderGoodsDetailId());
|
||||
// if((orderGoodsDetailVO.getIntoNum().add(imsIntoInventoryDetail.getPurNum())
|
||||
// .compareTo(orderGoodsDetailVO.getOrderNum().multiply(BigDecimal.valueOf(0.95))
|
||||
// )) >= 0) {
|
||||
// orderGoodsDetailsUpdate.setIfAllInspect(1L);
|
||||
// }
|
||||
orderGoodsDetailMapper.updateOrderGoodsDetail(orderGoodsDetailsUpdate);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
package com.bonus.canteen.core.ims.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.canteen.core.ims.domain.InspectGoodsDetail;
|
||||
|
|
@ -13,6 +16,7 @@ import com.bonus.canteen.core.ims.domain.param.InspectGoodsDetailAdd;
|
|||
import com.bonus.canteen.core.ims.domain.param.InspectGoodsDetailUpdate;
|
||||
import com.bonus.canteen.core.ims.domain.param.InspectGoodsUpdate;
|
||||
import com.bonus.canteen.core.ims.domain.vo.InspectGoodsDetailVO;
|
||||
import com.bonus.canteen.core.ims.domain.vo.InspectGoodsSum;
|
||||
import com.bonus.canteen.core.ims.domain.vo.InspectGoodsVO;
|
||||
import com.bonus.canteen.core.ims.domain.vo.OrderGoodsDetailVO;
|
||||
import com.bonus.canteen.core.ims.enums.SupplierOrderGenerateTypeEnum;
|
||||
|
|
@ -156,6 +160,20 @@ public class InspectGoodsServiceImpl implements IInspectGoodsService {
|
|||
inspectGoodsDetailService.insertInspectGoodsDetail(inspectGoodsDetail);
|
||||
}
|
||||
}
|
||||
ProductionPurchaseOrder productionPurchaseOrderQuery = new ProductionPurchaseOrder();
|
||||
productionPurchaseOrderQuery.setInspectGoodsId(inspectGoodsVO.getInspectGoodsCode());
|
||||
productionPurchaseOrderService.deleteProductionPurchaseOrderById(productionPurchaseOrderQuery);
|
||||
String orderGoodsIdStr = inspectGoodsUpdate.getOrderGoodsId();
|
||||
if(StringUtils.isNotBlank(orderGoodsIdStr)) {
|
||||
String[] orderGoodsIds = orderGoodsIdStr.split(",");
|
||||
for(String orderGoodId : orderGoodsIds) {
|
||||
ProductionPurchaseOrder productionPurchaseOrder = new ProductionPurchaseOrder();
|
||||
productionPurchaseOrder.setGoodsOrderId(orderGoodId);
|
||||
productionPurchaseOrder.setInspectGoodsId(String.valueOf(inspectGoods.getInspectGoodsId()));
|
||||
productionPurchaseOrder.setOrderType(SupplierOrderGenerateTypeEnum.PURCHASE_TO_INSPECT.getKey());
|
||||
productionPurchaseOrderService.insertProductionPurchaseOrder(productionPurchaseOrder);
|
||||
}
|
||||
}
|
||||
return inspectGoodsMapper.updateInspectGoods(inspectGoods);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
|
|
@ -187,4 +205,39 @@ public class InspectGoodsServiceImpl implements IInspectGoodsService {
|
|||
inspectGoodsDetailService.deleteInspectGoodsDetailByInspectGoodsId(inspectGoodsId);
|
||||
return inspectGoodsMapper.deleteInspectGoodsByInspectGoodsId(inspectGoodsId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InspectGoodsSum getInspectGoodsListByOrderGoodsCode(String orderGoodsCode) {
|
||||
InspectGoods inspectGoods = new InspectGoods();
|
||||
inspectGoods.setRelateOrderGoodsId(orderGoodsCode);
|
||||
List<InspectGoodsVO> inspectGoodsList = inspectGoodsMapper.selectInspectGoodsList(inspectGoods);
|
||||
InspectGoodsSum inspectGoodsSum = null;
|
||||
if(CollUtil.isNotEmpty(inspectGoodsList)) {
|
||||
inspectGoodsSum = new InspectGoodsSum();
|
||||
BigDecimal totalInspectQualifiedNum = inspectGoodsList.stream()
|
||||
.map(InspectGoodsVO::getInspectQualifiedNum)
|
||||
.filter(Objects::nonNull)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
inspectGoodsSum.setTotalQualifiedNum(totalInspectQualifiedNum);
|
||||
List<InspectGoodsDetailVO> inspectGoodsDetailListTotal = new ArrayList<>();
|
||||
for(InspectGoodsVO inspectGoodsVO : inspectGoodsList) {
|
||||
InspectGoodsDetail inspectGoodsDetail = new InspectGoodsDetail();
|
||||
inspectGoodsDetail.setInspectGoodsId(inspectGoodsVO.getInspectGoodsId());
|
||||
List<InspectGoodsDetailVO> inspectGoodsDetailList = inspectGoodsDetailService
|
||||
.selectInspectGoodsDetailList(inspectGoodsDetail);
|
||||
inspectGoodsDetailListTotal.addAll(inspectGoodsDetailList);
|
||||
}
|
||||
Map<Long, BigDecimal> result = inspectGoodsDetailListTotal.stream()
|
||||
.filter(detail -> detail.getMaterialId() != null && detail.getQualifiedNum() != null)
|
||||
.collect(Collectors.groupingBy(
|
||||
InspectGoodsDetailVO::getMaterialId,
|
||||
Collectors.mapping(
|
||||
InspectGoodsDetailVO::getQualifiedNum,
|
||||
Collectors.reducing(BigDecimal.ZERO, BigDecimal::add)
|
||||
)
|
||||
));
|
||||
inspectGoodsSum.setIndividualTotalQualifiedNum(result);
|
||||
}
|
||||
return inspectGoodsSum;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.canteen.core.ims.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -12,9 +14,11 @@ import com.bonus.canteen.core.ims.domain.param.OrderGoodsAdd;
|
|||
import com.bonus.canteen.core.ims.domain.param.OrderGoodsDetailAdd;
|
||||
import com.bonus.canteen.core.ims.domain.param.OrderGoodsDetailUpdate;
|
||||
import com.bonus.canteen.core.ims.domain.param.OrderGoodsUpdate;
|
||||
import com.bonus.canteen.core.ims.domain.vo.InspectGoodsSum;
|
||||
import com.bonus.canteen.core.ims.domain.vo.OrderGoodsDetailVO;
|
||||
import com.bonus.canteen.core.ims.domain.vo.OrderGoodsVO;
|
||||
import com.bonus.canteen.core.ims.enums.SupplierOrderGenerateTypeEnum;
|
||||
import com.bonus.canteen.core.ims.service.IInspectGoodsService;
|
||||
import com.bonus.canteen.core.ims.service.IOrderGoodsDetailService;
|
||||
import com.bonus.canteen.core.ims.service.IProductionPurchaseOrderService;
|
||||
import com.bonus.canteen.core.ims.utils.NoGenerateUtils;
|
||||
|
|
@ -44,6 +48,8 @@ public class OrderGoodsServiceImpl implements IOrderGoodsService {
|
|||
private IOrderGoodsDetailService inspectGoodsDetailService;
|
||||
@Autowired
|
||||
private IProductionPurchaseOrderService productionPurchaseOrderService;
|
||||
@Autowired
|
||||
private IInspectGoodsService inspectGoodsService;
|
||||
|
||||
/**
|
||||
* 查询采购订单主
|
||||
|
|
@ -58,6 +64,20 @@ public class OrderGoodsServiceImpl implements IOrderGoodsService {
|
|||
OrderGoodsDetail orderGoodsDetail = new OrderGoodsDetail();
|
||||
orderGoodsDetail.setOrderGoodsId(orderGoodsVO.getOrderGoodsId());
|
||||
List<OrderGoodsDetailVO> orderGoodsDetails = inspectGoodsDetailService.selectOrderGoodsDetailList(orderGoodsDetail);
|
||||
if(CollUtil.isNotEmpty(orderGoodsDetails)) {
|
||||
for(OrderGoodsDetailVO orderGoodsDetailVO : orderGoodsDetails) {
|
||||
if(orderGoodsDetailVO.getMaterialId() != null) {
|
||||
InspectGoodsSum inspectGoodsSum = inspectGoodsService
|
||||
.getInspectGoodsListByOrderGoodsCode(orderGoodsVO.getOrderGoodsCode());
|
||||
if(Objects.nonNull(inspectGoodsSum) && Objects.nonNull(inspectGoodsSum.getIndividualTotalQualifiedNum())) {
|
||||
Map<Long, BigDecimal> individualTotalQualifiedNumMap = inspectGoodsSum.getIndividualTotalQualifiedNum();
|
||||
orderGoodsDetailVO.setTotalQualifiedNum(individualTotalQualifiedNumMap.get(orderGoodsDetailVO.getMaterialId()));
|
||||
}else{
|
||||
orderGoodsDetailVO.setTotalQualifiedNum(BigDecimal.ZERO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
orderGoodsVO.setOrderGoodsDetailList(orderGoodsDetails);
|
||||
}
|
||||
return orderGoodsVO;
|
||||
|
|
@ -101,6 +121,13 @@ public class OrderGoodsServiceImpl implements IOrderGoodsService {
|
|||
}
|
||||
}
|
||||
}
|
||||
InspectGoodsSum inspectGoodsSum = inspectGoodsService
|
||||
.getInspectGoodsListByOrderGoodsCode(orderGoodsVO.getOrderGoodsCode());
|
||||
if(Objects.nonNull(inspectGoodsSum) && Objects.nonNull(inspectGoodsSum.getTotalQualifiedNum())) {
|
||||
orderGoodsVO.setTotalQualifiedNum(inspectGoodsSum.getTotalQualifiedNum());
|
||||
}else{
|
||||
orderGoodsVO.setTotalQualifiedNum(BigDecimal.ZERO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -132,6 +159,7 @@ public class OrderGoodsServiceImpl implements IOrderGoodsService {
|
|||
OrderGoodsDetail orderGoodsDetail = new OrderGoodsDetail();
|
||||
BeanUtils.copyProperties(orderGoodsDetailAdd, orderGoodsDetail);
|
||||
orderGoodsDetail.setOrderGoodsId(orderGoods.getOrderGoodsId());
|
||||
orderGoodsDetail.setOrderGoodsCode(orderGoods.getOrderGoodsCode());
|
||||
inspectGoodsDetailService.insertOrderGoodsDetail(orderGoodsDetail);
|
||||
}
|
||||
}
|
||||
|
|
@ -183,9 +211,24 @@ public class OrderGoodsServiceImpl implements IOrderGoodsService {
|
|||
OrderGoodsDetail orderGoodsDetail = new OrderGoodsDetail();
|
||||
BeanUtils.copyProperties(orderGoodsDetailUpdate, orderGoodsDetail);
|
||||
orderGoodsDetail.setOrderGoodsId(orderGoods.getOrderGoodsId());
|
||||
orderGoodsDetail.setOrderGoodsCode(orderGoodsVO.getOrderGoodsCode());
|
||||
inspectGoodsDetailService.insertOrderGoodsDetail(orderGoodsDetail);
|
||||
}
|
||||
}
|
||||
ProductionPurchaseOrder productionPurchaseOrderQuery = new ProductionPurchaseOrder();
|
||||
productionPurchaseOrderQuery.setGoodsOrderId(orderGoodsVO.getOrderGoodsCode());
|
||||
productionPurchaseOrderService.deleteProductionPurchaseOrderById(productionPurchaseOrderQuery);
|
||||
String purchasePlanCodeStr = orderGoodsUpdate.getPurchasePlanCode();
|
||||
if(StringUtils.isNotBlank(purchasePlanCodeStr)) {
|
||||
String[] purchasePlanCodes = purchasePlanCodeStr.split(",");
|
||||
for(String purchasePlanCode : purchasePlanCodes) {
|
||||
ProductionPurchaseOrder productionPurchaseOrder = new ProductionPurchaseOrder();
|
||||
productionPurchaseOrder.setPurchasePlanId(purchasePlanCode);
|
||||
productionPurchaseOrder.setGoodsOrderId(orderGoods.getOrderGoodsCode());
|
||||
productionPurchaseOrder.setOrderType(SupplierOrderGenerateTypeEnum.PURCHASE_TO_ORDER.getKey());
|
||||
productionPurchaseOrderService.insertProductionPurchaseOrder(productionPurchaseOrder);
|
||||
}
|
||||
}
|
||||
return orderGoodsMapper.updateOrderGoods(orderGoods);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
package com.bonus.canteen.core.ims.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.canteen.core.ims.mapper.ProductionPurchaseOrderMapper;
|
||||
|
|
@ -85,11 +88,19 @@ public class ProductionPurchaseOrderServiceImpl implements IProductionPurchaseOr
|
|||
/**
|
||||
* 删除生产-采购-订单关联信息
|
||||
*
|
||||
* @param id 生产-采购-订单关联主键
|
||||
* @param productionPurchaseOrder 生产-采购-订单关联主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProductionPurchaseOrderById(Long id) {
|
||||
return productionPurchaseOrderMapper.deleteProductionPurchaseOrderById(id);
|
||||
public int deleteProductionPurchaseOrderById(ProductionPurchaseOrder productionPurchaseOrder) {
|
||||
if(Objects.isNull(productionPurchaseOrder)
|
||||
|| Objects.isNull(productionPurchaseOrder.getId())
|
||||
|| StringUtils.isBlank(productionPurchaseOrder.getPurchasePlanId())
|
||||
|| StringUtils.isBlank(productionPurchaseOrder.getGoodsOrderId())
|
||||
|| StringUtils.isBlank(productionPurchaseOrder.getInspectGoodsId())
|
||||
){
|
||||
throw new ServiceException("删除生产-采购-订单关联信息参数错误");
|
||||
}
|
||||
return productionPurchaseOrderMapper.deleteProductionPurchaseOrderById(productionPurchaseOrder);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -218,6 +218,20 @@ public class PurchasePlanServiceImpl implements IPurchasePlanService {
|
|||
inspectGoodsDetailService.insertPurchasePlanDetail(purchasePlanDetail);
|
||||
}
|
||||
}
|
||||
ProductionPurchaseOrder productionPurchaseOrderQuery = new ProductionPurchaseOrder();
|
||||
productionPurchaseOrderQuery.setPurchasePlanId(purchasePlan.getPlanCode());
|
||||
productionPurchaseOrderService.deleteProductionPurchaseOrderById(productionPurchaseOrderQuery);
|
||||
String productionPlanCodeStr = purchasePlanUpdate.getProductionPlanCode();
|
||||
if(StringUtils.isNotBlank(productionPlanCodeStr)) {
|
||||
String[] productionPlanCodes = productionPlanCodeStr.split(",");
|
||||
for(String productionPlanCode : productionPlanCodes) {
|
||||
ProductionPurchaseOrder productionPurchaseOrder = new ProductionPurchaseOrder();
|
||||
productionPurchaseOrder.setProductionPlanId(productionPlanCode);
|
||||
productionPurchaseOrder.setPurchasePlanId(purchasePlan.getPlanCode());
|
||||
productionPurchaseOrder.setOrderType(SupplierOrderGenerateTypeEnum.PRODUCTION_TO_PURCHASE.getKey());
|
||||
productionPurchaseOrderService.insertProductionPurchaseOrder(productionPurchaseOrder);
|
||||
}
|
||||
}
|
||||
return purchasePlanMapper.updatePurchasePlan(purchasePlan);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<resultMap type="com.bonus.canteen.core.ims.domain.vo.OrderGoodsDetailVO" id="OrderGoodsDetailResult">
|
||||
<result property="orderGoodsDetailId" column="order_goods_detail_id" />
|
||||
<result property="orderGoodsId" column="order_goods_id" />
|
||||
<result property="orderGoodsCode" column="order_goods_code" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="unitId" column="unit_id" />
|
||||
<result property="size" column="size" />
|
||||
|
|
@ -29,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectOrderGoodsDetailVo">
|
||||
select order_goods_detail_id, order_goods_id, iogd.material_id, iogd.unit_id, iogd.size,
|
||||
select order_goods_detail_id, order_goods_id, iogd.order_goods_code, iogd.material_id, iogd.unit_id, iogd.size,
|
||||
order_num, single_price, total_price, into_num, unqualified_num,
|
||||
unqualified_reason, if_all_inspect, remark, del_flag, iogd.create_by,
|
||||
iogd.create_time, iogd.update_by, iogd.update_time, cm.material_name, iu.unit_name,
|
||||
|
|
@ -67,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<insert id="insertOrderGoodsDetail" parameterType="com.bonus.canteen.core.ims.domain.OrderGoodsDetail" useGeneratedKeys="true" keyProperty="orderGoodsDetailId">
|
||||
insert into ims_order_goods_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="orderGoodsCode != null">order_goods_code,</if>
|
||||
<if test="orderGoodsId != null">order_goods_id,</if>
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="unitId != null">unit_id,</if>
|
||||
|
|
@ -86,6 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderGoodsCode != null">#{orderGoodsCode},</if>
|
||||
<if test="orderGoodsId != null">#{orderGoodsId},</if>
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="unitId != null">#{unitId},</if>
|
||||
|
|
@ -109,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<update id="updateOrderGoodsDetail" parameterType="com.bonus.canteen.core.ims.domain.OrderGoodsDetail">
|
||||
update ims_order_goods_detail
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="orderGoodsCode != null">order_goods_code = #{orderGoodsCode},</if>
|
||||
<if test="orderGoodsId != null">order_goods_id = #{orderGoodsId},</if>
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="unitId != null">unit_id = #{unitId},</if>
|
||||
|
|
@ -116,7 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="singlePrice != null">single_price = #{singlePrice},</if>
|
||||
<if test="totalPrice != null">total_price = #{totalPrice},</if>
|
||||
<if test="intoNum != null">into_num = #{intoNum},</if>
|
||||
<if test="intoNum != null">into_num = into_num + #{intoNum},</if>
|
||||
<if test="unqualifiedNum != null">unqualified_num = #{unqualifiedNum},</if>
|
||||
<if test="unqualifiedReason != null">unqualified_reason = #{unqualifiedReason},</if>
|
||||
<if test="ifAllInspect != null">if_all_inspect = #{ifAllInspect},</if>
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="areaName" column="area_name" />
|
||||
<result property="canteenName" column="canteen_name" />
|
||||
<result property="stallName" column="stall_name" />
|
||||
<result property="contractCode" column="contract_code" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOrderGoodsVo">
|
||||
|
|
@ -48,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
total_num, total_into_num, approve_time, iog.stall_id, iog.canteen_id, iog.area_id,
|
||||
confirm_time, confirm_remark, if_all_inspect, iog.remark, iog.del_flag, iog.create_by,
|
||||
iog.create_time, iog.update_by, iog.update_time, isr.supplier_name, iwi.warehouse_name,
|
||||
ba.area_name, bc.canteen_name, bs.stall_name
|
||||
ba.area_name, bc.canteen_name, bs.stall_name, contract_code
|
||||
from ims_order_goods iog
|
||||
left join ims_supplier isr on isr.supplier_id = iog.supplier_id
|
||||
left join ims_warehouse_info iwi on iwi.warehouse_id = iog.warehouse_id
|
||||
|
|
@ -83,6 +84,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="confirmTime != null "> and iog.confirm_time = #{confirmTime}</if>
|
||||
<if test="confirmRemark != null and confirmRemark != ''"> and iog.confirm_remark = #{confirmRemark}</if>
|
||||
<if test="ifAllInspect != null "> and iog.if_all_inspect = #{ifAllInspect}</if>
|
||||
<if test="ifTotalIntoInventory != null ">
|
||||
and iog.total_num <![CDATA[ > ]]> iog.totalIntoNum
|
||||
</if>
|
||||
<if test="orderGoodsCode != null and orderGoodsCode != ''">
|
||||
and iog.order_goods_code like CONCAT('%',#{orderGoodsCode},'%')
|
||||
</if>
|
||||
|
|
@ -104,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<insert id="insertOrderGoods" parameterType="com.bonus.canteen.core.ims.domain.OrderGoods" useGeneratedKeys="true" keyProperty="orderGoodsId">
|
||||
insert into ims_order_goods
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="contractCode != null">contract_code,</if>
|
||||
<if test="orderGoodsCode != null">order_goods_code,</if>
|
||||
<if test="supplierId != null">supplier_id,</if>
|
||||
<if test="orderStatus != null">order_status,</if>
|
||||
|
|
@ -135,6 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="contractCode != null">#{contractCode},</if>
|
||||
<if test="orderGoodsCode != null">#{orderGoodsCode},</if>
|
||||
<if test="supplierId != null">#{supplierId},</if>
|
||||
<if test="orderStatus != null">#{orderStatus},</if>
|
||||
|
|
@ -170,6 +176,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<update id="updateOrderGoods" parameterType="com.bonus.canteen.core.ims.domain.OrderGoods">
|
||||
update ims_order_goods
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="contractCode != null">contract_code = #{contractCode},</if>
|
||||
<if test="supplierId != null">supplier_id = #{supplierId},</if>
|
||||
<if test="orderStatus != null">order_status = #{orderStatus},</if>
|
||||
<if test="orderAmount != null">order_amount = #{orderAmount},</if>
|
||||
|
|
@ -184,7 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="approveBy != null">approve_by = #{approveBy},</if>
|
||||
<if test="approveRemark != null">approve_remark = #{approveRemark},</if>
|
||||
<if test="totalNum != null">total_num = #{totalNum},</if>
|
||||
<if test="totalIntoNum != null">total_into_num = #{totalIntoNum},</if>
|
||||
<if test="totalIntoNum != null">total_into_num = total_into_num + #{totalIntoNum},</if>
|
||||
<if test="approveTime != null">approve_time = #{approveTime},</if>
|
||||
<if test="stallId != null">stall_id = #{stallId},</if>
|
||||
<if test="canteenId != null">canteen_id = #{canteenId},</if>
|
||||
|
|
|
|||
|
|
@ -43,7 +43,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectProductionPlanDetailList" parameterType="com.bonus.canteen.core.ims.domain.ProductionPlanDetail" resultMap="ProductionPlanDetailResult">
|
||||
<include refid="selectProductionPlanDetailVo"/>
|
||||
<where>
|
||||
<where>
|
||||
ippd.del_flag = '0'
|
||||
<if test="productionPlanId != null "> and ippd.production_plan_id = #{productionPlanId}</if>
|
||||
<if test="productionPlanCode != null and productionPlanCode != ''"> and ippd.production_plan_code = #{productionPlanCode}</if>
|
||||
<if test="detailDate != null "> and ippd.detail_date = #{detailDate}</if>
|
||||
|
|
@ -56,12 +57,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectProductionPlanDetailByProductionDetailId" parameterType="Long" resultMap="ProductionPlanDetailResult">
|
||||
<include refid="selectProductionPlanDetailVo"/>
|
||||
where ippd.production_detail_id = #{productionDetailId}
|
||||
where ippd.production_detail_id = #{productionDetailId} and ippd.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectProductionPlanDetailByProductionId" parameterType="Long" resultMap="ProductionPlanDetailResult">
|
||||
<include refid="selectProductionPlanDetailVo"/>
|
||||
where ippd.production_plan_id = #{productionId}
|
||||
where ippd.production_plan_id = #{productionId} and ippd.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insertProductionPlanDetail" parameterType="com.bonus.canteen.core.ims.domain.ProductionPlanDetail" useGeneratedKeys="true" keyProperty="productionDetailId">
|
||||
|
|
|
|||
|
|
@ -8,11 +8,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="productionPlanId" column="production_plan_id" />
|
||||
<result property="purchasePlanId" column="purchase_plan_id" />
|
||||
<result property="goodsOrderId" column="goods_order_id" />
|
||||
<result property="inspectGoodsId" column="inspect_goods_id" />
|
||||
<result property="orderType" column="order_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProductionPurchaseOrderVo">
|
||||
select id, production_plan_id, purchase_plan_id, goods_order_id, order_type
|
||||
select id, production_plan_id, purchase_plan_id, goods_order_id, inspect_goods_id, order_type
|
||||
from ims_production_purchase_order
|
||||
</sql>
|
||||
|
||||
|
|
@ -22,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="productionPlanId != null and productionPlanId != ''"> and production_plan_id = #{productionPlanId}</if>
|
||||
<if test="purchasePlanId != null and purchasePlanId != ''"> and purchase_plan_id = #{purchasePlanId}</if>
|
||||
<if test="goodsOrderId != null and goodsOrderId != ''"> and goods_order_id = #{goodsOrderId}</if>
|
||||
<if test="inspectGoodsId != null and inspectGoodsId != ''"> and inspect_goods_id = #{inspectGoodsId}</if>
|
||||
<if test="orderType != null "> and order_type = #{orderType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
|
@ -37,12 +39,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="productionPlanId != null">production_plan_id,</if>
|
||||
<if test="purchasePlanId != null">purchase_plan_id,</if>
|
||||
<if test="goodsOrderId != null">goods_order_id,</if>
|
||||
<if test="inspectGoodsId != null">inspect_goods_id,</if>
|
||||
<if test="orderType != null">order_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="productionPlanId != null">#{productionPlanId},</if>
|
||||
<if test="purchasePlanId != null">#{purchasePlanId},</if>
|
||||
<if test="goodsOrderId != null">#{goodsOrderId},</if>
|
||||
<if test="inspectGoodsId != null">#{inspectGoodsId},</if>
|
||||
<if test="orderType != null">#{orderType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
|
@ -53,13 +57,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="productionPlanId != null">production_plan_id = #{productionPlanId},</if>
|
||||
<if test="purchasePlanId != null">purchase_plan_id = #{purchasePlanId},</if>
|
||||
<if test="goodsOrderId != null">goods_order_id = #{goodsOrderId},</if>
|
||||
<if test="inspectGoodsId != null">inspect_goods_id = #{inspectGoodsId},</if>
|
||||
<if test="orderType != null">order_type = #{orderType},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProductionPurchaseOrderById" parameterType="Long">
|
||||
delete from ims_production_purchase_order where id = #{id}
|
||||
<delete id="deleteProductionPurchaseOrderById" parameterType="com.bonus.canteen.core.ims.domain.ProductionPurchaseOrder">
|
||||
delete from ims_production_purchase_order
|
||||
where
|
||||
<if test="id != null">
|
||||
id = #{id}
|
||||
</if>
|
||||
<if test="purchasePlanId != null and purchasePlanId != ''">
|
||||
purchase_plan_id = #{purchasePlanId}
|
||||
</if>
|
||||
<if test="goodsOrderId != null and goodsOrderId != ''">
|
||||
goods_order_id = #{goodsOrderId}
|
||||
</if>
|
||||
<if test="inspectGoodsId != null and inspectGoodsId != ''">
|
||||
inspect_goods_id = #{inspectGoodsId}
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProductionPurchaseOrderByIds" parameterType="String">
|
||||
|
|
|
|||
Loading…
Reference in New Issue