| | |
| | | @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" ; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | 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)); |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | 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) { |
| | |
| | | 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.common.oa.OAResult; |
| | | import com.chinaztt.mes.common.util.StateResult; |
| | | import com.chinaztt.mes.plan.dto.*; |
| | | import com.chinaztt.mes.plan.entity.*; |
| | | import com.chinaztt.mes.plan.entity.MasterProductionSchedule; |
| | | import com.chinaztt.mes.plan.entity.MasterProductionScheduleTheoryQuantity; |
| | | import com.chinaztt.mes.plan.entity.MpsStructureComponent; |
| | | import com.chinaztt.mes.plan.entity.OperationTaskProduce; |
| | | import com.chinaztt.mes.plan.mapper.*; |
| | | import com.chinaztt.mes.plan.service.CustomerOrderService; |
| | | import com.chinaztt.mes.plan.service.MasterProductionScheduleService; |
| | |
| | | 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; |
| | | |
| | | |
| | | @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(); |
| | | 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\":"+p+"}"; |
| | | 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 |