|  |  | 
 |  |  | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 
 |  |  | import com.ruoyi.basic.dto.IfsInventoryQuantityDto; | 
 |  |  | import com.ruoyi.basic.pojo.IfsInventoryQuantity; | 
 |  |  | import com.ruoyi.basic.vo.IfsInventoryQuantityVO; | 
 |  |  | import org.apache.ibatis.annotations.Mapper; | 
 |  |  | import org.apache.ibatis.annotations.Param; | 
 |  |  |  | 
 |  |  | 
 |  |  |      * @param ifsInventoryId | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     int selectReportCountById(@Param("ifsInventoryId") Integer ifsInventoryId); | 
 |  |  |     int selectReportCountById(@Param("ifsInventoryId") Long ifsInventoryId); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  | 
 |  |  |                           @Param("supplierName") String supplierName, | 
 |  |  |                           @Param("startOfNextQuarter") LocalDateTime startOfNextQuarter, | 
 |  |  |                           @Param("endOfQuarter") LocalDateTime endOfQuarter); | 
 |  |  |  | 
 |  |  |     List<IfsInventoryQuantityVO> selectSplitOrderList(@Param("partNo")String partNo, | 
 |  |  |                                                       @Param("lineNo")String lineNo, | 
 |  |  |                                                       @Param("releaseNo")String releaseNo, | 
 |  |  |                                                       @Param("receiptNo")Integer receiptNo, | 
 |  |  |                                                       @Param("orderNo")String orderNo); | 
 |  |  | } | 
 
 |  |  | 
 |  |  | @ExcelIgnoreUnannotated | 
 |  |  | public class IfsInventoryQuantity  implements Serializable { | 
 |  |  |     @TableId(type = IdType.AUTO) | 
 |  |  |     private Integer id; | 
 |  |  |  | 
 |  |  |     private Long id; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("å") | 
 |  |  |     private String contract; | 
 |  |  | 
 |  |  |     // æ¯å¦æ¯è¿æææ: 0å¦, 1:æ¯" | 
 |  |  |     @ApiModelProperty("ç©æç±»å") | 
 |  |  |     private Integer isExpire; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("æ¯å¦ä¸ºæå订å(1:æ¯ï¼0:å¦)") | 
 |  |  |     private Integer isSplitOrder; | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.basic.vo; | 
 |  |  |  | 
 |  |  | import com.ruoyi.basic.pojo.IfsInventoryQuantity; | 
 |  |  | import io.swagger.annotations.ApiModelProperty; | 
 |  |  | import lombok.Data; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * åæææ¥æ£vo | 
 |  |  |  */ | 
 |  |  | @Data | 
 |  |  | public class IfsInventoryQuantityVO extends IfsInventoryQuantity { | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * æ£éªåid | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "æ£éªåid") | 
 |  |  |     private Integer insOrderId; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * æ£éªç»æï¼0ï¼ä¸åæ ¼ï¼1ï¼åæ ¼ï¼ | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "æ£éªç»æï¼0ï¼ä¸åæ ¼ï¼1ï¼åæ ¼ï¼") | 
 |  |  |     private Integer insResult; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * åæ¥ç¶æï¼0ï¼æªåæ¥ï¼1ï¼å·²åæ¥ï¼ | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "åæ¥ç¶æï¼0ï¼æªåæ¥ï¼1ï¼å·²åæ¥ï¼") | 
 |  |  |     private Integer syncStatus; | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |           and iiq.supplier_name = #{supplierName} | 
 |  |  |           and iiq.receiver_date between #{startOfNextQuarter} and #{endOfQuarter} | 
 |  |  |     </select> | 
 |  |  |     <select id="selectSplitOrderList" resultType="com.ruoyi.basic.vo.IfsInventoryQuantityVO"> | 
 |  |  |         select | 
 |  |  |             iiq.*, | 
 |  |  |             io.id AS ins_order_id, | 
 |  |  |             io.ins_result, | 
 |  |  |             isor.sync_status | 
 |  |  |         from ifs_inventory_quantity iiq | 
 |  |  |                  join ifs_split_order_record isor | 
 |  |  |                       on iiq.update_batch_no = isor.lot_batch_no | 
 |  |  |                           and iiq.order_no=isor.order_no | 
 |  |  |                           and iiq.line_no=isor.line_no | 
 |  |  |                           and iiq.release_no=isor.release_no | 
 |  |  |                           and iiq.receipt_no=isor.receipt_no | 
 |  |  |                           and iiq.part_no=isor.part_no | 
 |  |  |                  left join ins_order io on iiq.id=io.ifs_inventory_id | 
 |  |  |         where iiq.order_no=#{orderNo} | 
 |  |  |           and iiq.part_no=#{partNo} | 
 |  |  |           and iiq.line_no=#{lineNo} | 
 |  |  |           and iiq.release_no=#{releaseNo} | 
 |  |  |           and iiq.receipt_no=#{receiptNo} | 
 |  |  |           and iiq.is_split_order=1 | 
 |  |  |           and (iiq.is_finish != 1 or isor.sync_status != 1) | 
 |  |  |           and (io.id is null or io.is_exemption != 1) | 
 |  |  |     </select> | 
 |  |  | </mapper> | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.inspect.aspect; | 
 |  |  |  | 
 |  |  | import cn.hutool.core.bean.BeanUtil; | 
 |  |  | import cn.hutool.json.JSONUtil; | 
 |  |  | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 
 |  |  | import com.ruoyi.basic.pojo.IfsInventoryQuantity; | 
 |  |  | import com.ruoyi.common.utils.api.MesApiUtils; | 
 |  |  | import com.ruoyi.inspect.pojo.IfsSplitOrderRecord; | 
 |  |  | import com.ruoyi.inspect.service.IfsSplitOrderRecordService; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.aspectj.lang.JoinPoint; | 
 |  |  | import org.aspectj.lang.annotation.AfterReturning; | 
 |  |  | import org.aspectj.lang.annotation.Aspect; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.stereotype.Component; | 
 |  |  | import org.springframework.transaction.annotation.Isolation; | 
 |  |  | import org.springframework.transaction.annotation.Transactional; | 
 |  |  |  | 
 |  |  | import java.util.Collections; | 
 |  |  | import java.util.HashMap; | 
 |  |  | import java.util.Map; | 
 |  |  | import java.util.Objects; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * æ§è¡ifsç§»åºæä½åï¼åæ¥æ¨émes宿¶åºå | 
 |  |  |  */ | 
 |  |  | @Aspect | 
 |  |  | @Slf4j | 
 |  |  | @Component | 
 |  |  | public class MoveLocationAfterPushMesStockAspect { | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private IfsSplitOrderRecordService ifsSplitOrderRecordService; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private MesApiUtils mesApiUtils; | 
 |  |  |  | 
 |  |  |     @AfterReturning(value = "execution(* com.ruoyi.inspect.service.impl.InsOrderServiceImpl.moveRawMaterial(..))") | 
 |  |  |     @Transactional(rollbackFor = Exception.class,isolation = Isolation.READ_COMMITTED) | 
 |  |  |     public void doAfterReturning(JoinPoint joinPoint) { | 
 |  |  |         Object[] args = joinPoint.getArgs(); | 
 |  |  |         if(Objects.nonNull(args) && args.length>0) { | 
 |  |  |             IfsInventoryQuantity ifsInventoryQuantity = BeanUtil.toBean(args[0], IfsInventoryQuantity.class); | 
 |  |  |             if(Objects.nonNull(ifsInventoryQuantity) && ifsInventoryQuantity.getIsSplitOrder()==1){ | 
 |  |  |                 //æ¥è¯¢å¯¹åºæ¹å·çæåè®°å½ | 
 |  |  |                 IfsSplitOrderRecord one = ifsSplitOrderRecordService.getOne(Wrappers.<IfsSplitOrderRecord>lambdaQuery() | 
 |  |  |                         .eq(IfsSplitOrderRecord::getPartNo, ifsInventoryQuantity.getPartNo()) | 
 |  |  |                         .eq(IfsSplitOrderRecord::getLotBatchNo, ifsInventoryQuantity.getUpdateBatchNo()) | 
 |  |  |                         .eq(IfsSplitOrderRecord::getLineNo, ifsInventoryQuantity.getLineNo()) | 
 |  |  |                         .eq(IfsSplitOrderRecord::getReleaseNo, ifsInventoryQuantity.getReleaseNo()) | 
 |  |  |                         .eq(IfsSplitOrderRecord::getReceiptNo, ifsInventoryQuantity.getReceiptNo()) | 
 |  |  |                         .eq(IfsSplitOrderRecord::getOrderNo, ifsInventoryQuantity.getOrderNo()) | 
 |  |  |                         .last("limit 1") | 
 |  |  |                 ); | 
 |  |  |                 if(Objects.nonNull(one)){ | 
 |  |  |                     //忥MES宿¶åºå | 
 |  |  |                     Map<String, Object> requestMap = new HashMap<>(); | 
 |  |  |                     requestMap.put("partNo", one.getPartNo()); // é¶ä»¶ç¼å· | 
 |  |  |                     requestMap.put("systemNo", one.getSystemNo()); // ç³»ç»ç¼å· | 
 |  |  |                     requestMap.put("spec", one.getSpec()); // è§æ ¼ | 
 |  |  |                     requestMap.put("partBatchNo", one.getLotBatchNo()); // é¶ä»¶æ¹å· | 
 |  |  |                     requestMap.put("stockQuantity", one.getLength()); // åºåæ°é1 | 
 |  |  |                     requestMap.put("qty", one.getQtyStock()); // åºåæ°é2 | 
 |  |  |                     requestMap.put("insulationColor", one.getInsulationColor()); // ç»ç¼é¢è² | 
 |  |  |                     requestMap.put("outerColor", one.getOuterColor()); // å¤æ¤é¢è² | 
 |  |  |                     requestMap.put("letteringInfo", one.getLetteringInfo()); // å°åä¿¡æ¯ | 
 |  |  |                     requestMap.put("reelNumber", one.getDrumNo()); // çå· | 
 |  |  |                     requestMap.put("locationNo", "1302"); // åºä½ç¼å· | 
 |  |  |                     requestMap.put("customerOrderNo", one.getOrderNo()); // éå®è®¢åå· | 
 |  |  |                     requestMap.put("stockSource", one.getStockSource()); // åºåæ¥æº | 
 |  |  |                     requestMap.put("remark", one.getRemark()); // å¤æ³¨ | 
 |  |  |  | 
 |  |  |                     String jsonStr = JSONUtil.toJsonStr(Collections.singletonList(requestMap)); | 
 |  |  |                     boolean b = mesApiUtils.batchAddStock(jsonStr); | 
 |  |  |                     //忥æåï¼æ´æ°åæ¥ç¶æ | 
 |  |  |                     if(b){ | 
 |  |  |                         ifsSplitOrderRecordService.update(null,Wrappers.<IfsSplitOrderRecord>lambdaUpdate() | 
 |  |  |                                 .set(IfsSplitOrderRecord::getSyncStatus,1) | 
 |  |  |                                 .eq(IfsSplitOrderRecord::getId,one.getId())); | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  | import java.io.IOException; | 
 |  |  | import java.time.LocalDateTime; | 
 |  |  | import java.time.format.DateTimeFormatter; | 
 |  |  | import java.util.HashMap; | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Map; | 
 |  |  | import java.util.Objects; | 
 |  |  | 
 |  |  |         Integer orderId = (Integer) param.get("orderId"); | 
 |  |  |         String ids = (String) param.get("ids"); | 
 |  |  |         Integer typeSource = (Integer) param.get("typeSource"); | 
 |  |  |         Integer ifsInventoryId = (Integer) param.get("ifsInventoryId"); | 
 |  |  |         Long ifsInventoryId = Long.parseLong(param.get("ifsInventoryId").toString()); | 
 |  |  |         if(Objects.nonNull(typeSource) && typeSource == 1){ | 
 |  |  |             ifsInventoryQuantityMapper.update(null,new LambdaUpdateWrapper<IfsInventoryQuantity>() | 
 |  |  |                     .set(IfsInventoryQuantity::getState,0) | 
 |  |  | 
 |  |  |     @ApiOperation(value = "è·åifs订å") | 
 |  |  |     @GetMapping("/getIfsOrder") | 
 |  |  |     public Result<?> getIfsOrder() { | 
 |  |  |         insOrderService.getIfsOrder(); | 
 |  |  |         HashMap<String, Object> map = new HashMap<>(); | 
 |  |  |         map.put("LOCATION_NO","1302"); | 
 |  |  |         map.put("STATE_DB","To be Inspected"); | 
 |  |  |         insOrderService.getIfsOrder(map,false); | 
 |  |  |         return Result.success(); | 
 |  |  |     } | 
 |  |  |  | 
 
 |  |  | 
 |  |  |         return Result.success(insOrderPlanService.checkSubmitPlan(orderId, laboratory)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @ApiOperation(value = "æ£éªä»»å¡æäº¤") | 
 |  |  |     @PostMapping("/submitPlan") | 
 |  |  |     public Result<?> submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode) { | 
 |  |  |         int num = insOrderPlanService.submitPlan(orderId, laboratory, verifyUser, entrustCode); | 
 |  |  |     public Result<?> submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode,Boolean registerInsResults) { | 
 |  |  |         int num = insOrderPlanService.submitPlan(orderId, laboratory, verifyUser, entrustCode,registerInsResults); | 
 |  |  |         return num == 1 ? Result.success() : Result.fail("æäº¤å¤±è´¥ï¼é¨å项ç®è¿æªè¿è¡æ£éª"); | 
 |  |  |     } | 
 |  |  |  | 
 
 |  |  | 
 |  |  | package com.ruoyi.inspect.controller; | 
 |  |  |  | 
 |  |  | import com.alibaba.excel.EasyExcel; | 
 |  |  | import com.alibaba.fastjson.JSON; | 
 |  |  | import com.alibaba.fastjson.JSONArray; | 
 |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
 |  |  | 
 |  |  | import com.ruoyi.basic.pojo.IfsInventoryQuantity; | 
 |  |  | import com.ruoyi.common.annotation.PersonalScope; | 
 |  |  | import com.ruoyi.inspect.dto.InsPlaceOrderDto; | 
 |  |  | import com.ruoyi.inspect.dto.OrderSplitDTO; | 
 |  |  | import com.ruoyi.inspect.dto.SampleProductDto; | 
 |  |  | import com.ruoyi.inspect.pojo.InsOrder; | 
 |  |  | import com.ruoyi.inspect.pojo.RawMaterialOrderTemplate; | 
 |  |  | 
 |  |  | import lombok.AllArgsConstructor; | 
 |  |  | import org.springframework.security.access.prepost.PreAuthorize; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  | import org.springframework.web.multipart.MultipartFile; | 
 |  |  |  | 
 |  |  | import javax.servlet.http.HttpServletRequest; | 
 |  |  | import javax.servlet.http.HttpServletResponse; | 
 |  |  | import java.io.File; | 
 |  |  | import java.util.List; | 
 |  |  | 
 |  |  |         return Result.success(rawMaterialOrderTemplateService.delRawMaterOrderTemplate(id)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * æ¥æ£æ¹é | 
 |  |  |      * @param param åææid | 
 |  |  | 
 |  |  |     @ApiOperation(value = "æ¥æ£æ¹é") | 
 |  |  |     @PostMapping("/inspectionReport") | 
 |  |  |     public Result<?> inspectionReport(@RequestBody Map<String, Object> param) { | 
 |  |  |         List<Integer> ids = (List<Integer>) param.get("ids"); | 
 |  |  |         List<Long> ids = (List<Long>) param.get("ids"); | 
 |  |  |         return Result.success(rawMaterialOrderService.inspectionReport(ids)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |     @ApiOperation(value = "æ¤éæ¥æ£") | 
 |  |  |     @PostMapping("/revokeInspectionReport") | 
 |  |  |     public Result<?> revokeInspectionReport(@RequestBody Map<String, Object> param) { | 
 |  |  |         Integer id = (Integer) param.get("id"); | 
 |  |  |         Long id = Long.parseLong(param.get("id").toString()); | 
 |  |  |         return Result.success(rawMaterialOrderService.revokeInspectionReport(id)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |     @ApiOperation(value = "æ¥æ£") | 
 |  |  |     @PostMapping("/inspectionReportOne") | 
 |  |  |     public Result<?> inspectionReportOne(@RequestBody IfsInventoryQuantity ifsInventoryQuantity) { | 
 |  |  |  | 
 |  |  |         return Result.success(rawMaterialOrderService.inspectionReportOne(ifsInventoryQuantity)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |     @ApiOperation(value = "åæææ¤éä¸å") | 
 |  |  |     @GetMapping("/repealRawOrder") | 
 |  |  |     public Result<?> repealRawOrder(@RequestBody Map<String, Object> param){ | 
 |  |  |         Integer ifsInventoryId = (Integer) param.get("ifsInventoryId"); | 
 |  |  |         Long ifsInventoryId = Long.parseLong(param.get("ifsInventoryId").toString()); | 
 |  |  |         return Result.success(rawMaterialOrderService.repealRawOrder(ifsInventoryId)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |     @ApiOperation(value = "åææä¸åæ¾è¡å
æ£") | 
 |  |  |     @PostMapping("/rawOrderRelease") | 
 |  |  |     public Result<?> rawOrderRelease(@RequestBody Map<String, Object> param){ | 
 |  |  |         Integer ifsInventoryId = (Integer) param.get("ifsInventoryId"); | 
 |  |  |         Long ifsInventoryId = Long.parseLong(param.get("ifsInventoryId").toString()); | 
 |  |  |         String partDetail = (String) param.get("partDetail"); | 
 |  |  |         return Result.success(rawMaterialOrderService.rawOrderRelease(ifsInventoryId, partDetail)); | 
 |  |  |     } | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @ApiOperation(value = "åææä¸åéç¥å
æ£æè
夿¬¡æ£éª") | 
 |  |  |     @GetMapping("/notificationRawOrder") | 
 |  |  |     public Result<?> notificationRawOrder(Integer ifsInventoryId){ | 
 |  |  |     public Result<?> notificationRawOrder(Long ifsInventoryId){ | 
 |  |  |         return Result.success(rawMaterialOrderService.notificationRawOrder(ifsInventoryId)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |     @ApiOperation(value = "è®©æ¥æ¾è¡") | 
 |  |  |     @PostMapping("/concessionRelease") | 
 |  |  |     public Result<?> concessionRelease(@RequestBody Map<String, Object> param){ | 
 |  |  |         Integer ifsInventoryId = (Integer) param.get("ifsInventoryId"); | 
 |  |  |         Long ifsInventoryId = Long.parseLong(param.get("ifsInventoryId").toString()); | 
 |  |  |         return Result.success(rawMaterialOrderService.concessionRelease(ifsInventoryId)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |     @ApiOperation(value = "æåå
¥åº") | 
 |  |  |     @PostMapping("/advancedGodown") | 
 |  |  |     public Result<?> advancedGodown(@RequestBody Map<String, Object> param){ | 
 |  |  |         Integer ifsInventoryId = (Integer) param.get("ifsInventoryId"); | 
 |  |  |         Long ifsInventoryId = Long.parseLong(param.get("ifsInventoryId").toString()); | 
 |  |  |         return Result.success(rawMaterialOrderService.advancedGodown(ifsInventoryId)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ä¸è½½è®¢åæå导å
¥æ¨¡æ¿ | 
 |  |  |      */ | 
 |  |  |     @ApiOperation(value = "ä¸è½½è®¢åæå导å
¥æ¨¡æ¿") | 
 |  |  |     @GetMapping("/downloadTemplate") | 
 |  |  |     public void downloadTemplate(HttpServletResponse response){ | 
 |  |  |         rawMaterialOrderService.downloadTemplate(response); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ä¸è½½è®¢åæå导å
¥æ¨¡æ¿ | 
 |  |  |      */ | 
 |  |  |     @ApiOperation(value = "导å
¥è®¢åæåæ°æ®") | 
 |  |  |     @PostMapping("/importSplitOrderData") | 
 |  |  |     public Result importSplitOrderData(@RequestParam(value = "file") MultipartFile file,@RequestParam("ifsId") Long ifsId, HttpServletRequest request){ | 
 |  |  |         return rawMaterialOrderService.importSplitOrderData(file,ifsId,request); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ç¡®è®¤æå订å | 
 |  |  |      */ | 
 |  |  |     @ApiOperation(value = "确认æå订å") | 
 |  |  |     @PostMapping("/confirmSplitOrder") | 
 |  |  |     public Result confirmSplitOrder(@RequestBody OrderSplitDTO orderSplitDTO){ | 
 |  |  |         return Result.success(rawMaterialOrderService.confirmSplitOrder(orderSplitDTO)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.inspect.dto; | 
 |  |  |  | 
 |  |  | import com.ruoyi.inspect.excel.OrderSplitExcelData; | 
 |  |  | import io.swagger.annotations.ApiModelProperty; | 
 |  |  | import lombok.Data; | 
 |  |  |  | 
 |  |  | import java.io.Serializable; | 
 |  |  | import java.util.List; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * è®¢åæådto | 
 |  |  |  */ | 
 |  |  | @Data | 
 |  |  | public class OrderSplitDTO implements Serializable { | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ifs订å主é®id | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("ifs订å主é®id") | 
 |  |  |     private Long ifsId; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      *æå详æ
å表 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("æå详æ
å表") | 
 |  |  |     private List<OrderSplitExcelData> splitDetailList; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      *æ¯å¦åæ¥å°MES | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("æ¯å¦åæ¥å°MES") | 
 |  |  |     private Boolean pushToMes; | 
 |  |  |  | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.inspect.excel; | 
 |  |  |  | 
 |  |  | import com.alibaba.excel.annotation.ExcelProperty; | 
 |  |  | import io.swagger.annotations.ApiModelProperty; | 
 |  |  | import lombok.Data; | 
 |  |  |  | 
 |  |  | import java.io.Serializable; | 
 |  |  | import java.math.BigDecimal; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * åæææ¥æ£ï¼è®¢åæå导å
¥æ¨¡æ¿å¯¹è±¡ | 
 |  |  |  */ | 
 |  |  | @Data | 
 |  |  | public class OrderSplitExcelData implements Serializable { | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * é¶ä»¶ç¼å· | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(index = 0,value = "é¶ä»¶ç¼å·") | 
 |  |  |     @ApiModelProperty("é¶ä»¶ç¼å·") | 
 |  |  |     private String partNo; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ç³»ç»ç¼å· | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(index = 1,value = "ç³»ç»ç¼å·") | 
 |  |  |     @ApiModelProperty("ç³»ç»ç¼å· ") | 
 |  |  |     private String systemNo; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * è§æ ¼ | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(index = 2,value = "è§æ ¼") | 
 |  |  |     @ApiModelProperty("è§æ ¼") | 
 |  |  |     private String spec; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * é¶ä»¶æ¹å· | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(index = 3,value = "é¶ä»¶æ¹å·") | 
 |  |  |     @ApiModelProperty("é¶ä»¶æ¹å·") | 
 |  |  |     private String lotBatchNo; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * åºåæ°é1 | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(index = 4,value = "åºåæ°é1") | 
 |  |  |     @ApiModelProperty("åºåæ°é1ï¼ç¨äºå¯¹æ¥mesåç计ç®ï¼") | 
 |  |  |     private BigDecimal length; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * åºåæ°é2 | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(index = 5,value = "åºåæ°é2") | 
 |  |  |     @ApiModelProperty("åºåæ°é2ï¼ifs对äºçåºåæ°éï¼") | 
 |  |  |     private BigDecimal qtyStock; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ç»ç¼é¢è² | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(index = 6,value = "ç»ç¼é¢è²") | 
 |  |  |     @ApiModelProperty("ç»ç¼é¢è²") | 
 |  |  |     private String insulationColor; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * å¤æ¤é¢è² | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(index = 7,value = "夿¤é¢è²") | 
 |  |  |     @ApiModelProperty("夿¤é¢è²") | 
 |  |  |     private String outerColor; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * å°åä¿¡æ¯ | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(index = 8,value = "å°åä¿¡æ¯") | 
 |  |  |     @ApiModelProperty("å°åä¿¡æ¯") | 
 |  |  |     private String letteringInfo; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * çå· | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(index = 9,value = "çå·") | 
 |  |  |     @ApiModelProperty("çå·") | 
 |  |  |     private String drumNo; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * åºä½ç¼å· | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(index = 10,value = "åºä½ç¼å·") | 
 |  |  |     @ApiModelProperty("åºä½ç¼å·") | 
 |  |  |     private String locationNo; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * åºä½æ¥æº | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(index = 11,value = "åºä½æ¥æº") | 
 |  |  |     @ApiModelProperty("åºä½æ¥æº") | 
 |  |  |     private String stockSource; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * å¤æ³¨ | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(index = 12,value = "夿³¨") | 
 |  |  |     @ApiModelProperty("夿³¨") | 
 |  |  |     private String remark; | 
 |  |  |  | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.inspect.excel; | 
 |  |  |  | 
 |  |  | import com.alibaba.excel.context.AnalysisContext; | 
 |  |  | import com.alibaba.excel.event.AnalysisEventListener; | 
 |  |  | import com.ruoyi.basic.pojo.IfsInventoryQuantity; | 
 |  |  | import lombok.Getter; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.apache.commons.lang3.StringUtils; | 
 |  |  |  | 
 |  |  | import java.math.BigDecimal; | 
 |  |  | import java.util.ArrayList; | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Map; | 
 |  |  | import java.util.Objects; | 
 |  |  | import java.util.concurrent.atomic.AtomicInteger; | 
 |  |  | import java.util.concurrent.atomic.AtomicReference; | 
 |  |  |  | 
 |  |  | @Slf4j | 
 |  |  | public class OrderSplitExcelListener extends AnalysisEventListener<Map<Integer,Object>> { | 
 |  |  |  | 
 |  |  |     //è¡¨å¤´æ¨¡æ¿ | 
 |  |  |     private static final String HEAD_TEMPLATE = "[é¶ä»¶ç¼å·, ç³»ç»ç¼å·, è§æ ¼, é¶ä»¶æ¹å·, åºåæ°é1, åºåæ°é2, ç»ç¼é¢è², å¤æ¤é¢è², å°åä¿¡æ¯, çå·, åºä½ç¼å·, åºä½æ¥æº, å¤æ³¨]"; | 
 |  |  |  | 
 |  |  |     AtomicInteger index = new AtomicInteger(0);//符å表格模æ¿çè¡æ° | 
 |  |  |  | 
 |  |  |     @Getter | 
 |  |  |     List<OrderSplitExcelData> dataList = new ArrayList<>();//导å
¥çæ°æ®å表 | 
 |  |  |  | 
 |  |  |     IfsInventoryQuantity ifsInventoryQuantity;//å¯¹åºæ¥æ£ifsä¿¡æ¯ | 
 |  |  |  | 
 |  |  |     public String errorMsg = ""; | 
 |  |  |  | 
 |  |  |     public OrderSplitExcelListener(IfsInventoryQuantity ifsInventoryQuantity) { | 
 |  |  |         this.ifsInventoryQuantity = ifsInventoryQuantity; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     AtomicReference<String> prePartLotBatchNo = new AtomicReference<>("");//ä¸ä¸æ¡æ°æ®çé¶ä»¶æ¹å· | 
 |  |  |  | 
 |  |  |     AtomicReference<BigDecimal> storeQty2Sum = new AtomicReference<>(BigDecimal.ZERO);//导å
¥æ°æ®åºåæ°é2çæ»å | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) { | 
 |  |  |         String temp = headMap.values().toString(); | 
 |  |  |         if(StringUtils.equals(HEAD_TEMPLATE,temp)){ | 
 |  |  |             index.getAndIncrement(); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public void invoke(Map<Integer,Object> mapData, AnalysisContext analysisContext) { | 
 |  |  |         Integer currentRowNum = analysisContext.getCurrentRowNum(); | 
 |  |  |         OrderSplitExcelData data = transformExcelData(mapData, currentRowNum); | 
 |  |  |         if(Objects.nonNull(data)){ | 
 |  |  |             dataList.add(data); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public void doAfterAllAnalysed(AnalysisContext analysisContext) { | 
 |  |  |         if(index.get()==0){ | 
 |  |  |             throw new RuntimeException("æä»¶å
容格å¼ä¸æ¨¡æ¿ä¸ç¬¦"); | 
 |  |  |         } | 
 |  |  |         if(storeQty2Sum.get().compareTo(ifsInventoryQuantity.getPurQtyInStore())>0){ | 
 |  |  |             throw new RuntimeException("åºåæ°é2ä¸è½å¤§äºæ¥æ£é¶ä»¶çæµè¾¾éè´æ°é"); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * æ ¡éªæ°æ® | 
 |  |  |      * @param mapData | 
 |  |  |      * @param rowNumber | 
 |  |  |      */ | 
 |  |  |     private void validateRowData(Map<Integer,Object> mapData,Integer rowNumber){ | 
 |  |  |         String rowStr = "</br>第"+(rowNumber+1)+"è¡:"; | 
 |  |  |         List<String> errorMsgList = new ArrayList<>(); | 
 |  |  |         //é¶ä»¶ç¼å· | 
 |  |  |         if(Objects.isNull(mapData.get(0))){ | 
 |  |  |             errorMsgList.add("é¶ä»¶ç¼å·ä¸è½ä¸ºç©º"); | 
 |  |  |         }else if(!StringUtils.equals(mapData.get(0).toString(),ifsInventoryQuantity.getPartNo())){ | 
 |  |  |             errorMsgList.add("é¶ä»¶ç¼å·ä¸æ¥æ£é¶ä»¶ä¸ä¸è´"); | 
 |  |  |         } | 
 |  |  |         //é¶ä»¶æ¹å· | 
 |  |  |         if(Objects.isNull(mapData.get(3))){ | 
 |  |  |             errorMsgList.add("é¶ä»¶æ¹å·ä¸è½ä¸ºç©º"); | 
 |  |  |         }else if(StringUtils.equals(mapData.get(3).toString(),ifsInventoryQuantity.getLotBatchNo())){ | 
 |  |  |             errorMsgList.add("é¶ä»¶æ¹å·ä¸æ¥æ£é¶ä»¶æ¹å·ç¸å"); | 
 |  |  |         }else if(StringUtils.equals(prePartLotBatchNo.get(),mapData.get(3).toString())){ | 
 |  |  |             errorMsgList.add("é¶ä»¶æ¹å·åå¨éå¤"); | 
 |  |  |         } | 
 |  |  |         prePartLotBatchNo.getAndSet(mapData.get(3).toString()); | 
 |  |  |         //åºåæ°é2 | 
 |  |  |         if(Objects.isNull(mapData.get(5))){ | 
 |  |  |             errorMsgList.add("åºåæ°é2ä¸è½ä¸ºç©º"); | 
 |  |  |         }else{ | 
 |  |  |             BigDecimal storeQty2 = BigDecimal.ZERO; | 
 |  |  |             try{ | 
 |  |  |                 storeQty2 = new BigDecimal(mapData.get(5).toString()); | 
 |  |  |             }catch (Exception e){ | 
 |  |  |                 errorMsgList.add("åºåæ°é2æ ¼å¼å¼å¸¸"); | 
 |  |  |             } | 
 |  |  |             if(storeQty2.compareTo(ifsInventoryQuantity.getPurQtyInStore())>0){ | 
 |  |  |                 errorMsgList.add("åºåæ°é2ä¸è½å¤§äºæ¥æ£é¶ä»¶çæµè¾¾éè´æ°é"); | 
 |  |  |             } | 
 |  |  |             BigDecimal oldSum = storeQty2Sum.get(); | 
 |  |  |             storeQty2Sum.getAndSet(oldSum.add(storeQty2)); | 
 |  |  |         } | 
 |  |  |         //åºä½ç¼å· | 
 |  |  |         if(Objects.isNull(mapData.get(10))){ | 
 |  |  |             errorMsgList.add("åºä½ç¼å·ä¸è½ä¸ºç©º"); | 
 |  |  |         }else if(!StringUtils.equals(mapData.get(10).toString(),ifsInventoryQuantity.getLocationNo())){ | 
 |  |  |             errorMsgList.add("åºä½ç¼å·ä¸æ¥æ£é¶ä»¶çåºä½ç¼å·ä¸ä¸è´"); | 
 |  |  |         } | 
 |  |  |         if(!errorMsgList.isEmpty()){ | 
 |  |  |             String errorStr = String.join(";",errorMsgList); | 
 |  |  |             errorMsg+= rowStr + errorStr ; | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * è½¬æ¢excel导å
¥è¡æ°æ® | 
 |  |  |      * @param mapData | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     private OrderSplitExcelData transformExcelData(Map<Integer,Object> mapData,Integer rowNumber){ | 
 |  |  |         validateRowData(mapData,rowNumber); | 
 |  |  |         if(StringUtils.isBlank(errorMsg)){ | 
 |  |  |             OrderSplitExcelData data = new OrderSplitExcelData(); | 
 |  |  |             data.setPartNo(mapData.get(0).toString()); | 
 |  |  |             data.setSystemNo(Objects.isNull(mapData.get(1))?"":mapData.get(1).toString()); | 
 |  |  |             data.setSpec(Objects.isNull(mapData.get(2))?"":mapData.get(2).toString()); | 
 |  |  |             data.setLotBatchNo(Objects.isNull(mapData.get(3))?"":mapData.get(3).toString()); | 
 |  |  |             data.setLength(new BigDecimal(mapData.get(4).toString())); | 
 |  |  |             data.setQtyStock(new BigDecimal(mapData.get(5).toString())); | 
 |  |  |             data.setInsulationColor(Objects.isNull(mapData.get(6))?"":mapData.get(6).toString()); | 
 |  |  |             data.setOuterColor(Objects.isNull(mapData.get(7))?"":mapData.get(7).toString()); | 
 |  |  |             data.setLetteringInfo(Objects.isNull(mapData.get(8))?"":mapData.get(8).toString()); | 
 |  |  |             data.setDrumNo(Objects.isNull(mapData.get(9))?"":mapData.get(9).toString()); | 
 |  |  |             data.setLocationNo(Objects.isNull(mapData.get(10))?"":mapData.get(10).toString()); | 
 |  |  |             data.setStockSource(Objects.isNull(mapData.get(11))?"":mapData.get(11).toString()); | 
 |  |  |             data.setRemark(Objects.isNull(mapData.get(12))?"":mapData.get(12).toString()); | 
 |  |  |             return data; | 
 |  |  |         } | 
 |  |  |         return null; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.inspect.mapper; | 
 |  |  |  | 
 |  |  | import com.ruoyi.inspect.pojo.IfsSplitOrderRecord; | 
 |  |  | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  | * @author 27233 | 
 |  |  | * @description é对表ãifs_split_order_record(ifsåææè®¢åæåè®°å½è¡¨)ãçæ°æ®åºæä½Mapper | 
 |  |  | * @createDate 2025-09-23 11:20:20 | 
 |  |  | * @Entity com.ruoyi.inspect.pojo.IfsSplitOrderRecord | 
 |  |  | */ | 
 |  |  | public interface IfsSplitOrderRecordMapper extends BaseMapper<IfsSplitOrderRecord> { | 
 |  |  |  | 
 |  |  | } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.inspect.pojo; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.annotation.*; | 
 |  |  |  | 
 |  |  | import java.io.Serializable; | 
 |  |  | import java.math.BigDecimal; | 
 |  |  | import java.time.LocalDateTime; | 
 |  |  |  | 
 |  |  | import com.fasterxml.jackson.annotation.JsonFormat; | 
 |  |  | import io.swagger.annotations.ApiModelProperty; | 
 |  |  | import lombok.Data; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * ifsåææè®¢åæåè®°å½è¡¨ | 
 |  |  |  * @TableName ifs_split_order_record | 
 |  |  |  */ | 
 |  |  | @TableName(value ="ifs_split_order_record") | 
 |  |  | @Data | 
 |  |  | public class IfsSplitOrderRecord implements Serializable { | 
 |  |  |  | 
 |  |  |     @TableField(exist = false) | 
 |  |  |     private static final long serialVersionUID = 1L; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ä¸»é®id | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("主é®id") | 
 |  |  |     @TableId | 
 |  |  |     private Long id; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * éå®è®¢åå· | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("éå®è®¢åå·") | 
 |  |  |     private String orderNo; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * è¡å· | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("è¡å·") | 
 |  |  |     private String lineNo; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ä¸è¾¾å· | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("ä¸è¾¾å·") | 
 |  |  |     private String releaseNo; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * æ¥æ¶å· | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("æ¥æ¶å·") | 
 |  |  |     private Integer receiptNo; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * é¶ä»¶å· | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("é¶ä»¶å·") | 
 |  |  |     private String partNo; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ç³»ç»ç¼å· | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("ç³»ç»ç¼å·") | 
 |  |  |     private String systemNo; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * è§æ ¼ | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("è§æ ¼") | 
 |  |  |     private String spec; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * é¶ä»¶æ¹å· | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("é¶ä»¶æ¹å·") | 
 |  |  |     private String lotBatchNo; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * åºåæ°é1ï¼ç¨äºå¯¹æ¥mesåç计ç®ï¼ | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("åºåæ°é1ï¼ç¨äºå¯¹æ¥mesåç计ç®ï¼") | 
 |  |  |     private BigDecimal length; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * åºåæ°é2ï¼ifs对äºçåºåæ°éï¼ | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("åºåæ°é2ï¼ifs对äºçåºåæ°éï¼") | 
 |  |  |     private BigDecimal qtyStock; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ç»ç¼é¢è² | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("ç»ç¼é¢è²") | 
 |  |  |     private String insulationColor; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * å¤æ¤é¢è² | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("夿¤é¢è²") | 
 |  |  |     private String outerColor; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * å°åä¿¡æ¯ | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("å°åä¿¡æ¯") | 
 |  |  |     private String letteringInfo; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * çå· | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("çå·") | 
 |  |  |     private String drumNo; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * åºä½å· | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("åºä½å·") | 
 |  |  |     private String locationNo; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * åºä½æ¥æº | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("åºä½æ¥æº") | 
 |  |  |     private String stockSource; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * å¤æ³¨ | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("夿³¨") | 
 |  |  |     private String remark; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * åæ¥ç¶æï¼0ï¼æªåæ¥ï¼1ï¼å·²åæ¥ï¼ | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "åæ¥ç¶æï¼0ï¼æªåæ¥ï¼1ï¼å·²åæ¥ï¼") | 
 |  |  |     private Integer syncStatus; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("å建人") | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     private Integer createUser; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("å建æ¶é´") | 
 |  |  |     @TableField(fill = FieldFill.INSERT) | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     private LocalDateTime createTime; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("ä¿®æ¹äºº") | 
 |  |  |     @TableField(fill = FieldFill.INSERT_UPDATE) | 
 |  |  |     private Integer updateUser; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("ä¿®æ¹æ¶é´") | 
 |  |  |     @TableField(fill = FieldFill.INSERT_UPDATE) | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
 |  |  |     private LocalDateTime updateTime; | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |     private Integer typeSource; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("åææid") | 
 |  |  |     private Integer ifsInventoryId; | 
 |  |  |     private Long ifsInventoryId; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty("æ½æ¥æ°é") | 
 |  |  |     private String testQuantity; | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.inspect.service; | 
 |  |  |  | 
 |  |  | import com.ruoyi.inspect.pojo.IfsSplitOrderRecord; | 
 |  |  | import com.baomidou.mybatisplus.extension.service.IService; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  | * @author 27233 | 
 |  |  | * @description é对表ãifs_split_order_record(ifsåææè®¢åæåè®°å½è¡¨)ãçæ°æ®åºæä½Service | 
 |  |  | * @createDate 2025-09-23 11:20:20 | 
 |  |  | */ | 
 |  |  | public interface IfsSplitOrderRecordService extends IService<IfsSplitOrderRecord> { | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |  | 
 |  |  |     int upPlanUser(Integer userId, Integer orderId,String sonLaboratory); | 
 |  |  |  | 
 |  |  |     int submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode); | 
 |  |  |     int submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode,Boolean registerInsResults); | 
 |  |  |  | 
 |  |  |     List<InsProduct> getInsProduct(InsOrderPlanProductDto insOrderPlanProductDto); | 
 |  |  |  | 
 |  |  |     List<String> checkSubmitPlan(Integer orderId, String laboratory); | 
 |  |  |     Map<String,Object> checkSubmitPlan(Integer orderId, String laboratory); | 
 |  |  |  | 
 |  |  |     IPage<InsOrderFile> getFileList(Page page, InsOrderFile insOrderFile); | 
 |  |  |  | 
 |  |  |     int uploadFile(Integer orderId, MultipartFile file); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     List<String> upPlanUser2(Integer orderId); | 
 |  |  |  | 
 
 |  |  | 
 |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
 |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
 |  |  | import com.baomidou.mybatisplus.extension.service.IService; | 
 |  |  | import com.ruoyi.basic.pojo.IfsInventoryQuantity; | 
 |  |  | import com.ruoyi.basic.pojo.StandardProductList; | 
 |  |  | import com.ruoyi.common.core.domain.Result; | 
 |  |  | import com.ruoyi.inspect.pojo.InsOrder; | 
 |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     // è·åifsåºåä¿¡æ¯ | 
 |  |  |     void getIfsOrder(); | 
 |  |  |     void getIfsOrder(Map<String,Object> objectMap,Boolean isSplitOrder); | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ä¿®æ¹è®¢ååå· | 
 |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     void updateIfsInventoryQuantity(Integer id); | 
 |  |  |     void updateIfsInventoryQuantity(Long id); | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * éæä¸å | 
 |  |  | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     Result judgeNotSpotCheckOrder(List<SampleProductDto> sampleList, InsOrder insOrder); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ç§»åºæä½ | 
 |  |  |      * @param one | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     String moveRawMaterial(IfsInventoryQuantity one); | 
 |  |  |  | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |  | 
 |  |  |     int upAll(MultipartFile file) throws IOException; | 
 |  |  |  | 
 |  |  |     void isRawMaterial(InsOrder insOrder); | 
 |  |  |     /** | 
 |  |  |      * | 
 |  |  |      * @param insOrder æ£éªåä¿¡æ¯ | 
 |  |  |      * @param registerInsResults æ¯å¦ç»è®°æ£éªç»æ | 
 |  |  |      * @param hasExemption æ¯å¦å
æ£ | 
 |  |  |      */ | 
 |  |  |     void isRawMaterial(InsOrder insOrder,Boolean registerInsResults,Boolean hasExemption); | 
 |  |  |  | 
 |  |  |     Long getUnqualifiedCount(InsOrder insOrder); | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ç§»åºæä½ | 
 |  |  |      * @param one | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     String moveRawMaterial(IfsInventoryQuantity one); | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * éåå°æ£éªä»»å¡ | 
 
 |  |  | 
 |  |  | import com.ruoyi.basic.dto.*; | 
 |  |  | import com.ruoyi.basic.pojo.IfsInventoryQuantity; | 
 |  |  | import com.ruoyi.common.core.domain.Result; | 
 |  |  | import com.ruoyi.inspect.dto.OrderSplitDTO; | 
 |  |  | import com.ruoyi.inspect.dto.SampleProductDto; | 
 |  |  | import com.ruoyi.inspect.pojo.InsOrder; | 
 |  |  | import com.ruoyi.inspect.dto.CopperInsOrderDto; | 
 |  |  | import com.ruoyi.inspect.dto.RawMaterialStandardTreeDto; | 
 |  |  | import org.springframework.web.multipart.MultipartFile; | 
 |  |  |  | 
 |  |  | import javax.servlet.http.HttpServletRequest; | 
 |  |  | import javax.servlet.http.HttpServletResponse; | 
 |  |  | import java.io.UnsupportedEncodingException; | 
 |  |  | import java.util.List; | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     IPage<IfsInventoryQuantityDto> getIfsByStateOne(IPage<IfsInventoryQuantityDto> page, IfsInventoryQuantityDto ifsInventoryQuantityDto); | 
 |  |  |  | 
 |  |  |     int inspectionReport(List<Integer> ids); | 
 |  |  |     int inspectionReport(List<Long> ids); | 
 |  |  |  | 
 |  |  |     int revokeInspectionReport(Integer id); | 
 |  |  |     int revokeInspectionReport(Long id); | 
 |  |  |  | 
 |  |  |     List<IfsInventoryQuantityDto> printLabel(List<Integer> ids); | 
 |  |  |  | 
 |  |  | 
 |  |  |      * @param ifsInventoryId | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     boolean repealRawOrder(Integer ifsInventoryId); | 
 |  |  |     boolean repealRawOrder(Long ifsInventoryId); | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * æ·»å å
æ£è®¢å | 
 |  |  | 
 |  |  |      * @param ifsInventoryId | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     boolean rawOrderRelease(Integer ifsInventoryId, String partDetail); | 
 |  |  |     boolean rawOrderRelease(Long ifsInventoryId, String partDetail); | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * åææä¸åéç¥å
æ£æè
夿¬¡æ£éª | 
 |  |  |      * @param ifsInventoryId | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     int notificationRawOrder(Integer ifsInventoryId); | 
 |  |  |     int notificationRawOrder(Long ifsInventoryId); | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * æå¨æ·»å åæä¿¡æ¯ | 
 |  |  | 
 |  |  |      * @param ifsInventoryId | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     boolean concessionRelease(Integer ifsInventoryId); | 
 |  |  |     boolean concessionRelease(Long ifsInventoryId); | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * åææè¿åæ¤éä¸å | 
 |  |  | 
 |  |  |      * @param ifsInventoryId | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     boolean advancedGodown(Integer ifsInventoryId); | 
 |  |  |     boolean advancedGodown(Long ifsInventoryId); | 
 |  |  |  | 
 |  |  |     void downloadTemplate(HttpServletResponse response); | 
 |  |  |  | 
 |  |  |     Result importSplitOrderData(MultipartFile file,Long ifsId, HttpServletRequest request); | 
 |  |  |  | 
 |  |  |     boolean confirmSplitOrder(OrderSplitDTO orderSplitDTO); | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.inspect.service.impl; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
 |  |  | import com.ruoyi.inspect.pojo.IfsSplitOrderRecord; | 
 |  |  | import com.ruoyi.inspect.service.IfsSplitOrderRecordService; | 
 |  |  | import com.ruoyi.inspect.mapper.IfsSplitOrderRecordMapper; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  | * @author 27233 | 
 |  |  | * @description é对表ãifs_split_order_record(ifsåææè®¢åæåè®°å½è¡¨)ãçæ°æ®åºæä½Serviceå®ç° | 
 |  |  | * @createDate 2025-09-23 11:20:20 | 
 |  |  | */ | 
 |  |  | @Service | 
 |  |  | public class IfsSplitOrderRecordServiceImpl extends ServiceImpl<IfsSplitOrderRecordMapper, IfsSplitOrderRecord> | 
 |  |  |     implements IfsSplitOrderRecordService{ | 
 |  |  |  | 
 |  |  | } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 
 |  |  | 
 |  |  | import com.ruoyi.basic.pojo.IfsInventoryQuantity; | 
 |  |  | import com.ruoyi.basic.pojo.StandardTemplate; | 
 |  |  | import com.ruoyi.basic.service.StandardTemplateService; | 
 |  |  | import com.ruoyi.basic.vo.IfsInventoryQuantityVO; | 
 |  |  | import com.ruoyi.common.constant.DictDataConstants; | 
 |  |  | import com.ruoyi.common.constant.InsOrderTypeConstants; | 
 |  |  | import com.ruoyi.common.constant.MenuJumpPathConstants; | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public List<String> checkSubmitPlan(Integer orderId, String laboratory) { | 
 |  |  |     public Map<String,Object> checkSubmitPlan(Integer orderId, String laboratory) { | 
 |  |  |         Map<String, Object> map = new HashMap<>(); | 
 |  |  |         List<String> collect = new ArrayList<>(); | 
 |  |  |         List<InsSample> insSamples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getInsOrderId, orderId).select(InsSample::getId)); | 
 |  |  |         List<Integer> ids = insSamples.stream().map(a -> a.getId()).collect(Collectors.toList()); | 
 |  |  | 
 |  |  |                 return insProduct.getInspectionItem() + "-" + insProduct.getInspectionItemSubclass(); | 
 |  |  |             }).collect(Collectors.toList()); | 
 |  |  |         } | 
 |  |  |         return collect; | 
 |  |  |         //æ¥è¯¢ifsæåè®¢åæ¯å¦æå·²ä¸å使¯æªæ£å®çåå | 
 |  |  |         long count = 0L; | 
 |  |  |         InsOrder insOrder = insOrderMapper.selectById(orderId); | 
 |  |  |         if(Objects.nonNull(insOrder.getIfsInventoryId())){ | 
 |  |  |             IfsInventoryQuantity one = ifsInventoryQuantityMapper.selectById(insOrder.getIfsInventoryId()); | 
 |  |  |             //è¿æ»¤åºä¸åæ ¼ææªæäº¤çåå | 
 |  |  |             count = ifsInventoryQuantityMapper.selectSplitOrderList(one.getPartNo(),one.getLineNo(),one.getReleaseNo(),one.getReceiptNo(),one.getOrderNo()) | 
 |  |  |                     .stream() | 
 |  |  |                     .filter(f->(Objects.nonNull(f.getInsOrderId()) && !Objects.equals(f.getInsOrderId(),orderId)) && (Objects.isNull(f.getInsResult()) || 0==f.getInsResult())).count(); | 
 |  |  |         } | 
 |  |  |         map.put("errorMsg",collect); | 
 |  |  |         map.put("unInsOrderCount",count); | 
 |  |  |         return map; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     @Transactional(rollbackFor = Exception.class) | 
 |  |  |     public int submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode) { | 
 |  |  |     public int submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode,Boolean registerInsResults) { | 
 |  |  |         InsOrder order = insOrderMapper.selectById(orderId); | 
 |  |  |         // 1. å¤ææ¯å¦æéå¤ç¼å·, æéå¤ç¼å·åæé | 
 |  |  |         Long codeCount = insOrderMapper.selectCount(Wrappers.<InsOrder>lambdaQuery() | 
 |  |  | 
 |  |  |         InsSample insSample = insSampleMapper.selectOne(Wrappers.<InsSample>lambdaQuery() | 
 |  |  |                 .eq(InsSample::getInsOrderId, orderId) | 
 |  |  |                 .last("limit 1")); | 
 |  |  |         threadPoolTaskExecutor.execute(() -> { | 
 |  |  |             String message = ""; | 
 |  |  |             message += "èä¸ç³»ç»æ£éªä»»å¡å¤æ ¸éç¥"; | 
 |  |  |             message += "\næäº¤äºº: " + userName; | 
 |  |  |             message += "\nå§æç¼å·: " + order.getEntrustCode(); | 
 |  |  |             message += "\næ ·ååç§°: " + insSample.getModel(); | 
 |  |  |             message += "\nè§æ ¼åå·: " + order.getPartDetail(); | 
 |  |  |             if (ifsInventoryQuantity != null) { | 
 |  |  |                 message += "\næ¹æ¬¡å·: " + ifsInventoryQuantity.getUpdateBatchNo(); | 
 |  |  |             } | 
 |  |  |             //åéä¼ä¸å¾®ä¿¡æ¶æ¯é祠 æäº¤å¤æ ¸ | 
 |  |  |             try { | 
 |  |  |                 WxCpUtils.inform(sendUserAccount, message, null); | 
 |  |  |             } catch (Exception e) { | 
 |  |  |                 throw new RuntimeException(e); | 
 |  |  |             } | 
 |  |  |         }); | 
 |  |  | //        threadPoolTaskExecutor.execute(() -> { | 
 |  |  | //            String message = ""; | 
 |  |  | //            message += "èä¸ç³»ç»æ£éªä»»å¡å¤æ ¸éç¥"; | 
 |  |  | //            message += "\næäº¤äºº: " + userName; | 
 |  |  | //            message += "\nå§æç¼å·: " + order.getEntrustCode(); | 
 |  |  | //            message += "\næ ·ååç§°: " + insSample.getModel(); | 
 |  |  | //            message += "\nè§æ ¼åå·: " + order.getPartDetail(); | 
 |  |  | //            if (ifsInventoryQuantity != null) { | 
 |  |  | //                message += "\næ¹æ¬¡å·: " + ifsInventoryQuantity.getUpdateBatchNo(); | 
 |  |  | //            } | 
 |  |  | //            //åéä¼ä¸å¾®ä¿¡æ¶æ¯é祠 æäº¤å¤æ ¸ | 
 |  |  | //            try { | 
 |  |  | //                WxCpUtils.inform(sendUserAccount, message, null); | 
 |  |  | //            } catch (Exception e) { | 
 |  |  | //                throw new RuntimeException(e); | 
 |  |  | //            } | 
 |  |  | //        }); | 
 |  |  |  | 
 |  |  |         // 14.ifsç§»åº(åææéè¦è¿è¡ç§»åºæä½) --> æåæ§è¡,å ä¸ºå¤±è´¥æ æ³åæ» | 
 |  |  |         if (ifsInventoryQuantity != null) { | 
 |  |  |             // ç»è®°æ£éªç»æ | 
 |  |  |             // å¤ææ¯å¦æä¸åæ ¼, æä¸åæ ¼ä¸è½ç§»åº | 
 |  |  |             // todo: ifsç§»åº | 
 |  |  |             insReportService.isRawMaterial(order); | 
 |  |  |             insReportService.isRawMaterial(order,registerInsResults,false); | 
 |  |  |  | 
 |  |  |             // 15 å¤æå½åæ ·åæ¯å¦ä¸ºåææ, åææéè¦è¿è¡æ°æ®åæ, å¤æä¹å10æ¡æ°æ®åä¸ä¸ªä¾åºå, åä¸ä¸ªæ£éªé¡¹çåå·®æ¯å¦è¶
è¿10% | 
 |  |  |             // æ¥è¯¢ifsä¿¡æ¯è·åè·åå10个ä¾åºå䏿 ·ç, æ£éªé¡¹ä¸æ ·ä¿¡æ¯ | 
 
 |  |  | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     public void getIfsOrder() { | 
 |  |  |         HashMap<String, Object> map = new HashMap<>(); | 
 |  |  |         map.put("LOCATION_NO","1302"); | 
 |  |  |         map.put("STATE_DB","To be Inspected"); | 
 |  |  |     public void getIfsOrder(Map<String, Object> map,Boolean isSplitOrder) { | 
 |  |  |         List<Map<String, Object>> inventory = ifsApiUtils.getInventory(JSONUtil.toJsonStr(map)); | 
 |  |  |         if(inventory.size() == 0) { | 
 |  |  |         if(inventory.isEmpty()) { | 
 |  |  |             return; | 
 |  |  |         } | 
 |  |  |         // è¿è¡ä¿å | 
 |  |  | 
 |  |  |             ); | 
 |  |  |             if(count == 0) { | 
 |  |  |                 ifsInventoryQuantity.setIsFirst(0); | 
 |  |  |                 if(isSplitOrder){ | 
 |  |  |                     ifsInventoryQuantity.setIsSplitOrder(1); | 
 |  |  |                 } | 
 |  |  |                 // æ¥è¯¢äº§ä¸é¾æ£æµæ°æ® | 
 |  |  |                 String industryChainAttrFields = IndustryChainUtils.getIndustryChainAttrFields(ifsInventoryQuantity.getOrderNo(), | 
 |  |  |                         ifsInventoryQuantity.getLineNo(), | 
 |  |  | 
 |  |  |      * @param id | 
 |  |  |      */ | 
 |  |  |     @Transactional | 
 |  |  |     public void updateIfsInventoryQuantity(Integer id) { | 
 |  |  |     public void updateIfsInventoryQuantity(Long id) { | 
 |  |  |         ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate() | 
 |  |  |                 .set(IfsInventoryQuantity::getIsRegister, 1) | 
 |  |  |                 .eq(IfsInventoryQuantity::getId, id)); | 
 |  |  | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ifsç§»åºæä½ | 
 |  |  |      * @param one | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     @Transactional(rollbackFor = Exception.class) | 
 |  |  |     public String moveRawMaterial(IfsInventoryQuantity one) { | 
 |  |  |         String toLocation; | 
 |  |  |         // ç»è®°éè´æ£éªç»æSTD | 
 |  |  |         if (one.getIsRegister().equals(0)) { | 
 |  |  |             Map<String, Object> resultMap = new HashMap<>(); | 
 |  |  |             List<Map<String, Object>> resultList = new ArrayList<>(); | 
 |  |  |             Map<String, Object> map = new HashMap<>(); | 
 |  |  |             map.put("ORDER_NO", one.getOrderNo()); // éè´è®¢åå· | 
 |  |  |             map.put("LINE_NO", one.getLineNo()); // è¡å· | 
 |  |  |             map.put("RELEASE_NO", one.getReleaseNo()); // ä¸è¾¾å· | 
 |  |  |             map.put("RECEIPT_NO", one.getReceiptNo()); // æ¥æ¶å· | 
 |  |  |             map.put("PURCH_QTY", one.getQtyToInspect()); // è¦æ£éªçéè´æ°é | 
 |  |  |             resultList.add(map); | 
 |  |  |             resultMap.put("RECORD_ID", UUID.randomUUID().toString()); | 
 |  |  |             resultMap.put("SYSCODE", "LIMS"); | 
 |  |  |             resultMap.put("SYSMODEL", "ç»è®°éè´æ£éªç»æ"); | 
 |  |  |             resultMap.put("BATCH_INFO", resultList); | 
 |  |  |             Result result = ifsApiUtils.getProcurementResults(JSONUtil.toJsonStr(resultMap)); | 
 |  |  |             if (result.getCode() != 200) { | 
 |  |  |                 throw new ErrorException("IFSç»è®°éè´æ£éªç»æå¤±è´¥: " + result.getMessage()); | 
 |  |  |             } | 
 |  |  |             //å¦ææ¯æå订åï¼åå°å䏿¥åå·çè®¢åæ è®°å·²ç»è®°æ¥æ¶ | 
 |  |  |             if(one.getIsSplitOrder()==1){ | 
 |  |  |                 //æ¥è¯¢å
¶ä½æåç订å | 
 |  |  |                 List<IfsInventoryQuantity> quantityList = ifsInventoryQuantityMapper.selectList(Wrappers.<IfsInventoryQuantity>lambdaQuery() | 
 |  |  |                         .eq(IfsInventoryQuantity::getOrderNo, one.getOrderNo()) | 
 |  |  |                         .eq(IfsInventoryQuantity::getPartNo, one.getPartNo()) | 
 |  |  |                         .eq(IfsInventoryQuantity::getLineNo, one.getLineNo()) | 
 |  |  |                         .eq(IfsInventoryQuantity::getReleaseNo, one.getReleaseNo()) | 
 |  |  |                         .eq(IfsInventoryQuantity::getReceiptNo, one.getReceiptNo()) | 
 |  |  |                         .eq(IfsInventoryQuantity::getIsSplitOrder, 1) | 
 |  |  |                 ); | 
 |  |  |                 if(Objects.nonNull(quantityList) && !quantityList.isEmpty()){ | 
 |  |  |                     //ä¿®æ¹éè´è®¢åç»è®°ç¶æ | 
 |  |  |                     List<Long> ids = quantityList.stream().map(IfsInventoryQuantity::getId).collect(Collectors.toList()); | 
 |  |  |                     ifsInventoryQuantityMapper.update(null,Wrappers.<IfsInventoryQuantity>lambdaUpdate() | 
 |  |  |                             .set(IfsInventoryQuantity::getIsRegister,1) | 
 |  |  |                             .in(IfsInventoryQuantity::getId, ids) | 
 |  |  |                     ); | 
 |  |  |                 } | 
 |  |  |             }else{ | 
 |  |  |                 this.updateIfsInventoryQuantity(one.getId()); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         /** | 
 |  |  |          * TODO åç»éè¦è°ç¨IFSçæ¥å£ ç§»å
¥çåºä½å· toLocation | 
 |  |  |          */ | 
 |  |  |         // æ£éªåç§»åº | 
 |  |  |         toLocation = "1301"; | 
 |  |  |         Map<String, Object> moveResultMap = new HashMap<>(); | 
 |  |  |         List<Map<String, Object>> moveResultList = new ArrayList<>(); | 
 |  |  |         Map<String, Object> moveMap = new HashMap<>(); | 
 |  |  |         moveMap.put("ORDER_NO", one.getOrderNo()); // éè´è®¢åå· | 
 |  |  |         moveMap.put("LINE_NO", one.getLineNo()); | 
 |  |  |         moveMap.put("RELEASE_NO", one.getReleaseNo()); | 
 |  |  |         moveMap.put("RECEIPT_NO", one.getReceiptNo()); | 
 |  |  |         moveMap.put("PART_NO", one.getPartNo()); | 
 |  |  |         moveMap.put("QTY", one.getPurQtyInStore()); | 
 |  |  |         moveMap.put("LOCATION_NO", one.getLocationNo()); | 
 |  |  |         moveMap.put("TO_LOCATION_NO", toLocation); | 
 |  |  |         moveMap.put("LOT_BATCH_NO", one.getLotBatchNo()); | 
 |  |  |         moveMap.put("SERIAL_NO", one.getSerialNo()); | 
 |  |  |         moveMap.put("WAIV_DEV_REJ_NO", one.getWaivDevRejNo()); | 
 |  |  |         moveMap.put("ENG_CHG_LEVEL", one.getEngChgLevel()); | 
 |  |  |         moveMap.put("ACTIVITY_SEQ", one.getActivitySeq()); | 
 |  |  |         moveResultList.add(moveMap); | 
 |  |  |         moveResultMap.put("RECORD_ID", UUID.randomUUID().toString()); | 
 |  |  |         moveResultMap.put("SYSCODE", "LIMS"); | 
 |  |  |         moveResultMap.put("SYSMODEL", "æ£éªåç§»åº"); | 
 |  |  |         moveResultMap.put("BATCH_INFO", moveResultList); | 
 |  |  |  | 
 |  |  |         Result result1 = ifsApiUtils.moveReceipt(JSONUtil.toJsonStr(moveResultMap)); | 
 |  |  |         // å¦ææå¿
须为é¶ä»¶æå®æ¹å·æ¥ééè¦éæ°æäº¤ç§»åºä¿¡æ¯å»æå®æ¹å· | 
 |  |  |         if (result1.getCode() != 200) { | 
 |  |  |             String message = result1.getMessage(); | 
 |  |  |             if (message.contains("å¿
须为é¶ä»¶") && message.contains("æå®æ¹å·")) { | 
 |  |  |                 updaeBatch(one, toLocation); | 
 |  |  |             } else { | 
 |  |  |                 throw new ErrorException("IFSæ£éªåç§»åºå¤±è´¥: " + result1.getMessage()); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         return toLocation; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * å
ä¿®æ¹éè´è®¢åæ¹æ¬¡å·, åè¿è¡ç§»åºæä½ | 
 |  |  |      * @param one | 
 |  |  |      * @param toLocation | 
 |  |  |      */ | 
 |  |  |     private void updaeBatch(IfsInventoryQuantity one, String toLocation) { | 
 |  |  |         if (one.getIsUpdateBatch().equals(0)) { | 
 |  |  |             // å
ä¿®æ¹æ¹æ¬¡å·åè¿è¡ç§»åº | 
 |  |  |             Map<String, Object> resultMap = new HashMap<>(); | 
 |  |  |             List<Map<String, Object>> resultList = new ArrayList<>(); | 
 |  |  |             Map<String, Object> map = new HashMap<>(); | 
 |  |  |             map.put("ORDER_NO", one.getOrderNo()); // éè´è®¢åå· | 
 |  |  |             map.put("LINE_NO", one.getLineNo()); // è¡å· | 
 |  |  |             map.put("RELEASE_NO", one.getReleaseNo()); // ä¸è¾¾å· | 
 |  |  |             map.put("RECEIPT_NO", one.getReceiptNo()); // æ¥æ¶å· | 
 |  |  |             map.put("PART_NO", one.getPartNo()); //é¶ä»¶å· | 
 |  |  |             map.put("CONFIGURATION_ID", one.getConfigurationId()); // é
ç½®æ è¯ | 
 |  |  |             map.put("LOCATION_NO", one.getLocationNo()); // åºä½å· | 
 |  |  |             map.put("LOT_BATCH_NO", one.getLotBatchNo());// æ¹æ¬¡å· | 
 |  |  |             map.put("NEW_LOT_BATCH_NO", one.getUpdateBatchNo()); // ç®æ æ¹æ¬¡å· | 
 |  |  |             map.put("SERIAL_NO", one.getSerialNo()); // åºåå· | 
 |  |  |             map.put("ENG_CHG_LEVEL", one.getEngChgLevel()); // çæ¬å· | 
 |  |  |             map.put("WAIV_DEV_REJ_NO", one.getWaivDevRejNo()); // wdrå· | 
 |  |  |             map.put("ACTIVITY_SEQ", one.getActivitySeq()); // æ´»å¨åºå· | 
 |  |  |             map.put("QTY_TO_CHANGE", one.getQtyArrived()); // åæ´æ°é | 
 |  |  |             resultList.add(map); | 
 |  |  |             resultMap.put("RECORD_ID", UUID.randomUUID().toString()); | 
 |  |  |             resultMap.put("SYSCODE", "LIMS"); | 
 |  |  |             resultMap.put("SYSMODEL", "ä¿®æ¹éè´è®¢åæ¹æ¬¡å·"); | 
 |  |  |             resultMap.put("BATCH_INFO", resultList); | 
 |  |  |  | 
 |  |  |             Result result = ifsApiUtils.updateMoveReceiptLot(JSONUtil.toJsonStr(resultMap)); | 
 |  |  |  | 
 |  |  |             if (result.getCode() != 200) { | 
 |  |  |                 throw new ErrorException("IFSä¿®æ¹æ¹æ¬¡å·å¤±è´¥: " + result.getMessage()); | 
 |  |  |             } | 
 |  |  |             ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate() | 
 |  |  |                     .set(IfsInventoryQuantity::getIsUpdateBatch, 1) | 
 |  |  |                     .eq(IfsInventoryQuantity::getId, one.getId())); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         Map<String, Object> moveResultMap = new HashMap<>(); | 
 |  |  |         List<Map<String, Object>> moveResultList = new ArrayList<>(); | 
 |  |  |         Map<String, Object> moveMap = new HashMap<>(); | 
 |  |  |         moveMap.put("ORDER_NO", one.getOrderNo()); // éè´è®¢åå· | 
 |  |  |         moveMap.put("LINE_NO", one.getLineNo()); | 
 |  |  |         moveMap.put("RELEASE_NO", one.getReleaseNo()); | 
 |  |  |         moveMap.put("RECEIPT_NO", one.getReceiptNo()); | 
 |  |  |         moveMap.put("PART_NO", one.getPartNo()); | 
 |  |  |         moveMap.put("QTY", one.getQtyArrived()); | 
 |  |  |         moveMap.put("LOCATION_NO", one.getLocationNo()); | 
 |  |  |         moveMap.put("TO_LOCATION_NO", toLocation); | 
 |  |  |         moveMap.put("LOT_BATCH_NO", one.getUpdateBatchNo()); | 
 |  |  |         moveMap.put("SERIAL_NO", one.getSerialNo()); | 
 |  |  |         moveMap.put("WAIV_DEV_REJ_NO", one.getWaivDevRejNo()); | 
 |  |  |         moveMap.put("ENG_CHG_LEVEL", one.getEngChgLevel()); | 
 |  |  |         moveMap.put("ACTIVITY_SEQ", one.getActivitySeq()); | 
 |  |  |         moveResultList.add(moveMap); | 
 |  |  |         moveResultMap.put("RECORD_ID", UUID.randomUUID().toString()); | 
 |  |  |         moveResultMap.put("SYSCODE", "LIMS"); | 
 |  |  |         moveResultMap.put("SYSMODEL", "æ£éªåç§»åº"); | 
 |  |  |         moveResultMap.put("BATCH_INFO", moveResultList); | 
 |  |  |  | 
 |  |  |         Result result1 = ifsApiUtils.moveReceipt(JSONUtil.toJsonStr(moveResultMap)); | 
 |  |  |         if (result1.getCode() != 200) { | 
 |  |  |             throw new ErrorException("IFSæ£éªåç§»åºå¤±è´¥: " + result1.getMessage()); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  | } | 
 |  |  |  | 
 |  |  |  | 
 
 |  |  | 
 |  |  | package com.ruoyi.inspect.service.impl; | 
 |  |  |  | 
 |  |  | import cn.hutool.core.collection.CollUtil; | 
 |  |  | import cn.hutool.core.util.StrUtil; | 
 |  |  | import cn.hutool.json.JSONUtil; | 
 |  |  | import com.alibaba.excel.EasyExcel; | 
 |  |  | import com.alibaba.excel.ExcelWriter; | 
 |  |  | import com.alibaba.excel.write.metadata.WriteSheet; | 
 |  |  | 
 |  |  | import com.aspose.words.SaveFormat; | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | 
 |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
 |  |  | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | 
 |  |  | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; | 
 |  |  | import com.baomidou.mybatisplus.core.toolkit.StringUtils; | 
 |  |  | 
 |  |  | import com.itextpdf.text.pdf.PdfContentByte; | 
 |  |  | import com.itextpdf.text.pdf.PdfReader; | 
 |  |  | import com.itextpdf.text.pdf.PdfStamper; | 
 |  |  | import com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto; | 
 |  |  | import com.ruoyi.basic.mapper.IfsInventoryQuantityMapper; | 
 |  |  | import com.ruoyi.basic.pojo.IfsInventoryQuantity; | 
 |  |  | import com.ruoyi.common.constant.InsOrderTypeConstants; | 
 |  |  | import com.ruoyi.common.constant.MenuJumpPathConstants; | 
 |  |  | import com.ruoyi.common.core.domain.Result; | 
 |  |  | import com.ruoyi.common.core.domain.entity.InformationNotification; | 
 |  |  | import com.ruoyi.common.config.WechatProperty; | 
 |  |  | import com.ruoyi.common.utils.*; | 
 |  |  | 
 |  |  | import com.ruoyi.inspect.service.InsOrderService; | 
 |  |  | import com.ruoyi.inspect.service.InsReportService; | 
 |  |  | import com.ruoyi.inspect.mapper.InsUnqualifiedHandlerMapper; | 
 |  |  | import com.ruoyi.basic.vo.IfsInventoryQuantityVO; | 
 |  |  | import com.ruoyi.inspect.service.RawMaterialOrderService; | 
 |  |  | import com.ruoyi.system.mapper.UserMapper; | 
 |  |  | import com.ruoyi.system.service.InformationNotificationService; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.apache.poi.xwpf.usermodel.*; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.beans.factory.annotation.Value; | 
 |  |  | import org.springframework.core.io.ClassPathResource; | 
 |  |  | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | 
 |  |  | 
 |  |  |     private IfsApiUtils ifsApiUtils; | 
 |  |  |     @Resource | 
 |  |  |     private InsSampleUserMapper insSampleUserMapper; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private RawMaterialOrderService rawMaterialOrderService; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  | 
 |  |  |         stamp.close(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     @Transactional(rollbackFor = Exception.class) | 
 |  |  |     public void isRawMaterial(InsOrder insOrder) { | 
 |  |  |     public void isRawMaterial(InsOrder insOrder,Boolean registerInsResults,Boolean hasExemption) { | 
 |  |  |         IfsInventoryQuantity one = ifsInventoryQuantityMapper.selectOne(new LambdaQueryWrapper<IfsInventoryQuantity>() | 
 |  |  |                 .eq(IfsInventoryQuantity::getId, insOrder.getIfsInventoryId())); | 
 |  |  |         if (Objects.isNull(one)) { | 
 |  |  | 
 |  |  |         // å¤ææ¯å¦æä¸åæ ¼ | 
 |  |  |         Long unqualifiedCount = getUnqualifiedCount(insOrder); | 
 |  |  |  | 
 |  |  |         if (count.equals(0L) && unqualifiedCount.equals(0L) && one.getIsFinish().equals(0) && one.getIsSource().equals(1)) { | 
 |  |  |         if (count.equals(0L) && unqualifiedCount.equals(0L) && one.getIsFinish().equals(0) && one.getIsSource().equals(1) && registerInsResults) { | 
 |  |  |             // åææç§»åº | 
 |  |  |             toLocation = this.moveRawMaterial(one); | 
 |  |  |             //å¦ææ¯æåç订åï¼åææåçæææ¹æ¬¡é½ç§»åº | 
 |  |  |             if(one.getIsSplitOrder()==1 && !hasExemption){ | 
 |  |  |                 //æ¥è¯¢æå订å详æ
 | 
 |  |  |                 List<IfsInventoryQuantityVO> ifsInventoryQuantityVOS = ifsInventoryQuantityMapper.selectSplitOrderList(one.getPartNo(), one.getLineNo(), one.getReleaseNo(), one.getReceiptNo(), one.getOrderNo()); | 
 |  |  |                 for (IfsInventoryQuantityVO vo : ifsInventoryQuantityVOS) { | 
 |  |  |                     //妿æå§æåä¿¡æ¯ä¸åæ ¼ï¼èµ°ç»è®°åç§»åºï¼å¦ææ²¡æï¼åèµ°å
æ£ï¼ä¸åæ ¼ä¸åå¤ç | 
 |  |  |                     if(Objects.isNull(vo.getInsOrderId())){ | 
 |  |  |                         rawMaterialOrderService.rawOrderRelease(vo.getId(), vo.getPartDesc()); | 
 |  |  |                     }else if(Objects.equals(vo.getInsOrderId(),insOrder.getId())){ | 
 |  |  |                         toLocation = insOrderService.moveRawMaterial(one); | 
 |  |  |                     }else if(Objects.nonNull(vo.getInsResult()) && 1 == vo.getInsResult()){ | 
 |  |  |                         toLocation = insOrderService.moveRawMaterial(one); | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |             }else{ | 
 |  |  |                 toLocation = insOrderService.moveRawMaterial(one); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         // å¤æç»æç¶æä¿®æ¹åæ ¼ç¶æ | 
 |  |  | 
 |  |  |                         .eq(IfsInventoryQuantity::getId, insOrder.getIfsInventoryId())); | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             threadPoolTaskExecutor.execute(() -> { | 
 |  |  |                 // ä¼ä¸å¾®ä¿¡éç¥ | 
 |  |  |                 String message = ""; | 
 |  |  |                 message += "æ£æµç»ææäº¤éç¥"; | 
 |  |  |                 message += "\næ¹æ¬¡å·: " + one.getUpdateBatchNo(); | 
 |  |  |                 message += "\né¶ä»¶å·: " + one.getPartNo(); | 
 |  |  |                 message += "\né¶ä»¶æè¿°: " + one.getPartDesc(); | 
 |  |  |                 message += "\nä¾åºååç§°: " + one.getSupplierName(); | 
 |  |  |                 message += "\næµè¾¾æ°é: " + one.getQtyArrived().stripTrailingZeros().toPlainString() + one.getBuyUnitMeas(); | 
 |  |  |                 // åéä¼ä¸inspectStatusä¿¡éç¥ | 
 |  |  |                 if (inspectStatus == 1) { | 
 |  |  |                     message += "\næ£æµç»æ: åæ ¼"; | 
 |  |  |                 } else { | 
 |  |  |                     message += "\næ£æµç»æ: ä¸åæ ¼"; | 
 |  |  |                 } | 
 |  |  |                 WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message); | 
 |  |  |             }); | 
 |  |  | //            threadPoolTaskExecutor.execute(() -> { | 
 |  |  | //                // ä¼ä¸å¾®ä¿¡éç¥ | 
 |  |  | //                String message = ""; | 
 |  |  | //                message += "æ£æµç»ææäº¤éç¥"; | 
 |  |  | //                message += "\næ¹æ¬¡å·: " + one.getUpdateBatchNo(); | 
 |  |  | //                message += "\né¶ä»¶å·: " + one.getPartNo(); | 
 |  |  | //                message += "\né¶ä»¶æè¿°: " + one.getPartDesc(); | 
 |  |  | //                message += "\nä¾åºååç§°: " + one.getSupplierName(); | 
 |  |  | //                message += "\næµè¾¾æ°é: " + one.getQtyArrived().stripTrailingZeros().toPlainString() + one.getBuyUnitMeas(); | 
 |  |  | //                // åéä¼ä¸inspectStatusä¿¡éç¥ | 
 |  |  | //                if (inspectStatus == 1) { | 
 |  |  | //                    message += "\næ£æµç»æ: åæ ¼"; | 
 |  |  | //                } else { | 
 |  |  | //                    message += "\næ£æµç»æ: ä¸åæ ¼"; | 
 |  |  | //                } | 
 |  |  | //                WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message); | 
 |  |  | //            }); | 
 |  |  |  | 
 |  |  |         } | 
 |  |  |  | 
 |  |  | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         return unqualifiedCount; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * ifsç§»åºæä½ | 
 |  |  |      * @param one | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     public String moveRawMaterial(IfsInventoryQuantity one) { | 
 |  |  |         String toLocation; | 
 |  |  |         // ç»è®°éè´æ£éªç»æSTD | 
 |  |  |         if (one.getIsRegister().equals(0)) { | 
 |  |  |             Map<String, Object> resultMap = new HashMap<>(); | 
 |  |  |             List<Map<String, Object>> resultList = new ArrayList<>(); | 
 |  |  |             Map<String, Object> map = new HashMap<>(); | 
 |  |  |             map.put("ORDER_NO", one.getOrderNo()); // éè´è®¢åå· | 
 |  |  |             map.put("LINE_NO", one.getLineNo()); // è¡å· | 
 |  |  |             map.put("RELEASE_NO", one.getReleaseNo()); // ä¸è¾¾å· | 
 |  |  |             map.put("RECEIPT_NO", one.getReceiptNo()); // æ¥æ¶å· | 
 |  |  |             map.put("PURCH_QTY", one.getQtyToInspect()); // è¦æ£éªçéè´æ°é | 
 |  |  |             resultList.add(map); | 
 |  |  |             resultMap.put("RECORD_ID", UUID.randomUUID().toString()); | 
 |  |  |             resultMap.put("SYSCODE", "LIMS"); | 
 |  |  |             resultMap.put("SYSMODEL", "ç»è®°éè´æ£éªç»æ"); | 
 |  |  |             resultMap.put("BATCH_INFO", resultList); | 
 |  |  |             Result result = ifsApiUtils.getProcurementResults(JSONUtil.toJsonStr(resultMap)); | 
 |  |  |             if (result.getCode() != 200) { | 
 |  |  |                 throw new ErrorException("IFSç»è®°éè´æ£éªç»æå¤±è´¥: " + result.getMessage()); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         insOrderService.updateIfsInventoryQuantity(one.getId()); | 
 |  |  |         /** | 
 |  |  |          * TODO åç»éè¦è°ç¨IFSçæ¥å£ ç§»å
¥çåºä½å· toLocation | 
 |  |  |          */ | 
 |  |  |         // æ£éªåç§»åº | 
 |  |  |         toLocation = "1301"; | 
 |  |  |         Map<String, Object> moveResultMap = new HashMap<>(); | 
 |  |  |         List<Map<String, Object>> moveResultList = new ArrayList<>(); | 
 |  |  |         Map<String, Object> moveMap = new HashMap<>(); | 
 |  |  |         moveMap.put("ORDER_NO", one.getOrderNo()); // éè´è®¢åå· | 
 |  |  |         moveMap.put("LINE_NO", one.getLineNo()); | 
 |  |  |         moveMap.put("RELEASE_NO", one.getReleaseNo()); | 
 |  |  |         moveMap.put("RECEIPT_NO", one.getReceiptNo()); | 
 |  |  |         moveMap.put("PART_NO", one.getPartNo()); | 
 |  |  |         moveMap.put("QTY", one.getQtyArrived()); | 
 |  |  |         moveMap.put("LOCATION_NO", one.getLocationNo()); | 
 |  |  |         moveMap.put("TO_LOCATION_NO", toLocation); | 
 |  |  |         moveMap.put("LOT_BATCH_NO", one.getLotBatchNo()); | 
 |  |  |         moveMap.put("SERIAL_NO", one.getSerialNo()); | 
 |  |  |         moveMap.put("WAIV_DEV_REJ_NO", one.getWaivDevRejNo()); | 
 |  |  |         moveMap.put("ENG_CHG_LEVEL", one.getEngChgLevel()); | 
 |  |  |         moveMap.put("ACTIVITY_SEQ", one.getActivitySeq()); | 
 |  |  |         moveResultList.add(moveMap); | 
 |  |  |         moveResultMap.put("RECORD_ID", UUID.randomUUID().toString()); | 
 |  |  |         moveResultMap.put("SYSCODE", "LIMS"); | 
 |  |  |         moveResultMap.put("SYSMODEL", "æ£éªåç§»åº"); | 
 |  |  |         moveResultMap.put("BATCH_INFO", moveResultList); | 
 |  |  |  | 
 |  |  |         Result result1 = ifsApiUtils.moveReceipt(JSONUtil.toJsonStr(moveResultMap)); | 
 |  |  |         // å¦ææå¿
须为é¶ä»¶æå®æ¹å·æ¥ééè¦éæ°æäº¤ç§»åºä¿¡æ¯å»æå®æ¹å· | 
 |  |  |         if (result1.getCode() != 200) { | 
 |  |  |             String message = result1.getMessage(); | 
 |  |  |             if (message.contains("å¿
须为é¶ä»¶") && message.contains("æå®æ¹å·")) { | 
 |  |  |                 updaeBatch(one, toLocation); | 
 |  |  |             } else { | 
 |  |  |                 throw new ErrorException("IFSæ£éªåç§»åºå¤±è´¥: " + result1.getMessage()); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         return toLocation; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  | 
 |  |  |             throw new RuntimeException("导åºå¤±è´¥"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * å
ä¿®æ¹éè´è®¢åæ¹æ¬¡å·, åè¿è¡ç§»åºæä½ | 
 |  |  |      * @param one | 
 |  |  |      * @param toLocation | 
 |  |  |      */ | 
 |  |  |     private void updaeBatch(IfsInventoryQuantity one, String toLocation) { | 
 |  |  |         if (one.getIsUpdateBatch().equals(0)) { | 
 |  |  |             // å
ä¿®æ¹æ¹æ¬¡å·åè¿è¡ç§»åº | 
 |  |  |             Map<String, Object> resultMap = new HashMap<>(); | 
 |  |  |             List<Map<String, Object>> resultList = new ArrayList<>(); | 
 |  |  |             Map<String, Object> map = new HashMap<>(); | 
 |  |  |             map.put("ORDER_NO", one.getOrderNo()); // éè´è®¢åå· | 
 |  |  |             map.put("LINE_NO", one.getLineNo()); // è¡å· | 
 |  |  |             map.put("RELEASE_NO", one.getReleaseNo()); // ä¸è¾¾å· | 
 |  |  |             map.put("RECEIPT_NO", one.getReceiptNo()); // æ¥æ¶å· | 
 |  |  |             map.put("PART_NO", one.getPartNo()); //é¶ä»¶å· | 
 |  |  |             map.put("CONFIGURATION_ID", one.getConfigurationId()); // é
ç½®æ è¯ | 
 |  |  |             map.put("LOCATION_NO", one.getLocationNo()); // åºä½å· | 
 |  |  |             map.put("LOT_BATCH_NO", one.getLotBatchNo());// æ¹æ¬¡å· | 
 |  |  |             map.put("NEW_LOT_BATCH_NO", one.getUpdateBatchNo()); // ç®æ æ¹æ¬¡å· | 
 |  |  |             map.put("SERIAL_NO", one.getSerialNo()); // åºåå· | 
 |  |  |             map.put("ENG_CHG_LEVEL", one.getEngChgLevel()); // çæ¬å· | 
 |  |  |             map.put("WAIV_DEV_REJ_NO", one.getWaivDevRejNo()); // wdrå· | 
 |  |  |             map.put("ACTIVITY_SEQ", one.getActivitySeq()); // æ´»å¨åºå· | 
 |  |  |             map.put("QTY_TO_CHANGE", one.getQtyArrived()); // åæ´æ°é | 
 |  |  |             resultList.add(map); | 
 |  |  |             resultMap.put("RECORD_ID", UUID.randomUUID().toString()); | 
 |  |  |             resultMap.put("SYSCODE", "LIMS"); | 
 |  |  |             resultMap.put("SYSMODEL", "ä¿®æ¹éè´è®¢åæ¹æ¬¡å·"); | 
 |  |  |             resultMap.put("BATCH_INFO", resultList); | 
 |  |  |  | 
 |  |  |             Result result = ifsApiUtils.updateMoveReceiptLot(JSONUtil.toJsonStr(resultMap)); | 
 |  |  |  | 
 |  |  |             if (result.getCode() != 200) { | 
 |  |  |                 throw new ErrorException("IFSä¿®æ¹æ¹æ¬¡å·å¤±è´¥: " + result.getMessage()); | 
 |  |  |             } | 
 |  |  |             ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate() | 
 |  |  |                     .set(IfsInventoryQuantity::getIsUpdateBatch, 1) | 
 |  |  |                     .eq(IfsInventoryQuantity::getId, one.getId())); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         Map<String, Object> moveResultMap = new HashMap<>(); | 
 |  |  |         List<Map<String, Object>> moveResultList = new ArrayList<>(); | 
 |  |  |         Map<String, Object> moveMap = new HashMap<>(); | 
 |  |  |         moveMap.put("ORDER_NO", one.getOrderNo()); // éè´è®¢åå· | 
 |  |  |         moveMap.put("LINE_NO", one.getLineNo()); | 
 |  |  |         moveMap.put("RELEASE_NO", one.getReleaseNo()); | 
 |  |  |         moveMap.put("RECEIPT_NO", one.getReceiptNo()); | 
 |  |  |         moveMap.put("PART_NO", one.getPartNo()); | 
 |  |  |         moveMap.put("QTY", one.getQtyArrived()); | 
 |  |  |         moveMap.put("LOCATION_NO", one.getLocationNo()); | 
 |  |  |         moveMap.put("TO_LOCATION_NO", toLocation); | 
 |  |  |         moveMap.put("LOT_BATCH_NO", one.getUpdateBatchNo()); | 
 |  |  |         moveMap.put("SERIAL_NO", one.getSerialNo()); | 
 |  |  |         moveMap.put("WAIV_DEV_REJ_NO", one.getWaivDevRejNo()); | 
 |  |  |         moveMap.put("ENG_CHG_LEVEL", one.getEngChgLevel()); | 
 |  |  |         moveMap.put("ACTIVITY_SEQ", one.getActivitySeq()); | 
 |  |  |         moveResultList.add(moveMap); | 
 |  |  |         moveResultMap.put("RECORD_ID", UUID.randomUUID().toString()); | 
 |  |  |         moveResultMap.put("SYSCODE", "LIMS"); | 
 |  |  |         moveResultMap.put("SYSMODEL", "æ£éªåç§»åº"); | 
 |  |  |         moveResultMap.put("BATCH_INFO", moveResultList); | 
 |  |  |  | 
 |  |  |         Result result1 = ifsApiUtils.moveReceipt(JSONUtil.toJsonStr(moveResultMap)); | 
 |  |  |         if (result1.getCode() != 200) { | 
 |  |  |             throw new ErrorException("IFSæ£éªåç§»åºå¤±è´¥: " + result1.getMessage()); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 
 |  |  | 
 |  |  | package com.ruoyi.inspect.service.impl; | 
 |  |  |  | 
 |  |  | import cn.hutool.core.bean.BeanUtil; | 
 |  |  | import cn.hutool.core.collection.CollUtil; | 
 |  |  | import cn.hutool.core.collection.CollectionUtil; | 
 |  |  | import cn.hutool.core.date.DateTime; | 
 |  |  | import cn.hutool.core.date.DateUtil; | 
 |  |  | import cn.hutool.core.io.IoUtil; | 
 |  |  | import cn.hutool.core.util.StrUtil; | 
 |  |  | import com.alibaba.excel.EasyExcel; | 
 |  |  | import com.alibaba.excel.ExcelWriter; | 
 |  |  | import com.alibaba.excel.support.ExcelTypeEnum; | 
 |  |  | import com.alibaba.excel.write.metadata.WriteSheet; | 
 |  |  | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; | 
 |  |  | import com.alibaba.fastjson.JSONObject; | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | 
 |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
 |  |  | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; | 
 |  |  | 
 |  |  | import com.ruoyi.common.utils.QueryWrappers; | 
 |  |  | import com.ruoyi.common.utils.SecurityUtils; | 
 |  |  | import com.ruoyi.common.utils.WxCpUtils; | 
 |  |  | import com.ruoyi.common.utils.api.IfsApiUtils; | 
 |  |  | import com.ruoyi.common.utils.api.MesApiUtils; | 
 |  |  | import com.ruoyi.inspect.dto.CopperInsOrderDto; | 
 |  |  | import com.ruoyi.inspect.dto.OrderSplitDTO; | 
 |  |  | import com.ruoyi.inspect.dto.RawMaterialStandardTreeDto; | 
 |  |  | import com.ruoyi.basic.mapper.IfsInventoryQuantityMapper; | 
 |  |  | import com.ruoyi.basic.mapper.StandardTreeMapper; | 
 |  |  | import com.ruoyi.inspect.dto.SampleProductDto; | 
 |  |  | import com.ruoyi.inspect.excel.OrderSplitExcelData; | 
 |  |  | import com.ruoyi.inspect.excel.OrderSplitExcelListener; | 
 |  |  | import com.ruoyi.inspect.mapper.InsOrderMapper; | 
 |  |  | import com.ruoyi.inspect.mapper.InsProductMapper; | 
 |  |  | import com.ruoyi.inspect.mapper.InsSampleMapper; | 
 |  |  | import com.ruoyi.inspect.pojo.IfsSplitOrderRecord; | 
 |  |  | import com.ruoyi.inspect.pojo.InsOrder; | 
 |  |  | import com.ruoyi.inspect.pojo.InsReport; | 
 |  |  | import com.ruoyi.inspect.service.IfsSplitOrderRecordService; | 
 |  |  | import com.ruoyi.inspect.service.InsOrderService; | 
 |  |  | import com.ruoyi.inspect.service.InsReportService; | 
 |  |  | import com.ruoyi.inspect.service.RawMaterialOrderService; | 
 |  |  | 
 |  |  | import lombok.AllArgsConstructor; | 
 |  |  | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  | import org.springframework.transaction.annotation.Isolation; | 
 |  |  | import org.springframework.transaction.annotation.Transactional; | 
 |  |  | import org.springframework.web.multipart.MultipartFile; | 
 |  |  |  | 
 |  |  | import javax.servlet.http.HttpServletRequest; | 
 |  |  | import javax.servlet.http.HttpServletResponse; | 
 |  |  | import java.io.IOException; | 
 |  |  | import java.io.InputStream; | 
 |  |  | import java.io.UnsupportedEncodingException; | 
 |  |  | import java.math.BigDecimal; | 
 |  |  | import java.net.URLEncoder; | 
 |  |  | import java.nio.charset.StandardCharsets; | 
 |  |  | import java.text.SimpleDateFormat; | 
 |  |  | import java.time.LocalDateTime; | 
 |  |  | import java.time.format.DateTimeFormatter; | 
 |  |  | import java.util.*; | 
 |  |  | import java.util.concurrent.atomic.AtomicInteger; | 
 |  |  | import java.util.stream.Collectors; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * @Author zhuo | 
 |  |  | 
 |  |  |     private ThreadPoolTaskExecutor threadPoolTaskExecutor; | 
 |  |  |     private InsProductMapper insProductMapper; | 
 |  |  |     private AuxiliaryOutputWorkingHoursMapper auxiliaryOutputWorkingHoursMapper; | 
 |  |  |  | 
 |  |  |     private IfsApiUtils ifsApiUtils; | 
 |  |  |  | 
 |  |  |     private IfsSplitOrderRecordService ifsSplitOrderRecordService; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     public int inspectionReport(List<Integer> ids) { | 
 |  |  |     public int inspectionReport(List<Long> ids) { | 
 |  |  |         Integer userId = SecurityUtils.getUserId().intValue(); | 
 |  |  |         ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate() | 
 |  |  |                 .in(IfsInventoryQuantity::getId, ids) | 
 |  |  | 
 |  |  |                 .set(IfsInventoryQuantity::getIsInspect, 1) | 
 |  |  |                 .set(IfsInventoryQuantity::getDeclareDate, LocalDateTime.now()) | 
 |  |  |         ); | 
 |  |  |         threadPoolTaskExecutor.execute(() -> { | 
 |  |  |             List<IfsInventoryQuantity> quantityList = ifsInventoryQuantityMapper.selectList(Wrappers.<IfsInventoryQuantity>lambdaQuery() | 
 |  |  |                     .in(IfsInventoryQuantity::getId, ids)); | 
 |  |  |             // ä¼ä¸å¾®ä¿¡éç¥ | 
 |  |  |             String message = ""; | 
 |  |  |             message += "æ°å¢æ¥æ£éç¥"; | 
 |  |  |             for (IfsInventoryQuantity inventoryQuantity : quantityList) { | 
 |  |  |                 message += "\næ¹æ¬¡å·: " + inventoryQuantity.getUpdateBatchNo(); | 
 |  |  |                 message += "\né¶ä»¶æè¿°: " + inventoryQuantity.getPartDesc(); | 
 |  |  |                 message += "\næµè¾¾æ°é: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas(); | 
 |  |  |  | 
 |  |  |                 // å¤æææ²¡æå°20å¨. æè
è½å¦å
æ£ | 
 |  |  |                 int result = notificationRawOrder(inventoryQuantity.getId()); | 
 |  |  |                 switch (result) { | 
 |  |  |                     case 1: | 
 |  |  |                         message += "\nå½åæ ·åå·²æ£éªè¿, å¯ä»¥å
æ£"; | 
 |  |  |                         break; | 
 |  |  |                     case 2: | 
 |  |  |                         message += "\nå½åæ ·åå·²è¶
è¿20å¨"; | 
 |  |  |                         break; | 
 |  |  |                 } | 
 |  |  |                 message += "\n"; | 
 |  |  |             } | 
 |  |  |             WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message); | 
 |  |  |         }); | 
 |  |  | //        threadPoolTaskExecutor.execute(() -> { | 
 |  |  | //            List<IfsInventoryQuantity> quantityList = ifsInventoryQuantityMapper.selectList(Wrappers.<IfsInventoryQuantity>lambdaQuery() | 
 |  |  | //                    .in(IfsInventoryQuantity::getId, ids)); | 
 |  |  | //            // ä¼ä¸å¾®ä¿¡éç¥ | 
 |  |  | //            String message = ""; | 
 |  |  | //            message += "æ°å¢æ¥æ£éç¥"; | 
 |  |  | //            for (IfsInventoryQuantity inventoryQuantity : quantityList) { | 
 |  |  | //                message += "\næ¹æ¬¡å·: " + inventoryQuantity.getUpdateBatchNo(); | 
 |  |  | //                message += "\né¶ä»¶æè¿°: " + inventoryQuantity.getPartDesc(); | 
 |  |  | //                message += "\næµè¾¾æ°é: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas(); | 
 |  |  | // | 
 |  |  | //                // å¤æææ²¡æå°20å¨. æè
è½å¦å
æ£ | 
 |  |  | //                int result = notificationRawOrder(inventoryQuantity.getId()); | 
 |  |  | //                switch (result) { | 
 |  |  | //                    case 1: | 
 |  |  | //                        message += "\nå½åæ ·åå·²æ£éªè¿, å¯ä»¥å
æ£"; | 
 |  |  | //                        break; | 
 |  |  | //                    case 2: | 
 |  |  | //                        message += "\nå½åæ ·åå·²è¶
è¿20å¨"; | 
 |  |  | //                        break; | 
 |  |  | //                } | 
 |  |  | //                message += "\n"; | 
 |  |  | //            } | 
 |  |  | //            WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message); | 
 |  |  | //        }); | 
 |  |  |         return 1; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     public int revokeInspectionReport(Integer id) { | 
 |  |  |     public int revokeInspectionReport(Long id) { | 
 |  |  |         return ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate() | 
 |  |  |                 .eq(IfsInventoryQuantity::getId, id) | 
 |  |  |                 .set(IfsInventoryQuantity::getIsInspect, 0) | 
 |  |  | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     public boolean repealRawOrder(Integer ifsInventoryId) { | 
 |  |  |     public boolean repealRawOrder(Long ifsInventoryId) { | 
 |  |  |         // æ¥è¯¢å¤ææ¯å¦æ¯éåä¸ | 
 |  |  |         IfsInventoryQuantity ifsInventoryQuantity = ifsInventoryQuantityMapper.selectById(ifsInventoryId); | 
 |  |  |         if (ifsInventoryQuantity.getIsCopper() != null && ifsInventoryQuantity.getIsCopper().equals(1)) { | 
 |  |  | 
 |  |  |         addAuxiliary(insOrder, ifsInventoryQuantity); | 
 |  |  |  | 
 |  |  |         // todo: ifsç´æ¥ç§»åº | 
 |  |  |         insReportService.isRawMaterial(insOrder); | 
 |  |  |         insReportService.isRawMaterial(insOrder,true,true); | 
 |  |  |  | 
 |  |  |         return insOrder.getId(); | 
 |  |  |     } | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     @Transactional(rollbackFor = Exception.class) | 
 |  |  |     public boolean rawOrderRelease(Integer ifsInventoryId, String partDetail) { | 
 |  |  |     public boolean rawOrderRelease(Long ifsInventoryId, String partDetail) { | 
 |  |  |         // ä¿®æ¹åæææ°æ®ç´æ¥ä¸ºå·²æ£éª | 
 |  |  |         ifsInventoryQuantityMapper.update(null, new LambdaUpdateWrapper<IfsInventoryQuantity>() | 
 |  |  |                 .set(IfsInventoryQuantity::getState, 2) | 
 |  |  | 
 |  |  |         addAuxiliary(insOrder, ifsInventoryQuantity); | 
 |  |  |  | 
 |  |  |         // todo: ifsç´æ¥ç§»åº | 
 |  |  |         insReportService.isRawMaterial(insOrder); | 
 |  |  |         insReportService.isRawMaterial(insOrder,true,true); | 
 |  |  |         return true; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     public int notificationRawOrder(Integer ifsInventoryId) { | 
 |  |  |     public int notificationRawOrder(Long ifsInventoryId) { | 
 |  |  |         IfsInventoryQuantity ifsInventory = ifsInventoryQuantityMapper.selectById(ifsInventoryId); | 
 |  |  |         // æ¥è¯¢å½åæ¹æ¬¡, ä¾åºå, é¶ä»¶å·çåæææ¯å¦è¶
è¿äº20å¨, è¶
è¿äº20å¨éè¦è¿è¡å¤æ¬¡æ£éªæé | 
 |  |  |         List<IfsInventoryQuantity> quantityList = ifsInventoryQuantityMapper.selectList(Wrappers.<IfsInventoryQuantity>lambdaQuery() | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     @Transactional(rollbackFor = Exception.class) | 
 |  |  |     public boolean concessionRelease(Integer ifsInventoryId) { | 
 |  |  |     public boolean concessionRelease(Long ifsInventoryId) { | 
 |  |  |         // æ¥è¯¢åææä¿¡æ¯ | 
 |  |  |         IfsInventoryQuantity ifsInventoryQuantity = ifsInventoryQuantityMapper.selectById(ifsInventoryId); | 
 |  |  |         if (!ifsInventoryQuantity.getInspectStatus().equals(2)) { | 
 |  |  | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         // todo:éè¦å¤æoaæµç¨æ¯å¦æ¯è®©æ¥æ¾è¡ | 
 |  |  |         String toLocation = insReportService.moveRawMaterial(ifsInventoryQuantity); | 
 |  |  |         String toLocation = insOrderService.moveRawMaterial(ifsInventoryQuantity); | 
 |  |  |  | 
 |  |  |         ifsInventoryQuantityMapper.update(null, new LambdaUpdateWrapper<IfsInventoryQuantity>() | 
 |  |  |                 .set(IfsInventoryQuantity::getInspectStatus, 4) | 
 |  |  | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     public boolean advancedGodown(Integer ifsInventoryId) { | 
 |  |  |     public boolean advancedGodown(Long ifsInventoryId) { | 
 |  |  |         // æ¥è¯¢åææä¿¡æ¯ | 
 |  |  |         IfsInventoryQuantity ifsInventoryQuantity = ifsInventoryQuantityMapper.selectById(ifsInventoryId); | 
 |  |  |         if (!ifsInventoryQuantity.getInspectStatus().equals(0) | 
 |  |  | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         // todo:éè¦å¤æoaæµç¨æ¯å¦æ¯è®©æ¥æ¾è¡ | 
 |  |  |         String toLocation = insReportService.moveRawMaterial(ifsInventoryQuantity); | 
 |  |  |         String toLocation = insOrderService.moveRawMaterial(ifsInventoryQuantity); | 
 |  |  |  | 
 |  |  |         ifsInventoryQuantityMapper.update(null, new LambdaUpdateWrapper<IfsInventoryQuantity>() | 
 |  |  |                 .set(IfsInventoryQuantity::getInspectStatus, 1) | 
 |  |  | 
 |  |  |         return true; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public void downloadTemplate(HttpServletResponse response) { | 
 |  |  |         response.reset(); | 
 |  |  |         try{ | 
 |  |  |             String fileName = "订åæå导å
¥æ¨¡æ¿" + ExcelTypeEnum.XLSX.getValue(); | 
 |  |  |             fileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8.toString()); | 
 |  |  |             response.setContentType("application/vnd.ms-excel"); | 
 |  |  |             response.setHeader("Cache-Control", "no-cache"); | 
 |  |  |             response.setHeader("Content-Disposition", "attachment;filename=" + fileName); | 
 |  |  |             response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); | 
 |  |  |             //订åæå导å
¥æ¨¡æ¿æä»¶ | 
 |  |  |             InputStream inputStream = this.getClass().getResourceAsStream("/static/split_order_import_template.xlsx"); | 
 |  |  |             IoUtil.copy(inputStream,response.getOutputStream()); | 
 |  |  |             inputStream.close(); | 
 |  |  |         }catch (Exception e){ | 
 |  |  |             e.printStackTrace(); | 
 |  |  |             throw new RuntimeException("模æ¿ä¸è½½å¤±è´¥"); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public Result importSplitOrderData(MultipartFile file,Long ifsId, HttpServletRequest request) { | 
 |  |  |         try { | 
 |  |  |             IfsInventoryQuantity ifsInventoryQuantity = ifsInventoryQuantityMapper.selectById(ifsId); | 
 |  |  |             OrderSplitExcelListener listener = new OrderSplitExcelListener(ifsInventoryQuantity); | 
 |  |  |             EasyExcel.read(file.getInputStream(), listener).sheet().headRowNumber(2).doRead(); | 
 |  |  |             if(StringUtils.isNotBlank(listener.errorMsg)){ | 
 |  |  |                 return Result.fail(201,listener.errorMsg); | 
 |  |  |             } | 
 |  |  |             return Result.success(listener.getDataList()); | 
 |  |  |         } catch (IOException e) { | 
 |  |  |             e.printStackTrace(); | 
 |  |  |             throw new RuntimeException("导å
¥å¤±è´¥:"+e.getMessage()); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     @Transactional(rollbackFor = Exception.class,isolation = Isolation.READ_COMMITTED) | 
 |  |  |     public boolean confirmSplitOrder(OrderSplitDTO orderSplitDTO) { | 
 |  |  |         //1.æ¥è¯¢ifs订åä¿¡æ¯ | 
 |  |  |         IfsInventoryQuantity ifsInventoryQuantity = ifsInventoryQuantityMapper.selectById(orderSplitDTO.getIfsId()); | 
 |  |  |         if(Objects.isNull(ifsInventoryQuantity)){ | 
 |  |  |             throw new RuntimeException("æªæ¥è¯¢å°è¯¥IFS订åä¿¡æ¯"); | 
 |  |  |         } | 
 |  |  |         //2.对æ¥ifséè´æ¥æ¶æ´æ¹æ¹å·æ¥å£ | 
 |  |  |         //ç»è£
请æ±åæ°inAttr | 
 |  |  |         List<String> newLotBathNo = new ArrayList<>();//æ°æ¹å·å表 | 
 |  |  |         Map<String,Object> inAttrMap = new HashMap<>(); | 
 |  |  |         inAttrMap.put("RECORD_ID",UUID.randomUUID().toString()); | 
 |  |  |         inAttrMap.put("SYSCODE","LIMS_NS"); | 
 |  |  |         inAttrMap.put("SYSMODEL","èä¸LIMS订åæå"); | 
 |  |  |         List<Map<String,Object>> batchInfoData = new ArrayList<>(); | 
 |  |  |         if(Objects.nonNull(orderSplitDTO.getSplitDetailList()) && !orderSplitDTO.getSplitDetailList().isEmpty()){ | 
 |  |  |             for (OrderSplitExcelData data : orderSplitDTO.getSplitDetailList()) { | 
 |  |  |                 Map<String, Object> infoMap = new HashMap<>(); | 
 |  |  |                 infoMap.put("ORDER_NO",ifsInventoryQuantity.getOrderNo()); | 
 |  |  |                 infoMap.put("LINE_NO",ifsInventoryQuantity.getLineNo()); | 
 |  |  |                 infoMap.put("RELEASE_NO",ifsInventoryQuantity.getReleaseNo()); | 
 |  |  |                 infoMap.put("RECEIPT_NO",ifsInventoryQuantity.getReceiptNo()); | 
 |  |  |                 infoMap.put("PART_NO",ifsInventoryQuantity.getPartNo()); | 
 |  |  |                 infoMap.put("CONFIGURATION_ID",ifsInventoryQuantity.getConfigurationId()); | 
 |  |  |                 infoMap.put("LOCATION_NO",ifsInventoryQuantity.getLocationNo()); | 
 |  |  |                 infoMap.put("LOT_BATCH_NO",ifsInventoryQuantity.getLotBatchNo()); | 
 |  |  |                 infoMap.put("NEW_LOT_BATCH_NO",data.getLotBatchNo()); | 
 |  |  |                 newLotBathNo.add(data.getLotBatchNo()); | 
 |  |  |                 infoMap.put("SERIAL_NO",ifsInventoryQuantity.getSerialNo()); | 
 |  |  |                 infoMap.put("ENG_CHG_LEVEL",ifsInventoryQuantity.getEngChgLevel()); | 
 |  |  |                 infoMap.put("WAIV_DEV_REJ_NO",ifsInventoryQuantity.getWaivDevRejNo()); | 
 |  |  |                 infoMap.put("ACTIVITY_SEQ",ifsInventoryQuantity.getActivitySeq()); | 
 |  |  |                 infoMap.put("QTY_TO_CHANGE",data.getQtyStock()); | 
 |  |  |                 batchInfoData.add(infoMap); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         inAttrMap.put("BATCH_INFO", batchInfoData); | 
 |  |  |         String inAttr = JSONObject.toJSONString(inAttrMap); | 
 |  |  |         //è°ç¨ifsæ¥å£ | 
 |  |  |         Result result = ifsApiUtils.updateMoveReceiptLot(inAttr); | 
 |  |  |         if(result.getCode()!=200){ | 
 |  |  |             throw new RuntimeException("IFSéè´æ¥æ¶æ´æ¹æ¹å·è¯·æ±å¼å¸¸ï¼"+result.getMessage()); | 
 |  |  |         } | 
 |  |  |         //æ´æ°ä¸»è®¢åçæµè¾¾éè´æ°é | 
 |  |  |         BigDecimal purQtyInStore = orderSplitDTO.getSplitDetailList() | 
 |  |  |                 .stream() | 
 |  |  |                 .map(OrderSplitExcelData::getQtyStock) | 
 |  |  |                 .reduce(BigDecimal::add).orElse(BigDecimal.ZERO); | 
 |  |  |         BigDecimal newPurQtyInStore = ifsInventoryQuantity.getPurQtyInStore().subtract(purQtyInStore); | 
 |  |  |         //妿æååï¼å©ä½çåºåæ°é为0ï¼åå é¤æ¹å·ä¸º*ç订åä¿¡æ¯ | 
 |  |  |         if(newPurQtyInStore.compareTo(BigDecimal.ZERO)==0){ | 
 |  |  |             ifsInventoryQuantityMapper.deleteById(ifsInventoryQuantity.getId()); | 
 |  |  |         }else{ | 
 |  |  |             ifsInventoryQuantityMapper.update(null,Wrappers.<IfsInventoryQuantity>lambdaUpdate() | 
 |  |  |                     .set(IfsInventoryQuantity::getPurQtyInStore,newPurQtyInStore) | 
 |  |  |                     .set(IfsInventoryQuantity::getInvQtyInStore,newPurQtyInStore) | 
 |  |  |                     .eq(IfsInventoryQuantity::getId,ifsInventoryQuantity.getId()) | 
 |  |  |             ); | 
 |  |  |         } | 
 |  |  |         //ifsæ´æ¹æ¹å·æ¥å£è°ç¨æåï¼æåæ°æåçifs订åå¹¶æ¥æ£ | 
 |  |  |         Map<String, Object> map = new HashMap<>(); | 
 |  |  |         map.put("LOCATION_NO","1302"); | 
 |  |  |         map.put("STATE_DB","To be Inspected"); | 
 |  |  |         map.put("PART_NO",ifsInventoryQuantity.getPartNo()); | 
 |  |  |         map.put("ORDER_NO",ifsInventoryQuantity.getOrderNo()); | 
 |  |  |         map.put("LINE_NO",ifsInventoryQuantity.getLineNo()); | 
 |  |  |         map.put("RELEASE_NO",ifsInventoryQuantity.getReleaseNo()); | 
 |  |  |         map.put("RECEIPT_NO",ifsInventoryQuantity.getReceiptNo()); | 
 |  |  |         map.put("LOT_BATCH_NO",String.join(";",newLotBathNo)); | 
 |  |  |         insOrderService.getIfsOrder(map,true); | 
 |  |  |         //æ¥è¯¢æ°æåç订åä¿¡æ¯ | 
 |  |  |         List<IfsInventoryQuantity> splitOrderList = ifsInventoryQuantityMapper.selectList(Wrappers.<IfsInventoryQuantity>lambdaQuery() | 
 |  |  |                 .eq(IfsInventoryQuantity::getLocationNo, "1302") | 
 |  |  |                 .eq(IfsInventoryQuantity::getStatusDb, "To be Inspected") | 
 |  |  |                 .eq(IfsInventoryQuantity::getPartNo, ifsInventoryQuantity.getPartNo()) | 
 |  |  |                 .eq(IfsInventoryQuantity::getOrderNo, ifsInventoryQuantity.getOrderNo()) | 
 |  |  |                 .eq(IfsInventoryQuantity::getLineNo, ifsInventoryQuantity.getLineNo()) | 
 |  |  |                 .eq(IfsInventoryQuantity::getReleaseNo, ifsInventoryQuantity.getReleaseNo()) | 
 |  |  |                 .eq(IfsInventoryQuantity::getReceiptNo, ifsInventoryQuantity.getReceiptNo()) | 
 |  |  |                 .in(IfsInventoryQuantity::getLotBatchNo, newLotBathNo) | 
 |  |  |         ); | 
 |  |  |         //æ§è¡æ¥æ£æä½ | 
 |  |  |         if(Objects.nonNull(splitOrderList) && !splitOrderList.isEmpty()){ | 
 |  |  |             List<Long> ids = splitOrderList.stream().map(IfsInventoryQuantity::getId).collect(Collectors.toList()); | 
 |  |  |             ids.add(ifsInventoryQuantity.getId()); | 
 |  |  |             this.inspectionReport(ids); | 
 |  |  |         } | 
 |  |  |         //å¾é忥å°MESï¼ä¿å订åæåè®°å½ | 
 |  |  |         if(orderSplitDTO.getPushToMes()){ | 
 |  |  |             List<IfsSplitOrderRecord> collect = orderSplitDTO.getSplitDetailList().stream().map(m -> { | 
 |  |  |                 IfsSplitOrderRecord record = new IfsSplitOrderRecord(); | 
 |  |  |                 BeanUtil.copyProperties(m, record); | 
 |  |  |                 record.setOrderNo(ifsInventoryQuantity.getOrderNo()); | 
 |  |  |                 record.setLineNo(ifsInventoryQuantity.getLineNo()); | 
 |  |  |                 record.setReleaseNo(ifsInventoryQuantity.getReleaseNo()); | 
 |  |  |                 record.setReceiptNo(ifsInventoryQuantity.getReceiptNo()); | 
 |  |  |                 return record; | 
 |  |  |             }).collect(Collectors.toList()); | 
 |  |  |             return ifsSplitOrderRecordService.saveBatch(collect); | 
 |  |  |         } | 
 |  |  |         return false; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * æ·»å å·¥æ¶ | 
 
 |  |  | 
 |  |  | import org.springframework.stereotype.Component; | 
 |  |  |  | 
 |  |  | import javax.annotation.Resource; | 
 |  |  | import java.util.HashMap; | 
 |  |  | import java.util.Map; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * @Author zhuo | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @Scheduled(fixedDelay = 1200000) | 
 |  |  |     public void getIfsOrderTiming() { | 
 |  |  |         insOrderService.getIfsOrder(); | 
 |  |  |         Map<String, Object> map = new HashMap<>(); | 
 |  |  |         map.put("LOCATION_NO","1302"); | 
 |  |  |         map.put("STATE_DB","To be Inspected"); | 
 |  |  |         insOrderService.getIfsOrder(map,false); | 
 |  |  |     } | 
 |  |  | } | 
 
 |  |  | 
 |  |  |     @ApiModelProperty("æ¥åid") | 
 |  |  |     private Integer insReportId; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty(value = "æ¯å¦ä¸ºæå订å(0:妠1:æ¯)") | 
 |  |  |     private Integer isSplitOrder; | 
 |  |  |  | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | <?xml version="1.0" encoding="UTF-8"?> | 
 |  |  | <!DOCTYPE mapper | 
 |  |  |         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 
 |  |  |         "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 
 |  |  | <mapper namespace="com.ruoyi.inspect.mapper.IfsSplitOrderRecordMapper"> | 
 |  |  |  | 
 |  |  |     <resultMap id="BaseResultMap" type="com.ruoyi.inspect.pojo.IfsSplitOrderRecord"> | 
 |  |  |             <id property="id" column="id" jdbcType="BIGINT"/> | 
 |  |  |             <result property="orderNo" column="order_no" jdbcType="VARCHAR"/> | 
 |  |  |             <result property="lineNo" column="line_no" jdbcType="VARCHAR"/> | 
 |  |  |             <result property="releaseNo" column="release_no" jdbcType="VARCHAR"/> | 
 |  |  |             <result property="receiptNo" column="receipt_no" jdbcType="VARCHAR"/> | 
 |  |  |             <result property="partNo" column="part_no" jdbcType="VARCHAR"/> | 
 |  |  |             <result property="systemNo" column="system_no" jdbcType="VARCHAR"/> | 
 |  |  |             <result property="spec" column="spec" jdbcType="VARCHAR"/> | 
 |  |  |             <result property="lotBatchNo" column="lot_batch_no" jdbcType="VARCHAR"/> | 
 |  |  |             <result property="length" column="length" jdbcType="DECIMAL"/> | 
 |  |  |             <result property="qtyStock" column="qty_stock" jdbcType="DECIMAL"/> | 
 |  |  |             <result property="insulationColor" column="insulation_color" jdbcType="VARCHAR"/> | 
 |  |  |             <result property="outerColor" column="outer_color" jdbcType="VARCHAR"/> | 
 |  |  |             <result property="letteringInfo" column="lettering_info" jdbcType="VARCHAR"/> | 
 |  |  |             <result property="drumNo" column="drum_no" jdbcType="VARCHAR"/> | 
 |  |  |             <result property="locationNo" column="location_no" jdbcType="VARCHAR"/> | 
 |  |  |             <result property="stockSource" column="stock_source" jdbcType="VARCHAR"/> | 
 |  |  |             <result property="remark" column="remark" jdbcType="VARCHAR"/> | 
 |  |  |             <result property="syncStatus" column="sync_status" jdbcType="TINYINT"/> | 
 |  |  |             <result property="createUser" column="create_user" jdbcType="INTEGER"/> | 
 |  |  |             <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | 
 |  |  |             <result property="updateUser" column="update_user" jdbcType="INTEGER"/> | 
 |  |  |             <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | 
 |  |  |     </resultMap> | 
 |  |  |  | 
 |  |  |     <sql id="Base_Column_List"> | 
 |  |  |         id,order_no,line_no,release_no,receipt_no,part_no, | 
 |  |  |         system_no,spec,lot_batch_no,`length`, | 
 |  |  |         qty_stock,insulation_color,outer_color, | 
 |  |  |         lettering_info,drum_no,location_no, | 
 |  |  |         stock_source,remark,sync_status,create_user,create_time, | 
 |  |  |         update_user,update_time | 
 |  |  |     </sql> | 
 |  |  | </mapper> | 
 
 |  |  | 
 |  |  |         ira.url, | 
 |  |  |         ira.url_s, | 
 |  |  |         ira.temp_url_pdf, | 
 |  |  |         iiq.is_copper | 
 |  |  |         iiq.is_copper, | 
 |  |  |         iiq.is_split_order | 
 |  |  |         FROM | 
 |  |  |         ins_order io | 
 |  |  |         LEFT JOIN ins_sample isa ON isa.ins_order_id = io.id | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.common.utils.api; | 
 |  |  |  | 
 |  |  | import cn.hutool.http.HttpRequest; | 
 |  |  | import cn.hutool.json.JSONObject; | 
 |  |  | import cn.hutool.json.JSONUtil; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.springframework.beans.factory.annotation.Value; | 
 |  |  | import org.springframework.stereotype.Component; | 
 |  |  |  | 
 |  |  | import java.util.HashMap; | 
 |  |  | import java.util.Map; | 
 |  |  | import java.util.Objects; | 
 |  |  |  | 
 |  |  | @Slf4j | 
 |  |  | @Component | 
 |  |  | public class MesApiUtils { | 
 |  |  |  | 
 |  |  |     @Value("${mes.ztzb.ip}") | 
 |  |  |     String ip; | 
 |  |  |  | 
 |  |  |     @Value("${mes.ztzb.user}") | 
 |  |  |     String user; | 
 |  |  |  | 
 |  |  |     @Value("${mes.ztzb.password}") | 
 |  |  |     String password; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * è·åtoken请æ±é¾æ¥ | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     private String getAuthTokenUrl() { | 
 |  |  |         return ip + "/auth/oauth/token?randomStr=blockPuzzle&grant_type=password"; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * æ°å¢å®æ¶åºå请æ±é¾æ¥ | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     private String getBatchAddStockUrl(){ | 
 |  |  |         return ip + "/mes/stock/batchAddStock"; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * è·åmesç³»ç»token | 
 |  |  |      * @return æ¥å£ååºç»æ | 
 |  |  |      */ | 
 |  |  |     public String getToken(){ | 
 |  |  |         try{ | 
 |  |  |             Map<String,Object> bodyMap = new HashMap<>(); | 
 |  |  |             bodyMap.put("username",user); | 
 |  |  |             String bodyStr = "username="+user+"&password="+password; | 
 |  |  |             String response = HttpRequest.post(getAuthTokenUrl()) | 
 |  |  |                     .header("Authorization", "Basic cGlnOnBpZw==") | 
 |  |  |                     .header("Content-Type", "application/x-www-form-urlencoded") | 
 |  |  |                     .body(bodyStr,"application/x-www-form-urlencoded").execute().body(); | 
 |  |  |             JSONObject responseObj = JSONUtil.parseObj(response); | 
 |  |  |             if(Objects.nonNull(responseObj.getStr("access_token"))){ | 
 |  |  |                 return "Bearer " + responseObj.getStr("access_token"); | 
 |  |  |             }else{ | 
 |  |  |                 throw new RuntimeException(responseObj.getStr("msg")); | 
 |  |  |             } | 
 |  |  |         }catch (Exception e){ | 
 |  |  |             e.printStackTrace(); | 
 |  |  |             throw new RuntimeException("è·åMESç³»ç»tokenæ¥å£å¼å¸¸:"+e.getMessage()); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * mesæ°å¢å®æ¶åºåæ¥å£ | 
 |  |  |      * @param requestJsonStr è¯·æ±åæ°jsonå符串 | 
 |  |  |      * @return æ¥å£ååºç»æ | 
 |  |  |      */ | 
 |  |  |     public boolean batchAddStock(String requestJsonStr){ | 
 |  |  |         try{ | 
 |  |  |             String response = HttpRequest.post(getBatchAddStockUrl()) | 
 |  |  |                     .header("Authorization", getToken()) | 
 |  |  |                     .header("Content-Type", "application/json") | 
 |  |  |                     .body(requestJsonStr) | 
 |  |  |                     .execute() | 
 |  |  |                     .body(); | 
 |  |  |             JSONObject entries = JSONUtil.parseObj(response); | 
 |  |  |             if(entries.getInt("code")==0){ | 
 |  |  |                 return true; | 
 |  |  |             }else{ | 
 |  |  |                 throw new RuntimeException("忥å°MES失败ï¼"+entries.getStr("msg")); | 
 |  |  |             } | 
 |  |  |         }catch (Exception e){ | 
 |  |  |             e.printStackTrace(); | 
 |  |  |             throw new RuntimeException("忥MES宿¶åºåæ¥å£å¼å¸¸:"+e.getMessage()); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } | 
 
| ¶Ô±ÈÐÂÎļþ | 
 |  |  | 
 |  |  | package com.ruoyi.common.utils.http; | 
 |  |  |  | 
 |  |  | import java.util.HashMap; | 
 |  |  | import java.util.Map; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * è¯·æ±åæ°ç¹æ®å符转ä¹å·¥å
·ç±» | 
 |  |  |  * ç¨äºå¤çHTTP请æ±åæ°ä¸çç¹æ®å符ï¼é²æ¢XSSæ»å»ååæ°è§£æé误 | 
 |  |  |  */ | 
 |  |  | public class ParameterEscaperUtil { | 
 |  |  |     // ç¹æ®åç¬¦è½¬ä¹æ å°è¡¨ | 
 |  |  |     private static final Map<Character, String> ESCAPE_MAP; | 
 |  |  |     // è½¬ä¹å符å转æ å°è¡¨ | 
 |  |  |     private static final Map<String, Character> UNESCAPE_MAP; | 
 |  |  |      | 
 |  |  |     static { | 
 |  |  |         // åå§åè½¬ä¹æ å° | 
 |  |  |         ESCAPE_MAP = new HashMap<>(); | 
 |  |  |         ESCAPE_MAP.put('&', "&"); | 
 |  |  |         ESCAPE_MAP.put('<', "<"); | 
 |  |  |         ESCAPE_MAP.put('>', ">"); | 
 |  |  |         ESCAPE_MAP.put('"', """); | 
 |  |  |         ESCAPE_MAP.put('\'', "'"); | 
 |  |  |         ESCAPE_MAP.put('/', "/"); | 
 |  |  |         ESCAPE_MAP.put('\\', "\"); | 
 |  |  |         ESCAPE_MAP.put(' ', "%20"); | 
 |  |  |         ESCAPE_MAP.put('?', "%3F"); | 
 |  |  |         ESCAPE_MAP.put('=', "%3D"); | 
 |  |  |         ESCAPE_MAP.put('+', "%2B"); | 
 |  |  |         ESCAPE_MAP.put('%', "%25"); | 
 |  |  |         ESCAPE_MAP.put('#', "%23"); | 
 |  |  |         ESCAPE_MAP.put(':', "%3A"); | 
 |  |  |         ESCAPE_MAP.put(';', "%3B"); | 
 |  |  |          | 
 |  |  |         // åå§ååè½¬ä¹æ å° | 
 |  |  |         UNESCAPE_MAP = new HashMap<>(); | 
 |  |  |         for (Map.Entry<Character, String> entry : ESCAPE_MAP.entrySet()) { | 
 |  |  |             UNESCAPE_MAP.put(entry.getValue(), entry.getKey()); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |      | 
 |  |  |     /** | 
 |  |  |      * è½¬ä¹è¯·æ±åæ°ä¸çç¹æ®å符 | 
 |  |  |      * @param input åå§è¾å
¥å符串 | 
 |  |  |      * @return è½¬ä¹åçå符串 | 
 |  |  |      */ | 
 |  |  |     public static String escape(String input) { | 
 |  |  |         if (input == null || input.isEmpty()) { | 
 |  |  |             return input; | 
 |  |  |         } | 
 |  |  |          | 
 |  |  |         StringBuilder sb = new StringBuilder(); | 
 |  |  |         for (char c : input.toCharArray()) { | 
 |  |  |             // å¦ææ¯éè¦è½¬ä¹çå符ï¼å使ç¨è½¬ä¹åçå符串ï¼å¦åç´æ¥æ·»å  | 
 |  |  |             String escaped = ESCAPE_MAP.get(c); | 
 |  |  |             sb.append(escaped != null ? escaped : c); | 
 |  |  |         } | 
 |  |  |         return sb.toString(); | 
 |  |  |     } | 
 |  |  |      | 
 |  |  |     /** | 
 |  |  |      * å转ä¹è¯·æ±åæ°ä¸çç¹æ®å符 | 
 |  |  |      * @param input è½¬ä¹åçå符串 | 
 |  |  |      * @return åå§å符串 | 
 |  |  |      */ | 
 |  |  |     public static String unescape(String input) { | 
 |  |  |         if (input == null || input.isEmpty()) { | 
 |  |  |             return input; | 
 |  |  |         } | 
 |  |  |          | 
 |  |  |         StringBuilder sb = new StringBuilder(); | 
 |  |  |         int i = 0; | 
 |  |  |         while (i < input.length()) { | 
 |  |  |             boolean found = false; | 
 |  |  |             // æ£æ¥æ¯å¦æ¯è½¬ä¹åºå | 
 |  |  |             for (String escapeSeq : UNESCAPE_MAP.keySet()) { | 
 |  |  |                 if (input.startsWith(escapeSeq, i)) { | 
 |  |  |                     sb.append(UNESCAPE_MAP.get(escapeSeq)); | 
 |  |  |                     i += escapeSeq.length(); | 
 |  |  |                     found = true; | 
 |  |  |                     break; | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |             if (!found) { | 
 |  |  |                 sb.append(input.charAt(i)); | 
 |  |  |                 i++; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         return sb.toString(); | 
 |  |  |     } | 
 |  |  | } | 
 |  |  |      |