diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceOrderController.java index 0b771112..a97c98ce 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceOrderController.java @@ -225,6 +225,8 @@ public class OutsourceOrderController extends BaseController if("submit".equals(instanceType)){ // 使用状态-是 outsourceOrderVO.setUseStatus("1"); + OutsourceOrder outsourceOrder = outsourceOrderService.selectOutsourceOrderByOutsourceOrderId(outsourceOrderVO.getOutsourceOrderId()); + outsourceOrderService.insertFinancialAccountsPayable(outsourceOrder); } // 作废 else if("cancel".equals(instanceType)){ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceOrderDetailMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceOrderDetailMapper.java new file mode 100644 index 00000000..9cc03797 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceOrderDetailMapper.java @@ -0,0 +1,95 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.OutsourceOrderDetail; + +/** + * 委外订单详情Mapper接口 + * + * @author ruoyi + * @date 2024-09-24 + */ +public interface OutsourceOrderDetailMapper +{ + /** + * 查询委外订单详情 + * + * @param outsourceOrderDetailId 委外订单详情ID + * @return 委外订单详情 + */ + public OutsourceOrderDetail selectOutsourceOrderDetailById(Long outsourceOrderDetailId); + + /** + * 查询委外订单详情列表 + * + * @param outsourceOrderDetail 委外订单详情 + * @return 委外订单详情集合 + */ + public List selectOutsourceOrderDetailList(OutsourceOrderDetail outsourceOrderDetail); + + /** + * 新增委外订单详情 + * + * @param outsourceOrderDetail 委外订单详情 + * @return 结果 + */ + public int insertOutsourceOrderDetail(OutsourceOrderDetail outsourceOrderDetail); + + /** + * 修改委外订单详情 + * + * @param outsourceOrderDetail 委外订单详情 + * @return 结果 + */ + public int updateOutsourceOrderDetail(OutsourceOrderDetail outsourceOrderDetail); + + /** + * 删除委外订单详情 + * + * @param outsourceOrderDetailId 委外订单详情ID + * @return 结果 + */ + public int deleteOutsourceOrderDetailById(Long outsourceOrderDetailId); + + /** + * 批量删除委外订单详情 + * + * @param outsourceOrderDetailIds 需要删除的数据ID + * @return 结果 + */ + public int deleteOutsourceOrderDetailByIds(String[] outsourceOrderDetailIds); + + /** + * 作废委外订单详情 + * + * @param outsourceOrderDetailId 委外订单详情ID + * @return 结果 + */ + public int cancelOutsourceOrderDetailById(Long outsourceOrderDetailId); + + /** + * 恢复委外订单详情 + * + * @param outsourceOrderDetailId 委外订单详情ID + * @return 结果 + */ + public int restoreOutsourceOrderDetailById(Long outsourceOrderDetailId); + + /** + * 批量新增委外订单详情 + * + * @param outsourceOrderDetailList 委外订单详情列表 + * @return 结果 + */ + public int batchOutsourceOrderDetail(List outsourceOrderDetailList); + + /** + * 通过委外订单主键删除委外订单详情信息 + * + * @param outsourceOrderNo 委外订单ID + * @return 结果 + */ + public int deleteOutsourceOrderDetailByOutsourceOrderNo(String outsourceOrderNo); + + public int deleteOutsourceOrderDetailByOutsourceOrderNos(String[] outsourceOrderNos); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceOrderMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceOrderMapper.java index 4958bcd9..49b03135 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceOrderMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceOrderMapper.java @@ -39,13 +39,6 @@ public interface OutsourceOrderMapper * @return 委外订单集合 */ public List selectOutsourceOrderList(OutsourceOrderVO outsourceOrderVO); - /** - * 查询委外订单详情列表 - * - * @param outsourceOrderNo 委外订单 - * @return 委外订单集合 - */ - public List selectOutsourceOrderDetailList(String outsourceOrderNo); /** * 新增委外订单 @@ -71,29 +64,6 @@ public interface OutsourceOrderMapper */ public int deleteOutsourceOrderByOutsourceOrderId(Long outsourceOrderId); - /** - * 批量删除委外订单 - * - * @param outsourceOrderIds 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteOutsourceOrderByOutsourceOrderIds(String[] outsourceOrderIds); - - /** - * 批量删除委外订单详情 - * - * @param outsourceOrderIds 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteOutsourceOrderDetailByOutsourceOrderNos(String[] outsourceOrderIds); - - /** - * 批量新增委外订单详情 - * - * @param outsourceOrderDetailList 委外订单详情列表 - * @return 结果 - */ - public int batchOutsourceOrderDetail(List outsourceOrderDetailList); /** * 查询委外物料 * @@ -102,14 +72,6 @@ public interface OutsourceOrderMapper */ public OutsourceMaterial selectMaterialByCode(String materialNo); - /** - * 通过委外订单主键删除委外订单详情信息 - * - * @param outsourceOrderNo 委外订单ID - * @return 结果 - */ - public int deleteOutsourceOrderDetailByOutsourceOrderNo(String outsourceOrderNo); - /** * 作废委外订单 * @@ -125,4 +87,7 @@ public interface OutsourceOrderMapper * @return 结果 */ public int restoreOutsourceOrderById(Long outsourceOrderId); + + public OutsourceOrder selectOutsourceOrderByNo(String outsourceOrderNo); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceOrderService.java index 08c3e19c..ee80b0b3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceOrderService.java @@ -97,4 +97,6 @@ public interface IOutsourceOrderService */ @Transactional(rollbackFor = Exception.class) ProcessInstance restoreOutsourceOrderById(Long id); + + int insertFinancialAccountsPayable(OutsourceOrder outsourceOrder); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceOrderServiceImpl.java index bb00172d..f50d027e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceOrderServiceImpl.java @@ -7,19 +7,25 @@ import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.page.PageDomain; import com.ruoyi.common.core.page.TableSupport; import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.erp.domain.ErpMaterial; import com.ruoyi.erp.domain.ErpMaterialVo; +import com.ruoyi.financial.domain.FinancialAccountsPayable; +import com.ruoyi.financial.mapper.FinancialAccountsPayableMapper; import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper; import com.ruoyi.system.domain.OutsourceMaterial; import com.ruoyi.system.domain.OutsourceOrder; import com.ruoyi.system.domain.OutsourceOrderDetail; +import com.ruoyi.system.domain.SysSupplier; import com.ruoyi.system.domain.Vo.OutsourceOrderVO; import com.ruoyi.system.domain.Vo.OutsourceRequisitionVO; +import com.ruoyi.system.mapper.OutsourceOrderDetailMapper; import com.ruoyi.system.mapper.OutsourceOrderMapper; +import com.ruoyi.system.mapper.SysSupplierMapper; import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.service.IOutsourceOrderService; import com.ruoyi.system.service.IOutsourcePlanService; @@ -28,6 +34,7 @@ import org.activiti.engine.TaskService; import org.activiti.engine.impl.persistence.entity.TaskEntityImpl; import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.task.Task; +import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -48,6 +55,15 @@ public class OutsourceOrderServiceImpl implements IOutsourceOrderService @Autowired private OutsourceOrderMapper outsourceOrderMapper; + @Autowired + private OutsourceOrderDetailMapper orderDetailMapper; + + @Autowired + private FinancialAccountsPayableMapper financialAccountsPayableMapper; + + @Autowired + private SysSupplierMapper supplierMapper; + @Autowired private IOutsourcePlanService outsourcePlanService; @@ -81,7 +97,9 @@ public class OutsourceOrderServiceImpl implements IOutsourceOrderService public OutsourceOrderVO selectOutsourceOrderByOutsourceOrderId(Long outsourceOrderId) { OutsourceOrderVO outsourceOrderVO = outsourceOrderMapper.selectOutsourceOrderByOutsourceOrderId(outsourceOrderId); - List details = outsourceOrderMapper.selectOutsourceOrderDetailList(outsourceOrderVO.getOutsourceOrderNo()); + OutsourceOrderDetail tempDetail = new OutsourceOrderDetail(); + tempDetail.setOutsourceOrderNo(outsourceOrderVO.getOutsourceOrderNo()); + List details = orderDetailMapper.selectOutsourceOrderDetailList(tempDetail); if(StringUtils.isNotEmpty(details)){ outsourceOrderVO.setOutsourceOrderDetailList(details); for (OutsourceOrderDetail detail: details) { @@ -117,8 +135,10 @@ public class OutsourceOrderServiceImpl implements IOutsourceOrderService if (sysUser2 != null) { tempOutsourceOrderVO.setApplyUserName(sysUser2.getUserName()); } - if(outsourceOrderMapper.selectOutsourceOrderDetailList(tempOutsourceOrderVO.getOutsourceOrderNo())!=null){ - List details = outsourceOrderMapper.selectOutsourceOrderDetailList(tempOutsourceOrderVO.getOutsourceOrderNo()); + OutsourceOrderDetail tempDetail = new OutsourceOrderDetail(); + tempDetail.setOutsourceOrderNo(outsourceOrderVO.getOutsourceOrderNo()); + if(orderDetailMapper.selectOutsourceOrderDetailList(tempDetail)!=null){ + List details = orderDetailMapper.selectOutsourceOrderDetailList(tempDetail); tempOutsourceOrderVO.setOutsourceOrderDetailList(details); } String instanceId = tempOutsourceOrderVO.getInstanceId(); @@ -271,7 +291,7 @@ public class OutsourceOrderServiceImpl implements IOutsourceOrderService String loginName = ShiroUtils.getLoginName(); outsourceOrderVO.setUpdateBy(loginName); int rows = outsourceOrderMapper.updateOutsourceOrder(outsourceOrderVO); - outsourceOrderMapper.deleteOutsourceOrderDetailByOutsourceOrderNo(outsourceOrderVO.getOutsourceOrderNo()); + orderDetailMapper.deleteOutsourceOrderDetailByOutsourceOrderNo(outsourceOrderVO.getOutsourceOrderNo()); insertOutsourceOrderDetail(outsourceOrderVO); return rows; } @@ -291,7 +311,9 @@ public class OutsourceOrderServiceImpl implements IOutsourceOrderService public List selectOutsourceOrderByOutsourceOrderNo(String outsourceOrderNo) { List outsourceOrders = outsourceOrderMapper.selectOutsourceOrderByOutsourceOrderNo(outsourceOrderNo); for (OutsourceOrderVO order:outsourceOrders) { - List details= outsourceOrderMapper.selectOutsourceOrderDetailList(order.getOutsourceOrderNo()); + OutsourceOrderDetail tempDetail = new OutsourceOrderDetail(); + tempDetail.setOutsourceOrderNo(order.getOutsourceOrderNo()); + List details= orderDetailMapper.selectOutsourceOrderDetailList(tempDetail); for (OutsourceOrderDetail detail:details) { OutsourceMaterial material = outsourcePlanService.selectMaterialByCode(detail.getMaterialNo()); // 确保 material 的 OrderDetails 集合已初始化 @@ -320,7 +342,7 @@ public class OutsourceOrderServiceImpl implements IOutsourceOrderService @Override public int deleteOutsourceOrderByOutsourceOrderIds(String outsourceOrderIds) { - int rows = outsourceOrderMapper.deleteOutsourceOrderDetailByOutsourceOrderNos(Convert.toStrArray(outsourceOrderIds)); + int rows = orderDetailMapper.deleteOutsourceOrderDetailByOutsourceOrderNos(Convert.toStrArray(outsourceOrderIds)); return rows; } @@ -335,7 +357,7 @@ public class OutsourceOrderServiceImpl implements IOutsourceOrderService public int deleteOutsourceOrderByOutsourceOrderId(Long outsourceOrderId) { OutsourceOrderVO orderVO = outsourceOrderMapper.selectOutsourceOrderByOutsourceOrderId(outsourceOrderId); - outsourceOrderMapper.deleteOutsourceOrderDetailByOutsourceOrderNo(orderVO.getOutsourceOrderNo()); + orderDetailMapper.deleteOutsourceOrderDetailByOutsourceOrderNo(orderVO.getOutsourceOrderNo()); int rows = outsourceOrderMapper.deleteOutsourceOrderByOutsourceOrderId(outsourceOrderId); return rows; } @@ -355,11 +377,13 @@ public class OutsourceOrderServiceImpl implements IOutsourceOrderService for (OutsourceOrderDetail outsourceOrderDetail : outsourceOrderDetailList) { outsourceOrderDetail.setOutsourceOrderNo(OutsourceOrderNo); + outsourceOrderDetail.setRemitStatus("0"); + outsourceOrderDetail.setClosedStatus("0"); list.add(outsourceOrderDetail); } if (list.size() > 0) { - outsourceOrderMapper.batchOutsourceOrderDetail(list); + orderDetailMapper.batchOutsourceOrderDetail(list); } } } @@ -440,4 +464,36 @@ public class OutsourceOrderServiceImpl implements IOutsourceOrderService outsourceOrderMapper.updateOutsourceOrder(outsourceOrderVO); return processInstance; } +// 根据委外订单详情子表数据生成应付账款记录 + @Override + public int insertFinancialAccountsPayable(OutsourceOrder outsourceOrder) { + List orderDetails = outsourceOrder.getOutsourceOrderDetailList(); + if(CollectionUtils.isEmpty(orderDetails)){ + throw new BusinessException("委外订单详情为空!"); + } + int rows = 0; + for (OutsourceOrderDetail detail : orderDetails) { + FinancialAccountsPayable financialPayable = new FinancialAccountsPayable(); + financialPayable.setAccountsPayableCode(redisCache.generateBillNo("YF")); + financialPayable.setAccountsPayableStatus("0"); + financialPayable.setStorageStatus("0"); + financialPayable.setRelevanceCode(detail.getOutsourceOrderNo()); + financialPayable.setSupplierCode(detail.getSupplierCode()); + financialPayable.setSupplierName(detail.getSupplierName()); + SysSupplier supplier = supplierMapper.selectSysSupplierByCode(detail.getSupplierCode()); + financialPayable.setOpenAccount(supplier.getBankAccount()); + financialPayable.setOpenBank(supplier.getDepositBank()); + financialPayable.setPriceExcludingTax(detail.getRmbSum()); + financialPayable.setPriceExcludingTax(detail.getNoRmbSum()); + financialPayable.setPurchaseBuyer(outsourceOrder.getOutsourceStaff()); + financialPayable.setCreateBy(ShiroUtils.getLoginName()); + financialPayable.setCreateTime(DateUtils.getNowDate()); + int row = financialAccountsPayableMapper.insertFinancialAccountsPayable(financialPayable); + if(row<=0){ + throw new BusinessException("新增应付账款记录失败!"); + } + rows ++; + } + return rows; + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceRequisitionServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceRequisitionServiceImpl.java index d8b5599c..28288d6b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceRequisitionServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceRequisitionServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service.impl; import java.util.*; +import java.util.stream.Collectors; import com.github.pagehelper.Page; import com.ruoyi.common.core.domain.entity.SysUser; @@ -355,7 +356,7 @@ public class OutsourceRequisitionServiceImpl implements IOutsourceRequisitionSer public int generateWarehouseOutOrder(OutsourceRequisitionVO outsourceRequisitionVO){ WarehouseOutOrder warehouseOutOrder = new WarehouseOutOrder(); warehouseOutOrder.setOutOrderCode(redisCache.generateBillNo("CK")); - warehouseOutOrder.setWarehouseOutStatus("0"); + warehouseOutOrder.setWarehouseOutStatus("4");//待出库 warehouseOutOrder.setRelatedOrderCode(outsourceRequisitionVO.getOutsourceRequisitionNo()); warehouseOutOrder.setWarehouseOrderType("3"); warehouseOutOrder.setOutMakeCode(outsourceRequisitionVO.getOutsourceOrderNo()); @@ -370,14 +371,23 @@ public class OutsourceRequisitionServiceImpl implements IOutsourceRequisitionSer List requisitionDetails = outsourceRequisitionVO.getOutsourceRequisitionDetailList(); if(StringUtils.isEmpty(requisitionDetails)){ throw new BusinessException("委外领料单详情为空!"); - }else{ - for (OutsourceRequisitionDetail detail:requisitionDetails) { - WarehouseOutOrderDetail warehouseOutOrderDetail = generateWarehouseOutOrderDetail(detail); - warehouseOutOrderDetail.setOutOrderCode(warehouseOutOrder.getOutOrderCode()); - warehouseOutOrderDetail.setApplyName(warehouseOutOrder.getApplyName()); - outOrderDetailMapper.insertWarehouseOutOrderDetail(warehouseOutOrderDetail); - } } + // 去重 + Map uniqueItems = requisitionDetails.stream() + .collect(Collectors.toMap( + OutsourceRequisitionDetail::getMaterialNo, // 键 + item -> item, // 值 + (existing, replacement) -> existing // 如果有重复的料号,保留第一个出现的对象 + )); + List reducedList = new ArrayList<>(uniqueItems.values()); + + for (OutsourceRequisitionDetail detail:reducedList) { + WarehouseOutOrderDetail warehouseOutOrderDetail = generateWarehouseOutOrderDetail(detail); + warehouseOutOrderDetail.setOutOrderCode(warehouseOutOrder.getOutOrderCode()); + warehouseOutOrderDetail.setApplyName(warehouseOutOrder.getApplyName()); + outOrderDetailMapper.insertWarehouseOutOrderDetail(warehouseOutOrderDetail); + } + int insertResult = warehouseOutOrderMapper.insertWarehouseOutOrder(warehouseOutOrder); if(insertResult<=0){ throw new BusinessException("新增委外领料出库单数据失败"); @@ -387,7 +397,7 @@ public class OutsourceRequisitionServiceImpl implements IOutsourceRequisitionSer // 根据委外领料单详情生成出库单详情 public WarehouseOutOrderDetail generateWarehouseOutOrderDetail(OutsourceRequisitionDetail requisitionDetail){ WarehouseOutOrderDetail warehouseOutOrderDetail = new WarehouseOutOrderDetail(); - warehouseOutOrderDetail.setWarehouseOutStatus("0"); + warehouseOutOrderDetail.setWarehouseOutStatus("4");//待出库 warehouseOutOrderDetail.setRelatedOrderCode(requisitionDetail.getOutsourceRequisitionNo()); warehouseOutOrderDetail.setOutMakeCode(requisitionDetail.getOutsourceOrderNo()); warehouseOutOrderDetail.setWarehouseOrderType("3"); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java index 50d4b851..e06517d5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java @@ -7,6 +7,7 @@ import com.ruoyi.system.domain.SysMakeorderPickVo; import com.ruoyi.system.domain.SysSalesOrder; import com.ruoyi.system.domain.Vo.BaseEmpRequisiteOrderVO; import com.ruoyi.warehouse.domain.WarehouseOutOrder; +import org.springframework.transaction.annotation.Transactional; /** * 仓库出库单Service接口 @@ -114,6 +115,10 @@ public interface IWarehouseOutOrderService * */ void generateWarehouseOutOrderByDevelopModifyorderPicking(ErpDevelopModifyorderPickingVo erpDevelopModifyorderPickingVo); + // 请购单-出库 + @Transactional(rollbackFor = Exception.class) + int updateRequisitionOutWarehouse(WarehouseOutOrder warehouseOutOrder); + /** * 仓库出库单通用修改保持方法 * */ @@ -128,4 +133,6 @@ public interface IWarehouseOutOrderService * 员工领料单审核通过后生成出库单 * */ int generateWarehouseOutOrderByBaseEmpRequisiteOrder(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO); + + int updateOutsourceOutWarehouse(WarehouseOutOrder warehouseOutOrder); } diff --git a/ruoyi-admin/src/main/resources/mapper/system/OutsourceOrderDetailMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/OutsourceOrderDetailMapper.xml new file mode 100644 index 00000000..48ad12b7 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/system/OutsourceOrderDetailMapper.xml @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + select outsource_order_detail_id, outsource_order_no, material_no, outsource_process_no, outsource_process_name, charge_unit, single_material, delivery_time, actual_outsource_amount, material_rmb, material_no_rmb, supplier_code, supplier_name, closed_status, remit_status, rmb_sum, no_rmb_sum, correlation_codes, planned_outsource_amount from outsource_order_detail + + + + + + + + insert into outsource_order_detail + + outsource_order_no, + material_no, + outsource_process_no, + outsource_process_name, + charge_unit, + single_material, + delivery_time, + actual_outsource_amount, + material_rmb, + material_no_rmb, + supplier_code, + supplier_name, + closed_status, + remit_status, + rmb_sum, + no_rmb_sum, + correlation_codes, + planned_outsource_amount, + + + #{outsourceOrderNo}, + #{materialNo}, + #{outsourceProcessNo}, + #{outsourceProcessName}, + #{chargeUnit}, + #{singleMaterial}, + #{deliveryTime}, + #{actualOutsourceAmount}, + #{materialRmb}, + #{materialNoRmb}, + #{supplierCode}, + #{supplierName}, + #{closedStatus}, + #{remitStatus}, + #{rmbSum}, + #{noRmbSum}, + #{correlationCodes}, + #{plannedOutsourceAmount}, + + + + + update outsource_order_detail + + outsource_order_no = #{outsourceOrderNo}, + material_no = #{materialNo}, + outsource_process_no = #{outsourceProcessNo}, + outsource_process_name = #{outsourceProcessName}, + charge_unit = #{chargeUnit}, + single_material = #{singleMaterial}, + delivery_time = #{deliveryTime}, + actual_outsource_amount = #{actualOutsourceAmount}, + material_rmb = #{materialRmb}, + material_no_rmb = #{materialNoRmb}, + supplier_code = #{supplierCode}, + supplier_name = #{supplierName}, + closed_status = #{closedStatus}, + remit_status = #{remitStatus}, + rmb_sum = #{rmbSum}, + no_rmb_sum = #{noRmbSum}, + correlation_codes = #{correlationCodes}, + planned_outsource_amount = #{plannedOutsourceAmount}, + + where outsource_order_detail_id = #{outsourceOrderDetailId} + + + + delete from outsource_order_detail where outsource_order_detail_id = #{outsourceOrderDetailId} + + + + delete from outsource_order_detail where outsource_order_detail_id in + + #{outsourceOrderDetailId} + + + + + update outsource_order_detail set del_flag = '1' where outsource_order_detail_id = #{outsourceOrderDetailId} + + + + update outsource_order_detail set del_flag = '0' where outsource_order_detail_id = #{outsourceOrderDetailId} + + + + delete from outsource_order_detail where outsource_order_no in + + #{outsourceOrderNo} + + + + + delete from outsource_order_detail where outsource_order_no = #{outsourceOrderNo} + + + + insert into outsource_order_detail( outsource_order_detail_id, outsource_order_no, material_no, outsource_process_no, outsource_process_name, charge_unit, single_material, delivery_time, actual_outsource_amount, material_rmb, material_no_rmb, supplier_code, supplier_name, closed_status, remit_status, rmb_sum, no_rmb_sum, correlation_codes,planned_outsource_amount) values + + ( #{item.outsourceOrderDetailId}, #{item.outsourceOrderNo}, #{item.materialNo}, #{item.outsourceProcessNo}, #{item.outsourceProcessName}, #{item.chargeUnit}, #{item.singleMaterial}, #{item.deliveryTime}, #{item.actualOutsourceAmount}, #{item.materialRmb}, #{item.materialNoRmb}, #{item.supplierCode}, #{item.supplierName}, #{item.closedStatus}, #{item.remitStatus}, #{item.rmbSum}, #{item.noRmbSum}, #{item.correlationCodes},#{item.plannedOutsourceAmount}) + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/system/OutsourceOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/OutsourceOrderMapper.xml index 06e184c4..d12b5c87 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/OutsourceOrderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/OutsourceOrderMapper.xml @@ -46,32 +46,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -108,10 +82,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and create_time between #{params.beginCreateTime} and #{params.endCreateTime} - and outsource_order_no in ( select outsource_order_no from outsource_order_detail where supplier_code = #{supplierCode}) + and outsource_order_no in ( select outsource_order_no from outsource_order_detail where supplier_code like concat('%', #{supplierCode}, '%')) - and outsource_order_no in ( select outsource_order_no from outsource_order_detail where supplier_name = #{supplierName}) + and outsource_order_no in ( select outsource_order_no from outsource_order_detail where supplier_name like concat('%', #{supplierName}, '%')) and use_status = #{useStatus} and receive_status = #{receiveStatus} @@ -121,14 +95,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and audit_status = #{auditStatus} and actual_material_amount = #{actualMaterialAmount} + order by audit_status asc, create_time desc - where outsource_order_id = #{outsourceOrderId} - + + where outsource_order_no = #{outsourceOrderNo} + + + @@ -140,13 +120,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where material_no =#{materialNo} - - - insert into outsource_order @@ -274,31 +247,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from outsource_order where outsource_order_id = #{outsourceOrderId} - - delete from outsource_order where outsource_order_id in - - #{outsourceOrderId} - - - - - delete from outsource_order_detail where outsource_order_no in - - #{outsourceOrderNo} - - - - - delete from outsource_order_detail where outsource_order_no = #{outsourceOrderNo} - - - - insert into outsource_order_detail( outsource_order_detail_id, outsource_order_no, material_no, outsource_process_no, outsource_process_name, charge_unit, single_material, delivery_time, actual_outsource_amount, material_rmb, material_no_rmb, supplier_code, supplier_name, closed_status, remit_status, rmb_sum, no_rmb_sum, correlation_codes,planned_outsource_amount) values - - ( #{item.outsourceOrderDetailId}, #{item.outsourceOrderNo}, #{item.materialNo}, #{item.outsourceProcessNo}, #{item.outsourceProcessName}, #{item.chargeUnit}, #{item.singleMaterial}, #{item.deliveryTime}, #{item.actualOutsourceAmount}, #{item.materialRmb}, #{item.materialNoRmb}, #{item.supplierCode}, #{item.supplierName}, #{item.closedStatus}, #{item.remitStatus}, #{item.rmbSum}, #{item.noRmbSum}, #{item.correlationCodes},#{item.plannedOutsourceAmount}) - - - update outsource_order set use_status = '2' where id = #{id} diff --git a/ruoyi-admin/src/main/resources/mapper/system/OutsourceQuoteMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/OutsourceQuoteMapper.xml index b18b5678..ebb9ae83 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/OutsourceQuoteMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/OutsourceQuoteMapper.xml @@ -83,6 +83,7 @@ select outsource_quote_child_id, outsource_quote_code, outsource_process_code, outsource_process_no, outsource_process_name, remark, tax_rate, material_rmb, material_noRmb, supplier_code, supplier_name, create_by, create_time, update_by, update_time, audit_status,charge_unit from outsource_quote_child where outsource_quote_code = #{outsource_quote_code} + order by audit_status asc, create_time desc