db/Ë«ÁÖлð¾æMESÊý¾Ý¿âÉè¼Æ.pdma.json
@@ -2,7 +2,7 @@ "name": "åææ°ç«ç¬MESæ°æ®åºè®¾è®¡", "describe": "æè¿°åèªæ°ç«ç¬MESæ°æ®åºè®¾è®¡è¯¦æ ", "avatar": "", "version": "4.9.4", "version": "4.9.2", "createdTime": "2025-3-10 16:38:19", "updatedTime": "2025-8-15 14:58:22", "dbConns": [], @@ -632,7 +632,7 @@ "#DDE5FF" ], "DDLToggleCase": "L", "menuWidth": "309px" "menuWidth": "364px" }, "entities": [ { @@ -61180,7 +61180,7 @@ "codeRoot": "" } }, "defKey": "lsw_âmaterial", "defKey": "lsw_material", "defName": "线边åºç©æä¿¡æ¯", "comment": "", "properties": { @@ -61487,24 +61487,6 @@ "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64" }, { "defKey": "material_model", "defName": "ç©æåå·", "comment": "", "type": "", "len": "", "scale": "", "primaryKey": false, "notNull": false, "autoIncrement": false, "defaultValue": "", "hideInGraph": false, "refDict": "", "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", "extProps": {}, "domain": "54611CCC-CA4B-42E1-9F32-4944C85B85A6", "id": "C2AF21CA-2BB0-4F88-9E66-F216401711A0" }, { "defKey": "material_category", "defName": "ç©æç±»å", "comment": "æå/夿³å °/å æ³å °/æ¯å¯/é ä»¶", @@ -61539,6 +61521,24 @@ "extProps": {}, "domain": "54611CCC-CA4B-42E1-9F32-4944C85B85A6", "id": "11AE1590-5695-4C1E-A85F-72AAD8288740" }, { "defKey": "material_status", "defName": "ç¶æ", "comment": "å¯ç¨ãç¦ç¨", "type": "", "len": "", "scale": "", "primaryKey": false, "notNull": false, "autoIncrement": false, "defaultValue": "", "hideInGraph": false, "refDict": "", "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", "extProps": {}, "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792", "id": "D9381762-109B-4003-9520-FF30D6D1D2AF" } ], "correlations": [], src/main/java/org/jeecg/modules/base/entity/Factory.java
@@ -94,4 +94,9 @@ @Excel(name = "夿³¨", width = 15) @ApiModelProperty(value = "夿³¨") private String remark; /**产线类å*/ @Excel(name = "产线类å", width = 15) @ApiModelProperty(value = "产线类å") private String productionType; } src/main/java/org/jeecg/modules/base/enums/ProductionTypeEnum.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,21 @@ package org.jeecg.modules.base.enums; public enum ProductionTypeEnum { /** * è£ é */ ASSEMBLE, /** * å æ³å ° */ INNERFLANGE, /** * 夿³å ° */ OUTERFLANGE, /** * çå¤ç */ HEATTREATMENT } src/main/java/org/jeecg/modules/base/model/FactoryTreeModel.java
@@ -74,6 +74,8 @@ private String mdcFlag; private String productionType; private List<FactoryTreeModel> children = new ArrayList<>(); public FactoryTreeModel() { @@ -103,5 +105,6 @@ this.updateTime = factory.getUpdateTime(); this.mdcFlag = factory.getMdcFlag(); this.factoryCategory = factory.getFactoryCategory(); this.productionType = factory.getProductionType(); } } src/main/java/org/jeecg/modules/lsw/controller/LswMaterialController.java
@@ -10,6 +10,8 @@ import org.apache.shiro.SecurityUtils; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.util.oConvertUtils; @@ -20,21 +22,15 @@ import org.jeecg.modules.lsw.service.ILswMaterialInventoryService; import org.jeecg.modules.lsw.service.ILswMaterialService; import org.jeecg.modules.lsw.vo.LswMaterialPage; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ImportParams; import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -48,7 +44,7 @@ */ @Api(tags = "线边åºç©æä¿¡æ¯") @RestController @RequestMapping("/lswmaterial/lswMaterial") @RequestMapping("/lsw/lswMaterial") @Slf4j public class LswMaterialController { @Autowired @@ -67,7 +63,6 @@ * @param req * @return */ //@AutoLog(value = "线边åºç©æä¿¡æ¯-å页å表æ¥è¯¢") @ApiOperation(value = "线边åºç©æä¿¡æ¯-å页å表æ¥è¯¢", notes = "线边åºç©æä¿¡æ¯-å页å表æ¥è¯¢") @GetMapping(value = "/list") public Result<IPage<LswMaterial>> queryPageList(LswMaterial lswMaterial, @@ -75,77 +70,55 @@ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { QueryWrapper<LswMaterial> queryWrapper = QueryGenerator.initQueryWrapper(lswMaterial, req.getParameterMap()); Page<LswMaterial> page = new Page<LswMaterial>(pageNo, pageSize); if (lswMaterial.isMaterialCategoryNull()) { queryWrapper.isNull("material_category"); } Page<LswMaterial> page = new Page<>(pageNo, pageSize); IPage<LswMaterial> pageList = lswMaterialService.page(page, queryWrapper); return Result.OK(pageList); } /** * æ·»å * * @param lswMaterialPage * @return */ @AutoLog(value = "线边åºç©æä¿¡æ¯-æ·»å ") @ApiOperation(value = "线边åºç©æä¿¡æ¯-æ·»å ", notes = "线边åºç©æä¿¡æ¯-æ·»å ") //@RequiresPermissions("org.jeecg.modules:lsw_material:add") @PostMapping(value = "/add") public Result<String> add(@RequestBody LswMaterialPage lswMaterialPage) { LswMaterial lswMaterial = new LswMaterial(); BeanUtils.copyProperties(lswMaterialPage, lswMaterial); lswMaterialService.saveMain(lswMaterial, lswMaterialPage.getLswMaterialInventoryList()); return Result.OK("æ·»å æåï¼"); } /** * ç¼è¾ * * @param lswMaterialPage * @param lswMaterial * @return */ @AutoLog(value = "线边åºç©æä¿¡æ¯-ç¼è¾") @ApiOperation(value = "线边åºç©æä¿¡æ¯-ç¼è¾", notes = "线边åºç©æä¿¡æ¯-ç¼è¾") //@RequiresPermissions("org.jeecg.modules:lsw_material:edit") @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) public Result<String> edit(@RequestBody LswMaterialPage lswMaterialPage) { LswMaterial lswMaterial = new LswMaterial(); BeanUtils.copyProperties(lswMaterialPage, lswMaterial); LswMaterial lswMaterialEntity = lswMaterialService.getById(lswMaterial.getId()); if (lswMaterialEntity == null) { return Result.error("æªæ¾å°å¯¹åºæ°æ®"); public Result<String> edit(@RequestBody LswMaterial lswMaterial) { boolean b = lswMaterialService.editMaterial(lswMaterial); if (!b) { return Result.error("ç¼è¾å¤±è´¥"); } lswMaterialService.updateMain(lswMaterial, lswMaterialPage.getLswMaterialInventoryList()); return Result.OK("ç¼è¾æå!"); } /** * éè¿idå é¤ * * @param id * @return */ @AutoLog(value = "线边åºç©æä¿¡æ¯-éè¿idå é¤") @ApiOperation(value = "线边åºç©æä¿¡æ¯-éè¿idå é¤", notes = "线边åºç©æä¿¡æ¯-éè¿idå é¤") //@RequiresPermissions("org.jeecg.modules:lsw_material:delete") @DeleteMapping(value = "/delete") public Result<String> delete(@RequestParam(name = "id", required = true) String id) { lswMaterialService.delMain(id); return Result.OK("å 餿å!"); @AutoLog(value = "线边åºç©æä¿¡æ¯-å¯ç¨") @ApiOperation(value = "线边åºç©æä¿¡æ¯-å¯ç¨", notes = "线边åºç©æä¿¡æ¯-å¯ç¨") @GetMapping("/active") public Result<?> active(@RequestParam("id") String id) { LswMaterial entity = lswMaterialService.getById(id); if (entity == null) { return Result.error("æ°æ®ä¸åå¨"); } entity.setMaterialStatus(CommonConstant.STATUS_1); lswMaterialService.updateById(entity); return Result.OK("æä½æå"); } /** * æ¹éå é¤ * * @param ids * @return */ @AutoLog(value = "线边åºç©æä¿¡æ¯-æ¹éå é¤") @ApiOperation(value = "线边åºç©æä¿¡æ¯-æ¹éå é¤", notes = "线边åºç©æä¿¡æ¯-æ¹éå é¤") //@RequiresPermissions("org.jeecg.modules:lsw_material:deleteBatch") @DeleteMapping(value = "/deleteBatch") public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { this.lswMaterialService.delBatchMain(Arrays.asList(ids.split(","))); return Result.OK("æ¹éå 餿åï¼"); @AutoLog(value = "线边åºç©æä¿¡æ¯-ç¦ç¨") @ApiOperation(value = "线边åºç©æä¿¡æ¯-ç¦ç¨", notes = "线边åºç©æä¿¡æ¯-ç¦ç¨") @GetMapping("/inactive") public Result<?> inactive(@RequestParam("id") String id) { LswMaterial entity = lswMaterialService.getById(id); if (entity == null) { return Result.error("æ°æ®ä¸åå¨"); } entity.setMaterialStatus(CommonConstant.STATUS_0); lswMaterialService.updateById(entity); return Result.OK("æä½æå"); } /** @@ -178,7 +151,7 @@ public Result<List<LswMaterialInventory>> queryLswMaterialInventoryListByMainId(@RequestParam(name = "id", required = true) String id) { List<LswMaterialInventory> lswMaterialInventoryList = lswMaterialInventoryService.selectByMainId(id); for (LswMaterialInventory lswMaterialInventory : lswMaterialInventoryList) { if(StringUtils.isNotEmpty(lswMaterialInventory.getWarehouseId())){ if (StringUtils.isNotEmpty(lswMaterialInventory.getWarehouseId())) { String warehouseId = lswMaterialInventory.getWarehouseId(); LineSideWarehouse warehouse = lineSideWarehouseService.getById(warehouseId); lswMaterialInventory.setWarehouseName(warehouse.getWarehouseName()); @@ -226,47 +199,6 @@ mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("线边åºç©æä¿¡æ¯æ°æ®", "导åºäºº:" + sysUser.getRealname(), "线边åºç©æä¿¡æ¯")); mv.addObject(NormalExcelConstants.DATA_LIST, pageList); return mv; } /** * éè¿excelå¯¼å ¥æ°æ® * * @param request * @param response * @return */ //@RequiresPermissions("org.jeecg.modules:lsw_material:importExcel") @RequestMapping(value = "/importExcel", method = RequestMethod.POST) public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { // è·åä¸ä¼ æä»¶å¯¹è±¡ MultipartFile file = entity.getValue(); ImportParams params = new ImportParams(); params.setTitleRows(2); params.setHeadRows(1); params.setNeedSave(true); try { List<LswMaterialPage> list = ExcelImportUtil.importExcel(file.getInputStream(), LswMaterialPage.class, params); for (LswMaterialPage page : list) { LswMaterial po = new LswMaterial(); BeanUtils.copyProperties(page, po); lswMaterialService.saveMain(po, page.getLswMaterialInventoryList()); } return Result.OK("æä»¶å¯¼å ¥æåï¼æ°æ®è¡æ°:" + list.size()); } catch (Exception e) { log.error(e.getMessage(), e); return Result.error("æä»¶å¯¼å ¥å¤±è´¥:" + e.getMessage()); } finally { try { file.getInputStream().close(); } catch (IOException e) { e.printStackTrace(); } } } return Result.OK("æä»¶å¯¼å ¥å¤±è´¥ï¼"); } @GetMapping(value = "/searchlikeQuery") src/main/java/org/jeecg/modules/lsw/entity/LswMaterial.java
@@ -1,9 +1,6 @@ package org.jeecg.modules.lsw.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.*; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -18,62 +15,57 @@ /** * @Description: 线边åºç©æä¿¡æ¯ * @Author: jeecg-boot * @Date: 2025-06-30 * @Date: 2025-06-30 * @Version: V1.0 */ @ApiModel(value="lsw_material对象", description="线边åºç©æä¿¡æ¯") @ApiModel(value = "lsw_material对象", description = "线边åºç©æä¿¡æ¯") @Data @TableName("lsw_material") public class LswMaterial implements Serializable { private static final long serialVersionUID = 1L; /**主é®*/ @TableId(type = IdType.ASSIGN_ID) /**主é®*/ @TableId(type = IdType.ASSIGN_ID) @ApiModelProperty(value = "主é®") private String id; /**å建人*/ /**å建人*/ @ApiModelProperty(value = "å建人") private String createBy; /**åå»ºæ¥æ*/ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") /**åå»ºæ¥æ*/ @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "åå»ºæ¥æ") private Date createTime; /**æ´æ°äºº*/ /**æ´æ°äºº*/ @ApiModelProperty(value = "æ´æ°äºº") private String updateBy; /**æ´æ°æ¥æ*/ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") /**æ´æ°æ¥æ*/ @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "æ´æ°æ¥æ") private Date updateTime; /**æå±é¨é¨*/ @ApiModelProperty(value = "æå±é¨é¨") private String sysOrgCode; /**å 餿 è®°*/ @Excel(name = "å 餿 è®°", width = 15) /**å 餿 è®°*/ @ApiModelProperty(value = "å 餿 è®°") @TableLogic private Integer delFlag; /**ç©æç¼ç */ @Excel(name = "ç©æç¼ç ", width = 15) /**ç©æç¼ç */ @ApiModelProperty(value = "ç©æç¼ç ") private String materialNumber; /**ç©æåç§°*/ @Excel(name = "ç©æåç§°", width = 15) /**ç©æåç§°*/ @ApiModelProperty(value = "ç©æåç§°") private String materialName; /**ç©æåå·*/ @Excel(name = "ç©æåå·", width = 15) @ApiModelProperty(value = "ç©æåå·") private String materialModel; /**ç©æç±»å*/ @Excel(name = "ç©æç±»å", width = 15, dicCode = "material_category") /**ç©æç±»å*/ @Dict(dicCode = "material_category") @ApiModelProperty(value = "ç©æç±»å") private String materialCategory; /**åä½*/ @Excel(name = "åä½", width = 15) @ApiModelProperty(value = "åä½") /**åºæ¬è®¡éåä½*/ @ApiModelProperty(value = "åºæ¬è®¡éåä½") private String materialUnit; /**ç©æç¶æ*/ @ApiModelProperty(value = "ç©æç¶æ") private String materialStatus; /** ç©æç±»åæ¯å¦ä¸ºç©º */ @TableField(exist = false) private boolean materialCategoryNull; } src/main/java/org/jeecg/modules/lsw/enums/MaterialCategoryEnum.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,10 @@ package org.jeecg.modules.lsw.enums; public enum MaterialCategoryEnum { FINISHED_PRODUCT, //æå OUTER_FLANGE, //夿³å ° INNER_FLANGE, //å æ³å ° COMPONENTS, //é ä»¶ BLANK, //æ¯å¯ ; } src/main/java/org/jeecg/modules/lsw/service/ILswMaterialService.java
@@ -3,11 +3,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import org.jeecg.modules.lsw.entity.LswMaterial; import org.jeecg.modules.lsw.entity.LswMaterialInventory; import org.jeecg.modules.mes.entity.MesProductionOrder; import org.jeecg.modules.sap.dto.OrderBomDTO; import javax.servlet.http.HttpServletRequest; import java.io.Serializable; import java.util.Collection; import java.util.List; import java.util.Map; @@ -19,36 +18,28 @@ */ public interface ILswMaterialService extends IService<LswMaterial> { /** * æ·»å ä¸å¯¹å¤ * * @param lswMaterial * @param lswMaterialInventoryList */ public void saveMain(LswMaterial lswMaterial,List<LswMaterialInventory> lswMaterialInventoryList) ; /** * ä¿®æ¹ä¸å¯¹å¤ * * @param lswMaterial * @param lswMaterialInventoryList */ public void updateMain(LswMaterial lswMaterial,List<LswMaterialInventory> lswMaterialInventoryList); /** * å é¤ä¸å¯¹å¤ * * @param id */ public void delMain (String id); /** * æ¹éå é¤ä¸å¯¹å¤ * * @param idList */ public void delBatchMain (Collection<? extends Serializable> idList); IPage<Map<String, Object>> getLswMaterialListData(Integer pageNo, Integer pageSize, HttpServletRequest req); /** * ç¼è¾ç©æä¿¡æ¯ * @param lswMaterial * @return */ boolean editMaterial(LswMaterial lswMaterial); /** * æ ¹æ®ç©æç¼å·æ¥è¯¢ * @param materialNumber * @return */ LswMaterial queryByMaterialNumber(String materialNumber); /** * æ¹éä¿åç©æåºæ¬ä¿¡æ¯ * @param orderMap * @param orderBomDTOList * @return */ boolean saveOrUpdateMaterial(Map<String, MesProductionOrder> orderMap, List<OrderBomDTO> orderBomDTOList); } src/main/java/org/jeecg/modules/lsw/service/impl/LswMaterialServiceImpl.java
@@ -1,106 +1,126 @@ package org.jeecg.modules.lsw.service.impl; import cn.hutool.core.collection.CollectionUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.commons.lang.StringUtils; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.exception.JeecgBootException; import org.jeecg.modules.lsw.entity.LswMaterial; import org.jeecg.modules.lsw.entity.LswMaterialInventory; import org.jeecg.modules.lsw.mapper.LswMaterialInventoryMapper; import org.jeecg.modules.lsw.mapper.LswMaterialMapper; import org.jeecg.modules.lsw.service.ILswMaterialService; import org.jeecg.modules.mes.entity.MesProductionOrder; import org.jeecg.modules.pms.entity.PmsProcessBillMaterials; import org.jeecg.modules.sap.dto.OrderBomDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.servlet.http.HttpServletRequest; import java.io.Serializable; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.*; import java.util.stream.Collectors; /** * @Description: 线边åºç©æä¿¡æ¯ * @Author: jeecg-boot * @Date: 2025-06-30 * @Date: 2025-06-30 * @Version: V1.0 */ @Service public class LswMaterialServiceImpl extends ServiceImpl<LswMaterialMapper, LswMaterial> implements ILswMaterialService { @Autowired private LswMaterialMapper lswMaterialMapper; @Autowired private LswMaterialInventoryMapper lswMaterialInventoryMapper; @Override @Transactional(rollbackFor = Exception.class) public void saveMain(LswMaterial lswMaterial, List<LswMaterialInventory> lswMaterialInventoryList) { lswMaterialMapper.insert(lswMaterial); if(lswMaterialInventoryList!=null && lswMaterialInventoryList.size()>0) { for(LswMaterialInventory entity:lswMaterialInventoryList) { //å¤é®è®¾ç½® entity.setMaterialId(lswMaterial.getId()); lswMaterialInventoryMapper.insert(entity); } } } @Autowired private LswMaterialMapper lswMaterialMapper; @Autowired private LswMaterialInventoryMapper lswMaterialInventoryMapper; @Override @Transactional(rollbackFor = Exception.class) public void updateMain(LswMaterial lswMaterial,List<LswMaterialInventory> lswMaterialInventoryList) { lswMaterialMapper.updateById(lswMaterial); //1.å å é¤åè¡¨æ°æ® lswMaterialInventoryMapper.deleteByMainId(lswMaterial.getId()); //2.åè¡¨æ°æ®éæ°æå ¥ if(lswMaterialInventoryList!=null && lswMaterialInventoryList.size()>0) { for(LswMaterialInventory entity:lswMaterialInventoryList) { //å¤é®è®¾ç½® entity.setMaterialId(lswMaterial.getId()); lswMaterialInventoryMapper.insert(entity); } } } @Override public IPage<Map<String, Object>> getLswMaterialListData(Integer pageNo, Integer pageSize, HttpServletRequest req) { IPage<Map> pageData = new Page<Map>(pageNo, pageSize); Map<String, String> paramMap = new HashMap<String, String>(); Map<String, String[]> parameterMap = req.getParameterMap(); if (null != parameterMap) { if (parameterMap.containsKey("materialNumber") && StringUtils.isNotBlank(parameterMap.get("materialNumber")[0])) { paramMap.put("materialNumber", parameterMap.get("materialNumber")[0]); } if (parameterMap.containsKey("materialName") && StringUtils.isNotBlank(parameterMap.get("materialName")[0])) { paramMap.put("materialName", parameterMap.get("materialName")[0].trim()); } if (parameterMap.containsKey("materialModel") && StringUtils.isNotBlank(parameterMap.get("materialModel")[0])) { paramMap.put("materialModel", parameterMap.get("materialModel")[0].trim()); } if (parameterMap.containsKey("materialCategory") && StringUtils.isNotBlank(parameterMap.get("materialCategory")[0])) { paramMap.put("materialCategory", parameterMap.get("materialCategory")[0].trim()); } } return super.getBaseMapper().getLswMaterialListData(pageData, paramMap); } @Override @Transactional(rollbackFor = Exception.class) public void delMain(String id) { lswMaterialInventoryMapper.deleteByMainId(id); lswMaterialMapper.deleteById(id); } @Override @Transactional(rollbackFor = Exception.class) public boolean editMaterial(LswMaterial lswMaterial) { LswMaterial entity = this.getBaseMapper().selectById(lswMaterial.getId()); if (entity == null) { throw new JeecgBootException("è¦ç¼è¾çæ°æ®ä¸åå¨ï¼"); } entity.setMaterialCategory(lswMaterial.getMaterialCategory()); this.updateById(entity); return true; } @Override @Transactional(rollbackFor = Exception.class) public void delBatchMain(Collection<? extends Serializable> idList) { for(Serializable id:idList) { lswMaterialInventoryMapper.deleteByMainId(id.toString()); lswMaterialMapper.deleteById(id); } } @Override public LswMaterial queryByMaterialNumber(String materialNumber) { LambdaQueryWrapper<LswMaterial> queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(LswMaterial::getMaterialNumber, materialNumber); queryWrapper.eq(LswMaterial::getDelFlag, CommonConstant.DEL_FLAG_0); List<LswMaterial> list = this.getBaseMapper().selectList(queryWrapper); if (CollectionUtil.isEmpty(list)) { return null; } return list.get(0); } @Override public IPage<Map<String, Object>> getLswMaterialListData(Integer pageNo, Integer pageSize, HttpServletRequest req) { IPage<Map> pageData = new Page<Map>(pageNo, pageSize); Map<String, String> paramMap = new HashMap<String, String>(); Map<String, String[]> parameterMap = req.getParameterMap(); if (null != parameterMap) { if (parameterMap.containsKey("materialNumber") && StringUtils.isNotBlank(parameterMap.get("materialNumber")[0])) { paramMap.put("materialNumber", parameterMap.get("materialNumber")[0]); } if (parameterMap.containsKey("materialName") && StringUtils.isNotBlank(parameterMap.get("materialName")[0])) { paramMap.put("materialName", parameterMap.get("materialName")[0].trim()); } if (parameterMap.containsKey("materialModel") && StringUtils.isNotBlank(parameterMap.get("materialModel")[0])) { paramMap.put("materialModel", parameterMap.get("materialModel")[0].trim()); } if (parameterMap.containsKey("materialCategory") && StringUtils.isNotBlank(parameterMap.get("materialCategory")[0])) { paramMap.put("materialCategory", parameterMap.get("materialCategory")[0].trim()); } } return super.getBaseMapper().getLswMaterialListData(pageData, paramMap); } @Override @Transactional(rollbackFor = Exception.class) public boolean saveOrUpdateMaterial(Map<String, MesProductionOrder> orderMap, List<OrderBomDTO> orderBomDTOList) { Map<String, LswMaterial> addMap = new HashMap<>(); for (Map.Entry<String, MesProductionOrder> entry : orderMap.entrySet()) { MesProductionOrder order = entry.getValue(); LswMaterial material = queryByMaterialNumber(order.getMaterialNumber()); if (material == null) { //æ°å¢ç©æ material = new LswMaterial(); material.setMaterialStatus(CommonConstant.STATUS_1); material.setMaterialNumber(order.getMaterialNumber()); material.setMaterialName(order.getMaterialName()); material.setMaterialUnit(order.getProductionUnit()); material.setDelFlag(CommonConstant.DEL_FLAG_0); addMap.put(material.getMaterialNumber(), material); } } for (OrderBomDTO bomDTO : orderBomDTOList) { LswMaterial material = queryByMaterialNumber(bomDTO.getMATNR()); if (material == null) { //æ°å¢ç©æ material = new LswMaterial(); material.setMaterialStatus(CommonConstant.STATUS_1); material.setMaterialNumber(bomDTO.getMATNR()); material.setMaterialName(bomDTO.getMAKTX()); material.setMaterialUnit(bomDTO.getMEINS()); material.setDelFlag(CommonConstant.DEL_FLAG_0); addMap.put(material.getMaterialNumber(), material); } } if (CollectionUtil.isNotEmpty(addMap)) { Collection<LswMaterial> addList = addMap.values(); super.saveBatch(addList); } return true; } } src/main/java/org/jeecg/modules/mes/job/ProductionOrderSyncCreationJob.java
@@ -1,6 +1,7 @@ package org.jeecg.modules.mes.job; import lombok.extern.slf4j.Slf4j; import org.jeecg.modules.lsw.service.ILswMaterialService; import org.jeecg.modules.mdc.util.DateUtils; import org.jeecg.modules.mdc.util.ThrowableUtil; import org.jeecg.modules.mes.entity.MesProductionOrder; @@ -87,6 +88,8 @@ private ISysQuartzLogService sysQuartzLogService; @Autowired private IQuartzJobService quartzJobService; @Autowired private ILswMaterialService lswMaterialService; @Override public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { @@ -144,12 +147,19 @@ log.error("è¿åç±»åéè¯¯ï¼ class:{}", result == null ? null : result.getClass()); return; } //订åBOMæ°æ®å¤ç List<OrderBomDTO> orderBomDTOList = (List<OrderBomDTO>) result; b = processBillMaterialsService.saveOrUpdateOrderBom(orderMap, orderBomDTOList); if (!b) { log.error("ä¿å订åBOMå¤±è´¥ï¼æ¥æï¼{}", LocalDateTime.now()); return; } //ç©ææ°æ®å¤ç b = lswMaterialService.saveOrUpdateMaterial(orderMap, orderBomDTOList); if (!b) { log.error("ä¿åç©æå¤±è´¥ï¼æ¥æï¼{}", LocalDateTime.now()); return; } //订åå·¥åºåæ¥ Map<String, Object> orderProcessMap = orderProcessSync.syncOrderProcess(FACTORY_CODE, orderCodes); if (orderBomMap == null || !SUCCESS_CODE.equals(orderProcessMap.get("ztype"))) { src/main/java/org/jeecg/modules/mes/job/ProductionOrderSyncUpdateJob.java
@@ -1,6 +1,7 @@ package org.jeecg.modules.mes.job; import lombok.extern.slf4j.Slf4j; import org.jeecg.modules.lsw.service.ILswMaterialService; import org.jeecg.modules.mdc.util.DateUtils; import org.jeecg.modules.mdc.util.ThrowableUtil; import org.jeecg.modules.mes.entity.MesProductionOrder; @@ -87,6 +88,8 @@ private ISysQuartzLogService sysQuartzLogService; @Autowired private IQuartzJobService quartzJobService; @Autowired private ILswMaterialService lswMaterialService; @Override public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { @@ -150,6 +153,12 @@ log.error("ä¿å订åBOMå¤±è´¥ï¼æ¥æï¼{}", LocalDateTime.now()); return; } //ç©ææ°æ®å¤ç b = lswMaterialService.saveOrUpdateMaterial(orderMap, orderBomDTOList); if (!b) { log.error("ä¿åç©æå¤±è´¥ï¼æ¥æï¼{}", LocalDateTime.now()); return; } //订åå·¥åºåæ¥ Map<String, Object> orderProcessMap = orderProcessSync.syncOrderProcess(FACTORY_CODE, orderCodes); if (orderBomMap == null || !SUCCESS_CODE.equals(orderProcessMap.get("ztype"))) { src/main/java/org/jeecg/modules/wms/controller/WMSTestController.java
@@ -8,6 +8,7 @@ import org.jeecg.modules.wms.dto.ReceiveMESScanItemListResponse; import org.jeecg.modules.wms.request.ReceiveMESScanItemList; import org.jeecg.modules.wms.service.ReceiveWMSScanItemListService; import org.jeecg.modules.wms.service.WMSWebService; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -20,8 +21,6 @@ public class WMSTestController { @Value("${webservice.url}") private String url; @Value("${webservice.namespace}") private String namespace; @ApiOperation(value = "WMSéææµè¯-æ¥æ¶WMSç§»åºç»æ", notes = "WMSéææµè¯-æ¥æ¶WMSç§»åºç»æ") @PostMapping("/testReceiveWMSScanItemList") @@ -34,4 +33,15 @@ ReceiveMESScanItemListResponse response = service.receiveWMSScanItemList(request); return Result.ok(response); } @ApiOperation(value = "WMSéææµè¯-HelloWordæµè¯", notes = "WMSéææµè¯-HelloWordæµè¯") @PostMapping("/testHelloWorld") public Result<?> testHelloWorld() { JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setAddress(url); factory.setServiceClass(WMSWebService.class); WMSWebService service = (WMSWebService) factory.create(); String response = service.helloWorld(); return Result.ok(response); } } src/main/java/org/jeecg/modules/wms/service/WMSWebService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ package org.jeecg.modules.wms.service; import javax.jws.WebMethod; import javax.jws.WebResult; import javax.jws.WebService; @WebService(name = "WebService", targetNamespace = "http://tempuri.org") public interface WMSWebService { @WebMethod(operationName = "HelloWorld") @WebResult(name = "HelloWorldResponse") String helloWorld(); } src/main/java/org/jeecg/modules/wms/service/impl/ReceiveWMSScanItemListServiceImpl.java
@@ -6,13 +6,11 @@ import org.jeecg.modules.wms.dto.ReceiveMESScanItemListResponse; import org.jeecg.modules.wms.request.ReceiveMESScanItemList; import org.jeecg.modules.wms.service.ReceiveWMSScanItemListService; import org.springframework.stereotype.Service; import javax.jws.WebService; @Slf4j //@Service @WebService(name = "ReceiveWMSScanItemListService", targetNamespace = "http://xhj008.server.webservice.com", endpointInterface = "org.jeecg.modules.wms.service.ReceiveWMSScanItemListService") public class ReceiveWMSScanItemListServiceImpl implements ReceiveWMSScanItemListService {