Merge remote-tracking branch 'origin/master'
| | |
| | | @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; |
| | | } |
| | | |
| | | |
| | |
| | | //åå· |
| | | 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" ; |
| | | } |
| | | } |
| | | |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | */ |
| | | @DeleteMapping("/processConfigFile/{id}") |
| | | public R processConfigFile(@PathVariable Long id) { |
| | | System.out.println("æ§è¡å é¤------>"+id); |
| | | return customerOrderService.deleteProcessConfigFile(id); |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | .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)); |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | @ApiModelProperty(value = "é¶ä»¶å·ï¼ç¨äºç产çé¶ä»¶å·") |
| | | private String partNo; |
| | | |
| | | @ApiModelProperty(value = "é¶ä»¶ç¼å·ï¼ç¨äºç产çé¶ä»¶å·") |
| | | private String partId; |
| | | /** |
| | | * æ°é |
| | | */ |
| | |
| | | */ |
| | | MasterProductionScheduleDTO getById(Long id); |
| | | |
| | | boolean addPlanPurchasing(List<MasterProductionSchedule>masterProductionSchedules); |
| | | } |
| | |
| | | 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; |
| | |
| | | |
| | | private final static String AFFILIATED_CONTRACT = "ä¸å¤©æ³¨å¡å"; |
| | | |
| | | |
| | | //private FileSaveUtil fileSaveUtil; |
| | | |
| | | @Override |
| | | public void otcDownload(Long id, HttpServletResponse response) { |
| | |
| | | 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æ¬å°æ¥æ å¹é
é¶ä»¶å¯¹è±¡"); |
| | | } |
| | |
| | | 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(); |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | * @author cxf |
| | | * @date 2020-09-21 14:42:39 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @AllArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | 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) { |
| | |
| | | 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; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | </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> |
| | |
| | | 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 |
| | |
| | | </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} |
| | |
| | | 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: |
| | |
| | | # 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 |