| | |
| | | "avatar": "", |
| | | "version": "4.9.2", |
| | | "createdTime": "2025-3-10 16:38:19", |
| | | "updatedTime": "2025-8-14 13:31:57", |
| | | "updatedTime": "2025-8-15 14:58:22", |
| | | "dbConns": [], |
| | | "profile": { |
| | | "default": { |
| | |
| | | { |
| | | "defKey": "work_order_status", |
| | | "defName": "å·¥åç¶æ", |
| | | "comment": "æ°å»ºãå·²åå¸ãéåå¸", |
| | | "comment": "æ°å»ºãå·²åå¸ãæ§è¡ä¸ãå·²å
³é", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | |
| | | "extProps": {}, |
| | | "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792", |
| | | "id": "2150E931-22A6-452C-BD42-54A37E0A5968" |
| | | }, |
| | | { |
| | | "defKey": "completeness_check_flag", |
| | | "defName": "æ¯å¦éè¿é½å¥æ§æ£æ¥", |
| | | "comment": "0å¦1æ¯", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "6F7C1C5C-D159-41E6-BF9D-54DEEFA79AFF", |
| | | "id": "D9F104A5-0DF1-40FB-8F0D-850E0E0C7EC6" |
| | | }, |
| | | { |
| | | "defKey": "equipment_inspection_flag", |
| | | "defName": "æ¯å¦éè¿è®¾å¤ç¹æ£", |
| | | "comment": "0å¦1æ¯", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "6F7C1C5C-D159-41E6-BF9D-54DEEFA79AFF", |
| | | "id": "CAF6B87F-AC08-41D7-867B-31B6906A35FC" |
| | | }, |
| | | { |
| | | "defKey": "process_inspection_flag", |
| | | "defName": "æ¯å¦éè¿å·¥èºç¹æ£", |
| | | "comment": "0å¦1æ¯", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "6F7C1C5C-D159-41E6-BF9D-54DEEFA79AFF", |
| | | "id": "17F725F0-ADC2-4265-9136-125AE1FDA8CA" |
| | | }, |
| | | { |
| | | "defKey": "actual_quantity", |
| | |
| | | "codeRoot": "" |
| | | } |
| | | }, |
| | | "defKey": "lsw_âmaterial", |
| | | "defKey": "lsw_material", |
| | | "defName": "线边åºç©æä¿¡æ¯", |
| | | "comment": "", |
| | | "properties": { |
| | |
| | | "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": "æå/夿³å
°/å
æ³å
°/æ¯å¯/é
ä»¶", |
| | |
| | | "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": [], |
| | |
| | | @Excel(name = "夿³¨", width = 15) |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | /**产线类å*/ |
| | | @Excel(name = "产线类å", width = 15) |
| | | @ApiModelProperty(value = "产线类å") |
| | | private String productionType; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.base.enums; |
| | | |
| | | |
| | | public enum ProductionTypeEnum { |
| | | /** |
| | | * è£
é
|
| | | */ |
| | | ASSEMBLE, |
| | | /** |
| | | * å
æ³å
° |
| | | */ |
| | | INNERFLANGE, |
| | | /** |
| | | * 夿³å
° |
| | | */ |
| | | OUTERFLANGE, |
| | | /** |
| | | * çå¤ç |
| | | */ |
| | | HEATTREATMENT |
| | | } |
| | |
| | | |
| | | private String mdcFlag; |
| | | |
| | | private String productionType; |
| | | |
| | | private List<FactoryTreeModel> children = new ArrayList<>(); |
| | | |
| | | public FactoryTreeModel() { |
| | |
| | | this.updateTime = factory.getUpdateTime(); |
| | | this.mdcFlag = factory.getMdcFlag(); |
| | | this.factoryCategory = factory.getFactoryCategory(); |
| | | this.productionType = factory.getProductionType(); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | */ |
| | | @Api(tags = "线边åºç©æä¿¡æ¯") |
| | | @RestController |
| | | @RequestMapping("/lswmaterial/lswMaterial") |
| | | @RequestMapping("/lsw/lswMaterial") |
| | | @Slf4j |
| | | public class LswMaterialController { |
| | | @Autowired |
| | |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "线边åºç©æä¿¡æ¯-å页å表æ¥è¯¢") |
| | | @ApiOperation(value = "线边åºç©æä¿¡æ¯-å页å表æ¥è¯¢", notes = "线边åºç©æä¿¡æ¯-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<LswMaterial>> queryPageList(LswMaterial lswMaterial, |
| | |
| | | @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("æä½æå"); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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()); |
| | |
| | | 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") |
| | |
| | | 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; |
| | |
| | | /** |
| | | * @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; |
| | | } |
| | |
| | | |
| | | import javax.persistence.Table; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | /**æ°é*/ |
| | | @Excel(name = "æ°é", width = 15) |
| | | @ApiModelProperty(value = "æ°é") |
| | | private Double quantity; |
| | | private BigDecimal quantity; |
| | | /**åºåå°ID*/ |
| | | @Excel(name = "åºåå°ID", width = 15) |
| | | @Dict(dictTable = "base_line_side_warehouse", dicCode = "id", dicText = "warehouse_name") |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.lsw.enums; |
| | | |
| | | |
| | | public enum MaterialCategory { |
| | | /** |
| | | * æå |
| | | */ |
| | | FINISHED, |
| | | /** |
| | | * åæå |
| | | */ |
| | | HALF, |
| | | /** |
| | | * æ¯å¯ |
| | | */ |
| | | RAW, |
| | | /** |
| | | * é
ä»¶ |
| | | */ |
| | | PARTS; |
| | | |
| | | /** |
| | | * @param name æä¸¾çåç§° |
| | | * @return 对åºç MaterialCategory æä¸¾ç±»åï¼å¦ææªæ¾å°åè¿å null |
| | | */ |
| | | public static MaterialCategory fromName(String name) { |
| | | for (MaterialCategory category : MaterialCategory.values()) { |
| | | if (category.name().equals(name)) { |
| | | return category; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.lsw.enums; |
| | | |
| | | public enum MaterialCategoryEnum { |
| | | FINISHED_PRODUCT, //æå |
| | | OUTER_FLANGE, //夿³å
° |
| | | INNER_FLANGE, //å
æ³å
° |
| | | COMPONENTS, //é
ä»¶ |
| | | BLANK, //æ¯å¯ |
| | | ; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInventory; |
| | | import org.jeecg.modules.lsw.vo.LswMaterialInventoryVo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return List<LswMaterialInventory> |
| | | */ |
| | | public List<LswMaterialInventory> selectByMainId(@Param("mainId") String mainId); |
| | | |
| | | List<LswMaterialInventoryVo> selectLineSideMaterialInventoryByMaterialNumber(@Param("materialNumberList") List<String> bomMaterialNumberList, |
| | | @Param("factoryId") String factoryId); |
| | | } |
| | |
| | | FROM lsw_material_inventory |
| | | WHERE |
| | | material_id = #{mainId} </select> |
| | | <select id="selectLineSideMaterialInventoryByMaterialNumber" |
| | | resultType="org.jeecg.modules.lsw.vo.LswMaterialInventoryVo"> |
| | | SELECT |
| | | t1.material_number materialNumber, |
| | | t1.material_name materialName, |
| | | SUM(t2.quantity) AS stockQuantity |
| | | FROM lsw_material t1 |
| | | INNER JOIN lsw_material_inventory t2 ON t1.id = t2.material_id |
| | | WHERE t1.material_number IN |
| | | <foreach collection="materialNumberList" item="item" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | AND t2.warehouse_id = #{factoryId} |
| | | AND t1.del_flag = 0 |
| | | GROUP BY |
| | | t1.material_number, |
| | | t1.material_name |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInventory; |
| | | import org.jeecg.modules.lsw.vo.LswMaterialInventoryVo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return List<LswMaterialInventory> |
| | | */ |
| | | public List<LswMaterialInventory> selectByMainId(String mainId); |
| | | /** éè¿ç©æç¼ç å线边åºidæ¥è¯¢ç©æåºå */ |
| | | List<LswMaterialInventoryVo> selectLineSideMaterialInventoryByMaterialNumber(List<String> bomMaterialNumberList, String factoryId); |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | */ |
| | | 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); |
| | | } |
| | |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInventory; |
| | | import org.jeecg.modules.lsw.mapper.LswMaterialInventoryMapper; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialInventoryService; |
| | | import org.jeecg.modules.lsw.vo.LswMaterialInventoryVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public List<LswMaterialInventory> selectByMainId(String mainId) { |
| | | return lswMaterialInventoryMapper.selectByMainId(mainId); |
| | | } |
| | | |
| | | @Override |
| | | public List<LswMaterialInventoryVo> selectLineSideMaterialInventoryByMaterialNumber(List<String> bomMaterialNumberList, String factoryId) { |
| | | return lswMaterialInventoryMapper.selectLineSideMaterialInventoryByMaterialNumber(bomMaterialNumberList, factoryId); |
| | | } |
| | | } |
| | |
| | | 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; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.lsw.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class LswMaterialInventoryVo implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /**ç©æç¼ç */ |
| | | @ApiModelProperty(value = "ç©æç¼ç ") |
| | | private String materialNumber; |
| | | /**ç©æåç§°*/ |
| | | @ApiModelProperty(value = "ç©æåç§°") |
| | | private String materialName; |
| | | /**æ°é*/ |
| | | @ApiModelProperty(value = "åºåæ°é") |
| | | private BigDecimal stockQuantity; |
| | | } |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: é½å¥æ§æ£æ¥è®°å½ |
| | |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | @AutoLog(value = "é½å¥æ§æ£æ¥è®°å½-æ¹éæ·»å ") |
| | | @ApiOperation(value="é½å¥æ§æ£æ¥è®°å½-æ¹éæ·»å ", notes="é½å¥æ§æ£æ¥è®°å½-æ¹éæ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:mes_kitting_completeness_check:addBatch") |
| | | @PostMapping(value = "/addBatch") |
| | | public Result<String> addBatch(@RequestBody List<MesKittingCompletenessCheck> mesKittingCompletenessCheckList) { |
| | | mesKittingCompletenessCheckService.batchSave(mesKittingCompletenessCheckList); |
| | | return Result.OK("æ¹éæ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | |
| | | package org.jeecg.modules.mes.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.modules.mes.entity.MesProductionOrder; |
| | | import org.jeecg.modules.mes.enums.ProductionOrderStatus; |
| | | import org.jeecg.modules.mes.service.IMesProductionOrderService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Description: SAPç产订å |
| | |
| | | } |
| | | return Result.OK(mesProductionOrder); |
| | | } |
| | | |
| | | @ApiOperation(value = "SAPç产订å-æ¥è¯¢å¯æ¥å·¥çç产订å", notes = "SAPç产订å-æ¥è¯¢å¯æ¥å·¥çç产订å") |
| | | @GetMapping(value = "/selectReportWorkOrderList") |
| | | public Result<?> selectReportWorkOrderList(MesProductionOrder mesProductionOrder) { |
| | | if (StringUtils.isBlank(mesProductionOrder.getMaterialNumber())) { |
| | | return Result.error("è¯·ä¼ å
¥å¿
è¦çæ¥è¯¢åæ°ï¼"); |
| | | } |
| | | List<MesProductionOrder> orderList = mesProductionOrderService.list(new LambdaQueryWrapper<MesProductionOrder>() |
| | | .eq(MesProductionOrder::getMaterialNumber, mesProductionOrder.getMaterialNumber()) |
| | | .eq(MesProductionOrder::getOrderStatus, ProductionOrderStatus.REL.name()) |
| | | .eq(MesProductionOrder::getDelFlag, CommonConstant.DEL_FLAG_0) |
| | | .orderByAsc(MesProductionOrder::getPlanStart)); |
| | | List<Map<String, Object>> res = orderList.stream().map(order -> { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("title", order.getOrderCode()); |
| | | map.put("label", order.getOrderCode()); |
| | | map.put("value", order.getId()); |
| | | return map; |
| | | }).collect(Collectors.toList()); |
| | | return Result.OK(res); |
| | | } |
| | | } |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.mes.dto.MesProductionWorkOrderRepublishRequest; |
| | | import org.jeecg.modules.mes.dto.MesProductionWorkScheduleRequest; |
| | | import org.jeecg.modules.mes.entity.MesKittingCompletenessCheck; |
| | | import org.jeecg.modules.mes.entity.MesProductionWorkOrder; |
| | | import org.jeecg.modules.mes.enums.ProductionWorkOrderStatus; |
| | | import org.jeecg.modules.mes.service.IMesProductionWorkOrderService; |
| | | import org.jeecg.modules.mes.utils.CommonUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | |
| | | |
| | | @AutoLog(value = "æäº§å·¥å-åå¸æäº§è®¡å") |
| | | @ApiOperation(value = "æäº§å·¥å-åå¸æäº§è®¡å", notes = "æäº§å·¥å-åå¸æäº§è®¡å") |
| | | //@RequiresPermissions("mes:production:work:order:publish") |
| | | //@RequiresPermissions("org.jeecg.modules:mes_production_work_order:publish") |
| | | @RequestMapping(value = "/publish", method = {RequestMethod.POST, RequestMethod.PUT}) |
| | | public Result<String> publish(@RequestParam("ids") String ids) { |
| | | List<String> idList = Arrays.asList(ids.split(",")); |
| | |
| | | MesProductionWorkOrder publish = new MesProductionWorkOrder() |
| | | .setId(id) |
| | | .setPublishTime(new Date()) |
| | | .setPublisher(Objects.requireNonNull(getCurrentUser()).getUsername()) |
| | | .setPublisher(Objects.requireNonNull(CommonUtils.getCurrentUser()).getUsername()) |
| | | .setWorkOrderStatus(ProductionWorkOrderStatus.PUBLISHED.name()); |
| | | publishList.add(publish); |
| | | }); |
| | |
| | | |
| | | @AutoLog(value = "æäº§å·¥å-éåå¸æäº§è®¡å") |
| | | @ApiOperation(value="æäº§å·¥å-éåå¸æäº§è®¡å", notes="éåå¸æäº§è®¡å") |
| | | //@RequiresPermissions("mes:production:work:order:republish") |
| | | //@RequiresPermissions("org.jeecg.modules:mes_production_work_order:republish") |
| | | @PostMapping(value = "/republish") |
| | | public Result<String> republish(@RequestBody MesProductionWorkOrderRepublishRequest request) { |
| | | MesProductionWorkOrder workOrder = mesProductionWorkOrderService.getById(request.getId()); |
| | |
| | | MesProductionWorkOrder republish = new MesProductionWorkOrder() |
| | | .setId(request.getId()) |
| | | .setPlanQuantity(request.getPlanQuantity()) |
| | | .setRepublisher(Objects.requireNonNull(getCurrentUser()).getUsername()) |
| | | .setRepublisher(Objects.requireNonNull(Objects.requireNonNull(CommonUtils.getCurrentUser()).getUsername())) |
| | | .setRepublishTime(new Date()) |
| | | .setRepublishReason(request.getRepublishReason()); |
| | | mesProductionWorkOrderService.updateById(republish); |
| | | return Result.ok("éå叿åï¼"); |
| | | } |
| | | |
| | | @AutoLog(value = "æäº§å·¥å-é½å¥æ§æ£æ¥") |
| | | @ApiOperation(value="æäº§å·¥å-é½å¥æ§æ£æ¥", notes="é½å¥æ§æ£æ¥") |
| | | //@RequiresPermissions("org.jeecg.modules:mes_production_work_order:workOrderCompletenessCheck") |
| | | @GetMapping(value = "/workOrderCompletenessCheck") |
| | | public Result<List<MesKittingCompletenessCheck>> workOrderCompletenessCheck(@RequestParam("id") String id) { |
| | | MesProductionWorkOrder workOrder = mesProductionWorkOrderService.getById(id); |
| | | if (workOrder == null) { |
| | | return Result.error("å·¥åä¸åå¨ï¼"); |
| | | } |
| | | if (!ProductionWorkOrderStatus.PUBLISHED.name().equals(workOrder.getWorkOrderStatus())) { |
| | | return Result.error("å½åå·¥åç¶æä¸è½è¿è¡é½å¥æ§æ£æ¥ï¼"); |
| | | } |
| | | List<MesKittingCompletenessCheck> list = mesProductionWorkOrderService.workOrderCompletenessCheck(workOrder); |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | @AutoLog(value = "æäº§å·¥å-æ§è¡æäº§å·¥å计å") |
| | | @ApiOperation(value = "æäº§å·¥å-æ§è¡æäº§å·¥å计å", notes = "æäº§å·¥å-æ§è¡æäº§å·¥å计å") |
| | | //@RequiresPermissions("org.jeecg.modules:mes_production_work_order:execute") |
| | | @GetMapping(value = "/execute") |
| | | public Result<?> execute(@RequestParam("id") String id) { |
| | | MesProductionWorkOrder workOrder = mesProductionWorkOrderService.getById(id); |
| | |
| | | return super.importExcel(request, response, MesProductionWorkOrder.class); |
| | | } |
| | | |
| | | private LoginUser getCurrentUser() { |
| | | try { |
| | | return (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | } catch (Exception e) { |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | |
| | | * @param mesWorkReporting |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "工忥工-æ·»å ") |
| | | @ApiOperation(value="工忥工-æ·»å ", notes="工忥工-æ·»å ") |
| | | @AutoLog(value = "工忥工-æ°å¢æ¥å·¥") |
| | | @ApiOperation(value="工忥工-æ°å¢æ¥å·¥", notes="工忥工-æ°å¢æ¥å·¥") |
| | | //@RequiresPermissions("org.jeecg.modules:mes_work_reporting:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody MesWorkReporting mesWorkReporting) { |
| | | mesWorkReportingService.save(mesWorkReporting); |
| | | mesWorkReportingService.addReporting(mesWorkReporting); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class MesProductionWorkOrderRepublishRequest { |
| | | |
| | |
| | | |
| | | /**计åç产æ°é*/ |
| | | @ApiModelProperty(value = "计åç产æ°é") |
| | | private Double planQuantity; |
| | | private BigDecimal planQuantity; |
| | | |
| | | /**éåå¸åå */ |
| | | @ApiModelProperty(value = "éåå¸åå ") |
| | |
| | | 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 requiredQuantity; |
| | | private BigDecimal requiredQuantity; |
| | | /**å®é
æ°é*/ |
| | | @Excel(name = "å®é
æ°é", width = 15) |
| | | @ApiModelProperty(value = "å®é
æ°é") |
| | | private Double actualQuantity; |
| | | private BigDecimal actualQuantity; |
| | | /**æ¯å¦é½å¤*/ |
| | | @Excel(name = "æ¯å¦é½å¤", width = 15) |
| | | @ApiModelProperty(value = "æ¯å¦é½å¤") |
| | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "å·¥åå·") |
| | | private String workOrderCode; |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "åºæ¬åä½") |
| | | private String productionUnit; |
| | | } |
| | |
| | | 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 planQuantity; |
| | | private BigDecimal planQuantity; |
| | | /**产线ID(åä½)*/ |
| | | @Excel(name = "产线ID(åä½)", width = 15) |
| | | @Dict(dictTable = "base_factory", dicCode = "id", dicText = "factory_name") |
| | |
| | | @Dict(dicCode = "work_order_status") |
| | | @ApiModelProperty(value = "å·¥åç¶æ") |
| | | private String workOrderStatus; |
| | | /**æ¯å¦éè¿é½å¥æ§æ£æ¥*/ |
| | | @Excel(name = "æ¯å¦éè¿é½å¥æ§æ£æ¥", width = 15, dicCode = "yn") |
| | | @Dict(dicCode = "yn") |
| | | @ApiModelProperty(value = "æ¯å¦éè¿é½å¥æ§æ£æ¥") |
| | | private String completenessCheckFlag = CommonConstant.DEFAULT_0; |
| | | /**æ¯å¦éè¿è®¾å¤ç¹æ£*/ |
| | | @Excel(name = "æ¯å¦éè¿è®¾å¤ç¹æ£", width = 15, dicCode = "yn") |
| | | @Dict(dicCode = "yn") |
| | | @ApiModelProperty(value = "æ¯å¦éè¿è®¾å¤ç¹æ£") |
| | | private String equipmentInspectionFlag = CommonConstant.DEFAULT_0; |
| | | /**æ¯å¦éè¿å·¥èºç¹æ£*/ |
| | | @Excel(name = "æ¯å¦éè¿å·¥èºç¹æ£", width = 15, dicCode = "yn") |
| | | @Dict(dicCode = "yn") |
| | | @ApiModelProperty(value = "æ¯å¦éè¿å·¥èºç¹æ£") |
| | | private String processInspectionFlag = CommonConstant.DEFAULT_0; |
| | | /**å®é
æ¥å·¥æ°é*/ |
| | | @Excel(name = "å®é
æ¥å·¥æ°é", width = 15) |
| | | @ApiModelProperty(value = "å®é
æ¥å·¥æ°é") |
| | | private Double actualQuantity; |
| | | private BigDecimal actualQuantity; |
| | | /**åå¸äºº*/ |
| | | @Excel(name = "åå¸äºº", width = 15) |
| | | @ApiModelProperty(value = "åå¸äºº") |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mes.enums; |
| | | |
| | | |
| | | public enum ProductionOrderStatus { |
| | | /** |
| | | * ä¸è¾¾ |
| | | */ |
| | | REL, |
| | | /** |
| | | * å
³é |
| | | */ |
| | | TECO |
| | | } |
| | |
| | | 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; |
| | |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | @Autowired |
| | | private IQuartzJobService quartzJobService; |
| | | @Autowired |
| | | private ILswMaterialService lswMaterialService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { |
| | |
| | | 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"))) { |
| | |
| | | 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; |
| | |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | @Autowired |
| | | private IQuartzJobService quartzJobService; |
| | | @Autowired |
| | | private ILswMaterialService lswMaterialService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { |
| | |
| | | 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"))) { |
| | |
| | | */ |
| | | public interface IMesKittingCompletenessCheckService extends IService<MesKittingCompletenessCheck> { |
| | | List<MesKittingCompletenessCheck> queryCompletenessCheckByWorkOrderId(String workOrderId); |
| | | |
| | | void batchSave(List<MesKittingCompletenessCheck> mesKittingCompletenessCheckList); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mes.dto.MesProductionWorkScheduleRequest; |
| | | import org.jeecg.modules.mes.entity.MesKittingCompletenessCheck; |
| | | import org.jeecg.modules.mes.entity.MesProductionWorkOrder; |
| | | |
| | | import java.util.List; |
| | |
| | | List<MesProductionWorkOrder> schedule(MesProductionWorkScheduleRequest request); |
| | | |
| | | IPage<MesProductionWorkOrder> queryPageList(Page<MesProductionWorkOrder> page, Map<String, String[]> parameterMap); |
| | | |
| | | List<MesKittingCompletenessCheck> workOrderCompletenessCheck(MesProductionWorkOrder workOrder); |
| | | } |
| | |
| | | public interface IMesWorkReportingService extends IService<MesWorkReporting> { |
| | | List<MesWorkReporting> queryWorkReportingByWorkOrderId(String workOrderId); |
| | | List<MesWorkReporting> queryWorkReportingByOrderId(String orderId); |
| | | |
| | | void addReporting(MesWorkReporting mesWorkReporting); |
| | | } |
| | |
| | | package org.jeecg.modules.mes.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.modules.mes.entity.MesKittingCompletenessCheck; |
| | | import org.jeecg.modules.mes.entity.MesProductionWorkOrder; |
| | | import org.jeecg.modules.mes.mapper.MesKittingCompletenessCheckMapper; |
| | | import org.jeecg.modules.mes.service.IMesKittingCompletenessCheckService; |
| | | import org.jeecg.modules.mes.service.IMesProductionWorkOrderService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Service |
| | | public class MesKittingCompletenessCheckServiceImpl extends ServiceImpl<MesKittingCompletenessCheckMapper, MesKittingCompletenessCheck> implements IMesKittingCompletenessCheckService { |
| | | |
| | | @Autowired |
| | | private IMesProductionWorkOrderService mesProductionWorkOrderService; |
| | | |
| | | @Override |
| | | public List<MesKittingCompletenessCheck> queryCompletenessCheckByWorkOrderId(String workOrderId) { |
| | | return baseMapper.queryCompletenessCheckByWorkOrderId(workOrderId); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void batchSave(List<MesKittingCompletenessCheck> mesKittingCompletenessCheckList) { |
| | | boolean allMatch = mesKittingCompletenessCheckList.stream() |
| | | .allMatch(item -> CommonConstant.DEFAULT_1.equals(item.getCheckFlag())); |
| | | //ç©æé½é½å¤ï¼æ´æ°æäº§å·¥åé½å¥æ£æ¥ç¶æ |
| | | if (allMatch) { |
| | | MesProductionWorkOrder order = new MesProductionWorkOrder() |
| | | .setId(mesKittingCompletenessCheckList.get(0).getWorkOrderId()) |
| | | .setCompletenessCheckFlag(CommonConstant.DEFAULT_1); |
| | | mesProductionWorkOrderService.updateById(order); |
| | | } |
| | | //ä¿åé½å¥æ£æ¥è®°å½ |
| | | saveBatch(mesKittingCompletenessCheckList); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.modules.base.entity.Factory; |
| | | import org.jeecg.modules.base.entity.LineSideWarehouse; |
| | | import org.jeecg.modules.base.entity.Shift; |
| | | import org.jeecg.modules.base.entity.ShiftGroup; |
| | | import org.jeecg.modules.base.service.IFactoryService; |
| | | import org.jeecg.modules.base.service.ILineSideWarehouseService; |
| | | import org.jeecg.modules.base.service.IShiftGroupService; |
| | | import org.jeecg.modules.base.service.IShiftService; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInventory; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialInventoryService; |
| | | import org.jeecg.modules.lsw.vo.LswMaterialInventoryVo; |
| | | import org.jeecg.modules.mes.dto.MesProductionWorkScheduleRequest; |
| | | import org.jeecg.modules.mes.entity.MesKittingCompletenessCheck; |
| | | import org.jeecg.modules.mes.entity.MesProductionOrder; |
| | | import org.jeecg.modules.mes.enums.ProductionOrderStatus; |
| | | import org.jeecg.modules.mes.service.IMesProductionOrderService; |
| | | import org.jeecg.modules.mes.service.IMesProductionWorkOrderService; |
| | | import org.jeecg.modules.mes.entity.MesProductionWorkOrder; |
| | | import org.jeecg.modules.mes.mapper.MesProductionWorkOrderMapper; |
| | | import org.jeecg.modules.system.service.ISysDictService; |
| | | import org.jeecg.modules.pms.entity.PmsProcessBillMaterials; |
| | | import org.jeecg.modules.pms.entity.PmsProcessBillMaterialsDetail; |
| | | import org.jeecg.modules.pms.service.IPmsProcessBillMaterialsDetailService; |
| | | import org.jeecg.modules.pms.service.IPmsProcessBillMaterialsService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDate; |
| | | import java.time.ZoneId; |
| | | import java.time.temporal.ChronoUnit; |
| | |
| | | private IShiftGroupService shiftGroupService; |
| | | @Autowired |
| | | private IFactoryService factoryService; |
| | | @Autowired |
| | | private IMesProductionOrderService mesProductionOrderService; |
| | | @Autowired |
| | | private IPmsProcessBillMaterialsService pmsProcessBillMaterialsService; |
| | | @Autowired |
| | | private IPmsProcessBillMaterialsDetailService pmsProcessBillMaterialsDetailService; |
| | | @Autowired |
| | | private ILswMaterialInventoryService lswMaterialInventoryService; |
| | | @Autowired |
| | | private ILineSideWarehouseService lineSideWarehouseService; |
| | | |
| | | @Override |
| | | public List<MesProductionWorkOrder> schedule(MesProductionWorkScheduleRequest request) { |
| | |
| | | queryWrapper.orderByAsc("t1.work_order_date"); |
| | | return this.baseMapper.queryPageList(page, queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<MesKittingCompletenessCheck> workOrderCompletenessCheck(MesProductionWorkOrder workOrder) { |
| | | //æ ¹æ®å½åæäº§å·¥åç¡®å®ç产订å |
| | | List<MesProductionOrder> orderList = mesProductionOrderService.list(new LambdaQueryWrapper<MesProductionOrder>() |
| | | .eq(MesProductionOrder::getMaterialNumber, workOrder.getMaterialNumber()) |
| | | .eq(MesProductionOrder::getOrderStatus, ProductionOrderStatus.REL.name()) |
| | | .eq(MesProductionOrder::getDelFlag, CommonConstant.DEL_FLAG_0) |
| | | .orderByAsc(MesProductionOrder::getPlanStart)); |
| | | if (orderList.isEmpty()) { |
| | | throw new JeecgBootException("æªæ¾å°è¯¥ç©æçå
³èç产订åï¼"); |
| | | } |
| | | //é»è®¤åæ¶é´ææ©æªå®æç订åï¼ä¹å°±æ¯ç¬¬ä¸é¡¹ |
| | | MesProductionOrder order = orderList.get(0); |
| | | //æ ¹æ®ç产订åidåç©æç¼ç æ¥è¯¢è®¢åBOM |
| | | PmsProcessBillMaterials processBillMaterials = pmsProcessBillMaterialsService.list(new LambdaQueryWrapper<PmsProcessBillMaterials>() |
| | | .eq(PmsProcessBillMaterials::getOrderId, order.getId()) |
| | | .eq(PmsProcessBillMaterials::getMaterialNumber, workOrder.getMaterialNumber())) |
| | | .stream().findFirst().orElse(null); |
| | | if (processBillMaterials == null) { |
| | | throw new JeecgBootException("æªæ¾å°ä¸è¯¥ç©æå
³èç订åBOMï¼"); |
| | | } |
| | | //æ¥è¯¢å·¥åæå±äº§çº¿å¯¹åºççº¿è¾¹ä» |
| | | LineSideWarehouse lineSideWarehouse = lineSideWarehouseService.list(new LambdaQueryWrapper<LineSideWarehouse>() |
| | | .eq(LineSideWarehouse::getFactoryId, workOrder.getFactoryId()) |
| | | .eq(LineSideWarehouse::getDelFlag, CommonConstant.DEL_FLAG_0) |
| | | .eq(LineSideWarehouse::getWarehouseStatus, CommonConstant.DEFAULT_1)) |
| | | .stream().findFirst().orElse(null); |
| | | if (lineSideWarehouse == null) { |
| | | throw new JeecgBootException("该产线æªé
置线边ä»ï¼"); |
| | | } |
| | | //订åBOMæç» |
| | | List<PmsProcessBillMaterialsDetail> processBillMaterialsDetails = pmsProcessBillMaterialsDetailService.queryByMaterialId(processBillMaterials.getId()); |
| | | //æ¥è¯¢è®¢åBOMæç»ä¸çç©æå¨è¯¥äº§çº¿çº¿è¾¹ä»ä¸çåºå |
| | | List<String> bomMaterialNumberList = processBillMaterialsDetails.stream() |
| | | .map(PmsProcessBillMaterialsDetail::getMaterialNumber).collect(Collectors.toList()); |
| | | Map<String, LswMaterialInventoryVo> lswMaterialInventoryMap = lswMaterialInventoryService |
| | | .selectLineSideMaterialInventoryByMaterialNumber(bomMaterialNumberList, lineSideWarehouse.getId()).stream() |
| | | .collect(Collectors.toMap(LswMaterialInventoryVo::getMaterialNumber, v1 -> v1, (v1, v2) -> v1)); |
| | | List<MesKittingCompletenessCheck> completenessCheckResultList = CollectionUtil.newArrayList(); |
| | | //æ ¹æ®è®¢åBOMæç»ååºé½å¥æ£æ¥ç»æ |
| | | for (PmsProcessBillMaterialsDetail processBillMaterialsDetail : processBillMaterialsDetails) { |
| | | LswMaterialInventoryVo materialInventoryVo = lswMaterialInventoryMap.get(processBillMaterialsDetail.getMaterialNumber()); |
| | | MesKittingCompletenessCheck completenessCheckItem = new MesKittingCompletenessCheck() |
| | | .setMaterialNumber(processBillMaterialsDetail.getMaterialNumber()) |
| | | .setMaterialName(processBillMaterialsDetail.getMaterialName()) |
| | | //éæ±æ°é = (bomæç»çéæ±æ°é / bom订åçæ°é) * æäº§å·¥å计åç产æ°é |
| | | .setRequiredQuantity(processBillMaterialsDetail.getUsageQuantity() |
| | | .divide(processBillMaterials.getProductionQuantity(), 2, RoundingMode.HALF_UP) |
| | | .multiply(workOrder.getPlanQuantity())) |
| | | .setActualQuantity(materialInventoryVo == null ? BigDecimal.ZERO : materialInventoryVo.getStockQuantity()) |
| | | .setProductionUnit(processBillMaterialsDetail.getProductionUnit()); |
| | | completenessCheckResultList.add(completenessCheckItem); |
| | | } |
| | | completenessCheckResultList.forEach(item -> { |
| | | if (item.getRequiredQuantity().compareTo(item.getActualQuantity()) > 0) { |
| | | item.setCheckFlag(CommonConstant.DEFAULT_0); |
| | | } else { |
| | | item.setCheckFlag(CommonConstant.DEFAULT_1); |
| | | } |
| | | }); |
| | | return completenessCheckResultList; |
| | | } |
| | | } |
| | |
| | | package org.jeecg.modules.mes.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.modules.base.entity.Factory; |
| | | import org.jeecg.modules.base.entity.LineSideWarehouse; |
| | | import org.jeecg.modules.base.entity.Shift; |
| | | import org.jeecg.modules.base.service.IFactoryService; |
| | | import org.jeecg.modules.base.service.ILineSideWarehouseService; |
| | | 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.enums.MaterialCategory; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialInboundService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialService; |
| | | import org.jeecg.modules.mes.entity.MesProductionWorkOrder; |
| | | import org.jeecg.modules.mes.entity.MesWorkReporting; |
| | | import org.jeecg.modules.mes.mapper.MesWorkReportingMapper; |
| | | import org.jeecg.modules.mes.service.IMesProductionWorkOrderService; |
| | | import org.jeecg.modules.mes.service.IMesWorkReportingService; |
| | | import org.jeecg.modules.mes.utils.CommonUtils; |
| | | import org.jeecg.modules.system.service.ISysBusinessCodeRuleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * @Description: 工忥工 |
| | |
| | | @Service |
| | | public class MesWorkReportingServiceImpl extends ServiceImpl<MesWorkReportingMapper, MesWorkReporting> implements IMesWorkReportingService { |
| | | |
| | | @Autowired |
| | | private IMesProductionWorkOrderService mesProductionWorkOrderService; |
| | | @Autowired |
| | | private ILswMaterialService lswMaterialService; |
| | | @Autowired |
| | | private IFactoryService factoryService; |
| | | @Autowired |
| | | private IShiftService shiftService; |
| | | @Autowired |
| | | private ILineSideWarehouseService lineSideWarehouseService; |
| | | @Autowired |
| | | private ILswMaterialInboundService lswMaterialInboundService; |
| | | @Autowired |
| | | private ISysBusinessCodeRuleService sysBusinessCodeRuleService; |
| | | |
| | | @Override |
| | | public List<MesWorkReporting> queryWorkReportingByWorkOrderId(String workOrderId) { |
| | | return baseMapper.queryWorkReportingByWorkOrderId(workOrderId); |
| | |
| | | public List<MesWorkReporting> queryWorkReportingByOrderId(String orderId) { |
| | | return baseMapper.queryWorkReportingByOrderId(orderId); |
| | | } |
| | | |
| | | @Override |
| | | public void addReporting(MesWorkReporting mesWorkReporting) { |
| | | MesProductionWorkOrder workOrder = mesProductionWorkOrderService.getById(mesWorkReporting.getWorkOrderId()); |
| | | if (workOrder == null) { |
| | | throw new JeecgBootException("å·¥åä¸åå¨ï¼"); |
| | | } |
| | | LswMaterial material = lswMaterialService.list(new LambdaQueryWrapper<LswMaterial>() |
| | | .eq(LswMaterial::getMaterialNumber, workOrder.getMaterialNumber()) |
| | | .eq(LswMaterial::getDelFlag, CommonConstant.DEL_FLAG_0)).stream() |
| | | .findAny().orElse(null); |
| | | if (material == null) { |
| | | throw new JeecgBootException("ç©æä¸åå¨ï¼"); |
| | | } |
| | | MaterialCategory materialCategory = MaterialCategory.fromName(material.getMaterialCategory()); |
| | | if (materialCategory == null) { |
| | | throw new JeecgBootException("æªç¥çç©æç±»åï¼"); |
| | | } |
| | | //çäº§æ¹æ¬¡å· |
| | | String batchNumber = sysBusinessCodeRuleService.generateBusinessCodeSeq("WorkReportingBatchNumber"); |
| | | mesWorkReporting.setBatchNumber(batchNumber); |
| | | LineSideWarehouse lineSideWarehouse = lineSideWarehouseService.list(new LambdaQueryWrapper<LineSideWarehouse>() |
| | | .eq(LineSideWarehouse::getFactoryId, mesWorkReporting.getFactoryId()) |
| | | .eq(LineSideWarehouse::getDelFlag, CommonConstant.DEL_FLAG_0)) |
| | | .stream().findAny().orElse(null); |
| | | if (lineSideWarehouse == null) { |
| | | throw new JeecgBootException("线边ä»åºä¸åå¨ï¼"); |
| | | } |
| | | mesWorkReporting.setWarehouseId(lineSideWarehouse.getId()); |
| | | mesWorkReporting.setReporter(Objects.requireNonNull(CommonUtils.getCurrentUser()).getUsername()); |
| | | mesWorkReporting.setReportTime(new Date()); |
| | | String date = DateUtil.format(new Date(), "yyMMdd"); |
| | | switch (materialCategory) { |
| | | case FINISHED: |
| | | //æåæ¥å·¥é»è¾ |
| | | String palletNumber4 = sysBusinessCodeRuleService.generateBusinessCodeSeq("WorkReportingPalletNumber4"); |
| | | String finishedPalletNumber = material.getMaterialNumber() + date + palletNumber4; |
| | | mesWorkReporting.setPalletNumber(finishedPalletNumber); |
| | | //todo æ£åå
æ³å
°ï¼å¯¹åºæºå å
æ³å
°çº¿è¾¹åºï¼ã夿³å
°ï¼å¯¹åºæºå 夿³å
°çº¿è¾¹åºï¼ãå°å
åï¼å¯¹åºè£
é
线边åºï¼åºåï¼è°ç¨SAPæææ¥å£ |
| | | //todo è°ç¨SAPå·¥åºæ¥å·¥ |
| | | //todo æå°æåææ ç¾ãæ£éªæ è¯å¡ãç§»åºåãå®å·¥æ£éªå·¥åï¼å¤æçäº§è®¢åæ¯å¦éè¦å
³éï¼åæ ¼æ°é = è®¢åæ°éï¼ |
| | | break; |
| | | case HALF: |
| | | case RAW: |
| | | //åæåæ¥å·¥é»è¾ |
| | | Factory factory = factoryService.getById(mesWorkReporting.getFactoryId()); |
| | | Shift shift = shiftService.getById(workOrder.getShiftId()); |
| | | String palletNumber6 = sysBusinessCodeRuleService.generateBusinessCodeSeq("WorkReportingPalletNumber6"); |
| | | //æ¼æ¥åæåæ¥å·¥æå· |
| | | String halfPalletNumber = factory.getFactoryCode() + material.getMaterialNumber() + date + shift.getShiftCode() + palletNumber6; |
| | | mesWorkReporting.setPalletNumber(halfPalletNumber); |
| | | //todo æ£å对åºçº¿è¾¹åºï¼å¤æ³å
°æ¯å¯ãå
æ³å
°æ¯å¯ï¼åºååï¼è°ç¨SAPæææ¥å£ |
| | | //todo è°ç¨SAPå·¥åºæ¥å·¥ |
| | | break; |
| | | case PARTS: |
| | | break; |
| | | } |
| | | save(mesWorkReporting); |
| | | //线边åºå
¥åºé»è¾ |
| | | LswMaterialInbound lswMaterialInbound = new LswMaterialInbound() |
| | | .setFactoryId(mesWorkReporting.getFactoryId()) |
| | | .setMaterialNumber(material.getMaterialNumber()) |
| | | .setMaterialName(material.getMaterialName()) |
| | | .setBatchNumber(batchNumber) |
| | | .setQuantity(mesWorkReporting.getQuantity()) |
| | | .setWarehouseId(lineSideWarehouse.getId()); |
| | | lswMaterialInboundService.save(lswMaterialInbound); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mes.utils; |
| | | |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | |
| | | public class CommonUtils { |
| | | |
| | | public static LoginUser getCurrentUser() { |
| | | try { |
| | | return (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | } catch (Exception e) { |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | public class WMSTestController { |
| | | @Value("${webservice.url}") |
| | | private String url; |
| | | @Value("${webservice.namespace}") |
| | | private String namespace; |
| | | |
| | | @ApiOperation(value = "WMSéææµè¯-æ¥æ¶WMSç§»åºç»æ", notes = "WMSéææµè¯-æ¥æ¶WMSç§»åºç»æ") |
| | | @PostMapping("/testReceiveWMSScanItemList") |
| | |
| | | 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); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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(); |
| | | } |
| | |
| | | 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 { |
| | | |