| | |
| | | "avatar": "", |
| | | "version": "4.9.2", |
| | | "createdTime": "2025-3-10 16:38:19", |
| | | "updatedTime": "2025-8-20 15:14:16", |
| | | "updatedTime": "2025-8-27 18:34:50", |
| | | "dbConns": [], |
| | | "profile": { |
| | | "default": { |
| | |
| | | "#DDE5FF" |
| | | ], |
| | | "DDLToggleCase": "L", |
| | | "menuWidth": "304px" |
| | | "menuWidth": "331px" |
| | | }, |
| | | "entities": [ |
| | | { |
| | |
| | | "extProps": {}, |
| | | "domain": "54611CCC-CA4B-42E1-9F32-4944C85B85A6", |
| | | "id": "41E30E92-FC92-4E2C-AE7D-AFF4D9371B27" |
| | | }, |
| | | { |
| | | "defKey": "reference_file", |
| | | "defName": "åèæä»¶", |
| | | "comment": "ä¿å
»æ¶åèçä¿å
»æ¥éª¤", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "B17BDED3-085F-40E1-9019-3B79CF2BF075", |
| | | "extProps": {}, |
| | | "domain": "13DE7063-440C-426F-B1DF-25EC824C6DB8", |
| | | "id": "5576D652-16B0-4098-A22E-0B2F5EF98107" |
| | | } |
| | | ], |
| | | "correlations": [], |
| | |
| | | "id": "337FC9CD-0DAD-4781-B0BB-7FBCB5C14658" |
| | | }, |
| | | { |
| | | "defKey": "item_condition", |
| | | "defName": "ä¿å
»æ¡ä»¶", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573", |
| | | "id": "7A893A46-3C20-4E23-A204-46A0F0394933" |
| | | }, |
| | | { |
| | | "defKey": "item_name", |
| | | "defName": "ä¿å
»é¡¹ç®", |
| | | "comment": "", |
| | |
| | | }, |
| | | { |
| | | "defKey": "item_demand_alias", |
| | | "defName": "ä¿å
»è¦æ±2", |
| | | "defName": "å¼å¸¸å¤çåºå", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | |
| | | "id": "9056CBAC-AC31-46AC-802D-7ECC455F7834" |
| | | }, |
| | | { |
| | | "defKey": "inventory_id", |
| | | "defName": "åºåID", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "16120F75-6AA7-4483-868D-F07F511BB081", |
| | | "id": "F0CCB50E-95F3-4D54-BE72-846BDAD32511" |
| | | }, |
| | | { |
| | | "defKey": "warehouse_id", |
| | | "defName": "åºåå°", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "16120F75-6AA7-4483-868D-F07F511BB081", |
| | | "id": "3892DFB2-BCFA-413E-9930-4B88E5C8EFE8" |
| | | }, |
| | | { |
| | | "defKey": "batch_number", |
| | | "defName": "æ¹æ¬¡å·", |
| | | "comment": "", |
| | |
| | | "extProps": {}, |
| | | "domain": "FF4459C5-6B45-4DBF-8FC0-E06239BC05B4", |
| | | "id": "5B833F2B-D8C6-478D-B830-604D2CC6AAF0" |
| | | }, |
| | | { |
| | | "defKey": "work_order_id", |
| | | "defName": "å·¥åID", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "16120F75-6AA7-4483-868D-F07F511BB081", |
| | | "id": "8D4EEF04-86ED-455F-A843-E9CAADBA042C" |
| | | } |
| | | ], |
| | | "correlations": [], |
| | |
| | | "id": "144B6087-1070-4007-9882-2A64F8AAAD91" |
| | | }, |
| | | { |
| | | "defKey": "order_category", |
| | | "defName": "ç§»åºç±»å", |
| | | "defKey": "inventory_id", |
| | | "defName": "åºåID", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792", |
| | | "id": "EB0DE062-AF2C-4401-8773-663BBDB65F84" |
| | | "domain": "16120F75-6AA7-4483-868D-F07F511BB081", |
| | | "id": "F0B826E3-51CF-4FA3-A239-95CFBAA64184" |
| | | }, |
| | | { |
| | | "defKey": "original_warehouse_id", |
| | |
| | | import java.net.URLDecoder; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | |
| | | /** |
| | | /** |
| | | * @Description: é¢å®å¯¿å½ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-07-28 |
| | | * @Date: 2025-07-28 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="é¢å®å¯¿å½") |
| | | @Api(tags = "é¢å®å¯¿å½") |
| | | @RestController |
| | | @RequestMapping("/cms/ratedLife") |
| | | @Slf4j |
| | | public class RatedLifeController extends JeecgController<RatedLife, IRatedLifeService> { |
| | | @Autowired |
| | | private IRatedLifeService ratedLifeService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param ratedLife |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "é¢å®å¯¿å½-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="é¢å®å¯¿å½-å页å表æ¥è¯¢", notes="é¢å®å¯¿å½-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<RatedLife>> queryPageList(RatedLife ratedLife, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<RatedLife> queryWrapper = QueryGenerator.initQueryWrapper(ratedLife, req.getParameterMap()); |
| | | Page<RatedLife> page = new Page<RatedLife>(pageNo, pageSize); |
| | | IPage<RatedLife> pageList = ratedLifeService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param ratedLife |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "é¢å®å¯¿å½-æ·»å ") |
| | | @ApiOperation(value="é¢å®å¯¿å½-æ·»å ", notes="é¢å®å¯¿å½-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_rated_life:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody RatedLife ratedLife) { |
| | | ratedLifeService.save(ratedLife); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param ratedLife |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "é¢å®å¯¿å½-ç¼è¾") |
| | | @ApiOperation(value="é¢å®å¯¿å½-ç¼è¾", notes="é¢å®å¯¿å½-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_rated_life:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody RatedLife ratedLife) { |
| | | ratedLifeService.updateById(ratedLife); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "é¢å®å¯¿å½-éè¿idå é¤") |
| | | @ApiOperation(value="é¢å®å¯¿å½-éè¿idå é¤", notes="é¢å®å¯¿å½-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_rated_life:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | ratedLifeService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "é¢å®å¯¿å½-æ¹éå é¤") |
| | | @ApiOperation(value="é¢å®å¯¿å½-æ¹éå é¤", notes="é¢å®å¯¿å½-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_rated_life:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.ratedLifeService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "é¢å®å¯¿å½-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value="é¢å®å¯¿å½-éè¿idæ¥è¯¢", notes="é¢å®å¯¿å½-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<RatedLife> queryById(@RequestParam(name="id",required=true) String id) { |
| | | RatedLife ratedLife = ratedLifeService.getById(id); |
| | | if(ratedLife==null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(ratedLife); |
| | | } |
| | | @Autowired |
| | | private IRatedLifeService ratedLifeService; |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param ratedLife |
| | | */ |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param ratedLife |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "é¢å®å¯¿å½-å页å表æ¥è¯¢") |
| | | @ApiOperation(value = "é¢å®å¯¿å½-å页å表æ¥è¯¢", notes = "é¢å®å¯¿å½-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<RatedLife>> queryPageList(RatedLife ratedLife, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<RatedLife> queryWrapper = QueryGenerator.initQueryWrapper(ratedLife, req.getParameterMap()); |
| | | Page<RatedLife> page = new Page<RatedLife>(pageNo, pageSize); |
| | | IPage<RatedLife> pageList = ratedLifeService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param ratedLife |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "é¢å®å¯¿å½-æ·»å ") |
| | | @ApiOperation(value = "é¢å®å¯¿å½-æ·»å ", notes = "é¢å®å¯¿å½-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_rated_life:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody RatedLife ratedLife) { |
| | | ratedLifeService.save(ratedLife); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param ratedLife |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "é¢å®å¯¿å½-ç¼è¾") |
| | | @ApiOperation(value = "é¢å®å¯¿å½-ç¼è¾", notes = "é¢å®å¯¿å½-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_rated_life:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody RatedLife ratedLife) { |
| | | ratedLifeService.updateById(ratedLife); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "é¢å®å¯¿å½-éè¿idå é¤") |
| | | @ApiOperation(value = "é¢å®å¯¿å½-éè¿idå é¤", notes = "é¢å®å¯¿å½-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_rated_life:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name = "id", required = true) String id) { |
| | | ratedLifeService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "é¢å®å¯¿å½-æ¹éå é¤") |
| | | @ApiOperation(value = "é¢å®å¯¿å½-æ¹éå é¤", notes = "é¢å®å¯¿å½-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_rated_life:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | this.ratedLifeService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "é¢å®å¯¿å½-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value = "é¢å®å¯¿å½-éè¿idæ¥è¯¢", notes = "é¢å®å¯¿å½-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<RatedLife> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | RatedLife ratedLife = ratedLifeService.getById(id); |
| | | if (ratedLife == null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(ratedLife); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param ratedLife |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:cms_rated_life:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, RatedLife ratedLife) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("cms_rated_life:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | |
| | | /**åå
·ID*/ |
| | | @Excel(name = "åå
·ID", width = 15) |
| | | @ApiModelProperty(value = "åå
·ID") |
| | | @Dict(dictTable = "cms_cutting_tool",dicCode = "id",dicText = "cutting_code") |
| | | private String cuttingId; |
| | | /**工件æè´¨*/ |
| | | @Excel(name = "工件æè´¨", width = 15) |
| | |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, EamPrecisionParameters.class); |
| | | } |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, EamPrecisionParameters.class); |
| | | } |
| | | |
| | | @ApiOperation(value = "ç²¾åº¦åæ°ç»´æ¤-æ¥è¯¢ææ", notes = "ç²¾åº¦åæ°ç»´æ¤-æ¥è¯¢ææ") |
| | | @GetMapping(value = "/listAll") |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.TranslateDictTextUtils; |
| | | import org.jeecg.modules.eam.constant.BusinessCodeConst; |
| | | import org.jeecg.modules.eam.entity.EamRepairOrder; |
| | | import org.jeecg.modules.eam.request.EamRepairOrderQuery; |
| | | import org.jeecg.modules.eam.request.EamRepairOrderRequest; |
| | | import org.jeecg.modules.eam.request.EamRepairOrderResponse; |
| | | import org.jeecg.modules.eam.request.EamReportRepairQuery; |
| | | import org.jeecg.modules.eam.service.IEamRepairOrderService; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * @Description: 维修工å |
| | | * @Author: Lius |
| | | * @Date: 2025-04-03 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "维修工å") |
| | | @RestController |
| | | @RequestMapping("/eam/eamRepairOrder") |
| | | public class EamRepairOrderController extends JeecgController<EamRepairOrder, IEamRepairOrderService> { |
| | | |
| | | @Resource |
| | | private IEamRepairOrderService eamRepairOrderService; |
| | | |
| | | @Resource |
| | | private ObjectMapper objectMapper; |
| | | |
| | | @Resource |
| | | private TranslateDictTextUtils translateDictTextUtils; |
| | | |
| | | @Resource |
| | | private ISysUserService sysUserService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param eamRepairOrderQuery |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "维修工å-å页å表æ¥è¯¢", notes = "维修工å-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<?> queryPageList(EamRepairOrderQuery eamRepairOrderQuery, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | Page<EamRepairOrder> page = new Page<EamRepairOrder>(pageNo, pageSize); |
| | | IPage<EamRepairOrder> pageList = eamRepairOrderService.pageList(page, eamRepairOrderQuery); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * é¢å |
| | | * |
| | | * @param eamRepairOrder |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "维修工å-é¢å") |
| | | @ApiOperation(value = "维修工å-é¢å", notes = "维修工å-é¢å") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody EamRepairOrder eamRepairOrder) { |
| | | if (StringUtils.isBlank(eamRepairOrder.getReportId())) { |
| | | return Result.error("é¢å失败,è¯·éæ©ç»´ä¿®è®°å½ï¼"); |
| | | } |
| | | // æ ¡éªé¢åæé |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (!BusinessCodeConst.PCR0002.equals(user.getPost())) { |
| | | return Result.error("é¢å失败,没æé¢åæéï¼"); |
| | | } |
| | | eamRepairOrderService.saveRepairOrder(eamRepairOrder); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ææ´¾ |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "æ
éæ¥ä¿®-ææ´¾") |
| | | @ApiOperation(value = "æ
éæ¥ä¿®-ææ´¾", notes = "æ
éæ¥ä¿®-ææ´¾") |
| | | @PostMapping(value = "/assign") |
| | | public Result<?> assign(@RequestBody EamReportRepairQuery eamReportRepairQuery) { |
| | | if (StringUtils.isBlank(eamReportRepairQuery.getRepairer())) { |
| | | return Result.error("ææ´¾å¤±è´¥,è¯·éæ©ç»´ä¿®å·¥ï¼"); |
| | | } |
| | | // æ ¡éªææ´¾æé |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (!BusinessCodeConst.PCR0004.equals(user.getPost())) { |
| | | return Result.error("ææ´¾å¤±è´¥,æ²¡æææ´¾æéï¼"); |
| | | } |
| | | // æ ¡éªç»´ä¿®å·¥æé |
| | | SysUser sysUser = sysUserService.getUserByName(eamReportRepairQuery.getRepairer()); |
| | | if (sysUser == null) { |
| | | return Result.error("ææ´¾å¤±è´¥,æªæ¾å°æ¤ç»´ä¿®å·¥ç¨æ·ï¼"); |
| | | } |
| | | if (!BusinessCodeConst.PCR0002.equals(sysUser.getPost())) { |
| | | return Result.error("ææ´¾å¤±è´¥,æ¤ç¨æ·ä¸æ¯ç»´ä¿®å·¥ï¼"); |
| | | } |
| | | eamRepairOrderService.assign(eamReportRepairQuery); |
| | | |
| | | return Result.OK("ææ´¾æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * æçå¾
å æ§è¡/å®¡æ¹ |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "维修工å-æ§è¡/审æ¹") |
| | | @ApiOperation(value = "维修工å-æ§è¡/审æ¹", notes = "维修工å-æ§è¡/审æ¹") |
| | | @PostMapping(value = "/perform") |
| | | public Result<?> perform(@RequestBody EamRepairOrderRequest request) { |
| | | if (request == null) { |
| | | return Result.error("审æ¹ç对象ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | // æ£æ¥è¯·æ±åæ° |
| | | if (StrUtil.isBlank(request.getTaskId()) || StrUtil.isBlank(request.getDataId()) || StrUtil.isBlank(request.getInstanceId())) { |
| | | return Result.error("审æ¹ä»»å¡é误æä¸åå¨ï¼"); |
| | | } |
| | | EamRepairOrder b = eamRepairOrderService.perform(request); |
| | | if(b == null) { |
| | | return Result.error("æä½å¤±è´¥ï¼"); |
| | | } |
| | | return Result.OK("æä½æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "维修工å-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value = "维修工å-éè¿idæ¥è¯¢", notes = "维修工å-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | EamRepairOrderResponse eamRepairOrder = eamRepairOrderService.findById(id); |
| | | if (eamRepairOrder == null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®ï¼"); |
| | | } |
| | | try { |
| | | String json = objectMapper.writeValueAsString(eamRepairOrder); |
| | | JSONObject item = JSONObject.parseObject(json, Feature.OrderedField); |
| | | translateDictTextUtils.translateField("createBy", eamRepairOrder.getCreateBy(), item, "sys_user,realname,username"); |
| | | translateDictTextUtils.translateField("breakdownFlag", eamRepairOrder.getBreakdownFlag(), item, "breakdown_flag"); |
| | | translateDictTextUtils.translateField("faultType", eamRepairOrder.getFaultType(), item, "fault_reason_category"); |
| | | translateDictTextUtils.translateField("reportStatus", eamRepairOrder.getReportStatus(), item, "report_repair_status"); |
| | | translateDictTextUtils.translateField("equipmentId", eamRepairOrder.getEquipmentId(), item, "eam_equipment,id,equipment_code"); |
| | | translateDictTextUtils.translateField("repairStatus", eamRepairOrder.getRepairStatus(), item, "report_repair_status"); |
| | | translateDictTextUtils.translateField("repairer", eamRepairOrder.getRepairer(), item, "sys_user,username,realname"); |
| | | return Result.OK(item); |
| | | } catch (Exception e) { |
| | | return Result.error("æ°æ®è½¬è¯å¤±è´¥ï¼"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param eamRepairOrder |
| | | */ |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, EamRepairOrder eamRepairOrder) { |
| | | return super.exportXls(request, eamRepairOrder, EamRepairOrder.class, "维修工å"); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.util.TranslateDictTextUtils; |
| | | import org.jeecg.modules.eam.constant.ReportRepairEnum; |
| | | import org.jeecg.modules.eam.entity.EamReportRepair; |
| | | import org.jeecg.modules.eam.request.EamReportRepairQuery; |
| | | import org.jeecg.modules.eam.service.IEamReportRepairService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: æ
éæ¥ä¿® |
| | | * @Author: Lius |
| | | * @Date: 2025-04-01 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "æ
éæ¥ä¿®") |
| | | @RestController |
| | | @RequestMapping("/eam/eamReportRepair") |
| | | public class EamReportRepairController extends JeecgController<EamReportRepair, IEamReportRepairService> { |
| | | |
| | | @Resource |
| | | private IEamReportRepairService eamReportRepairService; |
| | | |
| | | @Resource |
| | | private ObjectMapper objectMapper; |
| | | |
| | | @Resource |
| | | private TranslateDictTextUtils translateDictTextUtils; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param eamReportRepairQuery |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "æ
éæ¥ä¿®-å页å表æ¥è¯¢") |
| | | @ApiOperation(value = "æ
éæ¥ä¿®-å页å表æ¥è¯¢", notes = "æ
éæ¥ä¿®-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<?> queryPageList(EamReportRepairQuery eamReportRepairQuery, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | Page<EamReportRepair> page = new Page<EamReportRepair>(pageNo, pageSize); |
| | | IPage<EamReportRepair> pageList = eamReportRepairService.pageList(page, eamReportRepairQuery); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param eamReportRepair |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "æ
éæ¥ä¿®-æ·»å ") |
| | | @ApiOperation(value = "æ
éæ¥ä¿®-æ·»å ", notes = "æ
éæ¥ä¿®-æ·»å ") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody EamReportRepair eamReportRepair) { |
| | | EamReportRepair b = eamReportRepairService.add(eamReportRepair); |
| | | if(b == null) { |
| | | return Result.error("æ·»å 失败ï¼"); |
| | | } |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param eamReportRepair |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "æ
éæ¥ä¿®-ç¼è¾") |
| | | @ApiOperation(value = "æ
éæ¥ä¿®-ç¼è¾", notes = "æ
éæ¥ä¿®-ç¼è¾") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<?> edit(@RequestBody EamReportRepair eamReportRepair) { |
| | | boolean b = eamReportRepairService.edit(eamReportRepair); |
| | | if(!b) { |
| | | return Result.error("ç¼è¾å¤±è´¥ï¼"); |
| | | } |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idä½åº |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "æ
éæ¥ä¿®-ä½åº") |
| | | @ApiOperation(value = "æ
éæ¥ä¿®-ä½åº", notes = "æ
éæ¥ä¿®-ä½åº") |
| | | @DeleteMapping(value = "/abolish") |
| | | public Result<?> abolish(@RequestParam(name = "id", required = true) String id) { |
| | | eamReportRepairService.update(new LambdaUpdateWrapper<EamReportRepair>().set(EamReportRepair::getReportStatus, ReportRepairEnum.ABOLISH.name()).eq(EamReportRepair::getId, id).eq(EamReportRepair::getReportStatus, ReportRepairEnum.WAIT_REPAIR.name())); |
| | | return Result.OK("ä½åºæå!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éä½åº |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "æ
éæ¥ä¿®-æ¹éä½åº") |
| | | @ApiOperation(value = "æ
éæ¥ä¿®-æ¹éä½åº", notes = "æ
éæ¥ä¿®-æ¹éä½åº") |
| | | @DeleteMapping(value = "/abolishBatch") |
| | | public Result<?> abolishBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | List<EamReportRepair> eamReportRepairs = eamReportRepairService.listByIds(Arrays.asList(ids.split(","))); |
| | | eamReportRepairs.forEach(eamReportRepair -> { |
| | | if(ReportRepairEnum.ABOLISH.name().equals(eamReportRepair.getReportStatus())) { |
| | | eamReportRepair.setReportStatus(ReportRepairEnum.ABOLISH.name()); |
| | | } |
| | | }); |
| | | this.eamReportRepairService.updateBatchById(eamReportRepairs); |
| | | return Result.OK("æ¹éä½åºæåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "æ
éæ¥ä¿®-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value = "æ
éæ¥ä¿®-éè¿idæ¥è¯¢", notes = "æ
éæ¥ä¿®-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | EamReportRepair eamReportRepair = eamReportRepairService.getById(id); |
| | | if (eamReportRepair == null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®ï¼"); |
| | | } |
| | | try { |
| | | String json = objectMapper.writeValueAsString(eamReportRepair); |
| | | JSONObject item = JSONObject.parseObject(json, Feature.OrderedField); |
| | | translateDictTextUtils.translateField("createBy", eamReportRepair.getCreateBy(), item, "sys_user,realname,username"); |
| | | translateDictTextUtils.translateField("breakdownFlag", eamReportRepair.getBreakdownFlag(), item, "breakdown_flag"); |
| | | translateDictTextUtils.translateField("faultType", eamReportRepair.getFaultType(), item, "fault_reason_category"); |
| | | translateDictTextUtils.translateField("reportStatus", eamReportRepair.getReportStatus(), item, "report_repair_status"); |
| | | translateDictTextUtils.translateField("equipmentId", eamReportRepair.getEquipmentId(), item, "eam_equipment,id,equipment_code"); |
| | | return Result.OK(item); |
| | | } catch (Exception e) { |
| | | return Result.error("æ°æ®è½¬è¯å¤±è´¥ï¼"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param eamReportRepair |
| | | */ |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, EamReportRepair eamReportRepair) { |
| | | return super.exportXls(request, eamReportRepair, EamReportRepair.class, "æ
éæ¥ä¿®"); |
| | | } |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import org.jeecg.modules.lsw.enums.MaterialInventoryStatusEnum; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | |
| | | @Excel(name = "åºåç¶æ", width = 15) |
| | | @ApiModelProperty(value = "åºåç¶æ") |
| | | private String inventoryStatus; |
| | | |
| | | public LswMaterialInventory(){} |
| | | |
| | | public LswMaterialInventory(LswMaterialInbound inbound, String materialId, String inventoryCategory) { |
| | | this.warehouseId = inbound.getWarehouseId(); |
| | | this.quantity = inbound.getQuantity(); |
| | | this.batchNumber = inbound.getBatchNumber(); |
| | | this.inventoryStatus = MaterialInventoryStatusEnum.NORMAL.name(); |
| | | this.inventoryCategory = inventoryCategory; |
| | | this.materialId = materialId; |
| | | } |
| | | } |
| | |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | public class LswMaterialOutbound implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /**主é®*/ |
| | | /**主é®*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主é®") |
| | | private String id; |
| | |
| | | @ApiModelProperty(value = "产线ID") |
| | | @Dict(dictTable = "base_factory", dicCode = "id", dicText = "factory_name") |
| | | private String factoryId; |
| | | /**åºåID*/ |
| | | @Excel(name = "åºåID", width = 15) |
| | | @ApiModelProperty(value = "åºåID") |
| | | private String inventoryId; |
| | | /**线边åºID*/ |
| | | @Excel(name = "线边åºID", width = 15) |
| | | @ApiModelProperty(value = "线边åºID") |
| | | private String warehouseId; |
| | | /**æ¹æ¬¡å·*/ |
| | | @Excel(name = "æ¹æ¬¡å·", width = 15) |
| | | @ApiModelProperty(value = "æ¹æ¬¡å·") |
| | |
| | | /**åºåºæ°é*/ |
| | | @Excel(name = "åºåºæ°é", width = 15) |
| | | @ApiModelProperty(value = "åºåºæ°é") |
| | | private Double quantity; |
| | | /**å·¥åID*/ |
| | | @Excel(name = "å·¥åID", width = 15) |
| | | @ApiModelProperty(value = "å·¥åID") |
| | | private String workOrderId; |
| | | private BigDecimal quantity; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.lsw.enums; |
| | | |
| | | public enum MaterialInventoryCategoryEnum { |
| | | INBOUND, //å
¥åº |
| | | UNLOADING, //䏿 |
| | | ; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.lsw.enums; |
| | | |
| | | public enum MaterialInventoryStatusEnum { |
| | | NORMAL, //æ£å¸¸ |
| | | OUTBOUND, //å·²åºåº |
| | | ; |
| | | } |
| | |
| | | */ |
| | | public interface ILswMaterialInboundService extends IService<LswMaterialInbound> { |
| | | IPage<Map<String, Object>> getlswMaterialInboundListData(Integer pageNo, Integer pageSize, HttpServletRequest req); |
| | | |
| | | /** |
| | | * ç©æå
¥åº |
| | | * @param materialInbound å
¥åºä¿¡æ¯ |
| | | * @return |
| | | */ |
| | | boolean inboundMaterial(LswMaterialInbound materialInbound); |
| | | } |
| | |
| | | */ |
| | | public interface ILswMaterialOutboundService extends IService<LswMaterialOutbound> { |
| | | IPage<Map<String, Object>> getlswMaterialOutboundListData(Integer pageNo, Integer pageSize, HttpServletRequest req); |
| | | |
| | | /** |
| | | * ç©æåºåº |
| | | * @param outbound |
| | | * @return |
| | | */ |
| | | boolean outboundMaterial(LswMaterialOutbound outbound); |
| | | } |
| | |
| | | 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.modules.lsw.entity.LswMaterial; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInbound; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInventory; |
| | | import org.jeecg.modules.lsw.mapper.LswMaterialInboundMapper; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialInboundService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialInventoryService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialService; |
| | | 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.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | */ |
| | | @Service |
| | | public class LswMaterialInboundServiceImpl extends ServiceImpl<LswMaterialInboundMapper, LswMaterialInbound> implements ILswMaterialInboundService { |
| | | @Autowired |
| | | private ILswMaterialInventoryService inventoryService; |
| | | @Autowired |
| | | private ILswMaterialService materialService; |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> getlswMaterialInboundListData(Integer pageNo, Integer pageSize, HttpServletRequest req) { |
| | |
| | | } |
| | | return super.getBaseMapper().getlswMaterialInboundListData(pageData, paramMap); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean inboundMaterial(LswMaterialInbound materialInbound) { |
| | | if (StringUtils.isBlank(materialInbound.getMaterialNumber()) |
| | | || StringUtils.isBlank(materialInbound.getFactoryId()) |
| | | || StringUtils.isBlank(materialInbound.getWarehouseId()) |
| | | || materialInbound.getQuantity() == null |
| | | || materialInbound.getQuantity().intValue() > 0 |
| | | || StringUtils.isBlank(materialInbound.getBatchNumber())) { |
| | | return false; |
| | | } |
| | | LswMaterial material = materialService.queryByMaterialNumber(materialInbound.getMaterialNumber()); |
| | | if(material == null) { |
| | | return false; |
| | | } |
| | | //ä¿åå
¥åºä¿¡æ¯ |
| | | materialInbound.setDelFlag(CommonConstant.DEL_FLAG_0); |
| | | materialInbound.setReceiveTime(new Date()); |
| | | super.save(materialInbound); |
| | | //ä¿ååºåä¿¡æ¯ |
| | | LswMaterialInventory lswMaterialInventory = new LswMaterialInventory(materialInbound, material.getId(), material.getMaterialCategory()); |
| | | inventoryService.save(lswMaterialInventory); |
| | | return true; |
| | | } |
| | | } |
| | |
| | | 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.modules.lsw.entity.LswMaterial; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInventory; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialOutbound; |
| | | import org.jeecg.modules.lsw.enums.MaterialInventoryStatusEnum; |
| | | import org.jeecg.modules.lsw.mapper.LswMaterialOutboundMapper; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialInboundService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialInventoryService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialOutboundService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: ç©æåºåºå |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-30 |
| | | * @Date: 2025-06-30 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class LswMaterialOutboundServiceImpl extends ServiceImpl<LswMaterialOutboundMapper, LswMaterialOutbound> implements ILswMaterialOutboundService { |
| | | @Autowired |
| | | private ILswMaterialService materialService; |
| | | @Autowired |
| | | private ILswMaterialInventoryService materialInventoryService; |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> getlswMaterialOutboundListData(Integer pageNo, Integer pageSize, HttpServletRequest req) { |
| | |
| | | } |
| | | return super.getBaseMapper().getlswMaterialOutboundListData(pageData, paramMap); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean outboundMaterial(LswMaterialOutbound outbound) { |
| | | if (StringUtils.isBlank(outbound.getMaterialNumber()) |
| | | || StringUtils.isBlank(outbound.getFactoryId()) |
| | | || StringUtils.isBlank(outbound.getWarehouseId()) |
| | | || outbound.getQuantity() == null |
| | | || outbound.getQuantity().intValue() > 0 |
| | | || StringUtils.isBlank(outbound.getBatchNumber()) |
| | | || StringUtils.isBlank(outbound.getInventoryId())) { |
| | | return false; |
| | | } |
| | | LswMaterialInventory inventory = materialInventoryService.getById(outbound.getInventoryId()); |
| | | if(inventory == null) { |
| | | return false; |
| | | } |
| | | //æ´æ°åºåç¶æ |
| | | inventory.setInventoryStatus(MaterialInventoryStatusEnum.OUTBOUND.name()); |
| | | materialInventoryService.updateById(inventory); |
| | | //ä¿ååºåºä¿¡æ¯ |
| | | outbound.setDelFlag(CommonConstant.DEL_FLAG_0); |
| | | outbound.setOutboundTime(new Date()); |
| | | super.save(outbound); |
| | | return true; |
| | | } |
| | | } |
| | |
| | | @Excel(name = "ç§»åºåå·", width = 15) |
| | | @ApiModelProperty(value = "ç§»åºåå·") |
| | | private String workOrderCode; |
| | | /**ç§»åºç±»å*/ |
| | | @Excel(name = "ç§»åºç±»å", width = 15, dicCode = "order_category") |
| | | @Dict(dicCode = "order_category") |
| | | @ApiModelProperty(value = "ç§»åºç±»å") |
| | | private String orderCategory; |
| | | /**åºåID*/ |
| | | @Excel(name = "åºåID", width = 15) |
| | | @ApiModelProperty(value = "åºåID") |
| | | private String inventoryId; |
| | | /**ååºåå°*/ |
| | | @Excel(name = "ååºåå°", width = 15) |
| | | @ApiModelProperty(value = "ååºåå°") |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mes.enums; |
| | | |
| | | public enum TransferOrderStatusEnum { |
| | | NEW, //æ°å»º |
| | | PRINTED, //å·²æå°ã已请æ±WMS |
| | | COMPLETED, //已宿 |
| | | CANCELED, //å·²æ¤é |
| | | ; |
| | | } |
| | |
| | | import org.quartz.JobExecutionContext; |
| | | import org.quartz.JobExecutionException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.time.LocalDateTime; |
| | |
| | | @Slf4j |
| | | public class ProductionOrderSyncCreationJob implements Job { |
| | | //å·¥åç¼ç (æ°ç«ç¬ 2301) |
| | | private static final String FACTORY_CODE = "2301"; |
| | | @Value("${xhj.factoryCode:2301}") |
| | | private String FACTORY_CODE; |
| | | /** |
| | | * 订åç±»å |
| | | * æ åç产订å Z001 |
| | |
| | | * è¯å¶ç产订å(æ°ç«ç¬) Z011 |
| | | * æé¶ç产订å(æ°ç«ç¬) 2012 |
| | | */ |
| | | private static final String ORDER_TYPE_CODE = "Z001"; |
| | | @Value("${xhj.orderType:Z001}") |
| | | private String ORDER_TYPE_CODE; |
| | | /** |
| | | * ç产è°åº¦å |
| | | * 001 ä¸ååè°åº¦å |
| | |
| | | * 010 å
åè°åº¦å |
| | | * 012 å
«ååè°åº¦å |
| | | */ |
| | | private static final String PRODUCTION_MANAGER = "010"; |
| | | @Value("${xhj.productionManager:012}") |
| | | private String PRODUCTION_MANAGER; |
| | | /** |
| | | * ç产订åç¶æï¼å®é
ä¸ï¼åªæRELç¶æçå·¥åæå¯ä»¥è¿è¡æä½ |
| | | * CRTD æ°å»º |
| | | * REL ä¸è¾¾ |
| | | * TECO å
³é |
| | | */ |
| | | private static final String ORDER_STATUS = "REL"; |
| | | @Value("${xhj.orderStatus:REL}") |
| | | private String ORDER_STATUS; |
| | | |
| | | /** |
| | | * è¯·æ±æåç¼ç |
| | |
| | | import org.quartz.JobExecutionContext; |
| | | import org.quartz.JobExecutionException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.time.LocalDateTime; |
| | |
| | | @Slf4j |
| | | public class ProductionOrderSyncUpdateJob implements Job { |
| | | //å·¥åç¼ç (æ°ç«ç¬ 2301) |
| | | private static final String FACTORY_CODE = "2301"; |
| | | @Value("${xhj.factoryCode:2301}") |
| | | private String FACTORY_CODE; |
| | | /** |
| | | * 订åç±»å |
| | | * æ åç产订å Z001 |
| | |
| | | * è¯å¶ç产订å(æ°ç«ç¬) Z011 |
| | | * æé¶ç产订å(æ°ç«ç¬) 2012 |
| | | */ |
| | | private static final String ORDER_TYPE_CODE = "Z001"; |
| | | @Value("${xhj.orderType:Z001}") |
| | | private String ORDER_TYPE_CODE; |
| | | /** |
| | | * ç产è°åº¦å |
| | | * 001 ä¸ååè°åº¦å |
| | |
| | | * 010 å
åè°åº¦å |
| | | * 012 å
«ååè°åº¦å |
| | | */ |
| | | private static final String PRODUCTION_MANAGER = "010"; |
| | | @Value("${xhj.productionManager:012}") |
| | | private String PRODUCTION_MANAGER; |
| | | /** |
| | | * ç产订åç¶æï¼å®é
ä¸ï¼åªæRELç¶æçå·¥åæå¯ä»¥è¿è¡æä½ |
| | | * CRTD æ°å»º |
| | | * REL ä¸è¾¾ |
| | | * TECO å
³é |
| | | */ |
| | | private static final String ORDER_STATUS = "REL"; |
| | | @Value("${xhj.orderStatus:REL}") |
| | | private String ORDER_STATUS; |
| | | |
| | | /** |
| | | * è¯·æ±æåç¼ç |
| | |
| | | */ |
| | | public interface IMesTransferOrderPrintService extends IService<MesTransferOrderPrint> { |
| | | List<MesTransferOrderPrint> queryOrderPrintByOrderId(String orderId); |
| | | |
| | | /** |
| | | * æ ¹æ®ç§»åºåå·æ¥è¯¢ç§»åºè®°å½ |
| | | * @param orderCode |
| | | * @return |
| | | */ |
| | | MesTransferOrderPrint queryByOrderCode(String orderCode); |
| | | } |
| | |
| | | package org.jeecg.modules.mes.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | 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.modules.mes.entity.MesTransferOrderPrint; |
| | | import org.jeecg.modules.mes.mapper.MesTransferOrderPrintMapper; |
| | | import org.jeecg.modules.mes.service.IMesTransferOrderPrintService; |
| | |
| | | public List<MesTransferOrderPrint> queryOrderPrintByOrderId(String orderId) { |
| | | return baseMapper.queryOrderPrintByOrderId(orderId); |
| | | } |
| | | |
| | | @Override |
| | | public MesTransferOrderPrint queryByOrderCode(String orderCode) { |
| | | LambdaQueryWrapper<MesTransferOrderPrint> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(MesTransferOrderPrint::getWorkOrderCode, orderCode); |
| | | wrapper.eq(MesTransferOrderPrint::getDelFlag, CommonConstant.DEFAULT_0); |
| | | List<MesTransferOrderPrint> list = super.list(wrapper); |
| | | if(CollectionUtil.isNotEmpty(list)) { |
| | | return list.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | import javax.xml.bind.annotation.XmlAccessorType; |
| | | import javax.xml.bind.annotation.XmlElement; |
| | | import javax.xml.bind.annotation.XmlType; |
| | | import java.math.BigDecimal; |
| | | |
| | | @Getter |
| | | @Setter |
| | |
| | | /** é¢çå· */ |
| | | @XmlElement(name = "ReservationOrder") |
| | | private String reservationOrder; |
| | | /** 坹齿¹å¼ */ |
| | | /** MESç§»åºåå· */ |
| | | @XmlElement(name = "Align") |
| | | private String align; |
| | | /** æå· */ |
| | |
| | | private String mesStockID; |
| | | /** æ°é */ |
| | | @XmlElement(name = "Quantity") |
| | | private String quantity; |
| | | private BigDecimal quantity; |
| | | /** SAPæ¹æ¬¡å· */ |
| | | @XmlElement(name = "SapTrackLot") |
| | | private String sapTrackLot; |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.common.aspect.annotation.ApiLog; |
| | | import org.jeecg.common.constant.ApiLogCategoryEnum; |
| | | import org.jeecg.modules.base.entity.LineSideWarehouse; |
| | | import org.jeecg.modules.base.service.ILineSideWarehouseService; |
| | | import org.jeecg.modules.lsw.entity.LswMaterial; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInbound; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInventory; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialOutbound; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialInboundService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialInventoryService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialOutboundService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialService; |
| | | import org.jeecg.modules.mes.entity.MesMaterialTransferRequest; |
| | | import org.jeecg.modules.mes.entity.MesTransferOrderPrint; |
| | | import org.jeecg.modules.mes.enums.MaterialTransferRequestStatus; |
| | | import org.jeecg.modules.mes.enums.TransferOrderStatusEnum; |
| | | import org.jeecg.modules.mes.service.IMesMaterialTransferRequestService; |
| | | import org.jeecg.modules.mes.service.IMesTransferOrderPrintService; |
| | | import org.jeecg.modules.wms.dto.WSResponse; |
| | | import org.jeecg.modules.wms.request.ReceiveWMSScanItemList; |
| | | import org.jeecg.modules.wms.request.WMSWebServiceSendItem; |
| | |
| | | import javax.jws.WebService; |
| | | import javax.xml.ws.RequestWrapper; |
| | | import javax.xml.ws.ResponseWrapper; |
| | | import java.math.BigDecimal; |
| | | |
| | | |
| | | @Slf4j |
| | |
| | | |
| | | @Autowired |
| | | private IMesMaterialTransferRequestService materialTransferRequestService; |
| | | @Autowired |
| | | private ILineSideWarehouseService lineSideWarehouseService; |
| | | @Autowired |
| | | private ILswMaterialInboundService materialInboundService; |
| | | @Autowired |
| | | private IMesTransferOrderPrintService transferOrderPrintService; |
| | | @Autowired |
| | | private ILswMaterialOutboundService materialOutboundService; |
| | | @Autowired |
| | | private ILswMaterialInventoryService materialInventoryService; |
| | | @Autowired |
| | | private ILswMaterialService materialService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | response.setErrorDesc("ä¼ å
¥çåæ°ä¸ºç©ºï¼"); |
| | | return response; |
| | | } |
| | | for(WMSWebServiceSendItem item : request.getWmsWebServiceSendItemList()) { |
| | | if(StringUtils.isNotBlank(item.getReservationOrder())) { |
| | | int errorCount = 0; |
| | | int successCount = 0; |
| | | StringBuilder errorMsg = new StringBuilder(); |
| | | for (WMSWebServiceSendItem item : request.getWmsWebServiceSendItemList()) { |
| | | if (StringUtils.isNotBlank(item.getReservationOrder())) { |
| | | //ç©ææå¨åè° |
| | | MesMaterialTransferRequest transferRequest = materialTransferRequestService.queryByReservationCode(item.getReservationOrder()); |
| | | if(transferRequest == null) { |
| | | response.setErrorCode("N"); |
| | | response.setErrorDesc("æ ¹æ®é¢çå·æªæ¾å°ç©ææå¨åï¼"); |
| | | return response; |
| | | if (transferRequest == null) { |
| | | errorCount++; |
| | | errorMsg.append("æ ¹æ®é¢çå·[").append(item.getReservationOrder()).append("]æªæ¾å°ç©ææå¨åï¼\n"); |
| | | continue; |
| | | } |
| | | }else if(StringUtils.isNotBlank(item.getAlign())){ |
| | | LineSideWarehouse warehouse = lineSideWarehouseService.getById(transferRequest.getTargetWarehouseId()); |
| | | if (warehouse == null || !warehouse.getWarehouseCode().equals(item.getDestSection())) { |
| | | errorCount++; |
| | | errorMsg.append("线边åº[").append(item.getDestSection()).append("]æªæ¾å°ï¼\n"); |
| | | continue; |
| | | } |
| | | if (!transferRequest.getMaterialNumber().equals(item.getSkuCode())) { |
| | | errorCount++; |
| | | errorMsg.append("ç©æç¼å·[").append(item.getSkuCode()).append("]ä¸å¹é
ï¼\n"); |
| | | continue; |
| | | } |
| | | if (StringUtils.isBlank(item.getTrackLot())) { |
| | | errorCount++; |
| | | errorMsg.append("æ¹æ¬¡å·[").append(item.getTrackLot()).append("]ä¸è½ä¸ºç©ºï¼\n"); |
| | | continue; |
| | | } |
| | | transferRequest.setRequestStatus(MaterialTransferRequestStatus.CHECKED_IN.name()); |
| | | //计ç®å®é
æå¨æ°é |
| | | BigDecimal actualQuantity = transferRequest.getActualQuantity() == null ? item.getQuantity() : transferRequest.getActualQuantity().add(item.getQuantity()); |
| | | transferRequest.setActualQuantity(actualQuantity); |
| | | |
| | | //æ·»å å
¥åºä¿¡æ¯ |
| | | LswMaterialInbound inbound = new LswMaterialInbound(); |
| | | inbound.setWarehouseId(transferRequest.getTargetWarehouseId()); |
| | | inbound.setReceiver("WMS"); |
| | | inbound.setMaterialNumber(transferRequest.getMaterialNumber()); |
| | | inbound.setMaterialName(transferRequest.getMaterialName()); |
| | | inbound.setBatchNumber(item.getTrackLot()); |
| | | inbound.setQuantity(item.getQuantity()); |
| | | inbound.setFactoryId(warehouse.getFactoryId()); |
| | | boolean b = materialInboundService.inboundMaterial(inbound); |
| | | if (!b) { |
| | | errorCount++; |
| | | errorMsg.append("é¢çå·[").append(item.getReservationOrder()).append("]å
¥åºå¤±è´¥ï¼\n"); |
| | | continue; |
| | | } |
| | | //æ´æ°ç©ææå¨å |
| | | materialTransferRequestService.updateById(transferRequest); |
| | | successCount++; |
| | | } else if (StringUtils.isNotBlank(item.getAlign())) { |
| | | //ç§»åºååè° |
| | | MesTransferOrderPrint transferOrder = transferOrderPrintService.queryByOrderCode(item.getAlign()); |
| | | if (transferOrder == null) { |
| | | errorCount++; |
| | | errorMsg.append("ç§»åºå[").append(item.getAlign()).append("]ä¸åå¨ï¼\n"); |
| | | continue; |
| | | } |
| | | LswMaterialInventory inventory = materialInventoryService.getById(item.getMesStockID()); |
| | | if (inventory == null) { |
| | | errorCount++; |
| | | errorMsg.append("åºåä¿¡æ¯[").append(item.getMesStockID()).append("]ä¸åå¨ï¼\n"); |
| | | continue; |
| | | } |
| | | LswMaterial material = materialService.queryByMaterialNumber(item.getSkuCode()); |
| | | if(material == null) { |
| | | errorCount++; |
| | | errorMsg.append("ç©æç¼å·[").append(item.getSkuCode()).append("]ä¸åå¨ï¼\n"); |
| | | continue; |
| | | } |
| | | LineSideWarehouse warehouse = lineSideWarehouseService.getById(transferOrder.getOriginalWarehouseId()); |
| | | if (warehouse == null || !warehouse.getWarehouseCode().equals(item.getDestSection())) { |
| | | errorCount++; |
| | | errorMsg.append("线边åº[").append(item.getDestSection()).append("]æªæ¾å°ï¼\n"); |
| | | continue; |
| | | } |
| | | //ç§»åºåæ´æ¹ |
| | | transferOrder.setOrderStatus(TransferOrderStatusEnum.COMPLETED.name()); |
| | | //æååºåº |
| | | LswMaterialOutbound outbound = new LswMaterialOutbound(); |
| | | outbound.setBatchNumber(inventory.getBatchNumber()); |
| | | outbound.setQuantity(item.getQuantity()); |
| | | outbound.setMaterialNumber(material.getMaterialNumber()); |
| | | outbound.setMaterialName(material.getMaterialName()); |
| | | outbound.setInventoryId(inventory.getId()); |
| | | outbound.setWarehouseId(transferOrder.getOriginalWarehouseId()); |
| | | outbound.setFactoryId(warehouse.getFactoryId()); |
| | | outbound.setOutboundStaff("WMS"); |
| | | boolean b = materialOutboundService.outboundMaterial(outbound); |
| | | if (!b) { |
| | | errorCount++; |
| | | errorMsg.append("ç§»åºå[").append(item.getAlign()).append("]åºåºå¤±è´¥ï¼\n"); |
| | | continue; |
| | | } |
| | | transferOrderPrintService.updateById(transferOrder); |
| | | successCount++; |
| | | } |
| | | } |
| | | //å¤çè¿åç»æ |
| | | if (errorCount > 0) { |
| | | response.setErrorCode("N"); |
| | | if (successCount > 0) { |
| | | String msg = "æåæ§è¡" + successCount + "æ¡ï¼å¤±è´¥" + errorCount + "æ¡ï¼\n"; |
| | | errorMsg.insert(0, msg); |
| | | } else { |
| | | String msg = "失败" + errorCount + "æ¡ï¼\n"; |
| | | errorMsg.insert(0, msg); |
| | | } |
| | | response.setErrorDesc(errorMsg.toString()); |
| | | } else { |
| | | response.setErrorCode("Y"); |
| | | String msg = "æåæ§è¡" + successCount + "æ¡ï¼\n"; |
| | | response.setErrorDesc(msg); |
| | | } |
| | | return response; |
| | | } |
| | | } |
| | |
| | | appId: cli_a74aab6353b7d00e |
| | | appSecret: mx5wm7X9S8WSzZCOYlxcggXTFL8iujIT |
| | | sync: |
| | | departmentId: od-47692f32e6b66cc3985d317fee780a8b |
| | | departmentId: od-47692f32e6b66cc3985d317fee780a8b |
| | | xhj: |
| | | factoryCode: 2301 |
| | | orderType: Z001 |
| | | productionManager: 010 |
| | | orderStatus: REL |
| | |
| | | appId: cli_a74aab6353b7d00e |
| | | appSecret: mx5wm7X9S8WSzZCOYlxcggXTFL8iujIT |
| | | sync: |
| | | departmentId: od-47692f32e6b66cc3985d317fee780a8b |
| | | departmentId: od-47692f32e6b66cc3985d317fee780a8b |
| | | xhj: |
| | | factoryCode: 2301 |
| | | orderType: Z001 |
| | | productionManager: 012 |
| | | orderStatus: REL |