| | |
| | | <log4j2.version>2.17.0</log4j2.version> |
| | | <logback.version>1.2.9</logback.version> |
| | | <!-- webservice --> |
| | | <cxf.version>3.2.4</cxf.version> |
| | | <cxf.version>3.5.2</cxf.version> |
| | | </properties> |
| | | |
| | | <repositories> |
| | |
| | | </dependency> |
| | | |
| | | <!-- CXF webservice --> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.apache.cxf</groupId>--> |
| | | <!-- <artifactId>cxf-spring-boot-starter-jaxws</artifactId>--> |
| | | <!-- <version>${cxf.version}</version>--> |
| | | <!-- </dependency>--> |
| | | <dependency> |
| | | <groupId>org.apache.cxf</groupId> |
| | | <artifactId>cxf-rt-frontend-jaxws</artifactId> |
| | | <version>${cxf.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.cxf</groupId> |
| | | <artifactId>cxf-rt-transports-http</artifactId> |
| | | <artifactId>cxf-spring-boot-starter-jaxws</artifactId> |
| | | <version>${cxf.version}</version> |
| | | </dependency> |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<LineSideWarehouse> queryByProductionType(String productionType); |
| | | |
| | | /** |
| | | * 线边åºç¼ç |
| | | * @param warehouseCode |
| | | * @return |
| | | */ |
| | | LineSideWarehouse queryByWarehouseCode(String warehouseCode); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.modules.base.entity.LineSideWarehouse; |
| | | import org.jeecg.modules.base.mapper.LineSideWarehouseMapper; |
| | | import org.jeecg.modules.base.service.ILineSideWarehouseService; |
| | |
| | | String[] types = productionType.split(","); |
| | | return this.getBaseMapper().queryByProductionType(types); |
| | | } |
| | | |
| | | @Override |
| | | public LineSideWarehouse queryByWarehouseCode(String warehouseCode) { |
| | | LambdaQueryWrapper<LineSideWarehouse> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(LineSideWarehouse::getWarehouseCode, warehouseCode); |
| | | wrapper.eq(LineSideWarehouse::getDelFlag, CommonConstant.DEL_FLAG_0); |
| | | wrapper.eq(LineSideWarehouse::getWarehouseStatus, CommonConstant.STATUS_1); |
| | | return this.getBaseMapper().selectOne(wrapper); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | /* |
| | | * çæå¯ä¸æ¡ç çæ¹æ³ |
| | | * çæå¯ä¸æ¡ç çæ¹æ³ï¼ç®åè¿æ²¡æç¼ç è§åï¼ç¡®å®åå¨è¿éæ¹ï¼ |
| | | */ |
| | | private String generateUniqueBarcode(String cuttingId, int index) { |
| | | // æ¡ç çæè§å示ä¾ï¼åå
·ID + åºå·(4ä½) + éæºæ° |
| | | return cuttingId + String.format("%04d", index + 1) + (int) (Math.random() * 10000); |
| | | } |
| | | // @GetMapping("/submit") |
| | | // public Result<?> submit(@RequestParam("orderId") String orderId) { |
| | | // // cuttingInboundService.submit(orderId); |
| | | // // return Result.ok("æäº¤æå"); |
| | | |
| | | @GetMapping("/submit") |
| | | @Timed(value = "cutting.inbound.submit", description = "åå
·å
¥åºæäº¤èæ¶") |
| | | public Result<?> submit(@RequestParam("orderId") String orderId) { |
| | | // long startTime = System.currentTimeMillis(); |
| | | // try { |
| | | // // 1. æ´æ°å
¥åºåç¶æ |
| | | // CuttingInbound cuttingInbound = cuttingInboundService.getById(orderId); |
| | | // if (cuttingInbound == null) { |
| | | // return Result.error("æªæ¾å°å¯¹åºçå
¥åºå"); |
| | | // } |
| | | // |
| | | // // æ£æ¥å
¥åºåç¶æï¼åªå
è®¸ç¶æä¸º"1"çå
¥åºåæäº¤ |
| | | // if (!"1".equals(cuttingInbound.getOrderStatus())) { |
| | | // return Result.error("åªæç¶æä¸ºæªæäº¤çå
¥åºåæè½æ§è¡æäº¤æä½"); |
| | | // } |
| | | // |
| | | // // 2. æ´æ°ç¶æä¸ºå·²æäº¤ |
| | | // cuttingInbound.setOrderStatus("2"); |
| | | // boolean updateResult = cuttingInboundService.updateById(cuttingInbound); |
| | | // if (!updateResult) { |
| | | // return Result.error("æ´æ°å
¥åºåç¶æå¤±è´¥"); |
| | | // } |
| | | // cuttingInboundService.updateById(cuttingInbound); |
| | | // |
| | | // // 3. è·åå
¥åºæç» |
| | | // // 2. è·åå
¥åºæç» |
| | | // List<CuttingInboundDetail> detailList = cuttingInboundDetailService.lambdaQuery() |
| | | // .eq(CuttingInboundDetail::getOrderId, orderId) |
| | | // .list(); |
| | | // |
| | | // // ç¨äºç»è®¡æ»æ°é |
| | | // int totalSubmitted = 0; |
| | | // |
| | | // // æ¹éä¿åçå表 |
| | | // // 3. æ¶éææéè¦ä¿åçæ°æ® |
| | | // List<CuttingInventory> inventoryList = new ArrayList<>(); |
| | | // List<CuttingInboundInventory> inboundInventoryList = new ArrayList<>(); |
| | | // |
| | | // // 4. æ ¹æ®æç»æ°éçæåºåè®°å½åæ¡ç |
| | | // for (CuttingInboundDetail detail : detailList) { |
| | | // // æ ¹æ®æç»ä¸çæ°éçæå¯¹åºæ°éçåºåè®°å½receive_number |
| | | // int quantity = detail.getReceiveNumber() != null ? detail.getReceiveNumber() : 0; |
| | | // for (int i = 0; i < quantity; i++) { |
| | | // totalSubmitted++; |
| | | // // 为æ¯ä¸ªåå
·çæç¬ç«çåºåè®°å½ |
| | | // CuttingInventory cuttingInventory = new CuttingInventory(); |
| | | // String inventoryId = UUID.randomUUID().toString().replace("-", ""); |
| | | // cuttingInventory.setId(inventoryId); |
| | | // cuttingInventory.setCuttingId(detail.getCuttingId()); |
| | | // // 为æ¯ä¸ªåå
·çæå¯ä¸æ¡ç |
| | | // cuttingInventory.setCuttingBarcode(generateUniqueBarcode(detail.getCuttingId(), i)); |
| | | // // 设置åºåç¶æä¸ºå¨åº |
| | | // cuttingInventory.setInventoryStatus("æ£å¸¸"); |
| | | // // 设置å½å寿å½ä¸º100 |
| | | // cuttingInventory.setCurrentLife(BigDecimal.valueOf(100)); |
| | | // // æ·»å å°æ¹éä¿åå表 |
| | | // inventoryList.add(cuttingInventory); |
| | | // int quantity = detail.getReceiveNumber() != null ? detail.getReceiveNumber().intValue() : 0; |
| | | // |
| | | // // 建ç«å
¥åºåä¸åºåçå
³èå
³ç³» |
| | | // for (int i = 0; i < quantity; i++) { |
| | | // // çæåºåè®°å½ |
| | | // CuttingInventory cuttingInventory = new CuttingInventory(); |
| | | // cuttingInventory.setCuttingId(detail.getCuttingId()); |
| | | // cuttingInventory.setCuttingBarcode(generateUniqueBarcode(detail.getCuttingId(), i)); |
| | | // cuttingInventory.setInventoryStatus("æ£å¸¸"); |
| | | // cuttingInventory.setCurrentLife(BigDecimal.valueOf(100)); |
| | | // inventoryList.add(cuttingInventory); |
| | | // } |
| | | // } |
| | | // |
| | | // // 4. æ¹éä¿ååºåè®°å½ï¼ä¸æ¬¡æ§æä½ï¼ |
| | | // if (!inventoryList.isEmpty()) { |
| | | // cuttingInventoryService.saveBatch(inventoryList); |
| | | // |
| | | // // 5. 为æ¯ä¸ªä¿åçåºåè®°å½å建å
³èå
³ç³» |
| | | // for (CuttingInventory inventory : inventoryList) { |
| | | // CuttingInboundInventory cuttingInboundInventory = new CuttingInboundInventory(); |
| | | // cuttingInboundInventory.setOrderId(orderId); |
| | | // cuttingInboundInventory.setInventoryId(inventoryId); |
| | | // // æ·»å å°æ¹éä¿åå表 |
| | | // cuttingInboundInventory.setInventoryId(inventory.getId()); |
| | | // inboundInventoryList.add(cuttingInboundInventory); |
| | | // } |
| | | // |
| | | // // 6. æ¹éä¿åå
³èå
³ç³»ï¼ä¸æ¬¡æ§æä½ï¼ |
| | | // cuttingInboundInventoryService.saveBatch(inboundInventoryList); |
| | | // } |
| | | // |
| | | // // æ¹éä¿ååºåè®°å½ |
| | | // if (!inventoryList.isEmpty()) { |
| | | // boolean saveResult = cuttingInventoryService.saveBatch(inventoryList); |
| | | // if (!saveResult) { |
| | | // throw new RuntimeException("ä¿ååºåè®°å½å¤±è´¥"); |
| | | // } |
| | | // } |
| | | // long endTime = System.currentTimeMillis(); |
| | | // log.info("åå
·å
¥åºæäº¤å®æï¼èæ¶: {} s", (endTime - startTime)/1000); |
| | | // return Result.ok("æäº¤æå"); |
| | | // |
| | | // // æ¹éä¿åå
³èå
³ç³» |
| | | // if (!inboundInventoryList.isEmpty()) { |
| | | // boolean relationSaveResult = cuttingInboundInventoryService.saveBatch(inboundInventoryList); |
| | | // if (!relationSaveResult) { |
| | | // throw new RuntimeException("ä¿åå
³èå
³ç³»å¤±è´¥"); |
| | | // } |
| | | // } |
| | | // |
| | | // Map<String, Object> result = new HashMap<>(); |
| | | // result.put("message", "æäº¤æå"); |
| | | // result.put("totalSubmitted", totalSubmitted); |
| | | // return Result.ok(result); |
| | | // } catch (Exception e) { |
| | | // log.error("æäº¤å
¥åºå失败ï¼orderId: " + orderId, e); |
| | | // throw new RuntimeException("æäº¤å¤±è´¥: " + e.getMessage(), e); |
| | | // long endTime = System.currentTimeMillis(); |
| | | // log.error("æäº¤å
¥åºå失败ï¼orderId: " + orderId + "ï¼èæ¶: " + (endTime - startTime) + " ms", e); |
| | | // return Result.error("æäº¤å¤±è´¥: " + e.getMessage()); |
| | | // } |
| | | // } |
| | | |
| | | @GetMapping("/submit") |
| | | @Timed(value = "cutting.inbound.submit", description = "åå
·å
¥åºæäº¤èæ¶") |
| | | public Result<?> submit(@RequestParam("orderId") String orderId) { |
| | | long startTime = System.currentTimeMillis(); |
| | | try { |
| | | // 1. æ´æ°å
¥åºåç¶æ |
| | | CuttingInbound cuttingInbound = cuttingInboundService.getById(orderId); |
| | | if (cuttingInbound == null) { |
| | | return Result.error("æªæ¾å°å¯¹åºçå
¥åºå"); |
| | | } |
| | | cuttingInbound.setOrderStatus("2"); |
| | | cuttingInboundService.updateById(cuttingInbound); |
| | | |
| | | // 2. è·åå
¥åºæç» |
| | | List<CuttingInboundDetail> detailList = cuttingInboundDetailService.lambdaQuery() |
| | | .eq(CuttingInboundDetail::getOrderId, orderId) |
| | | .list(); |
| | | |
| | | // 3. æ¶éææéè¦ä¿åçæ°æ® |
| | | List<CuttingInventory> inventoryList = new ArrayList<>(); |
| | | List<CuttingInboundInventory> inboundInventoryList = new ArrayList<>(); |
| | | |
| | | for (CuttingInboundDetail detail : detailList) { |
| | | int quantity = detail.getReceiveNumber() != null ? detail.getReceiveNumber().intValue() : 0; |
| | | |
| | | for (int i = 0; i < quantity; i++) { |
| | | // çæåºåè®°å½ |
| | | CuttingInventory cuttingInventory = new CuttingInventory(); |
| | | cuttingInventory.setCuttingId(detail.getCuttingId()); |
| | | cuttingInventory.setCuttingBarcode(generateUniqueBarcode(detail.getCuttingId(), i)); |
| | | cuttingInventory.setInventoryStatus("æ£å¸¸"); |
| | | cuttingInventory.setCurrentLife(BigDecimal.valueOf(100)); |
| | | inventoryList.add(cuttingInventory); |
| | | } |
| | | } |
| | | |
| | | // 4. æ¹éä¿ååºåè®°å½ï¼ä¸æ¬¡æ§æä½ï¼ |
| | | if (!inventoryList.isEmpty()) { |
| | | cuttingInventoryService.saveBatch(inventoryList); |
| | | |
| | | // 5. 为æ¯ä¸ªä¿åçåºåè®°å½å建å
³èå
³ç³» |
| | | for (CuttingInventory inventory : inventoryList) { |
| | | CuttingInboundInventory cuttingInboundInventory = new CuttingInboundInventory(); |
| | | cuttingInboundInventory.setOrderId(orderId); |
| | | cuttingInboundInventory.setInventoryId(inventory.getId()); |
| | | inboundInventoryList.add(cuttingInboundInventory); |
| | | } |
| | | |
| | | // 6. æ¹éä¿åå
³èå
³ç³»ï¼ä¸æ¬¡æ§æä½ï¼ |
| | | cuttingInboundInventoryService.saveBatch(inboundInventoryList); |
| | | } |
| | | |
| | | long endTime = System.currentTimeMillis(); |
| | | log.info("åå
·å
¥åºæäº¤å®æï¼èæ¶: {} s", (endTime - startTime)/1000); |
| | | return Result.ok("æäº¤æå"); |
| | | |
| | | } catch (Exception e) { |
| | | long endTime = System.currentTimeMillis(); |
| | | log.error("æäº¤å
¥åºå失败ï¼orderId: " + orderId + "ï¼èæ¶: " + (endTime - startTime) + " ms", e); |
| | | return Result.error("æäº¤å¤±è´¥: " + e.getMessage()); |
| | | } |
| | | return cuttingInboundService.submit(orderId); |
| | | } |
| | | } |
| | | |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.modules.cms.entity.CuttingInventory; |
| | |
| | | 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/cuttingReceive") |
| | | @Slf4j |
| | | public class CuttingReceiveController extends JeecgController<CuttingReceive, ICuttingReceiveService> { |
| | | @Autowired |
| | | private ICuttingReceiveService cuttingReceiveService; |
| | | @Autowired |
| | | private ICuttingReceiveService cuttingReceiveService; |
| | | |
| | | @Autowired |
| | | private ICuttingReceiveDetailService cuttingReceiveDetailService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param cuttingReceive |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "åå
·é¢ç¨å-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="åå
·é¢ç¨å-å页å表æ¥è¯¢", notes="åå
·é¢ç¨å-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<CuttingReceive>> queryPageList(CuttingReceive cuttingReceive, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<CuttingReceive> queryWrapper = QueryGenerator.initQueryWrapper(cuttingReceive, req.getParameterMap()); |
| | | Page<CuttingReceive> page = new Page<CuttingReceive>(pageNo, pageSize); |
| | | IPage<CuttingReceive> pageList = cuttingReceiveService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param jSONObject |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·é¢ç¨å-æ·»å ") |
| | | @ApiOperation(value="åå
·é¢ç¨å-æ·»å ", notes="åå
·é¢ç¨å-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_receive:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody JSONObject jSONObject) { |
| | | CuttingReceive cuttingReceive = jSONObject.toJavaObject(CuttingReceive.class); |
| | | cuttingReceive.setOrderStatus("1"); |
| | | cuttingReceiveService.saveOrUpdate(cuttingReceive); |
| | | //å é¤åå
³èæ°æ® |
| | | List<CuttingReceiveDetail> cuttingReceiveDetailList = cuttingReceiveDetailService.lambdaQuery().eq(CuttingReceiveDetail::getOrderId,cuttingReceive.getId()).list(); |
| | | cuttingReceiveDetailService.removeBatchByIds(cuttingReceiveDetailList); |
| | | //æ·»å æ°å
³èæ°æ® |
| | | JSONArray jsonArray = jSONObject.getJSONArray("detailData"); |
| | | List<CuttingReceiveDetail> list = jsonArray.toJavaList(CuttingReceiveDetail.class); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | CuttingReceiveDetail temp = list.get(i); |
| | | temp.setOrderId(cuttingReceive.getId()); |
| | | cuttingReceiveDetailService.save(temp); |
| | | } |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param cuttingReceive |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·é¢ç¨å-ç¼è¾") |
| | | @ApiOperation(value="åå
·é¢ç¨å-ç¼è¾", notes="åå
·é¢ç¨å-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_receive:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody CuttingReceive cuttingReceive) { |
| | | cuttingReceiveService.updateById(cuttingReceive); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·é¢ç¨å-éè¿idå é¤") |
| | | @ApiOperation(value="åå
·é¢ç¨å-éè¿idå é¤", notes="åå
·é¢ç¨å-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_receive:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | cuttingReceiveService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·é¢ç¨å-æ¹éå é¤") |
| | | @ApiOperation(value="åå
·é¢ç¨å-æ¹éå é¤", notes="åå
·é¢ç¨å-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_receive:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.cuttingReceiveService.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<CuttingReceive> queryById(@RequestParam(name="id",required=true) String id) { |
| | | CuttingReceive cuttingReceive = cuttingReceiveService.getById(id); |
| | | if(cuttingReceive==null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(cuttingReceive); |
| | | } |
| | | @Autowired |
| | | private ICuttingReceiveDetailService cuttingReceiveDetailService; |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param cuttingReceive |
| | | */ |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param cuttingReceive |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "åå
·é¢ç¨å-å页å表æ¥è¯¢") |
| | | @ApiOperation(value = "åå
·é¢ç¨å-å页å表æ¥è¯¢", notes = "åå
·é¢ç¨å-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<CuttingReceive>> queryPageList(CuttingReceive cuttingReceive, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<CuttingReceive> queryWrapper = QueryGenerator.initQueryWrapper(cuttingReceive, req.getParameterMap()); |
| | | Page<CuttingReceive> page = new Page<CuttingReceive>(pageNo, pageSize); |
| | | IPage<CuttingReceive> pageList = cuttingReceiveService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param jSONObject |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·é¢ç¨å-æ·»å ") |
| | | @ApiOperation(value = "åå
·é¢ç¨å-æ·»å ", notes = "åå
·é¢ç¨å-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_receive:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody JSONObject jSONObject) { |
| | | CuttingReceive cuttingReceive = jSONObject.toJavaObject(CuttingReceive.class); |
| | | cuttingReceive.setOrderStatus("1"); |
| | | cuttingReceiveService.saveOrUpdate(cuttingReceive); |
| | | //å é¤åå
³èæ°æ® |
| | | List<CuttingReceiveDetail> cuttingReceiveDetailList = cuttingReceiveDetailService.lambdaQuery().eq(CuttingReceiveDetail::getOrderId, cuttingReceive.getId()).list(); |
| | | cuttingReceiveDetailService.removeBatchByIds(cuttingReceiveDetailList); |
| | | //æ·»å æ°å
³èæ°æ® |
| | | JSONArray jsonArray = jSONObject.getJSONArray("detailData"); |
| | | List<CuttingReceiveDetail> list = jsonArray.toJavaList(CuttingReceiveDetail.class); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | CuttingReceiveDetail temp = list.get(i); |
| | | temp.setOrderId(cuttingReceive.getId()); |
| | | cuttingReceiveDetailService.save(temp); |
| | | } |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param cuttingReceive |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·é¢ç¨å-ç¼è¾") |
| | | @ApiOperation(value = "åå
·é¢ç¨å-ç¼è¾", notes = "åå
·é¢ç¨å-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_receive:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody CuttingReceive cuttingReceive) { |
| | | cuttingReceiveService.updateById(cuttingReceive); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·é¢ç¨å-éè¿idå é¤") |
| | | @ApiOperation(value = "åå
·é¢ç¨å-éè¿idå é¤", notes = "åå
·é¢ç¨å-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_receive:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name = "id", required = true) String id) { |
| | | cuttingReceiveService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·é¢ç¨å-æ¹éå é¤") |
| | | @ApiOperation(value = "åå
·é¢ç¨å-æ¹éå é¤", notes = "åå
·é¢ç¨å-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_receive:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | this.cuttingReceiveService.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<CuttingReceive> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | CuttingReceive cuttingReceive = cuttingReceiveService.getById(id); |
| | | if (cuttingReceive == null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(cuttingReceive); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param cuttingReceive |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_receive:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, CuttingReceive cuttingReceive) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("cms_cutting_receive:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, CuttingReceive.class); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®é¢ç¨idæ¥è¯¢é¢ç¨æç» |
| | | * |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | @GetMapping("/detailList") |
| | | public Result<?> detailList(@RequestParam("orderId") String orderId) { |
| | | List<Map<String, Object>> list = cuttingReceiveDetailService.detailList(orderId); |
| | | return Result.ok(list); |
| | | } |
| | | /** |
| | | * æ ¹æ®é¢ç¨idæ¥è¯¢é¢ç¨æç» |
| | | * |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | @GetMapping("/detailList") |
| | | public Result<?> detailList(@RequestParam("orderId") String orderId) { |
| | | List<Map<String, Object>> list = cuttingReceiveDetailService.detailList(orderId); |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | } |
| | |
| | | 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/cuttingTool") |
| | | @Slf4j |
| | | public class CuttingToolController extends JeecgController<CuttingTool, ICuttingToolService> { |
| | | @Autowired |
| | | private ICuttingToolService cuttingToolService; |
| | | @Autowired |
| | | private ICuttingToolService cuttingToolService; |
| | | |
| | | @Autowired |
| | | private ICuttingPropertiesService cuttingPropertiesService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param cuttingTool |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "åå
·ä¿¡æ¯-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="åå
·ä¿¡æ¯-å页å表æ¥è¯¢", notes="åå
·ä¿¡æ¯-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<CuttingTool>> queryPageList(CuttingTool cuttingTool, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<CuttingTool> queryWrapper = QueryGenerator.initQueryWrapper(cuttingTool, req.getParameterMap()); |
| | | Page<CuttingTool> page = new Page<CuttingTool>(pageNo, pageSize); |
| | | IPage<CuttingTool> pageList = cuttingToolService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param cuttingTool |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·ä¿¡æ¯-æ·»å ") |
| | | @ApiOperation(value="åå
·ä¿¡æ¯-æ·»å ", notes="åå
·ä¿¡æ¯-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_tool:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody CuttingTool cuttingTool) { |
| | | cuttingToolService.save(cuttingTool); |
| | | List<CuttingProperties> cuttingPropertiesList = cuttingTool.getCuttingPropertiesList(); |
| | | for (CuttingProperties cuttingProperties : cuttingPropertiesList) { |
| | | cuttingProperties.setCuttingId(cuttingTool.getId()); |
| | | cuttingPropertiesService.save(cuttingProperties); |
| | | } |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param cuttingTool |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·ä¿¡æ¯-ç¼è¾") |
| | | @ApiOperation(value="åå
·ä¿¡æ¯-ç¼è¾", notes="åå
·ä¿¡æ¯-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_tool:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody CuttingTool cuttingTool) { |
| | | cuttingToolService.saveOrUpdate(cuttingTool); |
| | | List<String> deletePropertiesIds = cuttingTool.getDeletePropertiesIds(); |
| | | if (deletePropertiesIds != null) { |
| | | for (String deletePropertiesId : deletePropertiesIds) { |
| | | cuttingPropertiesService.removeById(deletePropertiesId); |
| | | } |
| | | } |
| | | List<CuttingProperties> cuttingPropertiesList = cuttingTool.getCuttingPropertiesList(); |
| | | for (CuttingProperties cuttingProperties : cuttingPropertiesList) { |
| | | cuttingProperties.setCuttingId(cuttingTool.getId()); |
| | | cuttingPropertiesService.saveOrUpdate(cuttingProperties); |
| | | } |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·ä¿¡æ¯-éè¿idå é¤") |
| | | @ApiOperation(value="åå
·ä¿¡æ¯-éè¿idå é¤", notes="åå
·ä¿¡æ¯-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_tool:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | cuttingToolService.removeById(id); |
| | | cuttingPropertiesService.remove(new LambdaQueryWrapper<CuttingProperties>().eq(CuttingProperties::getCuttingId, id)); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·ä¿¡æ¯-æ¹éå é¤") |
| | | @ApiOperation(value="åå
·ä¿¡æ¯-æ¹éå é¤", notes="åå
·ä¿¡æ¯-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_tool:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.cuttingToolService.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<CuttingTool> queryById(@RequestParam(name="id",required=true) String id) { |
| | | CuttingTool cuttingTool = cuttingToolService.getById(id); |
| | | if(cuttingTool==null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(cuttingTool); |
| | | } |
| | | @Autowired |
| | | private ICuttingPropertiesService cuttingPropertiesService; |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param cuttingTool |
| | | */ |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param cuttingTool |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "åå
·ä¿¡æ¯-å页å表æ¥è¯¢") |
| | | @ApiOperation(value = "åå
·ä¿¡æ¯-å页å表æ¥è¯¢", notes = "åå
·ä¿¡æ¯-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<CuttingTool>> queryPageList(CuttingTool cuttingTool, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<CuttingTool> queryWrapper = QueryGenerator.initQueryWrapper(cuttingTool, req.getParameterMap()); |
| | | Page<CuttingTool> page = new Page<CuttingTool>(pageNo, pageSize); |
| | | IPage<CuttingTool> pageList = cuttingToolService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param cuttingTool |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·ä¿¡æ¯-æ·»å ") |
| | | @ApiOperation(value = "åå
·ä¿¡æ¯-æ·»å ", notes = "åå
·ä¿¡æ¯-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_tool:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody CuttingTool cuttingTool) { |
| | | cuttingToolService.save(cuttingTool); |
| | | List<CuttingProperties> cuttingPropertiesList = cuttingTool.getCuttingPropertiesList(); |
| | | for (CuttingProperties cuttingProperties : cuttingPropertiesList) { |
| | | cuttingProperties.setCuttingId(cuttingTool.getId()); |
| | | cuttingPropertiesService.save(cuttingProperties); |
| | | } |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param cuttingTool |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·ä¿¡æ¯-ç¼è¾") |
| | | @ApiOperation(value = "åå
·ä¿¡æ¯-ç¼è¾", notes = "åå
·ä¿¡æ¯-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_tool:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody CuttingTool cuttingTool) { |
| | | cuttingToolService.saveOrUpdate(cuttingTool); |
| | | List<String> deletePropertiesIds = cuttingTool.getDeletePropertiesIds(); |
| | | if (deletePropertiesIds != null) { |
| | | for (String deletePropertiesId : deletePropertiesIds) { |
| | | cuttingPropertiesService.removeById(deletePropertiesId); |
| | | } |
| | | } |
| | | List<CuttingProperties> cuttingPropertiesList = cuttingTool.getCuttingPropertiesList(); |
| | | for (CuttingProperties cuttingProperties : cuttingPropertiesList) { |
| | | cuttingProperties.setCuttingId(cuttingTool.getId()); |
| | | cuttingPropertiesService.saveOrUpdate(cuttingProperties); |
| | | } |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·ä¿¡æ¯-éè¿idå é¤") |
| | | @ApiOperation(value = "åå
·ä¿¡æ¯-éè¿idå é¤", notes = "åå
·ä¿¡æ¯-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_tool:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name = "id", required = true) String id) { |
| | | cuttingToolService.removeById(id); |
| | | cuttingPropertiesService.remove(new LambdaQueryWrapper<CuttingProperties>().eq(CuttingProperties::getCuttingId, id)); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·ä¿¡æ¯-æ¹éå é¤") |
| | | @ApiOperation(value = "åå
·ä¿¡æ¯-æ¹éå é¤", notes = "åå
·ä¿¡æ¯-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_tool:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | this.cuttingToolService.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<CuttingTool> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | CuttingTool cuttingTool = cuttingToolService.getById(id); |
| | | if (cuttingTool == null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(cuttingTool); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param cuttingTool |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_tool:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, CuttingTool cuttingTool) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("cms_cutting_tool:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, CuttingTool.class); |
| | | } |
| | | |
| | | |
| | | @GetMapping(value = "/getCuttingToolList") |
| | | public Result<?> getCuttingToolList(@RequestParam("pageNo") Integer pageNo, |
| | | @RequestParam("pageSize") Integer pageSize, |
| | | @RequestParam Map<String, Object> params) { |
| | | IPage<Map<String, Object>> cuttingToolList = cuttingToolService.getCuttingToolList(pageNo, pageSize, params); |
| | | for (Map<String, Object> record : cuttingToolList.getRecords()) { |
| | | String cuttingId = (String) record.get("id"); |
| | | List<CuttingProperties> cuttingPropertiesList = cuttingPropertiesService.selectListByCuttingId(cuttingId); |
| | | record.put("cuttingPropertiesList", cuttingPropertiesList); |
| | | } |
| | | return Result.ok(cuttingToolList); |
| | | } |
| | | //éæ©åå
·çæ¥å£ |
| | | @GetMapping(value = "/getCuttingToolList") |
| | | public Result<?> getCuttingToolList(@RequestParam("pageNo") Integer pageNo, |
| | | @RequestParam("pageSize") Integer pageSize, |
| | | @RequestParam Map<String, Object> params) { |
| | | IPage<Map<String, Object>> cuttingToolList = cuttingToolService.getCuttingToolList(pageNo, pageSize, params); |
| | | for (Map<String, Object> record : cuttingToolList.getRecords()) { |
| | | String cuttingId = (String) record.get("id"); |
| | | List<CuttingProperties> cuttingPropertiesList = cuttingPropertiesService.selectListByCuttingId(cuttingId); |
| | | record.put("cuttingPropertiesList", cuttingPropertiesList); |
| | | } |
| | | return Result.ok(cuttingToolList); |
| | | } |
| | | |
| | | } |
| | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | |
| | | @ApiModelProperty(value = "åå
·ID") |
| | | @Dict(dictTable = "cms_cutting_tool",dicCode="id",dicText = "cutting_code") |
| | | private String cuttingId; |
| | | |
| | | @TableField(exist = false) // 表示è¿ä¸æ¯æ°æ®åºå段 |
| | | private String cuttingCode; |
| | | /**åå
·æ¡ç */ |
| | | @Excel(name = "åå
·æ¡ç ", width = 15) |
| | | @ApiModelProperty(value = "åå
·æ¡ç ") |
| | |
| | | @Excel(name = "å½å寿å½(ç¾åæ¯)", width = 15) |
| | | @ApiModelProperty(value = "å½å寿å½(ç¾åæ¯)") |
| | | private BigDecimal currentLife; |
| | | |
| | | // å¨CuttingInventoryå®ä½ç±»ä¸æ·»å |
| | | @TableField(exist = false) // 表示è¿ä¸æ¯æ°æ®åºå段 |
| | | private String cuttingIdSearch; |
| | | |
| | | @TableField(exist = false) // 表示è¿ä¸æ¯æ°æ®åºå段 |
| | | private String cuttingBarcodeSearch; |
| | | } |
| | |
| | | */ |
| | | public interface CuttingReceiveDetailMapper extends BaseMapper<CuttingReceiveDetail> { |
| | | |
| | | public List<Map<String, Object>> detailList(@Param("orderId") String orderId); |
| | | List<Map<String, Object>> detailList(@Param("orderId") String orderId); |
| | | } |
| | |
| | | */ |
| | | public interface ICuttingInboundService extends IService<CuttingInbound> { |
| | | Result<?> importExcelData(List<CuttingInboundExportVo> list); |
| | | |
| | | Result<?> submit(String orderId); |
| | | } |
| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | | * @Description: é¢ç¨åæç» |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-07-28 |
| | |
| | | */ |
| | | public interface ICuttingReceiveDetailService extends IService<CuttingReceiveDetail> { |
| | | |
| | | public List<Map<String, Object>> detailList(String orderId); |
| | | List<Map<String, Object>> detailList(String orderId); |
| | | } |
| | |
| | | package org.jeecg.modules.cms.service.impl; |
| | | |
| | | import io.micrometer.core.annotation.Timed; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.cms.entity.CuttingInbound; |
| | | import org.jeecg.modules.cms.entity.CuttingInboundDetail; |
| | | import org.jeecg.modules.cms.entity.CuttingInboundInventory; |
| | | import org.jeecg.modules.cms.entity.CuttingInventory; |
| | | import org.jeecg.modules.cms.mapper.CuttingInboundMapper; |
| | | import org.jeecg.modules.cms.service.ICuttingInboundInventoryService; |
| | | import org.jeecg.modules.cms.service.ICuttingInboundService; |
| | | import org.jeecg.modules.cms.service.ICuttingInboundDetailService; |
| | | import org.jeecg.modules.cms.service.ICuttingInventoryService; |
| | | import org.jeecg.modules.cms.vo.CuttingInboundExportVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * @Date: 2025-07-28 |
| | | * @Version: V1.0 |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class CuttingInboundServiceImpl extends ServiceImpl<CuttingInboundMapper, CuttingInbound> implements ICuttingInboundService { |
| | | @Autowired |
| | | private ICuttingInboundDetailService cuttingInboundDetailService; // 注å
¥ä»è¡¨æå¡ |
| | | |
| | | @Autowired |
| | | private ICuttingInventoryService cuttingInventoryService; |
| | | |
| | | @Autowired |
| | | private ICuttingInboundInventoryService cuttingInboundInventoryService; |
| | | /** |
| | | * éè¿Excel导å
¥åå
·å
¥åºåæ°æ® |
| | | * |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result<?> importExcelData(List<CuttingInboundExportVo> list) { |
| | | // try { |
| | | // for (CuttingInboundExportVo exportVo : list) { |
| | | // // ä¿åä¸»è¡¨æ°æ® |
| | | // CuttingInbound cuttingInbound = new CuttingInbound(); |
| | | // cuttingInbound.setReceiver(exportVo.getReceiver()); |
| | | // cuttingInbound.setReceiveTime(exportVo.getReceiveTime()); |
| | | // cuttingInbound.setReceiveComment(exportVo.getReceiveComment()); |
| | | // cuttingInbound.setConfirmer(exportVo.getConfirmer()); |
| | | // cuttingInbound.setConfirmTime(exportVo.getConfirmTime()); |
| | | // cuttingInbound.setConfirmComment(exportVo.getConfirmComment()); |
| | | // cuttingInbound.setOrderStatus(exportVo.getOrderStatus()); |
| | | // |
| | | // // ä¿åä¸»è¡¨æ°æ®ä»¥è·åID |
| | | // this.save(cuttingInbound); |
| | | // |
| | | // // è·å主表ID |
| | | // String orderId = cuttingInbound.getId(); |
| | | // |
| | | // // å¤çä»è¡¨æ°æ® |
| | | // List<CuttingInboundDetail> detailList = exportVo.getDetailList(); |
| | | // if (detailList != null && !detailList.isEmpty()) { |
| | | // for (CuttingInboundDetail detail : detailList) { |
| | | // detail.setOrderId(orderId); // 设置å¤é®å
³è |
| | | // cuttingInboundDetailService.save(detail); |
| | | // } |
| | | // } |
| | | // } |
| | | // return Result.ok("导å
¥æå"); |
| | | // } catch (Exception e) { |
| | | // log.error("导å
¥å¤±è´¥", e); |
| | | // return Result.error("导å
¥å¤±è´¥: " + e.getMessage()); |
| | | // } |
| | | // } |
| | | |
| | | for (CuttingInboundExportVo exportVo : list) { |
| | | // ä¿åä¸»è¡¨æ°æ® |
| | | CuttingInbound cuttingInbound = new CuttingInbound(); |
| | |
| | | } |
| | | return Result.ok("导å
¥æå"); |
| | | } |
| | | |
| | | |
| | | /* |
| | | * çæå¯ä¸æ¡ç çæ¹æ³ï¼ç¡®å®ç¼ç çæè§åå卿¤å¤éåï¼ |
| | | */ |
| | | private String generateUniqueBarcode(String cuttingId, int index) { |
| | | // æ¡ç çæè§å示ä¾ï¼åå
·ID + åºå·(4ä½) + éæºæ° |
| | | return cuttingId + String.format("%04d", index + 1) + (int) (Math.random() * 10000); |
| | | } |
| | | @Override |
| | | @Timed(value = "cutting.inbound.submit", description = "åå
·å
¥åºæäº¤èæ¶") |
| | | public synchronized Result<?> submit(String orderId) { |
| | | long startTime = System.currentTimeMillis(); |
| | | try { |
| | | // 1. æ´æ°å
¥åºåç¶æ |
| | | CuttingInbound cuttingInbound = this.getById(orderId); |
| | | if (cuttingInbound == null) { |
| | | return Result.error("æªæ¾å°å¯¹åºçå
¥åºå"); |
| | | } |
| | | |
| | | // æ£æ¥å
¥åºåç¶æï¼åªå
è®¸ç¶æä¸º"1"çå
¥åºåæäº¤ |
| | | if (!"1".equals(cuttingInbound.getOrderStatus())) { |
| | | return Result.error("åªæç¶æä¸ºæªæäº¤çå
¥åºåæè½æ§è¡æäº¤æä½"); |
| | | } |
| | | |
| | | cuttingInbound.setOrderStatus("2"); |
| | | boolean updateResult = this.updateById(cuttingInbound); |
| | | if (!updateResult) { |
| | | return Result.error("æ´æ°å
¥åºåç¶æå¤±è´¥ï¼å¯è½å·²è¢«å
¶ä»ç¨æ·å¤ç"); |
| | | } |
| | | |
| | | // 2. è·åå
¥åºæç» |
| | | List<CuttingInboundDetail> detailList = cuttingInboundDetailService.lambdaQuery() |
| | | .eq(CuttingInboundDetail::getOrderId, orderId) |
| | | .list(); |
| | | |
| | | // 3. æ¶éææéè¦ä¿åçæ°æ® |
| | | List<CuttingInventory> inventoryList = new ArrayList<>(); |
| | | List<CuttingInboundInventory> inboundInventoryList = new ArrayList<>(); |
| | | |
| | | for (CuttingInboundDetail detail : detailList) { |
| | | int quantity = detail.getReceiveNumber() != null ? detail.getReceiveNumber().intValue() : 0; |
| | | |
| | | for (int i = 0; i < quantity; i++) { |
| | | // çæåºåè®°å½ |
| | | CuttingInventory cuttingInventory = new CuttingInventory(); |
| | | cuttingInventory.setCuttingId(detail.getCuttingId()); |
| | | cuttingInventory.setCuttingBarcode(generateUniqueBarcode(detail.getCuttingId(), i)); |
| | | cuttingInventory.setInventoryStatus("æ£å¸¸"); |
| | | cuttingInventory.setCurrentLife(BigDecimal.valueOf(100)); |
| | | inventoryList.add(cuttingInventory); |
| | | } |
| | | } |
| | | |
| | | // 4. æ¹éä¿ååºåè®°å½ï¼ä¸æ¬¡æ§æä½ï¼ |
| | | if (!inventoryList.isEmpty()) { |
| | | cuttingInventoryService.saveBatch(inventoryList); |
| | | |
| | | // 5. 为æ¯ä¸ªä¿åçåºåè®°å½å建å
³èå
³ç³» |
| | | for (CuttingInventory inventory : inventoryList) { |
| | | CuttingInboundInventory cuttingInboundInventory = new CuttingInboundInventory(); |
| | | cuttingInboundInventory.setOrderId(orderId); |
| | | cuttingInboundInventory.setInventoryId(inventory.getId()); |
| | | inboundInventoryList.add(cuttingInboundInventory); |
| | | } |
| | | |
| | | // 6. æ¹éä¿åå
³èå
³ç³»ï¼ä¸æ¬¡æ§æä½ï¼ |
| | | cuttingInboundInventoryService.saveBatch(inboundInventoryList); |
| | | } |
| | | |
| | | long endTime = System.currentTimeMillis(); |
| | | log.info("åå
·å
¥åºæäº¤å®æï¼èæ¶: {} ms", (endTime - startTime)); |
| | | return Result.ok("æäº¤æå"); |
| | | |
| | | } catch (Exception e) { |
| | | long endTime = System.currentTimeMillis(); |
| | | log.error("æäº¤å
¥åºå失败ï¼orderId: " + orderId + "ï¼èæ¶: " + (endTime - startTime) + " ms", e); |
| | | return Result.error("æäº¤å¤±è´¥: " + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "线边åºç©æä¿¡æ¯-æ ¹æ®ç©æç±»åæ¥è¯¢", notes = "线边åºç©æä¿¡æ¯-æ ¹æ®ç©æç±»åæ¥è¯¢") |
| | | @GetMapping(value = "/queryByMaterialCategory") |
| | | public Result<List<LswMaterial>> queryByMaterialCategory(@RequestParam("materialCategory") String materialCategory) { |
| | | if (StringUtils.isBlank(materialCategory)) { |
| | | return Result.ok(Collections.emptyList()); |
| | | } |
| | | String[] split = materialCategory.split(","); |
| | | LambdaQueryWrapper<LswMaterial> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(LswMaterial::getMaterialCategory, materialCategory); |
| | | queryWrapper.in(LswMaterial::getMaterialCategory, Arrays.asList(split)); |
| | | queryWrapper.eq(LswMaterial::getDelFlag, CommonConstant.DEL_FLAG_0); |
| | | queryWrapper.eq(LswMaterial::getMaterialStatus, CommonConstant.STATUS_1); |
| | | queryWrapper.orderByAsc(LswMaterial::getMaterialNumber); |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | 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.query.QueryGenerator; |
| | | import org.jeecg.modules.lsw.entity.LswMaterial; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInbound; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialInboundService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | */ |
| | | @AutoLog(value = "ç©æå
¥åºå-æ·»å ") |
| | | @ApiOperation(value="ç©æå
¥åºå-æ·»å ", notes="ç©æå
¥åºå-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:lsw_material_inbound:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody LswMaterialInbound lswMaterialInbound) { |
| | | lswMaterialInboundService.save(lswMaterialInbound); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | if(lswMaterialInbound == null){ |
| | | return Result.error("å
¥åºä¿¡æ¯ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if(sysUser == null){ |
| | | return Result.error("ç¨æ·ä¿¡æ¯è·å失败ï¼"); |
| | | } |
| | | lswMaterialInbound.setReceiver(sysUser.getUsername()); |
| | | boolean b = lswMaterialInboundService.inboundMaterial(lswMaterialInbound); |
| | | if(!b) { |
| | | return Result.error("å
¥åºå¤±è´¥ï¼"); |
| | | } |
| | | return Result.OK("å
¥åºæåï¼"); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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.system.query.QueryGenerator; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInbound; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialOutbound; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialOutboundService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: ç©æåºåºå |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-30 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="ç©æåºåºå") |
| | | * @Description: ç©æåºåºå |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-30 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags = "ç©æåºåºå") |
| | | @RestController |
| | | @RequestMapping("/lswmaterialoutbound/lswMaterialOutbound") |
| | | @RequestMapping("/lsw/materialOutbound") |
| | | @Slf4j |
| | | public class LswMaterialOutboundController extends JeecgController<LswMaterialOutbound, ILswMaterialOutboundService> { |
| | | @Autowired |
| | | private ILswMaterialOutboundService lswMaterialOutboundService; |
| | | @Autowired |
| | | private ILswMaterialOutboundService lswMaterialOutboundService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param lswMaterialOutbound |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "ç©æåºåºå-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="ç©æåºåºå-å页å表æ¥è¯¢", notes="ç©æåºåºå-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<LswMaterialOutbound>> queryPageList(LswMaterialOutbound lswMaterialOutbound, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<LswMaterialOutbound> queryWrapper = QueryGenerator.initQueryWrapper(lswMaterialOutbound, req.getParameterMap()); |
| | | Page<LswMaterialOutbound> page = new Page<LswMaterialOutbound>(pageNo, pageSize); |
| | | IPage<LswMaterialOutbound> pageList = lswMaterialOutboundService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param lswMaterialOutbound |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç©æåºåºå-æ·»å ") |
| | | @ApiOperation(value="ç©æåºåºå-æ·»å ", notes="ç©æåºåºå-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:lsw_material_outbound:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody LswMaterialOutbound lswMaterialOutbound) { |
| | | lswMaterialOutboundService.save(lswMaterialOutbound); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param lswMaterialOutbound |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç©æåºåºå-ç¼è¾") |
| | | @ApiOperation(value="ç©æåºåºå-ç¼è¾", notes="ç©æåºåºå-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules:lsw_material_outbound:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody LswMaterialOutbound lswMaterialOutbound) { |
| | | lswMaterialOutboundService.updateById(lswMaterialOutbound); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç©æåºåºå-éè¿idå é¤") |
| | | @ApiOperation(value="ç©æåºåºå-éè¿idå é¤", notes="ç©æåºåºå-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:lsw_material_outbound:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | lswMaterialOutboundService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç©æåºåºå-æ¹éå é¤") |
| | | @ApiOperation(value="ç©æåºåºå-æ¹éå é¤", notes="ç©æåºåºå-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:lsw_material_outbound:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.lswMaterialOutboundService.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<LswMaterialOutbound> queryById(@RequestParam(name="id",required=true) String id) { |
| | | LswMaterialOutbound lswMaterialOutbound = lswMaterialOutboundService.getById(id); |
| | | if(lswMaterialOutbound==null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(lswMaterialOutbound); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param lswMaterialOutbound |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:lsw_material_outbound:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, LswMaterialOutbound lswMaterialOutbound) { |
| | | return super.exportXls(request, lswMaterialOutbound, LswMaterialOutbound.class, "ç©æåºåºå"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("lsw_material_outbound:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, LswMaterialOutbound.class); |
| | | } |
| | | @GetMapping(value = "/searchlikeQuery") |
| | | public Result<?> searchlikeQuery(LswMaterialOutbound lswMaterialOutbound, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req){ |
| | | IPage<Map<String, Object>> pageList = lswMaterialOutboundService.getlswMaterialOutboundListData(pageNo,pageSize,req); |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param lswMaterialOutbound |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "ç©æåºåºå-å页å表æ¥è¯¢", notes = "ç©æåºåºå-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<LswMaterialOutbound>> queryPageList(LswMaterialOutbound lswMaterialOutbound, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<LswMaterialOutbound> queryWrapper = QueryGenerator.initQueryWrapper(lswMaterialOutbound, req.getParameterMap()); |
| | | Page<LswMaterialOutbound> page = new Page<LswMaterialOutbound>(pageNo, pageSize); |
| | | IPage<LswMaterialOutbound> pageList = lswMaterialOutboundService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | |
| | | /**æ¥æ¶äºº*/ |
| | | @Excel(name = "æ¥æ¶äºº", width = 15) |
| | | @ApiModelProperty(value = "æ¥æ¶äºº") |
| | | @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") |
| | | private String receiver; |
| | | /**æ¥æ¶æ¶é´*/ |
| | | @Excel(name = "æ¥æ¶æ¶é´", width = 20, format = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | package org.jeecg.modules.lsw.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.modules.lsw.enums.MaterialInventoryStatusEnum; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.persistence.Table; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "åå»ºæ¥æ") |
| | | private Date createTime; |
| | | /**æ´æ°äºº*/ |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | private String updateBy; |
| | | /**æ´æ°æ¥æ*/ |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "æ´æ°æ¥æ") |
| | | private Date updateTime; |
| | | /**ç©æID*/ |
| | | @ApiModelProperty(value = "ç©æID") |
| | | private String materialId; |
| | |
| | | /**çå¤çæ è¯*/ |
| | | @Excel(name = "çå¤çæ è¯", width = 15) |
| | | @ApiModelProperty(value = "çå¤çæ è¯") |
| | | private String heatTreatmentFlag = CommonConstant.STATUS_0; |
| | | private String heatTreatmentFlag; |
| | | |
| | | public LswMaterialInventory(){} |
| | | |
| | | public LswMaterialInventory(LswMaterialInbound inbound, String materialId, String inventoryCategory) { |
| | | public LswMaterialInventory(LswMaterialInbound inbound, String materialId, String inventoryCategory, String heatTreatmentFlag) { |
| | | this.warehouseId = inbound.getWarehouseId(); |
| | | this.quantity = inbound.getQuantity(); |
| | | this.batchNumber = inbound.getBatchNumber(); |
| | | this.inventoryStatus = MaterialInventoryStatusEnum.NORMAL.name(); |
| | | this.inventoryCategory = inventoryCategory; |
| | | this.materialId = materialId; |
| | | this.heatTreatmentFlag = heatTreatmentFlag; |
| | | } |
| | | } |
| | |
| | | /**产线ID*/ |
| | | @Excel(name = "产线ID", width = 15) |
| | | @ApiModelProperty(value = "产线ID") |
| | | @Dict(dictTable = "base_factory", dicCode = "id", dicText = "factory_name") |
| | | private String factoryId; |
| | | /**åºåID*/ |
| | | @Excel(name = "åºåID", width = 15) |
| | |
| | | /**线边åºID*/ |
| | | @Excel(name = "线边åºID", width = 15) |
| | | @ApiModelProperty(value = "线边åºID") |
| | | @Dict(dictTable = "base_line_side_warehouse", dicCode = "id", dicText = "warehouse_name") |
| | | private String warehouseId; |
| | | /**æ¹æ¬¡å·*/ |
| | | @Excel(name = "æ¹æ¬¡å·", width = 15) |
| | |
| | | /**åºåºäºº*/ |
| | | @Excel(name = "åºåºäºº", width = 15) |
| | | @ApiModelProperty(value = "åºåºäºº") |
| | | @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") |
| | | private String outboundStaff; |
| | | /**åºåºæ¶é´*/ |
| | | @Excel(name = "åºåºæ¶é´", width = 20, format = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | @Excel(name = "åºåºæ°é", width = 15) |
| | | @ApiModelProperty(value = "åºåºæ°é") |
| | | private BigDecimal quantity; |
| | | /**åºåºç±»å*/ |
| | | @Excel(name = "åºåºç±»å", width = 15) |
| | | @ApiModelProperty(value = "åºåºç±»å") |
| | | @Dict(dicCode = "material_outbound_category") |
| | | private String outboundCategory; |
| | | } |
| | |
| | | PRODUCTION_INBOUND,//ç产ä¸çº¿ |
| | | HEAT_TREATMENT_INBOUND,//çå¤ç |
| | | SMALL_INNER_RING,//å°å
å |
| | | MATERIAL_INNER_TRANSFER //å
é¨è°æ¨ |
| | | MATERIAL_INNER_TRANSFER, //å
é¨è°æ¨ |
| | | PRODUCTION_UNLOADING, //䏿 |
| | | ; |
| | | } |
| | |
| | | public enum MaterialInventoryCategoryEnum { |
| | | INBOUND, //å
¥åº |
| | | UNLOADING, //䏿 |
| | | TRANSFER, //è°æ¨ |
| | | ; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.lsw.enums; |
| | | |
| | | public enum MaterialOutboundCategory { |
| | | MATERIAL_LOADING, //䏿 |
| | | WAREHOUSE_TRANSFER, //ç§»åº |
| | | MATERIAL_INNER_TRANSFER, //å
é¨è°æ¨ |
| | | ; |
| | | } |
| | |
| | | /** |
| | | * @Description: ç©æåºåä¿¡æ¯ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-30 |
| | | * @Date: 2025-06-30 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface ILswMaterialInventoryService extends IService<LswMaterialInventory> { |
| | | /** éè¿ç©æç¼ç å线边åºidæ¥è¯¢ç©æåºå */ |
| | | /** éè¿ç©æç¼ç å线边åºidæ¥è¯¢ç©æåºå */ |
| | | List<LswMaterialInventoryVo> selectLineSideMaterialInventoryByMaterialNumber(List<String> bomMaterialNumberList, String factoryId); |
| | | |
| | | /** |
| | | * åºåç»è®¡ |
| | | * @param materialId ç©æID |
| | | * @return |
| | | */ |
| | | /** |
| | | * åºåç»è®¡ |
| | | * @param materialId ç©æID |
| | | * @return |
| | | */ |
| | | List<MaterialInventoryStatisticsVO> statisticsInventory(String materialId); |
| | | |
| | | /** |
| | | * æ¥è¯¢æªåºåºä¿¡æ¯ |
| | | * @param materialNumber |
| | | * @param batchNumber |
| | | * @param warehouseId |
| | | * @return |
| | | */ |
| | | LswMaterialInventory queryByMaterialNumberAndBatchNumber(String materialNumber, String batchNumber, String warehouseId); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.modules.base.entity.LineSideWarehouse; |
| | | import org.jeecg.modules.base.service.ILineSideWarehouseService; |
| | | import org.jeecg.modules.lsw.entity.LswMaterial; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInbound; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInventory; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialOutbound; |
| | | import org.jeecg.modules.lsw.enums.MaterialInboundCategory; |
| | | import org.jeecg.modules.lsw.enums.MaterialInventoryCategoryEnum; |
| | | import org.jeecg.modules.lsw.enums.MaterialOutboundCategory; |
| | | 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.ILswMaterialOutboundService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private ILswMaterialInventoryService inventoryService; |
| | | @Autowired |
| | | private ILswMaterialService materialService; |
| | | @Autowired |
| | | private ILineSideWarehouseService lineSideWarehouseService; |
| | | @Autowired |
| | | private ILswMaterialOutboundService materialOutboundService; |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> getlswMaterialInboundListData(Integer pageNo, Integer pageSize, HttpServletRequest req) { |
| | |
| | | || StringUtils.isBlank(materialInbound.getFactoryId()) |
| | | || StringUtils.isBlank(materialInbound.getWarehouseId()) |
| | | || materialInbound.getQuantity() == null |
| | | || materialInbound.getQuantity().intValue() > 0 |
| | | || StringUtils.isBlank(materialInbound.getBatchNumber())) { |
| | | return false; |
| | | || materialInbound.getQuantity().intValue() < 1 |
| | | || StringUtils.isBlank(materialInbound.getBatchNumber()) |
| | | || StringUtils.isBlank(materialInbound.getOriginalCode()) |
| | | || StringUtils.isBlank(materialInbound.getOriginalName()) |
| | | || StringUtils.isBlank(materialInbound.getInboundCategory())) { |
| | | throw new JeecgBootException("åæ°é误ï¼"); |
| | | } |
| | | LswMaterial material = materialService.queryByMaterialNumber(materialInbound.getMaterialNumber()); |
| | | if(material == null) { |
| | | return false; |
| | | if (material == null) { |
| | | throw new JeecgBootException("ç©æç¼å·ä¸åå¨ï¼"); |
| | | } |
| | | LineSideWarehouse warehouse = lineSideWarehouseService.getById(materialInbound.getWarehouseId()); |
| | | if (warehouse == null) { |
| | | throw new JeecgBootException("线边åºä¸åå¨ï¼"); |
| | | } |
| | | String heatTreatmentFlag = CommonConstant.STATUS_0; |
| | | if (materialInbound.getInboundCategory().equals(MaterialInboundCategory.HEAT_TREATMENT_INBOUND.name())) { |
| | | heatTreatmentFlag = CommonConstant.STATUS_1; |
| | | } |
| | | //åºåç±»å |
| | | String inventoryCategory = MaterialInventoryCategoryEnum.INBOUND.name(); |
| | | if (materialInbound.getInboundCategory().equals(MaterialInboundCategory.MATERIAL_INNER_TRANSFER.name())) { |
| | | inventoryCategory = MaterialInventoryCategoryEnum.TRANSFER.name(); |
| | | //æ¥è¯¢æ¥æºçº¿è¾¹åº |
| | | LineSideWarehouse lineSideWarehouse = lineSideWarehouseService.queryByWarehouseCode(materialInbound.getOriginalCode()); |
| | | if (lineSideWarehouse == null) { |
| | | throw new JeecgBootException("æªæ¾å°æ¥æºçº¿è¾¹åºï¼"); |
| | | } |
| | | //è°æ¨ åºåºåå§åºå |
| | | LswMaterialInventory originalInventory = inventoryService.queryByMaterialNumberAndBatchNumber(materialInbound.getMaterialNumber(), materialInbound.getBatchNumber(), lineSideWarehouse.getId()); |
| | | if (originalInventory == null) { |
| | | throw new JeecgBootException("æªæ¾å°æ¥æºçº¿è¾¹åºåºåï¼"); |
| | | } |
| | | if (materialInbound.getQuantity().compareTo(originalInventory.getQuantity()) != 0) { |
| | | throw new JeecgBootException("è°æ¨æ°ééè¦çäºæ¥æºåºåæ°éï¼"); |
| | | } |
| | | //åºåºä¿¡æ¯ |
| | | LswMaterialOutbound outbound = new LswMaterialOutbound(); |
| | | outbound.setWarehouseId(lineSideWarehouse.getId()); |
| | | outbound.setFactoryId(lineSideWarehouse.getFactoryId()); |
| | | outbound.setOutboundStaff(materialInbound.getReceiver()); |
| | | outbound.setMaterialName(materialInbound.getMaterialName()); |
| | | outbound.setMaterialNumber(materialInbound.getMaterialNumber()); |
| | | outbound.setQuantity(originalInventory.getQuantity()); |
| | | outbound.setBatchNumber(originalInventory.getBatchNumber()); |
| | | outbound.setInventoryId(originalInventory.getId()); |
| | | outbound.setOutboundCategory(MaterialOutboundCategory.MATERIAL_INNER_TRANSFER.name()); |
| | | //è°æ¨åºåº |
| | | boolean b = materialOutboundService.outboundMaterial(outbound); |
| | | if (!b) { |
| | | throw new JeecgBootException("è°æ¨åºåºå¤±è´¥ï¼"); |
| | | } |
| | | } else if (materialInbound.getInboundCategory().equals(MaterialInboundCategory.PRODUCTION_UNLOADING.name())) { |
| | | inventoryCategory = MaterialInventoryCategoryEnum.UNLOADING.name(); |
| | | } |
| | | //ä¿åå
¥åºä¿¡æ¯ |
| | | materialInbound.setDelFlag(CommonConstant.DEL_FLAG_0); |
| | | materialInbound.setReceiveTime(new Date()); |
| | | super.save(materialInbound); |
| | | //ä¿ååºåä¿¡æ¯ |
| | | LswMaterialInventory lswMaterialInventory = new LswMaterialInventory(materialInbound, material.getId(), material.getMaterialCategory()); |
| | | LswMaterialInventory lswMaterialInventory = new LswMaterialInventory(materialInbound, material.getId(), inventoryCategory, heatTreatmentFlag); |
| | | inventoryService.save(lswMaterialInventory); |
| | | return true; |
| | | } |
| | |
| | | package org.jeecg.modules.lsw.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.lsw.entity.LswMaterial; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInventory; |
| | | import org.jeecg.modules.lsw.enums.MaterialInventoryStatusEnum; |
| | | import org.jeecg.modules.lsw.mapper.LswMaterialInventoryMapper; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialInventoryService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialService; |
| | | import org.jeecg.modules.lsw.vo.LswMaterialInventoryVo; |
| | | import org.jeecg.modules.lsw.vo.MaterialInventoryStatisticsVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: ç©æåºåä¿¡æ¯ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-30 |
| | | * @Date: 2025-06-30 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class LswMaterialInventoryServiceImpl extends ServiceImpl<LswMaterialInventoryMapper, LswMaterialInventory> implements ILswMaterialInventoryService { |
| | | |
| | | @Autowired |
| | | private LswMaterialInventoryMapper lswMaterialInventoryMapper; |
| | | |
| | | @Autowired |
| | | private LswMaterialInventoryMapper lswMaterialInventoryMapper; |
| | | @Autowired |
| | | private ILswMaterialService materialService; |
| | | |
| | | @Override |
| | | public List<LswMaterialInventoryVo> selectLineSideMaterialInventoryByMaterialNumber(List<String> bomMaterialNumberList, String factoryId) { |
| | | return lswMaterialInventoryMapper.selectLineSideMaterialInventoryByMaterialNumber(bomMaterialNumberList, factoryId); |
| | | return lswMaterialInventoryMapper.selectLineSideMaterialInventoryByMaterialNumber(bomMaterialNumberList, factoryId); |
| | | } |
| | | |
| | | @Override |
| | | public List<MaterialInventoryStatisticsVO> statisticsInventory(String materialId) { |
| | | return lswMaterialInventoryMapper.statisticsInventory(materialId); |
| | | } |
| | | @Override |
| | | public List<MaterialInventoryStatisticsVO> statisticsInventory(String materialId) { |
| | | return lswMaterialInventoryMapper.statisticsInventory(materialId); |
| | | } |
| | | |
| | | @Override |
| | | public LswMaterialInventory queryByMaterialNumberAndBatchNumber(String materialNumber, String batchNumber, String warehouseId) { |
| | | LswMaterial material = materialService.queryByMaterialNumber(materialNumber); |
| | | if (material == null) { |
| | | return null; |
| | | } |
| | | LambdaQueryWrapper<LswMaterialInventory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(LswMaterialInventory::getWarehouseId, warehouseId); |
| | | queryWrapper.eq(LswMaterialInventory::getMaterialId, material.getId()); |
| | | queryWrapper.eq(LswMaterialInventory::getBatchNumber, batchNumber); |
| | | queryWrapper.eq(LswMaterialInventory::getInventoryStatus, MaterialInventoryStatusEnum.NORMAL.name()); |
| | | return lswMaterialInventoryMapper.selectOne(queryWrapper); |
| | | } |
| | | } |
| | |
| | | || StringUtils.isBlank(outbound.getFactoryId()) |
| | | || StringUtils.isBlank(outbound.getWarehouseId()) |
| | | || outbound.getQuantity() == null |
| | | || outbound.getQuantity().intValue() > 0 |
| | | || outbound.getQuantity().intValue() < 1 |
| | | || StringUtils.isBlank(outbound.getBatchNumber()) |
| | | || StringUtils.isBlank(outbound.getInventoryId())) { |
| | | || StringUtils.isBlank(outbound.getInventoryId())) { |
| | | return false; |
| | | } |
| | | LswMaterialInventory inventory = materialInventoryService.getById(outbound.getInventoryId()); |
| | | if(inventory == null) { |
| | | if (inventory == null) { |
| | | return false; |
| | | } |
| | | //æ´æ°åºåç¶æ |
| | |
| | | package org.jeecg.modules.wms.config; |
| | | |
| | | import org.apache.cxf.Bus; |
| | | import org.apache.cxf.bus.spring.SpringBus; |
| | | import org.apache.cxf.jaxws.EndpointImpl; |
| | | import org.apache.cxf.transport.servlet.CXFServlet; |
| | | import org.jeecg.modules.wms.service.MESWebServiceSoap; |
| | |
| | | @Configuration |
| | | public class WebServiceServerConfig { |
| | | @Autowired |
| | | private MESWebServiceSoap webServiceSoap; |
| | | |
| | | @Bean(name = Bus.DEFAULT_BUS_ID) |
| | | public Bus springBus() { |
| | | return new SpringBus(); |
| | | } |
| | | private Bus bus; |
| | | @Autowired |
| | | private MESWebServiceSoap mesWebServiceSoap; |
| | | |
| | | @Bean(name = "cxfServlet") // 注å
¥servlet bean nameä¸è½dispatcherServlet ,å¦åä¼è¦çdispatcherServlet |
| | | public ServletRegistrationBean<CXFServlet> cxfServlet() { |
| | |
| | | @Bean |
| | | public Endpoint endpoint() { |
| | | // åæ°äºï¼æ¯SEIå®ç°ç±»å¯¹è±¡ |
| | | Endpoint endpoint = new EndpointImpl(this.springBus(), webServiceSoap); |
| | | Endpoint endpoint = new EndpointImpl(bus, mesWebServiceSoap); |
| | | // åå¸æå¡ |
| | | endpoint.publish("/MESWebService"); |
| | | |
| | | return endpoint; |
| | | } |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.wms.dto.WSResponse; |
| | | import org.jeecg.modules.wms.dto.MESResponse; |
| | | import org.jeecg.modules.wms.request.*; |
| | | import org.jeecg.modules.wms.service.MESWebServiceSoap; |
| | | import org.jeecg.modules.wms.service.WMSWebServiceClient; |
| | |
| | | MESWebServiceSoap service = (MESWebServiceSoap) factory.create(); |
| | | ReceiveWMSScanItemList request = new ReceiveWMSScanItemList(); |
| | | request.setWmsWebServiceSendItemList(list); |
| | | WSResponse response = service.receiveWMSScanItemList(request); |
| | | MESResponse response = service.receiveWMSScanItemList(request); |
| | | return Result.ok(response); |
| | | } |
| | | |
| | |
| | | @Getter |
| | | @Setter |
| | | @XmlAccessorType(XmlAccessType.FIELD) |
| | | @XmlType(name = "WSResponse", propOrder = { |
| | | @XmlType(name = "MESResponse", propOrder = { |
| | | "errorCode", |
| | | "errorDesc" |
| | | }) |
| | | }, namespace = "http://xhj008.server.webservice.com/") |
| | | public class MESResponse { |
| | | @XmlElement(name = "ErrorCode") |
| | | @XmlElement(name = "ErrorCode", namespace = "http://xhj008.server.webservice.com/") |
| | | protected String errorCode; |
| | | @XmlElement(name = "ErrorDesc") |
| | | @XmlElement(name = "ErrorDesc", namespace = "http://xhj008.server.webservice.com/") |
| | | protected String errorDesc; |
| | | } |
| | |
| | | @XmlAccessorType(XmlAccessType.FIELD) |
| | | @XmlType(name = "", propOrder = { |
| | | "receiveWMSScanItemListResult" |
| | | }) |
| | | @XmlRootElement(name = "ReceiveWMSScanItemListResponse") |
| | | }, namespace = "http://xhj008.server.webservice.com/") |
| | | @XmlRootElement(name = "ReceiveWMSScanItemListResponse", namespace = "http://xhj008.server.webservice.com/") |
| | | @Getter |
| | | @Setter |
| | | public class ReceiveWMSScanItemListResponse { |
| | | @XmlElement(name = "ReceiveWMSScanItemListResult") |
| | | @XmlElement(name = "ReceiveWMSScanItemListResult", namespace = "http://xhj008.server.webservice.com/") |
| | | protected MESResponse receiveWMSScanItemListResult; |
| | | } |
| | |
| | | @XmlAccessorType(XmlAccessType.FIELD) |
| | | @XmlType(name = "", propOrder = { |
| | | "wmsWebServiceSendItemList" |
| | | }) |
| | | @XmlRootElement(name = "ReceiveWMSScanItemList") |
| | | }, namespace = "http://xhj008.server.webservice.com/") |
| | | @XmlRootElement(name = "ReceiveWMSScanItemList", namespace = "http://xhj008.server.webservice.com/") |
| | | @Getter |
| | | @Setter |
| | | public class ReceiveWMSScanItemList { |
| | | |
| | | @XmlElementWrapper(name = "ArrayOfWMSWebServiceSendItem") |
| | | @XmlElement(name = "WMSWebServiceSendItem", nillable = true) |
| | | @XmlElementWrapper(name = "ArrayOfWMSWebServiceSendItem", namespace = "http://xhj008.server.webservice.com/") |
| | | @XmlElement(name = "WMSWebServiceSendItem", nillable = true, namespace = "http://xhj008.server.webservice.com/") |
| | | protected List<WMSWebServiceSendItem> wmsWebServiceSendItemList; |
| | | } |
| | |
| | | "stageID", |
| | | "remark", |
| | | "orderCode" |
| | | }) |
| | | }, namespace = "http://xhj008.server.webservice.com/") |
| | | @XmlAccessorType(XmlAccessType.FIELD) |
| | | public class WMSWebServiceSendItem { |
| | | |
| | | /**å·¥åç¼ç */ |
| | | @XmlElement(name = "FactoryCode") |
| | | @XmlElement(name = "FactoryCode", namespace = "http://xhj008.server.webservice.com/") |
| | | private String factoryCode; |
| | | /** ç©æç¼ç */ |
| | | @XmlElement(name = "SkuCode") |
| | | @XmlElement(name = "SkuCode", namespace = "http://xhj008.server.webservice.com/") |
| | | private String skuCode; |
| | | /** é¢çå· */ |
| | | @XmlElement(name = "ReservationOrder") |
| | | @XmlElement(name = "ReservationOrder", namespace = "http://xhj008.server.webservice.com/") |
| | | private String reservationOrder; |
| | | /** MESç§»åºåå· */ |
| | | @XmlElement(name = "Align") |
| | | @XmlElement(name = "Align", namespace = "http://xhj008.server.webservice.com/") |
| | | private String align; |
| | | /** æå· */ |
| | | @XmlElement(name = "Pallet") |
| | | @XmlElement(name = "Pallet", namespace = "http://xhj008.server.webservice.com/") |
| | | private String pallet; |
| | | /** å
è£
ç¼ç */ |
| | | @XmlElement(name = "PackageNo") |
| | | @XmlElement(name = "PackageNo", namespace = "http://xhj008.server.webservice.com/") |
| | | private String packageNo; |
| | | /** æ¹æ¬¡å· */ |
| | | @XmlElement(name = "TrackLot") |
| | | @XmlElement(name = "TrackLot", namespace = "http://xhj008.server.webservice.com/") |
| | | private String trackLot; |
| | | /** ç³»åå· */ |
| | | @XmlElement(name = "Series") |
| | | @XmlElement(name = "Series", namespace = "http://xhj008.server.webservice.com/") |
| | | private String series; |
| | | /** MESåºåID */ |
| | | @XmlElement(name = "MesStockID") |
| | | @XmlElement(name = "MesStockID", namespace = "http://xhj008.server.webservice.com/") |
| | | private String mesStockID; |
| | | /** æ°é */ |
| | | @XmlElement(name = "Quantity") |
| | | @XmlElement(name = "Quantity", namespace = "http://xhj008.server.webservice.com/") |
| | | private BigDecimal quantity; |
| | | /** SAPæ¹æ¬¡å· */ |
| | | @XmlElement(name = "SapTrackLot") |
| | | @XmlElement(name = "SapTrackLot", namespace = "http://xhj008.server.webservice.com/") |
| | | private String sapTrackLot; |
| | | /** åéåºåå° */ |
| | | @XmlElement(name = "Section") |
| | | @XmlElement(name = "Section", namespace = "http://xhj008.server.webservice.com/") |
| | | private String section; |
| | | /** ç®æ åºåå° */ |
| | | @XmlElement(name = "DestSection") |
| | | @XmlElement(name = "DestSection", namespace = "http://xhj008.server.webservice.com/") |
| | | private String destSection; |
| | | /** ä¾åºå代ç */ |
| | | @XmlElement(name = "SupplierCode") |
| | | @XmlElement(name = "SupplierCode", namespace = "http://xhj008.server.webservice.com/") |
| | | private String supplierCode; |
| | | /** ä¾åºåæ¹æ¬¡å· */ |
| | | @XmlElement(name = "SupplierTrackLot") |
| | | @XmlElement(name = "SupplierTrackLot", namespace = "http://xhj008.server.webservice.com/") |
| | | private String supplierTrackLot; |
| | | /** é¶æ®µID */ |
| | | @XmlElement(name = "StageID") |
| | | @XmlElement(name = "StageID", namespace = "http://xhj008.server.webservice.com/") |
| | | private String stageID; |
| | | /** 夿³¨ */ |
| | | @XmlElement(name = "Remark") |
| | | @XmlElement(name = "Remark", namespace = "http://xhj008.server.webservice.com/") |
| | | private String remark; |
| | | /** 订åç¼ç */ |
| | | @XmlElement(name = "OrderCode") |
| | | @XmlElement(name = "OrderCode", namespace = "http://xhj008.server.webservice.com/") |
| | | private String orderCode; |
| | | } |
| | |
| | | package org.jeecg.modules.wms.service; |
| | | |
| | | import org.jeecg.modules.wms.dto.WSResponse; |
| | | import org.jeecg.modules.wms.dto.MESResponse; |
| | | import org.jeecg.modules.wms.request.ReceiveWMSScanItemList; |
| | | |
| | | import javax.jws.WebMethod; |
| | | import javax.jws.WebParam; |
| | | import javax.jws.WebResult; |
| | | import javax.jws.WebService; |
| | | import javax.xml.ws.RequestWrapper; |
| | | import javax.xml.ws.ResponseWrapper; |
| | | |
| | | @WebService(name = "MESWebServiceSoap", targetNamespace = "http://xhj008.server.webservice.com/") |
| | | public interface MESWebServiceSoap { |
| | | /** |
| | | * æ¥æ¶WMSç§»åºä¿¡æ¯ |
| | | * @param request |
| | | * @param wmsWebServiceSendItemList |
| | | * @return |
| | | */ |
| | | @WebMethod |
| | | WSResponse receiveWMSScanItemList(ReceiveWMSScanItemList request); |
| | | @WebMethod(operationName = "ReceiveWMSScanItemList", action = "http://xhj008.server.webservice.com/ReceiveWMSScanItemList") |
| | | @RequestWrapper(localName = "ReceiveWMSScanItemList", targetNamespace = "http://xhj008.server.webservice.com/", className = "ReceiveWMSScanItemList") |
| | | @ResponseWrapper(localName = "ReceiveWMSScanItemListResponse", targetNamespace = "http://xhj008.server.webservice.com/", className = "ReceiveWMSScanItemListResponse") |
| | | @WebResult(name = "ReceiveWMSScanItemListResult", targetNamespace = "http://xhj008.server.webservice.com/") |
| | | MESResponse receiveWMSScanItemList( |
| | | @WebParam(name = "wmsWebServiceSendItemList", targetNamespace = "http:/xhj008.server.webservice.com/") |
| | | ReceiveWMSScanItemList wmsWebServiceSendItemList); |
| | | } |
| | |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInbound; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInventory; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialOutbound; |
| | | import org.jeecg.modules.lsw.enums.MaterialInboundCategory; |
| | | 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.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.dto.MESResponse; |
| | | import org.jeecg.modules.wms.request.ReceiveWMSScanItemList; |
| | | import org.jeecg.modules.wms.request.WMSWebServiceSendItem; |
| | | import org.jeecg.modules.wms.service.MESWebServiceSoap; |
| | |
| | | |
| | | |
| | | @Slf4j |
| | | @Service |
| | | @Service("MESWebServiceSoap") |
| | | @WebService(name = "MESWebServiceSoap", targetNamespace = "http://xhj008.server.webservice.com", endpointInterface = "org.jeecg.modules.wms.service.MESWebServiceSoap") |
| | | public class MESWebServiceSoapImpl implements MESWebServiceSoap { |
| | | |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @ApiLog(apiName = "æ¥æ¶WMSçç§»åºä¿¡æ¯(ReceiveWMSScanItemList(MES)", apiCategory = ApiLogCategoryEnum.WMS) |
| | | public WSResponse receiveWMSScanItemList(ReceiveWMSScanItemList request) { |
| | | WSResponse response = new WSResponse(); |
| | | public MESResponse receiveWMSScanItemList(ReceiveWMSScanItemList request) { |
| | | MESResponse response = new MESResponse(); |
| | | if (request == null || CollectionUtil.isEmpty(request.getWmsWebServiceSendItemList())) { |
| | | response.setErrorCode("N"); |
| | | response.setErrorDesc("ä¼ å
¥çåæ°ä¸ºç©ºï¼"); |
| | |
| | | |
| | | //æ·»å å
¥åºä¿¡æ¯ |
| | | LswMaterialInbound inbound = new LswMaterialInbound(); |
| | | inbound.setOriginalCode(transferRequest.getOriginalWarehouseId()); |
| | | inbound.setOriginalName("WMS"); |
| | | inbound.setWarehouseId(transferRequest.getTargetWarehouseId()); |
| | | inbound.setReceiver("WMS"); |
| | | inbound.setMaterialNumber(transferRequest.getMaterialNumber()); |
| | |
| | | inbound.setBatchNumber(item.getTrackLot()); |
| | | inbound.setQuantity(item.getQuantity()); |
| | | inbound.setFactoryId(warehouse.getFactoryId()); |
| | | inbound.setInboundCategory(MaterialInboundCategory.MATERIAL_TRANSFER_REQUEST.name()); |
| | | boolean b = materialInboundService.inboundMaterial(inbound); |
| | | if (!b) { |
| | | errorCount++; |