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 @@