feat(production): 生产计划添加销售相关字段
| | |
| | | |
| | | @Schema(description = "产品ID") |
| | | private Long productId; |
| | | |
| | | @Schema(description = "销售合同号") |
| | | private String salesContractNo; |
| | | |
| | | @Schema(description = "客户名称") |
| | | private String customerName; |
| | | |
| | | @Schema(description = "项目名称") |
| | | private String projectName; |
| | | } |
| | |
| | | } |
| | | ProductionAccount productionAccount = new ProductionAccount(); |
| | | productionAccount.setProductionProductMainId(productionProductMain.getId()); |
| | | productionAccount.setSalesLedgerId(productionOrder.getSalesLedgerId()); |
| | | productionAccount.setSalesLedgerProductId(productionOrder.getSalesLedgerProductId() == null ? null : productionOrder.getSalesLedgerProductId().longValue()); |
| | | // productionAccount.setSalesLedgerId(productionOrder.getSalesLedgerId()); |
| | | // productionAccount.setSalesLedgerProductId(productionOrder.getSalesLedgerProductId() == null ? null : productionOrder.getSalesLedgerProductId().longValue()); |
| | | productionAccount.setSchedulingUserId(user == null ? null : user.getUserId()); |
| | | productionAccount.setSchedulingUserName(user == null ? dto.getUserName() : user.getNickName()); |
| | | productionAccount.setFinishedNum(productQty); |
| | |
| | | if (!salesLedgerProduct.getIsProduction()) { |
| | | return; |
| | | } |
| | | SalesLedger salesLedger = salesLedgerMapper.selectById(salesLedgerProduct.getSalesLedgerId()); |
| | | ProductionPlan productionPlan = new ProductionPlan(); |
| | | productionPlan.setSalesLedgerId(salesLedgerProduct.getSalesLedgerId()); |
| | | productionPlan.setSalesLedgerProductId(salesLedgerProduct.getId()); |
| | |
| | | productionPlan.setQtyRequired(salesLedgerProduct.getQuantity()); |
| | | productionPlan.setSource("销售"); |
| | | productionPlan.setStatus(0); |
| | | productionPlan.setRequiredDate(salesLedger.getDeliveryDate());//需求日期=交货日期 |
| | | productionPlan.setPromisedDeliveryDate(salesLedger.getDeliveryDate());//承诺日期=交货日期 |
| | | productionPlanMapper.insert(productionPlan); |
| | | |
| | | } |
| | |
| | | <result column="qty_required" property="qtyRequired"/> |
| | | <result column="issued" property="issued"/> |
| | | <result column="source" property="source"/> |
| | | <result column="is_audit" property="isAudit"/> |
| | | <result column="promised_delivery_date" property="promisedDeliveryDate"/> |
| | | </resultMap> |
| | | |
| | |
| | | pm.model, |
| | | p.id as productId, |
| | | p.product_name AS productName, |
| | | pm.unit |
| | | pm.unit, |
| | | sl.sales_contract_no, |
| | | sl.customer_name, |
| | | sl.project_name |
| | | FROM production_plan pp |
| | | left join product_model pm on pp.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | left join sales_ledger sl on pp.sales_ledger_id = sl.id |
| | | <where> |
| | | <if test="c != null"> |
| | | <if test="c.id != null"> |