| | |
| | | "name": "åææ°ç«ç¬MESæ°æ®åºè®¾è®¡", |
| | | "describe": "æè¿°åèªæ°ç«ç¬MESæ°æ®åºè®¾è®¡è¯¦æ
", |
| | | "avatar": "", |
| | | "version": "4.9.2", |
| | | "version": "4.9.4", |
| | | "createdTime": "2025-3-10 16:38:19", |
| | | "updatedTime": "2025-8-14 13:31:57", |
| | | "updatedTime": "2025-8-15 14:58:22", |
| | | "dbConns": [], |
| | | "profile": { |
| | | "default": { |
| | |
| | | "#DDE5FF" |
| | | ], |
| | | "DDLToggleCase": "L", |
| | | "menuWidth": "364px" |
| | | "menuWidth": "309px" |
| | | }, |
| | | "entities": [ |
| | | { |
| | |
| | | { |
| | | "defKey": "work_order_status", |
| | | "defName": "å·¥åç¶æ", |
| | | "comment": "æ°å»ºãå·²åå¸ãéåå¸", |
| | | "comment": "æ°å»ºãå·²åå¸ãæ§è¡ä¸ãå·²å
³é", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | |
| | | "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", |
| | | "defName": "å®é
æ¥å·¥æ°é", |
| | | "comment": "", |
| | |
| | | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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 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.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 |
| | | } |
| | |
| | | */ |
| | | 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; |
| | | } |
| | | } |
| | | } |