zouyu
2023-11-17 2b0dc519ddc4fefcabc7f60dcda4968964155e11
Merge remote-tracking branch 'origin/master'
已修改11个文件
已删除1个文件
已添加1个文件
653 ■■■■ 文件已修改
mes-basic/src/main/java/com/chinaztt/mes/basic/controller/PartController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
mes-basic/src/main/java/com/chinaztt/mes/basic/service/impl/PartServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
mes-common/pom.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
mes-common/src/main/java/com/chinaztt/mes/common/server/WebSocketMessage.java 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
mes-common/src/main/java/com/chinaztt/mes/common/server/WebSocketServer.java 178 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
mes-plan/src/main/java/com/chinaztt/mes/plan/controller/CustomerOrderController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
mes-plan/src/main/java/com/chinaztt/mes/plan/controller/MasterProductionScheduleController.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
mes-plan/src/main/java/com/chinaztt/mes/plan/entity/CustomerOrder.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
mes-plan/src/main/java/com/chinaztt/mes/plan/service/MasterProductionScheduleService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
mes-plan/src/main/java/com/chinaztt/mes/plan/service/impl/CustomerOrderServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
mes-plan/src/main/java/com/chinaztt/mes/plan/service/impl/MasterProductionScheduleServiceImpl.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
mes-plan/src/main/resources/mapper/MasterProductionScheduleMapper.xml 249 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
mes-web/src/main/resources/bootstrap.yml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
mes-basic/src/main/java/com/chinaztt/mes/basic/controller/PartController.java
@@ -89,7 +89,15 @@
    @Inner(value = false)
    public R triggerAdd(@RequestParam String params) {
        PartVo partVo = JSONObject.parseObject(params, PartVo.class);
        return R.ok(partService.triggerAdd(partVo));
        R<Object> objectR = new R<>();
        if(partService.triggerAdd(partVo).equals("1")){
            objectR.setCode(1);
            objectR.setMsg("操作成功");
        }else {
            objectR.setCode(0);
            objectR.setMsg("操作失败!联系人员查看日志!");
        }
        return objectR;
    }
mes-basic/src/main/java/com/chinaztt/mes/basic/service/impl/PartServiceImpl.java
@@ -509,11 +509,13 @@
        //型号
        part.setPartModel(partVo.getMaterial_spec());
        if (partVo.getType().equals("add")){
            baseMapper.insert(part);
            return "新增"+part.getPartNo()+"零件号成功" ;
            int insert = baseMapper.insert(part);
            log.info("新增"+part.getPartNo()+"零件号成功");
            return insert>0?"1":"0" ;
        }else {
            baseMapper.update(part,Wrappers.<Part>lambdaUpdate().eq(Part::getPartNo,part.getPartNo()));
            return "修改"+part.getPartNo()+"零件号成功" ;
            int update = baseMapper.update(part, Wrappers.<Part>lambdaUpdate().eq(Part::getPartNo, part.getPartNo()));
            log.info("修改"+part.getPartNo()+"零件号成功");
            return update>0?"1":"0" ;
        }
    }
mes-common/pom.xml
@@ -31,7 +31,11 @@
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-websocket</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.websocket</groupId>
            <artifactId>jakarta.websocket-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-net</groupId>
            <artifactId>commons-net</artifactId>
mes-common/src/main/java/com/chinaztt/mes/common/server/WebSocketMessage.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,128 @@
package com.chinaztt.mes.common.server;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.websocket.*;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArraySet;
/**
 * @Author å¼ å®¾
 * @Date 2023/11/16
 */
