diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java index 2a1aabbb..c15c513f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java @@ -77,6 +77,14 @@ public class SysMakeOrderController extends BaseController public String bmps(@PathVariable("id") Long id, ModelMap mmap) { SysMakeOrder sysMakeOrder = sysMakeOrderService.selectSysMakeOrderById(id); + SysSalesOrder sysSalesOrder = salesOrderService.selectSysSalesOrderBySalesOrderCode(sysMakeOrder.getSaleNo()); + if(StringUtils.isNotNull(sysSalesOrder)){ + sysMakeOrder.setOrderType(sysSalesOrder.getSalesOrderType()); + sysMakeOrder.setSalesman(sysSalesOrder.getBusinessMembers()); + sysMakeOrder.setCustomerName(sysSalesOrder.getEnterpriseName()); + sysMakeOrder.setCustomerId(sysSalesOrder.getEnterpriseCode()); + sysMakeOrder.setCustomerOderCode(sysSalesOrder.getSalesOrderNumber()); + } mmap.put("sysMakeOrder", sysMakeOrder); return prefix + "/bmps"; } @@ -89,6 +97,14 @@ public class SysMakeOrderController extends BaseController { mmap.put("currentUser", ShiroUtils.getSysUser()); SysMakeOrder sysMakeOrder = sysMakeOrderService.selectSysMakeOrderById(id); + SysSalesOrder sysSalesOrder = salesOrderService.selectSysSalesOrderBySalesOrderCode(sysMakeOrder.getSaleNo()); + if(StringUtils.isNotNull(sysSalesOrder)){ + sysMakeOrder.setOrderType(sysSalesOrder.getSalesOrderType()); + sysMakeOrder.setSalesman(sysSalesOrder.getBusinessMembers()); + sysMakeOrder.setCustomerName(sysSalesOrder.getEnterpriseName()); + sysMakeOrder.setCustomerId(sysSalesOrder.getEnterpriseCode()); + sysMakeOrder.setCustomerOderCode(sysSalesOrder.getSalesOrderNumber()); + } mmap.put("sysMakeOrder", sysMakeOrder); return prefix + "/bmzgqr"; } @@ -101,6 +117,14 @@ public class SysMakeOrderController extends BaseController { mmap.put("currentUser", ShiroUtils.getSysUser()); SysMakeOrder sysMakeOrder = sysMakeOrderService.selectSysMakeOrderById(id); + SysSalesOrder sysSalesOrder = salesOrderService.selectSysSalesOrderBySalesOrderCode(sysMakeOrder.getSaleNo()); + if(StringUtils.isNotNull(sysSalesOrder)){ + sysMakeOrder.setOrderType(sysSalesOrder.getSalesOrderType()); + sysMakeOrder.setSalesman(sysSalesOrder.getBusinessMembers()); + sysMakeOrder.setCustomerName(sysSalesOrder.getEnterpriseName()); + sysMakeOrder.setCustomerId(sysSalesOrder.getEnterpriseCode()); + sysMakeOrder.setCustomerOderCode(sysSalesOrder.getSalesOrderNumber()); + } mmap.put("sysMakeOrder", sysMakeOrder); return prefix + "/gcsh"; } @@ -116,6 +140,10 @@ public class SysMakeOrderController extends BaseController SysSalesOrder sysSalesOrder = salesOrderService.selectSysSalesOrderBySalesOrderCode(sysMakeOrder.getSaleNo()); if(StringUtils.isNotNull(sysSalesOrder)){ sysMakeOrder.setOrderType(sysSalesOrder.getSalesOrderType()); + sysMakeOrder.setSalesman(sysSalesOrder.getBusinessMembers()); + sysMakeOrder.setCustomerName(sysSalesOrder.getEnterpriseName()); + sysMakeOrder.setCustomerId(sysSalesOrder.getEnterpriseCode()); + sysMakeOrder.setCustomerOderCode(sysSalesOrder.getSalesOrderNumber()); } mmap.put("sysMakeOrder", sysMakeOrder); return prefix + "/addPick"; @@ -132,6 +160,10 @@ public class SysMakeOrderController extends BaseController SysSalesOrder sysSalesOrder = salesOrderService.selectSysSalesOrderBySalesOrderCode(sysMakeOrder.getSaleNo()); if(StringUtils.isNotNull(sysSalesOrder)){ sysMakeOrder.setOrderType(sysSalesOrder.getSalesOrderType()); + sysMakeOrder.setSalesman(sysSalesOrder.getBusinessMembers()); + sysMakeOrder.setCustomerName(sysSalesOrder.getEnterpriseName()); + sysMakeOrder.setCustomerId(sysSalesOrder.getEnterpriseCode()); + sysMakeOrder.setCustomerOderCode(sysSalesOrder.getSalesOrderNumber()); } mmap.put("sysMakeOrder", sysMakeOrder); return prefix + "/addProcessInbound"; @@ -145,6 +177,14 @@ public class SysMakeOrderController extends BaseController { mmap.put("currentUser", ShiroUtils.getSysUser()); SysMakeOrder sysMakeOrder = sysMakeOrderService.selectSysMakeOrderById(id); + SysSalesOrder sysSalesOrder = salesOrderService.selectSysSalesOrderBySalesOrderCode(sysMakeOrder.getSaleNo()); + if(StringUtils.isNotNull(sysSalesOrder)){ + sysMakeOrder.setOrderType(sysSalesOrder.getSalesOrderType()); + sysMakeOrder.setSalesman(sysSalesOrder.getBusinessMembers()); + sysMakeOrder.setCustomerName(sysSalesOrder.getEnterpriseName()); + sysMakeOrder.setCustomerId(sysSalesOrder.getEnterpriseCode()); + sysMakeOrder.setCustomerOderCode(sysSalesOrder.getSalesOrderNumber()); + } mmap.put("sysMakeOrder", sysMakeOrder); return prefix + "/addProduceInbound"; } @@ -220,13 +260,27 @@ public class SysMakeOrderController extends BaseController @RequiresPermissions("system:makeorder:list") @PostMapping("/list") @ResponseBody - public TableDataInfo list(SysMakeOrder sysMakeOrder) + public TableDataInfo list(SysMakeOrder sysMakeOrder) throws RuntimeException,NumberFormatException { SysUser sysUser = ShiroUtils.getSysUser(); String deptNumber = sysUser.getDept().getDeptNumber(); sysMakeOrder.setDeptNumber(deptNumber); startPage(); List list = sysMakeOrderService.selectSysMakeOrderList(sysMakeOrder); + for(SysMakeOrder makeOrder:list){ + if(StringUtils.isNotNull(makeOrder.getSaleNo())){ + SysSalesOrder sysSalesOrder = salesOrderService.selectSysSalesOrderBySalesOrderCode(makeOrder.getSaleNo()); + if(StringUtils.isNotNull(sysSalesOrder)){ + makeOrder.setOrderType(sysSalesOrder.getSalesOrderType()); + makeOrder.setSalesman(sysSalesOrder.getBusinessMembers()); + makeOrder.setCustomerName(sysSalesOrder.getEnterpriseName()); + makeOrder.setCustomerId(sysSalesOrder.getEnterpriseCode()); + makeOrder.setCustomerOderCode(sysSalesOrder.getSalesOrderNumber()); + makeOrder.setMaterial(String.valueOf(sysSalesOrder.getMaterialSum())); + makeOrder.setMaterialSum(sysSalesOrder.getEnterpriseSum()); + } + } + } return getDataTable(list); } diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysMakeOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysMakeOrderMapper.xml index 489cd7f7..f982a194 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysMakeOrderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysMakeOrderMapper.xml @@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -41,7 +42,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + diff --git a/ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html b/ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html index 39ab1bad..aa622b12 100644 --- a/ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html +++ b/ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html @@ -107,7 +107,7 @@ var qualityStatusDatas = [[${@dict.getType('qualityStatus')}]]; var useStatusDatas = [[${@dict.getType('useStatus')}]]; var prefix = ctx + "system/makeorder"; - + var orderTypeDatas = [[${@dict.getType('sys_order_type')}]]; $(function() { var options = { url: prefix + "/list", @@ -167,6 +167,13 @@ { field: 'Salesman', title: '业务员' + }, + { + field: 'orderType', + title: '订单类型', + formatter: function(value, row, index) { + return $.table.selectDictLabel(orderTypeDatas, value); + } }, { field: 'customerId',