From 5fd7f67f7ca83124928323edcbb911dec646ad2e Mon Sep 17 00:00:00 2001 From: xins Date: Tue, 14 May 2024 19:48:37 +0800 Subject: [PATCH] =?UTF-8?q?2.2.1=20MES=EF=BC=9A=E7=94=9F=E4=BA=A7=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E5=A2=9E=E5=8A=A0=E9=94=80=E5=94=AE=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=EF=BC=8C=E6=94=AF=E6=8C=81=E5=A4=96=E9=83=A8=E9=94=80=E5=94=AE?= =?UTF-8?q?=E5=92=8C=E5=AF=B9=E5=86=85=E7=94=9F=E4=BA=A7=E7=9A=84=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E5=92=8C=E4=BF=AE=E6=94=B9=EF=BC=88=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E5=9B=9B=E6=A5=BC=E5=88=B6=E9=80=A0=E7=9A=84=E6=88=90=E5=93=81?= =?UTF-8?q?=E5=8F=91=E5=BE=80=E4=BA=94=E6=A5=BC=E4=BD=9C=E4=B8=BA=E4=BA=94?= =?UTF-8?q?=E6=A5=BC=E7=9A=84=E5=8E=9F=E6=9D=90=E6=96=99=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MesProductOrderController.java | 20 +++ .../com/hw/mes/domain/MesProductOrder.java | 14 ++ .../com/hw/mes/mapper/MesSaleOrderMapper.java | 25 ++- .../hw/mes/service/IMesSaleOrderService.java | 24 ++- .../impl/MesProductOrderServiceImpl.java | 9 +- .../service/impl/MesSaleOrderServiceImpl.java | 30 +++- .../mapper/mes/MesProductOrderMapper.xml | 5 + .../mapper/mes/MesSaleOrderMapper.xml | 34 +++- hw-ui/src/api/mes/productOrder.js | 11 ++ .../views/mes/productOrder/addSaleOrder.vue | 21 +-- hw-ui/src/views/mes/productOrder/index.vue | 154 +++++++++++++----- 11 files changed, 264 insertions(+), 83 deletions(-) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductOrderController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductOrderController.java index 5b38149..382066f 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductOrderController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductOrderController.java @@ -4,6 +4,8 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; import com.hw.common.security.utils.SecurityUtils; +import com.hw.mes.domain.MesSaleOrder; +import com.hw.mes.service.IMesSaleOrderService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -35,6 +37,9 @@ public class MesProductOrderController extends BaseController { @Autowired private IMesProductOrderService mesProductOrderService; + @Autowired + private IMesSaleOrderService mesSaleOrderService; + /** * 查询生产工单列表 */ @@ -137,4 +142,19 @@ public class MesProductOrderController extends BaseController { return success(mesProductOrderService.verifyBOMIsProduction(materialBomId)); } + + + /** + * 查询销售订单信息列表 + */ + @RequiresPermissions("mes:productOrder:query") + @GetMapping("/getSaleOrders") + public TableDataInfo getSaleOrders(MesSaleOrder mesSaleOrder) + { + startPage(); + List list = mesSaleOrderService.selectMesSaleOrderJoinMaterialList(mesSaleOrder); + return getDataTable(list); + } + + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java index cf9f6b5..53f3d0f 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java @@ -53,6 +53,12 @@ public class MesProductOrder extends BaseEntity { @Excel(name = "项目编号") private String projectNo; + /** + * 销售类型 + */ + @Excel(name = "销售类型(1外部销售 2对内生产 3集装箱生产)") + private String saleType; + /** * 物料ID,关联mes_base_material_info的material_id;成品信息 */ @@ -281,6 +287,14 @@ public class MesProductOrder extends BaseEntity { return projectNo; } + public String getSaleType() { + return saleType; + } + + public void setSaleType(String saleType) { + this.saleType = saleType; + } + public void setMaterialId(Long materialId) { this.materialId = materialId; } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesSaleOrderMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesSaleOrderMapper.java index 80e3bc6..0b32428 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesSaleOrderMapper.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesSaleOrderMapper.java @@ -5,15 +5,15 @@ import com.hw.mes.domain.MesSaleOrder; /** * 销售订单信息Mapper接口 - * + * * @author Yinq * @date 2024-02-19 */ -public interface MesSaleOrderMapper +public interface MesSaleOrderMapper { /** * 查询销售订单信息 - * + * * @param saleOrderId 销售订单信息主键 * @return 销售订单信息 */ @@ -21,7 +21,7 @@ public interface MesSaleOrderMapper /** * 查询销售订单信息列表 - * + * * @param mesSaleOrder 销售订单信息 * @return 销售订单信息集合 */ @@ -29,7 +29,7 @@ public interface MesSaleOrderMapper /** * 新增销售订单信息 - * + * * @param mesSaleOrder 销售订单信息 * @return 结果 */ @@ -37,7 +37,7 @@ public interface MesSaleOrderMapper /** * 修改销售订单信息 - * + * * @param mesSaleOrder 销售订单信息 * @return 结果 */ @@ -45,7 +45,7 @@ public interface MesSaleOrderMapper /** * 删除销售订单信息 - * + * * @param saleOrderId 销售订单信息主键 * @return 结果 */ @@ -53,9 +53,18 @@ public interface MesSaleOrderMapper /** * 批量删除销售订单信息 - * + * * @param saleOrderIds 需要删除的数据主键集合 * @return 结果 */ public int deleteMesSaleOrderBySaleOrderIds(Long[] saleOrderIds); + + /** + * 查询销售订单信息列表,Join mes_base_material_info(将销售订单中的material_id转换成mes_base_material_info中的material_id) + * + * @param mesSaleOrder 销售订单信息 + * @return 销售订单信息集合 + */ + public List selectMesSaleOrderJoinMaterialList(MesSaleOrder mesSaleOrder); + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java index 03ecfc0..b7338ef 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java @@ -5,15 +5,15 @@ import com.hw.mes.domain.MesSaleOrder; /** * 销售订单信息Service接口 - * + * * @author Yinq * @date 2024-02-19 */ -public interface IMesSaleOrderService +public interface IMesSaleOrderService { /** * 查询销售订单信息 - * + * * @param saleOrderId 销售订单信息主键 * @return 销售订单信息 */ @@ -21,7 +21,7 @@ public interface IMesSaleOrderService /** * 查询销售订单信息列表 - * + * * @param mesSaleOrder 销售订单信息 * @return 销售订单信息集合 */ @@ -29,7 +29,7 @@ public interface IMesSaleOrderService /** * 新增销售订单信息 - * + * * @param mesSaleOrder 销售订单信息 * @return 结果 */ @@ -37,7 +37,7 @@ public interface IMesSaleOrderService /** * 修改销售订单信息 - * + * * @param mesSaleOrder 销售订单信息 * @return 结果 */ @@ -45,7 +45,7 @@ public interface IMesSaleOrderService /** * 批量删除销售订单信息 - * + * * @param saleOrderIds 需要删除的销售订单信息主键集合 * @return 结果 */ @@ -53,9 +53,17 @@ public interface IMesSaleOrderService /** * 删除销售订单信息信息 - * + * * @param saleOrderId 销售订单信息主键 * @return 结果 */ public int deleteMesSaleOrderBySaleOrderId(Long saleOrderId); + + /** + * 查询销售订单信息列表,Join mes_base_material_info(将销售订单中的material_id转换成mes_base_material_info中的material_id) + * + * @param mesSaleOrder 销售订单信息 + * @return 销售订单信息 + */ + public List selectMesSaleOrderJoinMaterialList(MesSaleOrder mesSaleOrder); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java index 5e15184..bd15970 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java @@ -136,13 +136,16 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService { if (StringUtils.isNull(mesProductOrder.getPlanAmount()) || StringUtils.isNull(mesProductOrder.getSaleAmount())) { return; } + MesProductOrder productOrder = new MesProductOrder(); productOrder.setSaleOrderId(mesProductOrder.getSaleOrderId()); List mesProductOrders = mesProductOrderMapper.selectMesProductOrderList(productOrder); BigDecimal sumDecimal = new BigDecimal(0); if (StringUtils.isNotNull(mesProductOrders)) { for (MesProductOrder order : mesProductOrders) { - if (!order.getOrderStatus().equals(MesConstants.RECALL) && !order.getProductOrderId().equals(mesProductOrder.getProductOrderId())) { + if (!order.getOrderStatus().equals(MesConstants.RECALL) + && !order.getProductOrderId().equals(mesProductOrder.getProductOrderId()) + && order.getSaleType().equals(mesProductOrder.getSaleType())) { sumDecimal = sumDecimal.add(order.getPlanAmount()); } } @@ -201,14 +204,14 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService { public Boolean verifyBOMIsProduction(Long materialBomId) { //查询顶级BOM MesMaterialBom mesMaterialBom = mesMaterialBomService.selectTopMaterialBomByMaterialBomId(materialBomId); - if (StringUtils.isNull(mesMaterialBom)){ + if (StringUtils.isNull(mesMaterialBom)) { return false; } //通过顶级BOM主键查询生产工单 MesProductOrder mesProductOrder = new MesProductOrder(); mesProductOrder.setMaterialBomId(mesMaterialBom.getMaterialBomId()); List productOrderList = mesProductOrderMapper.selectMesProductOrderList(mesProductOrder); - if (productOrderList.size() > 0){ + if (productOrderList.size() > 0) { return true; } return false; diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java index 92ccb44..d9c232c 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java @@ -10,19 +10,19 @@ import com.hw.mes.service.IMesSaleOrderService; /** * 销售订单信息Service业务层处理 - * + * * @author Yinq * @date 2024-02-19 */ @Service -public class MesSaleOrderServiceImpl implements IMesSaleOrderService +public class MesSaleOrderServiceImpl implements IMesSaleOrderService { @Autowired private MesSaleOrderMapper mesSaleOrderMapper; /** * 查询销售订单信息 - * + * * @param saleOrderId 销售订单信息主键 * @return 销售订单信息 */ @@ -34,7 +34,7 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService /** * 查询销售订单信息列表 - * + * * @param mesSaleOrder 销售订单信息 * @return 销售订单信息 */ @@ -46,7 +46,7 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService /** * 新增销售订单信息 - * + * * @param mesSaleOrder 销售订单信息 * @return 结果 */ @@ -59,7 +59,7 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService /** * 修改销售订单信息 - * + * * @param mesSaleOrder 销售订单信息 * @return 结果 */ @@ -72,7 +72,7 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService /** * 批量删除销售订单信息 - * + * * @param saleOrderIds 需要删除的销售订单信息主键 * @return 结果 */ @@ -84,7 +84,7 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService /** * 删除销售订单信息信息 - * + * * @param saleOrderId 销售订单信息主键 * @return 结果 */ @@ -93,4 +93,18 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService { return mesSaleOrderMapper.deleteMesSaleOrderBySaleOrderId(saleOrderId); } + + + + /** + * 查询销售订单信息列表,Join mes_base_material_info(将销售订单中的material_id转换成mes_base_material_info中的material_id) + * + * @param mesSaleOrder 销售订单信息 + * @return 销售订单信息 + */ + @Override + public List selectMesSaleOrderJoinMaterialList(MesSaleOrder mesSaleOrder) + { + return mesSaleOrderMapper.selectMesSaleOrderJoinMaterialList(mesSaleOrder); + } } diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml index b479359..95c4607 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml @@ -11,6 +11,7 @@ + @@ -47,6 +48,7 @@ mpo.saleorder_code, mpo.saleorder_linenumber, mpo.project_no, + mpo.sale_type, mpo.material_id, mpo.material_bom_id, concat(mb.material_name, '-', mb.material_bom_desc) material_bom_desc, @@ -135,6 +137,7 @@ saleorder_code, saleorder_linenumber, project_no, + sale_type, material_id, material_bom_id, dispatch_type, @@ -164,6 +167,7 @@ #{saleorderCode}, #{saleorderLinenumber}, #{projectNo}, + #{saleType}, #{materialId}, #{materialBomId}, #{dispatchType}, @@ -197,6 +201,7 @@ saleorder_code = #{saleorderCode}, saleorder_linenumber = #{saleorderLinenumber}, project_no = #{projectNo}, + sale_type = #{saleType}, material_id = #{materialId}, material_bom_id = #{materialBomId}, dispatch_type = #{dispatchType}, diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml index 05e7136..3cbb933 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml @@ -212,4 +212,36 @@ #{saleOrderId} - \ No newline at end of file + + + + + + + + + + diff --git a/hw-ui/src/api/mes/productOrder.js b/hw-ui/src/api/mes/productOrder.js index e372de1..7b7d7af 100644 --- a/hw-ui/src/api/mes/productOrder.js +++ b/hw-ui/src/api/mes/productOrder.js @@ -85,3 +85,14 @@ export function verifyBOMIsProduction(materialBomId) { method: 'get' }) } + + + +// 查询销售订单列表 +export function getSaleOrders(query) { + return request({ + url: '/mes/productOrder/getSaleOrders', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/views/mes/productOrder/addSaleOrder.vue b/hw-ui/src/views/mes/productOrder/addSaleOrder.vue index 0b85f82..f7174f6 100644 --- a/hw-ui/src/views/mes/productOrder/addSaleOrder.vue +++ b/hw-ui/src/views/mes/productOrder/addSaleOrder.vue @@ -9,16 +9,6 @@ @keyup.enter.native="handleQuery" /> - - - - - @@ -113,7 +103,6 @@ - - - - @@ -305,6 +289,7 @@