@Component
@Slf4j
@ServerEndpoint("/websocket/{userId}")  // æŽ¥å£è·¯å¾„ ws://ip:端口/webSocket/userId;
public class WebSocketMessage {
    //与某个客户端的连接会话,需要通过它来给客户端发送数据
    private Session session;
    /**
     * ç”¨æˆ·ID
     */
    private String userId;
    //concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。
    //虽然@Component默认是单例模式的,但springboot还是会为每个websocket连接初始化一个bean,所以可以用一个静态set保存起来。
    //  æ³¨ï¼šåº•下WebSocket是当前类名
    private static CopyOnWriteArraySet<WebSocketMessage> webSockets =new CopyOnWriteArraySet<>();
    // ç”¨æ¥å­˜åœ¨çº¿è¿žæŽ¥ç”¨æˆ·ä¿¡æ¯
    private static ConcurrentHashMap<String,Session> sessionPool = new ConcurrentHashMap<String,Session>();
    /**
     * é“¾æŽ¥æˆåŠŸè°ƒç”¨çš„æ–¹æ³•
     */
    @OnOpen
    public void onOpen(Session session, @PathParam(value="userId")String userId) {
        try {
            this.session = session;
            this.userId = userId;
            webSockets.add(this);
            sessionPool.put(userId, session);
            log.info("【websocket消息】有新的连接,总数为:"+webSockets.size());
        } catch (Exception e) {
        }
    }
    /**
     * é“¾æŽ¥å…³é—­è°ƒç”¨çš„æ–¹æ³•
     */
    @OnClose
    public void onClose() {
        try {
            webSockets.remove(this);
            sessionPool.remove(this.userId);
            log.info("【websocket消息】连接断开,总数为:"+webSockets.size());
        } catch (Exception e) {
        }
    }
    /**
     * æ”¶åˆ°å®¢æˆ·ç«¯æ¶ˆæ¯åŽè°ƒç”¨çš„æ–¹æ³•
     *
     * @param message
     */
    @OnMessage
    public void onMessage(String message) {
        log.info("【websocket消息】收到客户端消息:"+message);
    }
    /** å‘送错误时的处理
     * @param session
     * @param error
     */
    @OnError
    public void onError(Session session, Throwable error) {
        log.error("用户错误,原因:"+error.getMessage());
        error.printStackTrace();
    }
    // æ­¤ä¸ºå¹¿æ’­æ¶ˆæ¯
    public void sendAllMessage(String message) {
        log.info("【websocket消息】广播消息:"+message);
        for(WebSocketMessage webSocket : webSockets) {
            try {
                if(webSocket.session.isOpen()) {
                    webSocket.session.getAsyncRemote().sendText(message);
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    // æ­¤ä¸ºå•点消息
    public void sendOneMessage(String userId, String message) {
        Session session = sessionPool.get(userId);
        if (session != null&&session.isOpen()) {
            try {
                log.info("【websocket消息】 å•点消息:"+message);
                session.getAsyncRemote().sendText(message);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    // æ­¤ä¸ºå•点消息(多人)
    public void sendMoreMessage(String[] userIds, String message) {
        for(String userId:userIds) {
            Session session = sessionPool.get(userId);
            if (session != null&&session.isOpen()) {
                try {
                    log.info("【websocket消息】 å•点消息:"+message);
                    session.getAsyncRemote().sendText(message);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
mes-common/src/main/java/com/chinaztt/mes/common/server/WebSocketServer.java
ÎļþÒÑɾ³ý
mes-plan/src/main/java/com/chinaztt/mes/plan/controller/CustomerOrderController.java
@@ -17,7 +17,6 @@
package com.chinaztt.mes.plan.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chinaztt.mes.basic.service.StaffService;
@@ -52,7 +51,6 @@
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.List;
@@ -530,6 +528,7 @@
     */
    @DeleteMapping("/processConfigFile/{id}")
    public R processConfigFile(@PathVariable Long id) {
        System.out.println("执行删除------>"+id);
        return customerOrderService.deleteProcessConfigFile(id);
    }
mes-plan/src/main/java/com/chinaztt/mes/plan/controller/MasterProductionScheduleController.java
@@ -4,8 +4,10 @@
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chinaztt.mes.common.wrapper.QueryWrapperUtil;
import com.chinaztt.mes.plan.dto.*;
import com.chinaztt.mes.plan.entity.CustomerOrder;
import com.chinaztt.mes.plan.dto.CustomerOrderDTO;
import com.chinaztt.mes.plan.dto.MasterProductionScheduleDTO;
import com.chinaztt.mes.plan.dto.MpsStructureComponentDTO;
import com.chinaztt.mes.plan.dto.MpsStructureComponentTreeNode;
import com.chinaztt.mes.plan.entity.MasterProductionSchedule;
import com.chinaztt.mes.plan.entity.OperationTaskProduce;
import com.chinaztt.mes.plan.service.MasterProductionScheduleService;
@@ -13,6 +15,7 @@
import com.chinaztt.mes.technology.service.StructureService;
import com.chinaztt.ztt.common.core.util.R;
import com.chinaztt.ztt.common.log.annotation.SysLog;
import com.chinaztt.ztt.common.security.annotation.Inner;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
@@ -351,6 +354,11 @@
                .eq(MasterProductionSchedule::getMpsNo, mpsNo)));
    }
    @ApiOperation(value = "通过主计划查询ifs库存生产采购计划", notes = "通过主计划查询ifs库存生产采购计划")
    @PostMapping("/addPlanPurchasing")
    @Inner(value = false)
    public R addPlanPurchasing(@RequestParam(required = false) List<MasterProductionSchedule>masterProductionSchedules){
        return R.ok(masterProductionScheduleService.addPlanPurchasing(masterProductionSchedules));
    }
}
mes-plan/src/main/java/com/chinaztt/mes/plan/entity/CustomerOrder.java
@@ -108,6 +108,9 @@
     */
    @ApiModelProperty(value = "零件号:用于生产的零件号")
    private String partNo;
    @ApiModelProperty(value = "零件编号:用于生产的零件号")
    private String partId;
    /**
     * æ•°é‡
     */
mes-plan/src/main/java/com/chinaztt/mes/plan/service/MasterProductionScheduleService.java
@@ -190,4 +190,5 @@
     */
    MasterProductionScheduleDTO getById(Long id);
    boolean addPlanPurchasing(List<MasterProductionSchedule>masterProductionSchedules);
}
mes-plan/src/main/java/com/chinaztt/mes/plan/service/impl/CustomerOrderServiceImpl.java
@@ -93,10 +93,10 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.Assert;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -194,7 +194,7 @@
    private final static String AFFILIATED_CONTRACT = "中天注塑厂";
    //private FileSaveUtil fileSaveUtil;
    @Override
    public void otcDownload(Long id, HttpServletResponse response) {
@@ -257,8 +257,9 @@
    private void changeAudit(CustomerOrder customerOrder, String isAudit) {
        //审核状态 é€šè¿‡ è®¢å•状态待计划
        if (isAudit.equals(AuditStateStringValues.ACCEPTED)) {
            //TODO: è¦åŠ é›¶ä»¶id参数
            Document document = documentMapper.selectById(customerOrder.getTechnologyDocumentId());
            Part part = partMapper.selectOne(Wrappers.<Part>lambdaQuery().eq(Part::getEngChgLevel, "1").eq(Part::getPartNo, customerOrder.getPartNo()));
            Part part = partMapper.selectOne(Wrappers.<Part>lambdaQuery().eq(Part::getEngChgLevel, "1").eq(Part::getId,customerOrder.getPartId() ));
            if (null == part) {
                throw new RuntimeException("根据零件编号 = ã€" + customerOrder.getPartNo() + "】MES本地查无匹配零件对象");
            }
@@ -1908,7 +1909,9 @@
    public R deleteProcessConfigFile(Long id) {
        try {
            OrderProcessConfigFile configFile = orderProcessConfigFileMapper.selectById(id);
            minioTemplate.removeObject(configFile.getBucketName(), configFile.getFileName());
            String filePath=FileSaveUtil.FILE_PATH+"//"+configFile.getBucketName();
            boolean del = FileUtil.del(new File(filePath));
            //minioTemplate.removeObject(configFile.getBucketName(), configFile.getFileName());
            orderProcessConfigFileMapper.deleteById(id);
            processConfigFileOrderMappingMapper.delete(Wrappers.<ProcessConfigFileOrderMapping>lambdaQuery().eq(ProcessConfigFileOrderMapping::getConfigFileId, id));
            return R.ok();
mes-plan/src/main/java/com/chinaztt/mes/plan/service/impl/MasterProductionScheduleServiceImpl.java
@@ -1,6 +1,7 @@
package com.chinaztt.mes.plan.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -28,7 +29,6 @@
import com.chinaztt.mes.plan.state.masterproductionschedule.constant.MasterProductionScheduleEvents;
import com.chinaztt.mes.plan.state.masterproductionschedule.constant.MasterProductionScheduleStates;
import com.chinaztt.mes.technology.entity.Document;
import com.chinaztt.mes.technology.entity.Operation;
import com.chinaztt.mes.technology.entity.Routing;
import com.chinaztt.mes.technology.entity.Structure;
import com.chinaztt.mes.technology.mapper.DocumentMapper;
@@ -40,6 +40,7 @@
import com.chinaztt.ztt.common.core.util.R;
import com.chinaztt.ztt.common.security.util.SecurityUtils;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.messaging.Message;
import org.springframework.messaging.support.MessageBuilder;
@@ -50,7 +51,6 @@
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.time.format.DateTimeFormatter;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
@@ -63,6 +63,7 @@
 * @author cxf
 * @date 2020-09-21 14:42:39
 */
@Slf4j
@Service
@AllArgsConstructor
@Transactional(rollbackFor = Exception.class)
@@ -86,6 +87,7 @@
    private StructureMapper structureMapper;
    private StateMachineFactory<MasterProductionScheduleStates, MasterProductionScheduleEvents> masterproductionscheduleStateMachineFactory;
    private StateMachinePersister<MasterProductionScheduleStates, MasterProductionScheduleEvents, MasterProductionSchedule> persister;
    private MoStructureComponentMapper moStructureComponentMapper;
    @Override
    public IPage<List<MasterProductionScheduleDTO>> getMasterProductionSchedulePage(Page page, QueryWrapper<MasterProductionScheduleDTO> masterProductionScheduleDTO) {
@@ -457,4 +459,32 @@
        masterProductionScheduleDTO.setOutPutBatchList(operationTaskProduceList);
        return masterProductionScheduleDTO;
    }
    /**
     * æ·»åŠ é‡‡è´­è®¡åˆ’
     * @param masterProductionSchedules
     * @return
     */
    @Override
    public boolean addPlanPurchasing(List<MasterProductionSchedule>masterProductionSchedules) {
        masterProductionSchedules.forEach(p->{
            Long technologyDocumentId = p.getTechnologyDocumentId();
            Document document = documentMapper.selectById(technologyDocumentId);
            Long firstPart = document.getPartId();
            List<MoStructureComponent> moStructureComponents = moStructureComponentMapper.selectList(new QueryWrapper<MoStructureComponent>().lambda().eq(MoStructureComponent::getPlanManufacturingOrderId, p.getId()));
            moStructureComponents.forEach(m->{
                Part part = partMapper.selectById(m.getPartId());
                String url="http://192.168.20.47:8008/PurchService.ashx?contract=ZTKJ&contractKey=4ttDeLKNsZuhstjtROMcRE1USNFXKdFYE7lQ2p1m5Bo=&procedureName=QUERY_INVENTORY_INFO_STD&userId=7632&inAttr={\"LOCATION_NO\": \"1019\",\"PART_NO\":"+part.getPartNo()+"}";
                String body = HttpRequest.get(url).execute().body();
                JSONObject partInfo = JSONObject.parseObject(body);
                log.info("库存零件==================================>"+partInfo);
            });
        });
        return false;
    }
}
mes-plan/src/main/resources/mapper/MasterProductionScheduleMapper.xml
@@ -57,81 +57,85 @@
    </resultMap>
    <select id="getDtoById" resultType="com.chinaztt.mes.plan.dto.MasterProductionScheduleDTO">
        SELECT * FROM plan_master_production_schedule where ID = #{id}
        SELECT *
        FROM plan_master_production_schedule
        where ID = #{id}
    </select>
    <select id="getMasterProductionSchedulePage" resultMap="masterProductionScheduleMap">
        select
            D.id,
            D.factory_id,
            D.mps_no,
            D.required_date,
            D.remark,
            D.create_time,
            D.update_time,
            D.create_user,
            D.update_user,
            D.part_id,
            D.qty_required,
            D.state,
            D.part_no,
            D.unit,
            D.part_name,
            D.part_description,
            D.inventory_reserved_quantity,
            D.outsourcing_number,
            D.manufacturing_quantity,
            D.customer_order_no,
            D.outer_color,
            D.length_requirement,
            D.order_remark,
            D.print_requirement,
            D.source,
            D.is_audit,
            D.technology_document_id,
            D.doc_number,
            D.manufacture_attr,
            D.promised_delivery_date
        D.id,
        D.factory_id,
        D.mps_no,
        D.required_date,
        D.remark,
        D.create_time,
        D.update_time,
        D.create_user,
        D.update_user,
        D.part_id,
        D.qty_required,
        D.state,
        D.part_no,
        D.unit,
        D.part_name,
        D.part_description,
        D.inventory_reserved_quantity,
        D.outsourcing_number,
        D.manufacturing_quantity,
        D.customer_order_no,
        D.outer_color,
        D.length_requirement,
        D.order_remark,
        D.print_requirement,
        D.source,
        D.is_audit,
        D.technology_document_id,
        D.doc_number,
        D.manufacture_attr,
        D.promised_delivery_date
        FROM (
                 select
                     pmps.*,
                     bp.part_no,
                     bp.part_name,
                     bp.description   part_description,
                     bp.unit,
                     pco.customer_order_no,
                     pco.outer_color,
                     pcop."value"  as length_requirement,
                     pcop2."value" as order_remark,
                     pcop3."value" as print_requirement,
                     (
                         SELECT coalesce(sum(wjso.reserved_quantity), 0)
                         from
                             warehouse_join_stock_order wjso
                                 left join plan_customer_order pco on pco."id" = wjso.customer_order_id
                                 left join plan_join_model_customer pjmc on pjmc.customer_order_id = pco."id" AND pjmc.model = 'plan_master_production_schedule'
                         where wjso.type = '客户订单预留'
                           and status = '02confirmed'
                           and pjmc.model_id = pmps.id
                     )                inventory_reserved_quantity,
                     (
                         SELECT coalesce(sum(poo.qty_required), 0)
                         from plan_outsourcing_order poo
                         where poo.mps_id = pmps.id
                     )                outsourcing_number,
                     (
                         SELECT coalesce(sum(pmo.qty_required), 0)
                         from plan_manufacturing_order pmo
                         where pmo.mps_id = pmps.id AND pmo.part_id = pmps.part_id
                     )                manufacturing_quantity
                 from plan_master_production_schedule pmps
                          left join basic_part bp on bp."id" = pmps.part_id
                          left join plan_join_model_customer pjmc on pjmc.model_id = pmps.id and pjmc.model = 'plan_master_production_schedule'
                          left join plan_customer_order pco on pco.id = pjmc.customer_order_id
                          left join plan_customer_order_param pcop on pcop.order_id = pco.id and pcop.field = 'LengthRequirement'
                          left join plan_customer_order_param pcop2 on pcop2.order_id = pco.id and pcop2.field = 'Remark'
                          left join plan_customer_order_param pcop3 on pcop3.order_id = pco.id and pcop3.field = 'PrintRequirement'
             ) D
        select
        pmps.*,
        bp.part_no,
        bp.part_name,
        bp.description part_description,
        bp.unit,
        pco.customer_order_no,
        pco.outer_color,
        pcop."value" as length_requirement,
        pcop2."value" as order_remark,
        pcop3."value" as print_requirement,
        (
        SELECT coalesce(sum(wjso.reserved_quantity), 0)
        from
        warehouse_join_stock_order wjso
        left join plan_customer_order pco on pco."id" = wjso.customer_order_id
        left join plan_join_model_customer pjmc on pjmc.customer_order_id = pco."id" AND pjmc.model =
        'plan_master_production_schedule'
        where wjso.type = '客户订单预留'
        and status = '02confirmed'
        and pjmc.model_id = pmps.id
        ) inventory_reserved_quantity,
        (
        SELECT coalesce(sum(poo.qty_required), 0)
        from plan_outsourcing_order poo
        where poo.mps_id = pmps.id
        ) outsourcing_number,
        (
        SELECT coalesce(sum(pmo.qty_required), 0)
        from plan_manufacturing_order pmo
        where pmo.mps_id = pmps.id AND pmo.part_id = pmps.part_id
        ) manufacturing_quantity
        from plan_master_production_schedule pmps
        left join basic_part bp on bp."id" = pmps.part_id
        left join plan_join_model_customer pjmc on pjmc.model_id = pmps.id and pjmc.model =
        'plan_master_production_schedule'
        left join plan_customer_order pco on pco.id = pjmc.customer_order_id
        left join plan_customer_order_param pcop on pcop.order_id = pco.id and pcop.field = 'LengthRequirement'
        left join plan_customer_order_param pcop2 on pcop2.order_id = pco.id and pcop2.field = 'Remark'
        left join plan_customer_order_param pcop3 on pcop3.order_id = pco.id and pcop3.field = 'PrintRequirement'
        ) D
        <if test="ew.emptyOfWhere == false">
            ${ew.customSqlSegment}
        </if>
@@ -144,7 +148,7 @@
                                    left join plan_mps_source pms on pms.mps_requ_id = pmr."id"
                           where pms.mps_id = pmps."id")
        where exists(select 1 from plan_mps_source pms where pms.mps_id = pmps."id" and pms.mps_requ_id = #{param.id})
    </update>
    </update>
    <select id="getPlanProduction" resultMap="masterProductionScheduleMap">
        select *
        FROM plan_master_production_schedule a
@@ -153,59 +157,58 @@
    </select>
    <select id="getByIdExt" resultMap="masterProductionScheduleMap">
        select
            D.id,
            D.factory_id,
            D.mps_no,
            D.required_date,
            D.remark,
            D.create_time,
            D.update_time,
            D.create_user,
            D.update_user,
            D.part_id,
            D.qty_required,
            D.state,
            D.part_no,
            D.unit,
            D.part_name,
            D.part_description,
            D.inventory_reserved_quantity,
            D.outsourcing_number,
            D.manufacturing_quantity,
            D.source,
            D.is_audit,
            D.technology_document_id,
            D.doc_number,
            D.manufacture_attr,
            D.promised_delivery_date
        select D.id,
               D.factory_id,
               D.mps_no,
               D.required_date,
               D.remark,
               D.create_time,
               D.update_time,
               D.create_user,
               D.update_user,
               D.part_id,
               D.qty_required,
               D.state,
               D.part_no,
               D.unit,
               D.part_name,
               D.part_description,
               D.inventory_reserved_quantity,
               D.outsourcing_number,
               D.manufacturing_quantity,
               D.source,
               D.is_audit,
               D.technology_document_id,
               D.doc_number,
               D.manufacture_attr,
               D.promised_delivery_date
        FROM (
                 select
                     pmps.*,
                     bp.part_no,
                     bp.part_name,
                     bp.description part_description,
                     bp.unit,
                     (
                         SELECT coalesce(sum(wjso.reserved_quantity), 0)
                         from
                             warehouse_join_stock_order wjso
                                 left join plan_customer_order pco on pco."id" = wjso.customer_order_id
                                 left join plan_join_model_customer pjmc on pjmc.customer_order_id = pco."id" AND pjmc.model = 'plan_master_production_schedule'
                         where wjso.type = '客户订单预留'
                           and status = '02confirmed'
                           and pjmc.model_id = pmps.id
                     )              inventory_reserved_quantity,
                     (
                         SELECT coalesce(sum(poo.qty_required), 0)
                         from plan_outsourcing_order poo
                         where poo.mps_id = pmps.id
                     )              outsourcing_number,
                     (
                         SELECT coalesce(sum(pmo.qty_required), 0)
                         from plan_manufacturing_order pmo
                         where pmo.mps_id = pmps.id
                     )              manufacturing_quantity
                 select pmps.*,
                        bp.part_no,
                        bp.part_name,
                        bp.description part_description,
                        bp.unit,
                        (
                            SELECT coalesce(sum(wjso.reserved_quantity), 0)
                            from warehouse_join_stock_order wjso
                                     left join plan_customer_order pco on pco."id" = wjso.customer_order_id
                                     left join plan_join_model_customer pjmc on pjmc.customer_order_id = pco."id" AND
                                                                                pjmc.model =
                                                                                'plan_master_production_schedule'
                            where wjso.type = '客户订单预留'
                              and status = '02confirmed'
                              and pjmc.model_id = pmps.id
                        )              inventory_reserved_quantity,
                        (
                            SELECT coalesce(sum(poo.qty_required), 0)
                            from plan_outsourcing_order poo
                            where poo.mps_id = pmps.id
                        )              outsourcing_number,
                        (
                            SELECT coalesce(sum(pmo.qty_required), 0)
                            from plan_manufacturing_order pmo
                            where pmo.mps_id = pmps.id
                        )              manufacturing_quantity
                 from plan_master_production_schedule pmps
                          left join basic_part bp on bp."id" = pmps.part_id
                 where pmps.id = #{id}
mes-web/src/main/resources/bootstrap.yml
@@ -6,9 +6,9 @@
    druid:
      username: postgres
      #      password: postgres123
      password: root2022
      password: zsAdmin123!
      #      å°„频开发数据库
      url: jdbc:postgresql://127.0.0.1:5432/postgres
      url: jdbc:postgresql://10.1.51.136:5432/zs_dev
  application:
    name: ztt-mes
  cloud:
@@ -17,7 +17,7 @@
      #      password: nacos
      password: zttZTT123!
      discovery:
        server-addr: 106.13.194.57:8848
        server-addr: 127.0.0.1:8848
        metadata:
          #          VERSION: 10.88.15.224
          VERSION: 127.0.0.1