| | |
| | | .eq(LswMaterial::getMaterialStatus, CommonConstant.STATUS_1) |
| | | .orderByAsc(LswMaterial::getMaterialNumber)); |
| | | break; |
| | | case HEATTREATMENT: |
| | | //çå¤ççº¿ï¼æ¥è¯¢æ¯å¯ç©æ |
| | | lswMaterialList = lswMaterialService.list(new LambdaQueryWrapper<LswMaterial>() |
| | | .eq(LswMaterial::getMaterialCategory, MaterialCategoryEnum.BLANK.name()) |
| | | .eq(LswMaterial::getDelFlag, CommonConstant.DEL_FLAG_0) |
| | | .eq(LswMaterial::getMaterialStatus, CommonConstant.STATUS_1) |
| | | .orderByAsc(LswMaterial::getMaterialNumber)); |
| | | break; |
| | | } |
| | | return Result.OK(lswMaterialList); |
| | | } |
| | |
| | | * @param mesMaterialLoading |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "䏿-ç¼è¾") |
| | | @ApiOperation(value = "䏿-ç¼è¾", notes = "䏿-ç¼è¾") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody MesMaterialLoading mesMaterialLoading) { |
| | | mesMaterialLoadingService.updateById(mesMaterialLoading); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | @AutoLog(value = "䏿-䏿") |
| | | @ApiOperation(value = "䏿-䏿", notes = "䏿-䏿") |
| | | @RequestMapping(value = "/unloading", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<String> unloading(@RequestBody MesMaterialLoading mesMaterialLoading) { |
| | | boolean b = mesMaterialLoadingService.unloading(mesMaterialLoading); |
| | | if (!b) { |
| | | Result.error("ä¸æå¤±è´¥ï¼"); |
| | | } |
| | | return Result.OK("䏿æåï¼"); |
| | | } |
| | | |
| | | /** |
| | |
| | | private String id; |
| | | /**å建人*/ |
| | | @ApiModelProperty(value = "å建人") |
| | | @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") |
| | | private String createBy; |
| | | /**åå»ºæ¥æ*/ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | /** åç±» */ |
| | | @TableField(exist = false) |
| | | private String category; |
| | | /** 䏿æ°é */ |
| | | @TableField(exist = false) |
| | | private BigDecimal unloadingQuantity; |
| | | } |
| | |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | /**æ°é*/ |
| | | @Excel(name = "æ°é", width = 15) |
| | | @ApiModelProperty(value = "æ°é") |
| | | private Double quantity; |
| | | private BigDecimal quantity; |
| | | } |
| | |
| | | /**产线åç§°*/ |
| | | @TableField(exist = false) |
| | | private String factoryName; |
| | | /**产线类å*/ |
| | | @TableField(exist = false) |
| | | @Dict(dicCode = "production_type") |
| | | private String productionType; |
| | | /**çç»åç§°*/ |
| | | @TableField(exist = false) |
| | | private String groupName; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mes.enums; |
| | | |
| | | |
| | | public enum ReportCategoryEnum { |
| | | /** |
| | | * æåæ¥å·¥ |
| | | */ |
| | | FINISHED, |
| | | /** |
| | | * åæåæ¥å·¥ |
| | | */ |
| | | HALF, |
| | | /** |
| | | * çå¤çæ¥å·¥ |
| | | */ |
| | | HEATTREATMENT |
| | | } |
| | |
| | | t2.warehouse_id, |
| | | t2.batch_number, |
| | | t2.steel_ball_size, |
| | | t2.quantity, |
| | | t1.quantity, |
| | | t2.remaining_quantity, |
| | | t2.unloading_flag, |
| | | 'UNLOADING' AS category |
| | |
| | | t1.work_order_code AS text, |
| | | t1.id AS value, |
| | | t2.factory_code factoryCode, |
| | | t2.production_type productionType, |
| | | t3.shift_code shiftCode |
| | | FROM mes_production_work_order t1 |
| | | LEFT JOIN base_factory t2 ON t1.factory_id = t2.id |
| | |
| | | import org.jeecg.modules.mes.entity.MesMaterialUnloading; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: 䏿 |
| | |
| | | * @return |
| | | */ |
| | | boolean loading(MesMaterialLoading mesMaterialLoading); |
| | | |
| | | /** |
| | | * 䏿 |
| | | * @param mesMaterialLoading |
| | | * @return |
| | | */ |
| | | boolean unloading(MesMaterialLoading mesMaterialLoading); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.shiro.SecurityUtils; |
| | |
| | | import org.jeecg.modules.base.entity.LineSideWarehouse; |
| | | import org.jeecg.modules.base.service.ILineSideWarehouseService; |
| | | import org.jeecg.modules.lsw.entity.LswMaterial; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInbound; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInventory; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialOutbound; |
| | | import org.jeecg.modules.lsw.enums.MaterialCategoryEnum; |
| | | import org.jeecg.modules.lsw.enums.MaterialInboundCategory; |
| | | import org.jeecg.modules.lsw.enums.MaterialOutboundCategory; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialInboundService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialInventoryService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialOutboundService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialService; |
| | |
| | | import org.jeecg.modules.mes.entity.MesMaterialUnloading; |
| | | import org.jeecg.modules.mes.mapper.MesMaterialLoadingMapper; |
| | | import org.jeecg.modules.mes.service.IMesMaterialLoadingService; |
| | | import org.jeecg.modules.mes.service.IMesMaterialUnloadingService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: 䏿 |
| | |
| | | private ILswMaterialInventoryService materialInventoryService; |
| | | @Autowired |
| | | private ILswMaterialService materialService; |
| | | @Autowired |
| | | private IMesMaterialUnloadingService mesMaterialUnloadingService; |
| | | @Autowired |
| | | private ILswMaterialInboundService materialInboundService; |
| | | |
| | | @Override |
| | | public List<MesMaterialUnloading> queryUnloadingByLoadingId(String loadingId) { |
| | |
| | | this.save(mesMaterialLoading); |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean unloading(MesMaterialLoading mesMaterialLoading) { |
| | | if (mesMaterialLoading == null) { |
| | | throw new JeecgBootException("åæ°é误ï¼"); |
| | | } |
| | | if (StringUtils.isBlank(mesMaterialLoading.getId()) |
| | | || mesMaterialLoading.getUnloadingQuantity() == null |
| | | || mesMaterialLoading.getUnloadingQuantity().intValue() < 1) { |
| | | throw new JeecgBootException("åæ°é误ï¼"); |
| | | } |
| | | //æ¥è¯¢ä¸ææ°æ® |
| | | MesMaterialLoading loading = super.getById(mesMaterialLoading.getId()); |
| | | if (loading == null) { |
| | | throw new JeecgBootException("æªæ¥è¯¢å°ä¸ææ°æ®ï¼"); |
| | | } |
| | | if (loading.getRemainingQuantity().compareTo(mesMaterialLoading.getUnloadingQuantity()) < 0) { |
| | | throw new JeecgBootException("䏿æ°éä¸è½å¤§äºå½åå©ä½æ°éï¼"); |
| | | } |
| | | //线边åºä¿¡æ¯ |
| | | LineSideWarehouse warehouse = lineSideWarehouseService.getById(loading.getWarehouseId()); |
| | | if(warehouse == null) { |
| | | throw new JeecgBootException("æªæ¥è¯¢å°çº¿è¾¹åºï¼"); |
| | | } |
| | | loading.setUnloadingFlag(CommonConstant.STATUS_1); |
| | | loading.setRemainingQuantity(loading.getRemainingQuantity().subtract(mesMaterialLoading.getUnloadingQuantity())); |
| | | super.updateById(loading); |
| | | //ä¿åä¸æä¿¡æ¯ |
| | | MesMaterialUnloading unloading = new MesMaterialUnloading(); |
| | | unloading.setLoadingId(loading.getId()); |
| | | unloading.setMaterialNumber(loading.getMaterialNumber()); |
| | | unloading.setMaterialName(loading.getMaterialName()); |
| | | unloading.setBatchNumber(loading.getBatchNumber()); |
| | | unloading.setQuantity(mesMaterialLoading.getUnloadingQuantity()); |
| | | mesMaterialUnloadingService.save(unloading); |
| | | //ä¿åå
¥åºä¿¡æ¯ |
| | | LswMaterialInbound materialInbound = new LswMaterialInbound() |
| | | .setFactoryId(loading.getFactoryId()) |
| | | .setWarehouseId(loading.getWarehouseId()) |
| | | .setMaterialNumber(loading.getMaterialNumber()) |
| | | .setMaterialName(loading.getMaterialName()) |
| | | .setBatchNumber(loading.getBatchNumber()) |
| | | .setQuantity(unloading.getQuantity()) |
| | | .setInboundCategory(MaterialInboundCategory.PRODUCTION_UNLOADING.name())//䏿 |
| | | .setOriginalCode(warehouse.getWarehouseCode()) |
| | | .setOriginalName(warehouse.getWarehouseName()); |
| | | materialInboundService.inboundMaterial(materialInbound); |
| | | return true; |
| | | } |
| | | } |
| | |
| | | import org.jeecg.modules.base.service.IShiftService; |
| | | import org.jeecg.modules.lsw.entity.LswMaterial; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInbound; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInventory; |
| | | import org.jeecg.modules.lsw.enums.MaterialCategoryEnum; |
| | | import org.jeecg.modules.lsw.enums.MaterialInboundCategory; |
| | | import org.jeecg.modules.lsw.enums.MaterialInventoryStatusEnum; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialInboundService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialInventoryService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialService; |
| | | import org.jeecg.modules.mes.entity.*; |
| | | import org.jeecg.modules.mes.enums.ReportCategoryEnum; |
| | | import org.jeecg.modules.mes.mapper.MesWorkReportingMapper; |
| | | import org.jeecg.modules.mes.service.*; |
| | | import org.jeecg.modules.mes.utils.CommonUtils; |
| | |
| | | import java.time.temporal.ChronoField; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * @Description: 工忥工 |
| | |
| | | private IInspectionPlanItemService inspectionPlanItemService; |
| | | @Autowired |
| | | private IMesMaterialConsumptionDetailService mesMaterialConsumptionDetailService; |
| | | @Autowired |
| | | private ILswMaterialInventoryService lswMaterialInventoryService; |
| | | |
| | | @Override |
| | | public List<MesWorkReporting> queryWorkReportingByWorkOrderId(String workOrderId) { |
| | |
| | | //æ¼æ¥æåæ¥å·¥æå· |
| | | String palletNumber4 = sysBusinessCodeRuleService.generateBusinessCodeSeq("WorkReportingPalletNumber4"); |
| | | String finishedPalletNumber = material.getMaterialNumber() + date + palletNumber4; |
| | | mesWorkReporting.setPalletNumber(finishedPalletNumber).setReportType("FINISHED"); |
| | | mesWorkReporting.setPalletNumber(finishedPalletNumber).setReportType(ReportCategoryEnum.FINISHED.name()); |
| | | break; |
| | | case INNER_FLANGE: |
| | | case OUTER_FLANGE: |
| | |
| | | Shift shift = shiftService.getById(workOrder.getShiftId()); |
| | | String palletNumber6 = sysBusinessCodeRuleService.generateBusinessCodeSeq("WorkReportingPalletNumber6"); |
| | | String halfPalletNumber = factory.getFactoryCode() + material.getMaterialNumber() + date + shift.getShiftCode() + palletNumber6; |
| | | mesWorkReporting.setPalletNumber(halfPalletNumber).setReportType("HALF"); |
| | | mesWorkReporting.setPalletNumber(halfPalletNumber).setReportType(ReportCategoryEnum.HALF.name()); |
| | | break; |
| | | case BLANK: |
| | | //çå¤çæ¥å·¥ |
| | | consumptionDetailList = heatTreatmentReport(mesWorkReporting, workOrder, lineSideWarehouse); |
| | | mesWorkReporting.setReportType(ReportCategoryEnum.HEATTREATMENT.name()); |
| | | |
| | | } |
| | | //æ°å¢æ¥å·¥è®°å½ |
| | | save(mesWorkReporting); |
| | |
| | | return mesWorkReporting; |
| | | } |
| | | |
| | | //çå¤çæ¥å·¥ |
| | | private List<MesMaterialConsumptionDetail> heatTreatmentReport(MesWorkReporting mesWorkReporting, MesProductionWorkOrder workOrder, LineSideWarehouse lineSideWarehouse) { |
| | | //1ãå
¥åºçå¤çæ¯å¯å°å¯¹åºçº¿è¾¹åºï¼çå¤çååç©æç¼ç ä¸åçååï¼åªéè¦æ´æ°çå¤çæ è¯ï¼æä»¥æ¤å¤ä¸è½ç´æ¥è°ç¨çº¿è¾¹åºçå
¥åºæ¹æ³ï¼éè¦ç´æ¥æ´æ°ç©æåºåä¿¡æ¯ä¸ççå¤çæ è¯å段 |
| | | LswMaterialInventory materialInventory = lswMaterialInventoryService.list(new LambdaQueryWrapper<LswMaterialInventory>() |
| | | .eq(LswMaterialInventory::getWarehouseId, lineSideWarehouse.getId()) |
| | | .eq(LswMaterialInventory::getInventoryStatus, MaterialInventoryStatusEnum.OUTBOUND.name()) |
| | | .eq(LswMaterialInventory::getHeatTreatmentFlag, CommonConstant.STATUS_0) |
| | | .apply("EXISTS (SELECT 1 FROM lsw_material t WHERE t.id = lsw_material_inventory.material_id AND t.material_number = {0} " + |
| | | "AND t.del_flag = {1} AND t.material_status = {2})", workOrder.getMaterialNumber(), CommonConstant.DEL_FLAG_0, CommonConstant.STATUS_1)) |
| | | .stream().findFirst().orElse(null); |
| | | if (materialInventory == null) { |
| | | throw new JeecgBootException("çº¿è¾¹åºæ è¯¥ç©æåºåä¿¡æ¯ï¼"); |
| | | } |
| | | if (materialInventory.getQuantity().compareTo(mesWorkReporting.getQuantity()) != 0) { |
| | | throw new JeecgBootException("æ¥å·¥æ°éä¸ç¬¦åæ´æ¹æ¬¡æ°éè¦æ±ï¼"); |
| | | } |
| | | materialInventory.setHeatTreatmentFlag(CommonConstant.STATUS_1); |
| | | materialInventory.setInventoryStatus(MaterialInventoryStatusEnum.NORMAL.name()); |
| | | lswMaterialInventoryService.updateById(materialInventory); |
| | | //2ãæ´æ°è¯¥æ¹æ¬¡å·å¾ä¸æè®°å½ |
| | | MesMaterialLoading materialLoading = mesMaterialLoadingService.list(new LambdaQueryWrapper<MesMaterialLoading>() |
| | | .eq(MesMaterialLoading::getFactoryId, workOrder.getFactoryId()) |
| | | .eq(MesMaterialLoading::getWarehouseId, lineSideWarehouse.getId()) |
| | | .eq(MesMaterialLoading::getMaterialNumber, workOrder.getMaterialNumber()) |
| | | .eq(MesMaterialLoading::getBatchNumber, materialInventory.getBatchNumber())) |
| | | .stream().findFirst().orElse(null); |
| | | if (materialLoading == null) { |
| | | throw new JeecgBootException("æªæ¾å°è¯¥æ¹æ¬¡å·çä¸æè®°å½ï¼"); |
| | | } |
| | | materialLoading.setRemainingQuantity(BigDecimal.ZERO); |
| | | mesMaterialLoadingService.updateById(materialLoading); |
| | | //çå¤çæ¥å·¥ï¼æ¹æ¬¡å·ååºåçæ´æ¹æ¹æ¬¡å· |
| | | mesWorkReporting.setBatchNumber(materialInventory.getBatchNumber()); |
| | | //3ãè®°å½æ¶èæç» |
| | | MesMaterialConsumptionDetail materialConsumptionDetail = new MesMaterialConsumptionDetail() |
| | | .setWorkOrderId(workOrder.getId()) |
| | | .setFactoryId(workOrder.getFactoryId()) |
| | | .setLoadingId(materialLoading.getId()) |
| | | .setQuantity(mesWorkReporting.getQuantity()); |
| | | return Collections.singletonList(materialConsumptionDetail); |
| | | } |
| | | |
| | | //åæå(å
æ³å
°ã夿³å
°)ãæåæ¥å·¥ |
| | | private List<MesMaterialConsumptionDetail> productReport(MesWorkReporting mesWorkReporting, MesProductionWorkOrder workOrder, LineSideWarehouse lineSideWarehouse) { |
| | | //1ãå
¥åº åæå/æå å°å¯¹åºçº¿è¾¹åº |
| | |
| | | package org.jeecg.modules.wms.config; |
| | | |
| | | import org.apache.cxf.Bus; |
| | | import org.apache.cxf.jaxws.EndpointImpl; |
| | | import org.apache.cxf.transport.servlet.CXFServlet; |
| | | import org.jeecg.modules.wms.service.MESWebServiceSoap; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.web.servlet.ServletRegistrationBean; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import javax.xml.ws.Endpoint; |
| | | |
| | | |
| | | @Configuration |
| | | public class WebServiceServerConfig { |
| | | @Autowired |
| | | private Bus bus; |
| | | @Autowired |
| | | private MESWebServiceSoap mesWebServiceSoap; |
| | | |
| | | @Bean(name = "cxfServlet") // 注å
¥servlet bean nameä¸è½dispatcherServlet ,å¦åä¼è¦çdispatcherServlet |
| | | public ServletRegistrationBean<CXFServlet> cxfServlet() { |
| | | return new ServletRegistrationBean<>(new CXFServlet(), "/webservice/*"); |
| | | } |
| | | |
| | | @Bean |
| | | public Endpoint endpoint() { |
| | | // åæ°äºï¼æ¯SEIå®ç°ç±»å¯¹è±¡ |
| | | Endpoint endpoint = new EndpointImpl(bus, mesWebServiceSoap); |
| | | // åå¸æå¡ |
| | | endpoint.publish("/MESWebService"); |
| | | |
| | | return endpoint; |
| | | } |
| | | } |
| | | //package org.jeecg.modules.wms.config; |
| | | // |
| | | //import org.apache.cxf.Bus; |
| | | //import org.apache.cxf.jaxws.EndpointImpl; |
| | | //import org.apache.cxf.transport.servlet.CXFServlet; |
| | | //import org.jeecg.modules.wms.service.MESWebServiceSoap; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.boot.web.servlet.ServletRegistrationBean; |
| | | //import org.springframework.context.annotation.Bean; |
| | | //import org.springframework.context.annotation.Configuration; |
| | | // |
| | | //import javax.xml.ws.Endpoint; |
| | | // |
| | | // |
| | | //@Configuration |
| | | //public class WebServiceServerConfig { |
| | | // @Autowired |
| | | // private Bus bus; |
| | | // @Autowired |
| | | // private MESWebServiceSoap mesWebServiceSoap; |
| | | // |
| | | // @Bean(name = "cxfServlet") // 注å
¥servlet bean nameä¸è½dispatcherServlet ,å¦åä¼è¦çdispatcherServlet |
| | | // public ServletRegistrationBean<CXFServlet> cxfServlet() { |
| | | // return new ServletRegistrationBean<>(new CXFServlet(), "/webservice/*"); |
| | | // } |
| | | // |
| | | // @Bean |
| | | // public Endpoint endpoint() { |
| | | // // åæ°äºï¼æ¯SEIå®ç°ç±»å¯¹è±¡ |
| | | // Endpoint endpoint = new EndpointImpl(bus, mesWebServiceSoap); |
| | | // // åå¸æå¡ |
| | | // endpoint.publish("/MESWebService"); |
| | | // |
| | | // return endpoint; |
| | | // } |
| | | //} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.wms.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.modules.wms.dto.MESResponse; |
| | | import org.jeecg.modules.wms.request.WMSWebServiceSendItem; |
| | | import org.jeecg.modules.wms.service.MESWebServiceSoap; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Api(tags = "MES坹夿¥å£") |
| | | @RestController |
| | | @RequestMapping("/api/mes") |
| | | @Slf4j |
| | | public class ReceiveWMSScanItemListController { |
| | | @Autowired |
| | | private MESWebServiceSoap mesWebServiceSoap; |
| | | |
| | | @ApiOperation(value = "WMSéææµè¯-æ¥æ¶WMSç§»åºç»æ", notes = "WMSéææµè¯-æ¥æ¶WMSç§»åºç»æ") |
| | | @PostMapping("/receiveWMSScanItemList") |
| | | public MESResponse receiveWMSScanItemList(@RequestBody List<WMSWebServiceSendItem> list) { |
| | | return mesWebServiceSoap.receiveWMSScanItemList(list); |
| | | } |
| | | } |
| | |
| | | @Autowired |
| | | private WMSWebServiceClient webServiceClient; |
| | | |
| | | private final static String localUrl = "http://localhost:9989/webservice/MESWebService?wsdl"; |
| | | |
| | | |
| | | @ApiOperation(value = "WMSéææµè¯-æ¥æ¶WMSç§»åºç»æ", notes = "WMSéææµè¯-æ¥æ¶WMSç§»åºç»æ") |
| | | @PostMapping("/testReceiveWMSScanItemList") |
| | | public Result<?> testReceiveWMSScanItemList(@RequestBody List<WMSWebServiceSendItem> list) { |
| | | JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); |
| | | factory.setAddress(localUrl); |
| | | factory.setServiceClass(MESWebServiceSoap.class); |
| | | MESWebServiceSoap service = (MESWebServiceSoap) factory.create(); |
| | | ReceiveWMSScanItemList request = new ReceiveWMSScanItemList(); |
| | | request.setWmsWebServiceSendItemList(list); |
| | | MESResponse response = service.receiveWMSScanItemList(request); |
| | | return Result.ok(response); |
| | | } |
| | | |
| | | @ApiOperation(value = "WMSéææµè¯-HelloWordæµè¯", notes = "WMSéææµè¯-HelloWordæµè¯") |
| | | @PostMapping("/testHelloWorld") |
| | | public Result<?> testHelloWorld() { |
| | |
| | | package org.jeecg.modules.wms.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import javax.xml.bind.annotation.XmlAccessType; |
| | | import javax.xml.bind.annotation.XmlAccessorType; |
| | | import javax.xml.bind.annotation.XmlElement; |
| | | import javax.xml.bind.annotation.XmlType; |
| | | |
| | | @Getter |
| | | @Setter |
| | | @XmlAccessorType(XmlAccessType.FIELD) |
| | | @XmlType(name = "MESResponse", propOrder = { |
| | | "errorCode", |
| | | "errorDesc" |
| | | }, namespace = "http://xhj008.server.webservice.com/") |
| | | public class MESResponse { |
| | | @XmlElement(name = "ErrorCode", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("ErrorCode") |
| | | protected String errorCode; |
| | | @XmlElement(name = "ErrorDesc", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("ErrorDesc") |
| | | protected String errorDesc; |
| | | } |
| | |
| | | package org.jeecg.modules.wms.dto; |
| | | |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import javax.xml.bind.annotation.*; |
| | | |
| | | @XmlAccessorType(XmlAccessType.FIELD) |
| | | @XmlType(name = "", propOrder = { |
| | | "receiveWMSScanItemListResult" |
| | | }, namespace = "http://xhj008.server.webservice.com/") |
| | | @XmlRootElement(name = "ReceiveWMSScanItemListResponse", namespace = "http://xhj008.server.webservice.com/") |
| | | @Getter |
| | | @Setter |
| | | public class ReceiveWMSScanItemListResponse { |
| | | @XmlElement(name = "ReceiveWMSScanItemListResult", namespace = "http://xhj008.server.webservice.com/") |
| | | protected MESResponse receiveWMSScanItemListResult; |
| | | } |
| | | //package org.jeecg.modules.wms.dto; |
| | | // |
| | | //import lombok.Getter; |
| | | //import lombok.Setter; |
| | | // |
| | | //import javax.xml.bind.annotation.*; |
| | | // |
| | | //@XmlAccessorType(XmlAccessType.FIELD) |
| | | //@XmlType(name = "", propOrder = { |
| | | // "receiveWMSScanItemListResult" |
| | | //}, namespace = "http://xhj008.server.webservice.com/") |
| | | //@XmlRootElement(name = "ReceiveWMSScanItemListResponse", namespace = "http://xhj008.server.webservice.com/") |
| | | //@Getter |
| | | //@Setter |
| | | //public class ReceiveWMSScanItemListResponse { |
| | | // @XmlElement(name = "ReceiveWMSScanItemListResult", namespace = "http://xhj008.server.webservice.com/") |
| | | // protected MESResponse receiveWMSScanItemListResult; |
| | | //} |
| | |
| | | package org.jeecg.modules.wms.request; |
| | | |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import javax.xml.bind.annotation.*; |
| | | import java.util.List; |
| | | |
| | | @XmlAccessorType(XmlAccessType.FIELD) |
| | | @XmlType(name = "", propOrder = { |
| | | "wmsWebServiceSendItemList" |
| | | }, namespace = "http://xhj008.server.webservice.com/") |
| | | @XmlRootElement(name = "ReceiveWMSScanItemList", namespace = "http://xhj008.server.webservice.com/") |
| | | @Getter |
| | | @Setter |
| | | public class ReceiveWMSScanItemList { |
| | | |
| | | @XmlElementWrapper(name = "ArrayOfWMSWebServiceSendItem", namespace = "http://xhj008.server.webservice.com/") |
| | | @XmlElement(name = "WMSWebServiceSendItem", nillable = true, namespace = "http://xhj008.server.webservice.com/") |
| | | protected List<WMSWebServiceSendItem> wmsWebServiceSendItemList; |
| | | } |
| | | //package org.jeecg.modules.wms.request; |
| | | // |
| | | //import lombok.Getter; |
| | | //import lombok.Setter; |
| | | // |
| | | //import javax.xml.bind.annotation.*; |
| | | //import java.util.List; |
| | | // |
| | | //@XmlAccessorType(XmlAccessType.FIELD) |
| | | //@XmlType(name = "", propOrder = { |
| | | // "wmsWebServiceSendItemList" |
| | | //}, namespace = "http://xhj008.server.webservice.com/") |
| | | //@XmlRootElement(name = "ReceiveWMSScanItemList", namespace = "http://xhj008.server.webservice.com/") |
| | | //@Getter |
| | | //@Setter |
| | | //public class ReceiveWMSScanItemList { |
| | | // |
| | | // @XmlElementWrapper(name = "ArrayOfWMSWebServiceSendItem", namespace = "http://xhj008.server.webservice.com/") |
| | | // @XmlElement(name = "WMSWebServiceSendItem", nillable = true, namespace = "http://xhj008.server.webservice.com/") |
| | | // protected List<WMSWebServiceSendItem> wmsWebServiceSendItemList; |
| | | //} |
| | |
| | | |
| | | package org.jeecg.modules.wms.request; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import javax.xml.bind.annotation.XmlAccessType; |
| | | import javax.xml.bind.annotation.XmlAccessorType; |
| | | import javax.xml.bind.annotation.XmlElement; |
| | | import javax.xml.bind.annotation.XmlType; |
| | | import java.math.BigDecimal; |
| | | |
| | | @Getter |
| | | @Setter |
| | | @XmlType(name = "WMSWebServiceSendItem", propOrder = { |
| | | "factoryCode", |
| | | "skuCode", |
| | | "reservationOrder", |
| | | "align", |
| | | "pallet", |
| | | "packageNo", |
| | | "trackLot", |
| | | "series", |
| | | "mesStockID", |
| | | "quantity", |
| | | "sapTrackLot", |
| | | "section", |
| | | "destSection", |
| | | "supplierCode", |
| | | "supplierTrackLot", |
| | | "stageID", |
| | | "remark", |
| | | "orderCode" |
| | | }, namespace = "http://xhj008.server.webservice.com/") |
| | | @XmlAccessorType(XmlAccessType.FIELD) |
| | | public class WMSWebServiceSendItem { |
| | | |
| | | /**å·¥åç¼ç */ |
| | | @XmlElement(name = "FactoryCode", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("FactoryCode") |
| | | private String factoryCode; |
| | | /** ç©æç¼ç */ |
| | | @XmlElement(name = "SkuCode", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("SkuCode") |
| | | private String skuCode; |
| | | /** é¢çå· */ |
| | | @XmlElement(name = "ReservationOrder", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("ReservationOrder") |
| | | private String reservationOrder; |
| | | /** MESç§»åºåå· */ |
| | | @XmlElement(name = "Align", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("Align") |
| | | private String align; |
| | | /** æå· */ |
| | | @XmlElement(name = "Pallet", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("Pallet") |
| | | private String pallet; |
| | | /** å
è£
ç¼ç */ |
| | | @XmlElement(name = "PackageNo", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("PackageNo") |
| | | private String packageNo; |
| | | /** æ¹æ¬¡å· */ |
| | | @XmlElement(name = "TrackLot", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("TrackLot") |
| | | private String trackLot; |
| | | /** ç³»åå· */ |
| | | @XmlElement(name = "Series", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("Series") |
| | | private String series; |
| | | /** MESåºåID */ |
| | | @XmlElement(name = "MesStockID", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("MesStockID") |
| | | private String mesStockID; |
| | | /** æ°é */ |
| | | @XmlElement(name = "Quantity", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("Quantity") |
| | | private BigDecimal quantity; |
| | | /** SAPæ¹æ¬¡å· */ |
| | | @XmlElement(name = "SapTrackLot", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("SapTrackLot") |
| | | private String sapTrackLot; |
| | | /** åéåºåå° */ |
| | | @XmlElement(name = "Section", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("Section") |
| | | private String section; |
| | | /** ç®æ åºåå° */ |
| | | @XmlElement(name = "DestSection", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("DestSection") |
| | | private String destSection; |
| | | /** ä¾åºå代ç */ |
| | | @XmlElement(name = "SupplierCode", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("SupplierCode") |
| | | private String supplierCode; |
| | | /** ä¾åºåæ¹æ¬¡å· */ |
| | | @XmlElement(name = "SupplierTrackLot", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("SupplierTrackLot") |
| | | private String supplierTrackLot; |
| | | /** é¶æ®µID */ |
| | | @XmlElement(name = "StageID", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("StageID") |
| | | private String stageID; |
| | | /** 夿³¨ */ |
| | | @XmlElement(name = "Remark", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("Remark") |
| | | private String remark; |
| | | /** 订åç¼ç */ |
| | | @XmlElement(name = "OrderCode", namespace = "http://xhj008.server.webservice.com/") |
| | | @JsonProperty("OrderCode") |
| | | private String orderCode; |
| | | } |
| | |
| | | package org.jeecg.modules.wms.service; |
| | | |
| | | import org.jeecg.modules.wms.dto.MESResponse; |
| | | import org.jeecg.modules.wms.request.ReceiveWMSScanItemList; |
| | | import org.jeecg.modules.wms.request.WMSWebServiceSendItem; |
| | | |
| | | import javax.jws.WebMethod; |
| | | import javax.jws.WebParam; |
| | | import javax.jws.WebResult; |
| | | import javax.jws.WebService; |
| | | import javax.xml.ws.RequestWrapper; |
| | | import javax.xml.ws.ResponseWrapper; |
| | | import java.util.List; |
| | | |
| | | @WebService(name = "MESWebServiceSoap", targetNamespace = "http://xhj008.server.webservice.com/") |
| | | public interface MESWebServiceSoap { |
| | | /** |
| | | * æ¥æ¶WMSç§»åºä¿¡æ¯ |
| | | * @param wmsWebServiceSendItemList |
| | | * @param list |
| | | * @return |
| | | */ |
| | | @WebMethod(operationName = "ReceiveWMSScanItemList", action = "http://xhj008.server.webservice.com/ReceiveWMSScanItemList") |
| | | @RequestWrapper(localName = "ReceiveWMSScanItemList", targetNamespace = "http://xhj008.server.webservice.com/", className = "ReceiveWMSScanItemList") |
| | | @ResponseWrapper(localName = "ReceiveWMSScanItemListResponse", targetNamespace = "http://xhj008.server.webservice.com/", className = "ReceiveWMSScanItemListResponse") |
| | | @WebResult(name = "ReceiveWMSScanItemListResult", targetNamespace = "http://xhj008.server.webservice.com/") |
| | | MESResponse receiveWMSScanItemList( |
| | | @WebParam(name = "wmsWebServiceSendItemList", targetNamespace = "http:/xhj008.server.webservice.com/") |
| | | ReceiveWMSScanItemList wmsWebServiceSendItemList); |
| | | MESResponse receiveWMSScanItemList(List<WMSWebServiceSendItem> list); |
| | | } |
| | |
| | | import org.jeecg.modules.mes.service.IMesMaterialTransferRequestService; |
| | | import org.jeecg.modules.mes.service.IMesTransferOrderPrintService; |
| | | import org.jeecg.modules.wms.dto.MESResponse; |
| | | import org.jeecg.modules.wms.request.ReceiveWMSScanItemList; |
| | | import org.jeecg.modules.wms.request.WMSWebServiceSendItem; |
| | | import org.jeecg.modules.wms.service.MESWebServiceSoap; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.jws.WebService; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | |
| | | @Slf4j |
| | | @Service("MESWebServiceSoap") |
| | | @WebService(name = "MESWebServiceSoap", targetNamespace = "http://xhj008.server.webservice.com", endpointInterface = "org.jeecg.modules.wms.service.MESWebServiceSoap") |
| | | @Service |
| | | public class MESWebServiceSoapImpl implements MESWebServiceSoap { |
| | | |
| | | @Autowired |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @ApiLog(apiName = "æ¥æ¶WMSçç§»åºä¿¡æ¯(ReceiveWMSScanItemList(MES)", apiCategory = ApiLogCategoryEnum.WMS) |
| | | public MESResponse receiveWMSScanItemList(ReceiveWMSScanItemList request) { |
| | | public MESResponse receiveWMSScanItemList(List<WMSWebServiceSendItem> list) { |
| | | MESResponse response = new MESResponse(); |
| | | if (request == null || CollectionUtil.isEmpty(request.getWmsWebServiceSendItemList())) { |
| | | if (CollectionUtil.isEmpty(list)) { |
| | | response.setErrorCode("N"); |
| | | response.setErrorDesc("ä¼ å
¥çåæ°ä¸ºç©ºï¼"); |
| | | return response; |
| | |
| | | int errorCount = 0; |
| | | int successCount = 0; |
| | | StringBuilder errorMsg = new StringBuilder(); |
| | | for (WMSWebServiceSendItem item : request.getWmsWebServiceSendItemList()) { |
| | | for (WMSWebServiceSendItem item : list) { |
| | | if (StringUtils.isNotBlank(item.getReservationOrder())) { |
| | | //ç©ææå¨åè° |
| | | MesMaterialTransferRequest transferRequest = materialTransferRequestService.queryByReservationCode(item.getReservationOrder()); |
| | |
| | | } |
| | | transferOrderPrintService.updateById(transferOrder); |
| | | successCount++; |
| | | } else { |
| | | errorCount++; |
| | | errorMsg.append("ç§»åºååé¢çå·é½ä¸ºç©ºï¼\n"); |
| | | } |
| | | } |
| | | //å¤çè¿åç»æ |