basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantityDto.java
@@ -79,4 +79,7 @@ @ApiModelProperty("æ£éªäºº") private String userName; @ApiModelProperty("éå®è®¢ååç±»") private String orderType; } basic-server/src/main/java/com/ruoyi/basic/dto/IfsInventoryQuantitySupplierDto.java
@@ -40,6 +40,9 @@ @ApiModelProperty("æ ·åç¼å·") private String sampleCode; @ApiModelProperty("éå®è®¢ååç±»åç§°") private String orderTypeName; // è¿å @ApiModelProperty("è¿å订åid") private Integer enterOrderId; basic-server/src/main/java/com/ruoyi/basic/mapper/StandardTreeMapper.java
@@ -9,6 +9,7 @@ import com.ruoyi.basic.pojo.StandardProductList; import com.ruoyi.basic.pojo.StandardTree; import com.ruoyi.basic.vo.IfsInventoryQuantityVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -20,6 +21,7 @@ * @createDate 2024-03-01 15:06:44 * @Entity com.ruoyi.basic.pojo.StandardTree */ @Mapper public interface StandardTreeMapper extends BaseMapper<StandardTree> { List<FactoryDto> selectStandardTreeList(); basic-server/src/main/java/com/ruoyi/basic/pojo/IfsInventoryQuantity.java
@@ -37,6 +37,9 @@ @ApiModelProperty("æ¥æ¶å·") private Integer receiptNo; @ApiModelProperty("订åç±»å(01raw:åææï¼02wg:å¤è´æå)") private String orderType; @ExcelProperty(index = 3, value = "é¶ä»¶å·") @ApiModelProperty("é¶ä»¶å·") private String partNo; basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardMethodServiceImpl.java
@@ -26,6 +26,7 @@ import java.io.IOException; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; /** * @author Administrator @@ -193,7 +194,8 @@ return map; } standardMethodLists.addAll(standardMethodMapper.selectStandardMethodListsByNull(str)); map.put("standardMethodList", standardMethodLists); List<StandardMethodList> collect = standardMethodLists.stream().distinct().collect(Collectors.toList()); map.put("standardMethodList", collect); return map; } inspect-server/src/main/java/com/ruoyi/inspect/controller/IfsOrderInspectionController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,38 @@ package com.ruoyi.inspect.controller; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto; import com.ruoyi.common.core.domain.Result; import com.ruoyi.inspect.service.IfsOrderInspectionService; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * ifséå®è®¢åæ¥æ£controller */ @RestController @RequestMapping("/ifsOrderInspection") public class IfsOrderInspectionController { @Autowired private IfsOrderInspectionService ifsOrderInspectionService; @ApiOperation(value = "éå®è®¢åæ¥æ£æ¥è¯¢å ¨é¨") @PreAuthorize("@ss.hasPermi('get:Ifs:ByAll')") @GetMapping("/getIfsByAll") public Result getIfsByAll(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto){ return Result.success(ifsOrderInspectionService.getIfsByOver(page, ifsInventoryQuantityDto)); } @ApiOperation(value = "éå®è®¢åæ¥æ£æ¥çå·²å®æä¿¡æ¯") @GetMapping("/getIfsByFinish") public Result getIfsByFinish(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto) { ifsInventoryQuantityDto.setIsFinish(1); return Result.success(ifsOrderInspectionService.getIfsByOver(page, ifsInventoryQuantityDto)); } } inspect-server/src/main/java/com/ruoyi/inspect/controller/IfsPartPropsRecordController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,34 @@ package com.ruoyi.inspect.controller; import com.ruoyi.common.core.domain.Result; import com.ruoyi.inspect.dto.IfsPartPropsRecordDTO; import com.ruoyi.inspect.service.IfsPartPropsRecordService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; /** * ifsé¶ä»¶å±æ§controller */ @Api("ifsé¶ä»¶å±æ§") @RestController @RequestMapping("/ifsPartProps") public class IfsPartPropsRecordController { @Autowired private IfsPartPropsRecordService ifsPartPropsRecordService; @ApiOperation(value = "æ°å¢æä¿åé¶ä»¶å±æ§") @PostMapping("/saveOrUpdateProps") public Result saveOrUpdateProps(@RequestBody IfsPartPropsRecordDTO ifsPartPropsRecord){ return Result.success(ifsPartPropsRecordService.saveOrUpdateProps(ifsPartPropsRecord)); } @ApiOperation(value = "æ¥è¯¢ifs订åçé¶ä»¶å±æ§è®°å½") @GetMapping("/getOneByIfsId/{ifsId}") public Result getOneByIfsId(@PathVariable("ifsId") Long ifsId){ return Result.success(ifsPartPropsRecordService.getOneByIfsId(ifsId)); } } inspect-server/src/main/java/com/ruoyi/inspect/controller/OutsourcingFinishProductInspectionController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,58 @@ package com.ruoyi.inspect.controller; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.basic.dto.IfsInventoryQuantityDto; import com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto; import com.ruoyi.basic.pojo.IfsInventoryQuantity; import com.ruoyi.common.annotation.PersonalScope; import com.ruoyi.common.core.domain.Result; import com.ruoyi.inspect.service.OutsourcingFinishProductInspectionService; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * å¤è´æåæ£éªcontroller */ @RestController @RequestMapping("/outsourcingFinishProduct") public class OutsourcingFinishProductInspectionController { @Autowired private OutsourcingFinishProductInspectionService outsourcingFinishProductInspectionService; @ApiOperation(value = "ä»åºæ¥æ£æ¥è¯¢") @GetMapping("/getWarehouseSubmit") public Result getWarehouseSubmit(Page page, IfsInventoryQuantity ifsInventoryQuantity) { return Result.success(outsourcingFinishProductInspectionService.getWarehouseSubmit(page, ifsInventoryQuantity)); } @ApiOperation(value = "å¤è´æåæ£éªæ¥è¯¢æ£éªä¸") @GetMapping("/getIfsByStateOne") @PreAuthorize("@ss.hasPermi('business:order')") @PersonalScope(permsName = "business:order", objectName = IfsInventoryQuantityDto.class, paramName = "createUser") public Result getIfsByStateOne(Page page, IfsInventoryQuantityDto ifsInventoryQuantityDto){ return Result.success(outsourcingFinishProductInspectionService.getIfsByStateOne(page, ifsInventoryQuantityDto)); } @ApiOperation(value = "å¤è´æåæ£éªæ¥è¯¢å·²æ£éª") @GetMapping("/getIfsByOver") @PreAuthorize("@ss.hasPermi('business:order')") @PersonalScope(permsName = "business:order", objectName = IfsInventoryQuantitySupplierDto.class, paramName = "createUser") public Result getIfsByOver(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto){ return Result.success(outsourcingFinishProductInspectionService.getIfsByOver(page, ifsInventoryQuantityDto)); } @ApiOperation(value = "åæææ¥æ£æ¥è¯¢å ¨é¨") @PreAuthorize("@ss.hasPermi('get:Ifs:ByAll')") @GetMapping("/getIfsByAll") public Result getIfsByAll(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto){ return Result.success(outsourcingFinishProductInspectionService.getIfsByOver(page, ifsInventoryQuantityDto)); } } inspect-server/src/main/java/com/ruoyi/inspect/controller/RawMaterialOrderController.java
@@ -1,23 +1,21 @@ package com.ruoyi.inspect.controller; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.basic.dto.*; import com.ruoyi.basic.dto.IfsInventoryQuantityCheckDto; import com.ruoyi.basic.dto.IfsInventoryQuantityDto; import com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto; import com.ruoyi.basic.pojo.IfsInventoryQuantity; import com.ruoyi.common.annotation.PersonalScope; import com.ruoyi.common.core.domain.Result; import com.ruoyi.common.enums.OrderType; import com.ruoyi.common.utils.WxCpUtils; import com.ruoyi.framework.exception.ErrorException; 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 com.ruoyi.inspect.service.InsOrderService; import com.ruoyi.inspect.service.RawMaterialOrderService; import com.ruoyi.inspect.service.RawMaterialOrderTemplateService; import com.ruoyi.common.core.domain.Result; import com.ruoyi.common.utils.JackSonUtil; import com.ruoyi.common.utils.WxCpUtils; import com.ruoyi.inspect.dto.CopperInsOrderDto; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; @@ -30,6 +28,7 @@ import java.io.File; import java.util.List; import java.util.Map; import java.util.Objects; /** * @Author zhuo @@ -106,7 +105,11 @@ @PostMapping("/inspectionReport") public Result<?> inspectionReport(@RequestBody Map<String, Object> param) { List<Long> ids = (List<Long>) param.get("ids"); return Result.success(rawMaterialOrderService.inspectionReport(ids)); String orderType = Objects.nonNull(param.get("orderType"))?param.get("orderType").toString():""; if(!OrderType.validateValue(orderType)){ throw new ErrorException("æ¹éæ¥æ£å¤±è´¥,éæ³çéå®è®¢ååç±»æä¸¾"); } return Result.success(rawMaterialOrderService.inspectionReport(ids,orderType)); } /** @@ -221,6 +224,7 @@ @PreAuthorize("@ss.hasPermi('get:Ifs:ByAll')") @GetMapping("/getIfsByAll") public Result getIfsByAll(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto){ ifsInventoryQuantityDto.setOrderType(OrderType.RAW.getValue()); return Result.success(rawMaterialOrderService.getIfsByOver(page, ifsInventoryQuantityDto)); } @@ -236,6 +240,7 @@ @GetMapping("/getIfsByFinish") public Result getIfsByFinish(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto) throws Exception { ifsInventoryQuantityDto.setIsFinish(1); ifsInventoryQuantityDto.setOrderType(OrderType.RAW.getValue()); return Result.success(rawMaterialOrderService.getIfsByOver(page, ifsInventoryQuantityDto)); } @@ -349,4 +354,13 @@ return Result.success(rawMaterialOrderService.confirmSplitOrder(orderSplitDTO)); } /** * æ ¹æ®ifsIdæ¥è¯¢ä¸åæ°é */ @ApiOperation(value = "æ ¹æ®ifsIdæ¥è¯¢ä¸åæ°é") @GetMapping("/getOrderCountByIfsId/{ifsId}") public Result getOrderCountByIfsId(@PathVariable("ifsId") Long ifsId){ return Result.success(rawMaterialOrderService.getOrderCountByIfsId(ifsId)); } } inspect-server/src/main/java/com/ruoyi/inspect/dto/EnterFactoryReport.java
@@ -30,4 +30,23 @@ @ApiModelProperty("æ£æµç¼å·") private String code; /** * 夿¤é¢è² */ @ApiModelProperty("夿¤é¢è²") private String outerColor; /** * æ£éªå */ @ApiModelProperty("æ£éªå") private String inspector; /** * æ£éªæ¥æ */ @ApiModelProperty("æ£éªæ¥æ") private String inspectDate; } inspect-server/src/main/java/com/ruoyi/inspect/dto/IfsPartPropsRecordDTO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ package com.ruoyi.inspect.dto; import com.ruoyi.inspect.pojo.IfsPartPropsRecord; import lombok.Data; @Data public class IfsPartPropsRecordDTO extends IfsPartPropsRecord { private String partNo; private String lotBatchNo; } inspect-server/src/main/java/com/ruoyi/inspect/mapper/IfsPartPropsRecordMapper.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,22 @@ package com.ruoyi.inspect.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.inspect.pojo.IfsPartPropsRecord; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; /** * @author 27233 * @description é对表ãifs_part_props_record(ifs订åé¶ä»¶å±æ§è®°å½è¡¨)ãçæ°æ®åºæä½Mapper * @createDate 2025-10-23 15:00:34 * @Entity com.ruoyi.inspect.pojo.IfsPartPropsRecord */ @Mapper public interface IfsPartPropsRecordMapper extends BaseMapper<IfsPartPropsRecord> { Long selectCountByPartNoAndLotBatchNo(@Param("partNo") String partNo, @Param("lotBatchNo") String lotBatchNo); } inspect-server/src/main/java/com/ruoyi/inspect/mapper/IfsSplitOrderRecordMapper.java
@@ -2,6 +2,7 @@ import com.ruoyi.inspect.pojo.IfsSplitOrderRecord; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; /** * @author 27233 @@ -9,6 +10,7 @@ * @createDate 2025-10-29 16:39:41 * @Entity com.ruoyi.inspect.pojo.IfsSplitOrderRecord */ @Mapper public interface IfsSplitOrderRecordMapper extends BaseMapper<IfsSplitOrderRecord> { } inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsOrderMapper.java
@@ -9,8 +9,10 @@ import com.ruoyi.inspect.dto.SampleProductDto2; import com.ruoyi.inspect.dto.SampleProductExportDto; import com.ruoyi.inspect.pojo.InsOrder; import com.ruoyi.inspect.vo.IfsOrderVO; import com.ruoyi.inspect.vo.InsOrderPrintingVo; import com.ruoyi.inspect.vo.SampleDefectsFatherVo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -23,6 +25,7 @@ * @createDate 2024-03-12 16:17:55 * @Entity com.yuanchu.mom.pojo.InsOrder */ @Mapper public interface InsOrderMapper extends BaseMapper<InsOrder> { //è·åæ£éªä¸åæ°æ® @@ -144,4 +147,6 @@ * @return */ Integer selectNotSpotCheckOrder(@Param("itmeId") Integer itmeId, @Param("startTime") String startTime, @Param("endTime") String endTime); IfsOrderVO selectOrderInfoById(@Param("id") Integer id); } inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsProductMapper.java
@@ -8,6 +8,7 @@ import com.ruoyi.inspect.dto.SampleProductRawAnalysisDto; import com.ruoyi.inspect.pojo.InsProduct; import com.ruoyi.inspect.pojo.InsProductDeviationWarningDetail; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -19,6 +20,7 @@ * @createDate 2024-03-08 09:45:03 * @Entity com.yuanchu.mom.pojo.InsProduct */ @Mapper public interface InsProductMapper extends BaseMapper<InsProduct> { int selectOrderManDay(@Param("orderId") Integer orderId); inspect-server/src/main/java/com/ruoyi/inspect/mapper/InsSampleUserMapper.java
@@ -2,6 +2,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.inspect.pojo.InsSampleUser; import com.ruoyi.inspect.vo.InsSampleUserVO; import org.apache.ibatis.annotations.Param; /** * @author Administrator @@ -11,6 +13,7 @@ */ public interface InsSampleUserMapper extends BaseMapper<InsSampleUser> { InsSampleUserVO selectUserNameByOrderId(@Param("orderId") Integer orderId); } inspect-server/src/main/java/com/ruoyi/inspect/pojo/IfsPartPropsRecord.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,67 @@ package com.ruoyi.inspect.pojo; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; /** * ifs订åé¶ä»¶å±æ§è®°å½è¡¨ * @TableName ifs_part_props_record */ @TableName(value ="ifs_part_props_record") @Data public class IfsPartPropsRecord implements Serializable { /** * 主é®id */ @TableId(type = IdType.AUTO) private Long id; /** * ifs订åid */ private Long ifsInventoryId; /** * è½½å ·ç¼å· */ private String drumNo; /** * èµ·å§ç±³æ */ private BigDecimal startMeterMark; /** * æªæ¢ç±³æ */ private BigDecimal endMeterMark; /** * ç»ç¼é¢è² */ private String insulationColor; /** * 夿¤é¢è² */ private String outerColor; /** * å°åä¿¡æ¯ */ private String letteringInfo; /** * ifsé¶ä»¶å±æ§æ´æ°æ è¯ */ private Boolean partPropsFlag; @TableField(exist = false) private static final long serialVersionUID = 1L; } inspect-server/src/main/java/com/ruoyi/inspect/service/IfsOrderInspectionService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,20 @@ package com.ruoyi.inspect.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto; import org.springframework.stereotype.Component; @Component public interface IfsOrderInspectionService { /** * æ¥è¯¢å·²æ£éª * @param page * @param ifsInventoryQuantityDto * @return */ IPage<IfsInventoryQuantitySupplierDto> getIfsByOver(Page<IfsInventoryQuantitySupplierDto> page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto); } inspect-server/src/main/java/com/ruoyi/inspect/service/IfsPartPropsRecordService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,17 @@ package com.ruoyi.inspect.service; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.inspect.dto.IfsPartPropsRecordDTO; import com.ruoyi.inspect.pojo.IfsPartPropsRecord; /** * @author 27233 * @description é对表ãifs_part_props_record(ifs订åé¶ä»¶å±æ§è®°å½è¡¨)ãçæ°æ®åºæä½Service * @createDate 2025-10-23 15:00:34 */ public interface IfsPartPropsRecordService extends IService<IfsPartPropsRecord> { boolean saveOrUpdateProps(IfsPartPropsRecordDTO ifsPartPropsRecord); IfsPartPropsRecord getOneByIfsId(Long ifsId); } inspect-server/src/main/java/com/ruoyi/inspect/service/OutsourcingFinishProductInspectionService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,38 @@ package com.ruoyi.inspect.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.basic.dto.IfsInventoryQuantityDto; import com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto; import com.ruoyi.basic.pojo.IfsInventoryQuantity; import com.ruoyi.basic.vo.IfsInventoryQuantityVO; import org.springframework.stereotype.Component; @Component public interface OutsourcingFinishProductInspectionService { /** * æ¥æ£æ¥è¯¢ * @param page * @param ifsInventoryQuantity * @return */ IPage<IfsInventoryQuantityVO> getWarehouseSubmit(Page page, IfsInventoryQuantity ifsInventoryQuantity); /** * æ¥è¯¢å·²æ£éª * @param page * @param ifsInventoryQuantityDto * @return */ IPage<IfsInventoryQuantitySupplierDto> getIfsByOver(Page<IfsInventoryQuantitySupplierDto> page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto); /** * æ¥è¯¢æ£éªå¼ * @param page * @param ifsInventoryQuantityDto * @return */ IPage<IfsInventoryQuantityDto> getIfsByStateOne(IPage<IfsInventoryQuantityDto> page, IfsInventoryQuantityDto ifsInventoryQuantityDto); } inspect-server/src/main/java/com/ruoyi/inspect/service/RawMaterialOrderService.java
@@ -43,7 +43,7 @@ */ IPage<IfsInventoryQuantityDto> getIfsByStateOne(IPage<IfsInventoryQuantityDto> page, IfsInventoryQuantityDto ifsInventoryQuantityDto); int inspectionReport(List<Long> ids); int inspectionReport(List<Long> ids,String orderType); int revokeInspectionReport(Long id); @@ -156,4 +156,6 @@ Result importSplitOrderData(MultipartFile file, Long ifsId, HttpServletRequest request); boolean confirmSplitOrder(OrderSplitDTO orderSplitDTO); Long getOrderCountByIfsId(Long ifsId); } inspect-server/src/main/java/com/ruoyi/inspect/service/impl/IfsOrderInspectionServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,35 @@ package com.ruoyi.inspect.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto; import com.ruoyi.basic.mapper.StandardTreeMapper; import com.ruoyi.common.enums.OrderType; import com.ruoyi.common.utils.QueryWrappers; import com.ruoyi.inspect.service.IfsOrderInspectionService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * éå®è®¢åæ¥æ£service */ @Slf4j @Service public class IfsOrderInspectionServiceImpl implements IfsOrderInspectionService { @Autowired private StandardTreeMapper standardTreeMapper; @Override public IPage<IfsInventoryQuantitySupplierDto> getIfsByOver(Page<IfsInventoryQuantitySupplierDto> page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto) { // todo: åªçæ String beginDeclareDate = ifsInventoryQuantityDto.getBeginDeclareDate(); String endDeclareDate = ifsInventoryQuantityDto.getEndDeclareDate(); ifsInventoryQuantityDto.setBeginDeclareDate(null); ifsInventoryQuantityDto.setEndDeclareDate(null); IPage<IfsInventoryQuantitySupplierDto> ifsByOver = standardTreeMapper.getIfsByOver(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate); ifsByOver.getRecords().forEach(r->r.setOrderTypeName(OrderType.getLabelByValue(r.getOrderType()))); return ifsByOver; } } inspect-server/src/main/java/com/ruoyi/inspect/service/impl/IfsPartPropsRecordServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,122 @@ package com.ruoyi.inspect.service.impl; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.basic.mapper.IfsInventoryQuantityMapper; import com.ruoyi.basic.pojo.IfsInventoryQuantity; import com.ruoyi.common.core.domain.Result; import com.ruoyi.common.enums.OrderType; import com.ruoyi.common.utils.api.IfsApiUtils; import com.ruoyi.inspect.dto.IfsPartPropsRecordDTO; import com.ruoyi.inspect.mapper.IfsPartPropsRecordMapper; import com.ruoyi.inspect.mapper.IfsSplitOrderRecordMapper; import com.ruoyi.inspect.pojo.IfsPartPropsRecord; import com.ruoyi.inspect.pojo.IfsSplitOrderRecord; import com.ruoyi.inspect.service.IfsPartPropsRecordService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; /** * @author 27233 * @description é对表ãifs_part_props_record(ifs订åé¶ä»¶å±æ§è®°å½è¡¨)ãçæ°æ®åºæä½Serviceå®ç° * @createDate 2025-10-23 15:00:34 */ @Slf4j @Service public class IfsPartPropsRecordServiceImpl extends ServiceImpl<IfsPartPropsRecordMapper, IfsPartPropsRecord> implements IfsPartPropsRecordService{ @Autowired private IfsApiUtils ifsApiUtils; @Autowired private IfsInventoryQuantityMapper ifsInventoryQuantityMapper; @Autowired private IfsSplitOrderRecordMapper ifsSplitOrderRecordMapper; @Value("${ifs.contract}") public String contract; @Override @Transactional(rollbackFor = Exception.class) public boolean saveOrUpdateProps(IfsPartPropsRecordDTO ifsPartPropsRecord) { if(Objects.isNull(ifsPartPropsRecord)){ throw new RuntimeException("åæ°ä¸è½ä¸ºç©º"); } //æ¥è¯¢æ¯å¦å·²æåæ¹æ¬¡åé¶ä»¶å·çæ¹æ¬¡å±æ§ï¼æ²¡æææ´æ° Long count = baseMapper.selectCountByPartNoAndLotBatchNo(ifsPartPropsRecord.getPartNo(),ifsPartPropsRecord.getLotBatchNo()); if(count==0){ //å¤ææ¯æ°å¢è¿æ¯æ´æ° String actionType = Objects.isNull(ifsPartPropsRecord.getId())?"New":"Modify"; Map<String, Object> inAttrMap = new HashMap<>(); inAttrMap.put("RECORD_ID", UUID.randomUUID().toString()); inAttrMap.put("SYSCODE", "LIMS"); inAttrMap.put("SYSMODEL", "åºåç©ææ¹æ¬¡å±æ§ä¿®æ¹"); HashMap<String, Object> batchInfoMap = new HashMap<>(); batchInfoMap.put("CONTRACT",contract);//å batchInfoMap.put("PART_NO",ifsPartPropsRecord.getPartNo());//é¶ä»¶å· batchInfoMap.put("LOT_BATCH_NO",ifsPartPropsRecord.getLotBatchNo());//æ¹æ¬¡å· batchInfoMap.put("ATTR1",ifsPartPropsRecord.getDrumNo());//è½½å ·ç¼å· batchInfoMap.put("ATTR2",ifsPartPropsRecord.getStartMeterMark().toString());//èµ·å§ç±³æ batchInfoMap.put("ATTR3",ifsPartPropsRecord.getEndMeterMark().toString());//æªæ¢ç±³æ batchInfoMap.put("ATTR4", ifsPartPropsRecord.getOuterColor());//夿¤é¢è² batchInfoMap.put("ATTR5",ifsPartPropsRecord.getInsulationColor());//ç»ç¼é¢è² batchInfoMap.put("ATTR8",ifsPartPropsRecord.getLetteringInfo());//å°åä¿¡æ¯ batchInfoMap.put("ATTR23","车é´è®¢å");//å ¥åºæ¥æº batchInfoMap.put("ATTR24","0");//åå²é¢çæ°é batchInfoMap.put("ACTION_TYPE",actionType);//æä½ç±»å inAttrMap.put("BATCH_INFO", Collections.singletonList(batchInfoMap)); Result result = ifsApiUtils.importPartLotAttr(JSONUtil.toJsonStr(inAttrMap)); if(result.getCode()!=200){ throw new RuntimeException("åºåç©ææ¹æ¬¡å±æ§æ´æ°å¤±è´¥ï¼"+result.getMessage()); } } return this.saveOrUpdate(ifsPartPropsRecord); } @Override public IfsPartPropsRecord getOneByIfsId(Long ifsId) { //æ¥è¯¢ifs订åä¿¡æ¯ IfsInventoryQuantity ifsInventoryQuantity = ifsInventoryQuantityMapper.selectById(ifsId); if(Objects.isNull(ifsInventoryQuantity)){ throw new RuntimeException("æªæ¾å°å¯¹åºçIFS订åä¿¡æ¯"); } //夿æ¯å¦æ¯æå订å if(ifsInventoryQuantity.getIsSplitOrder().equals(1)&& StringUtils.equals(ifsInventoryQuantity.getOrderType(), OrderType.RAW.getValue())){ //æ¥è¯¢æåè®°å½ IfsSplitOrderRecord splitRecord = ifsSplitOrderRecordMapper.selectOne(Wrappers.<IfsSplitOrderRecord>lambdaQuery() .eq(IfsSplitOrderRecord::getOrderNo, ifsInventoryQuantity.getOrderNo()) .eq(IfsSplitOrderRecord::getPartNo, ifsInventoryQuantity.getPartNo()) .eq(IfsSplitOrderRecord::getReleaseNo, ifsInventoryQuantity.getReleaseNo()) .eq(IfsSplitOrderRecord::getLineNo, ifsInventoryQuantity.getLineNo()) .eq(IfsSplitOrderRecord::getReceiptNo, ifsInventoryQuantity.getReceiptNo()) .eq(IfsSplitOrderRecord::getLotBatchNo, ifsInventoryQuantity.getUpdateBatchNo()) .eq(IfsSplitOrderRecord::getOrderNo, ifsInventoryQuantity.getOrderNo()) ); if(Objects.isNull(splitRecord)){ throw new RuntimeException("æªæ¾å°é¶ä»¶çæåä¿¡æ¯"); } IfsPartPropsRecord ifsPartPropsRecord = new IfsPartPropsRecord(); ifsPartPropsRecord.setDrumNo(splitRecord.getDrumNo()); ifsPartPropsRecord.setLetteringInfo(splitRecord.getLetteringInfo()); ifsPartPropsRecord.setInsulationColor(splitRecord.getInsulationColor()); ifsPartPropsRecord.setOuterColor(splitRecord.getOuterColor()); ifsPartPropsRecord.setDrumNo(splitRecord.getDrumNo()); ifsPartPropsRecord.setDrumNo(splitRecord.getDrumNo()); return ifsPartPropsRecord; } return this.getOne(Wrappers.<IfsPartPropsRecord>lambdaQuery().eq(IfsPartPropsRecord::getIfsInventoryId,ifsId).last("limit 1")); } } inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
@@ -2,6 +2,7 @@ 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.util.ObjectUtil; @@ -11,6 +12,7 @@ import com.alibaba.fastjson.JSONObject; import com.aspose.words.License; import com.aspose.words.SaveFormat; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; @@ -36,6 +38,7 @@ import com.ruoyi.common.core.domain.entity.Custom; import com.ruoyi.common.core.domain.entity.InformationNotification; import com.ruoyi.common.core.domain.entity.User; import com.ruoyi.common.enums.OrderType; import com.ruoyi.common.utils.*; import com.ruoyi.framework.exception.ErrorException; import com.ruoyi.inspect.dto.*; @@ -45,13 +48,10 @@ import com.ruoyi.inspect.util.HackLoopTableRenderPolicy; import com.ruoyi.inspect.vo.InsOrderPlanTaskSwitchVo; import com.ruoyi.inspect.vo.InsOrderPlanVO; import com.ruoyi.inspect.vo.InsSampleUserVO; import com.ruoyi.performance.mapper.AuxiliaryOutputWorkingHoursMapper; import com.ruoyi.performance.mapper.PerformanceShiftMapper; import com.ruoyi.performance.mapper.ShiftTimeMapper; import com.ruoyi.performance.pojo.AuxiliaryOutputWorkingHours; import com.ruoyi.performance.pojo.AuxiliaryOutputWorkingHoursTemporary; import com.ruoyi.performance.service.AuxiliaryOutputWorkingHoursService; import com.ruoyi.performance.service.AuxiliaryOutputWorkingHoursTemporaryService; import com.ruoyi.system.mapper.CustomMapper; import com.ruoyi.system.mapper.UserMapper; import com.ruoyi.system.service.ISysDictTypeService; @@ -74,9 +74,7 @@ import java.nio.file.Paths; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.format.DateTimeFormatter; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; @@ -131,6 +129,8 @@ @Resource private IfsInventoryQuantityMapper ifsInventoryQuantityMapper; @Resource private IfsPartPropsRecordMapper ifsPartPropsRecordMapper; @Resource private InsReportService insReportService; @Resource private InsUnqualifiedRetestProductMapper insUnqualifiedRetestProductMapper; @@ -167,9 +167,7 @@ public IPage<InsOrderPlanVO> selectInsOrderPlanList(Page page, InsOrderPlanDTO insOrderPlanDTO) { // todo: ä» çèªå·±æè å®éªå®¤ //è·åå½å人æå±å®éªå®¤id String laboratory = null; String userName = null; Integer userId = null; if (ObjectUtil.isNotEmpty(insOrderPlanDTO.getUserId())) { @@ -1637,6 +1635,96 @@ /***************************************************** å°æ¥å ***************************************************************************/ /** * è®¾ç½®è¡¨æ ¼æ ·å¼ * @param max æ è¯æå¤§ä¸ªæ° * @return */ private TableStyle setTableStyle(int max){ //è®¾ç½®æ ·å¼ TableStyle tableStyle = new TableStyle(); if(max<=5){ for (int i = 1; i <= max; i++) { // æ ¹æ®æ£éªç»æä¸ªæ°ä¿®æ¹é¿åº¦ switch (i) { case 1: tableStyle.setColWidths(new int[]{650, 2900, 850, 2300, 2100, 1200}); break; case 2: tableStyle.setColWidths(new int[]{650, 2700, 850, 2200, 1200, 1200, 1200}); break; case 3: tableStyle.setColWidths(new int[]{650, 2700, 850, 1600, 1000, 1000, 1000, 1200}); break; case 4: tableStyle.setColWidths(new int[]{650, 2400, 850, 1500, 850, 850, 850, 850, 1200}); break; case 5: tableStyle.setColWidths(new int[]{650, 2200, 850, 1350, 770, 770, 770, 770, 770, 1100}); break; } } } tableStyle.setWidth("10000"); tableStyle.setAlign(TableRowAlign.CENTER); BorderStyle borderStyle = new BorderStyle(); borderStyle.setColor("000000"); borderStyle.setType(XWPFTable.XWPFBorderType.SINGLE); borderStyle.setSize(4); tableStyle.setLeftBorder(borderStyle); tableStyle.setRightBorder(borderStyle); tableStyle.setInsideHBorder(borderStyle); // 设置水平å è¾¹æ¡ tableStyle.setInsideVBorder(borderStyle); return tableStyle; } /** * å¤çæçµç¼é¢è²æ è¯çæ£æµé¡¹ * @param cableTags çµç¼é¢è²æ è¯ * @param collect æ£æµé¡¹å表 * @param startIndex èµ·å§ä¸æ * @param endIndex ç»æä¸æ * @return */ private List<SampleProductExportDto> transformSampleProduct(List<String> cableTags,Map<String, List<SampleProductExportDto>> collect,int startIndex,int endIndex){ List<SampleProductExportDto> sampleProductExportDtos = new ArrayList<>(); for (String s : collect.keySet()) { List<String> lastValueList = new ArrayList<>(); SampleProductExportDto dto = new SampleProductExportDto(); BeanUtil.copyProperties(collect.get(s).get(0),dto); Set<String> tellSet = new HashSet<>(); for (int i = startIndex; i < endIndex; i++) { String cableTag = cableTags.get(i); for (SampleProductExportDto sDto : collect.get(s)) { tellSet.add(sDto.getTell()); if(sDto.getCableTag().equals(cableTag)){ lastValueList.add(sDto.getLastValue()); } } } //åå²çµç¼é 置项 dto.setTell(String.join("\n",tellSet)); dto.setLastValueList(lastValueList); sampleProductExportDtos.add(dto); } return sampleProductExportDtos; } /** * æ£æµé¡¹æåº * @param sourceMap * @param targetMap */ private void sortSampleProduct(Map<String, List<SampleProductExportDto>> sourceMap,Map<String, List<SampleProductExportDto>> targetMap){ List<Map.Entry<String, List<SampleProductExportDto>>> entries = new ArrayList<>(sourceMap.entrySet()); entries.sort(Comparator.comparingInt(o -> (o.getValue().get(0).getSort() == null ? 0 : o.getValue().get(0).getSort()))); for (Map.Entry<String, List<SampleProductExportDto>> entry : entries) { targetMap.put(entry.getKey(), entry.getValue()); } } /** * å°æ¥åçæ * @param orderId * @param insOrder @@ -1654,11 +1742,17 @@ enterFactoryReport.setSample(insOrder.getSample()); // è·åifsæ°æ® IfsInventoryQuantity ifsInventoryQuantity = ifsInventoryQuantityMapper.selectById(insOrder.getIfsInventoryId()); //æ¥è¯¢é¶ä»¶å±æ§ IfsPartPropsRecord ifsPartPropsRecord = ifsPartPropsRecordMapper.selectOne(Wrappers.<IfsPartPropsRecord>lambdaQuery() .eq(IfsPartPropsRecord::getIfsInventoryId, ifsInventoryQuantity.getId())); if(Objects.nonNull(ifsPartPropsRecord)){ enterFactoryReport.setOuterColor(ifsPartPropsRecord.getOuterColor()); } enterFactoryReport.setQtyArrived(ifsInventoryQuantity.getQtyArrived() == null ? "" : ifsInventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + ifsInventoryQuantity.getBuyUnitMeas()); enterFactoryReport.setQuantity(insOrder.getTestQuantity()); enterFactoryReport.setPartDesc(insOrder.getPartDetail()); enterFactoryReport.setSupplierName("**********"); enterFactoryReport.setSupplierName(ifsInventoryQuantity.getSupplierName()); enterFactoryReport.setLotBatchNo(ifsInventoryQuantity.getUpdateBatchNo()); // æ£æµä¾æ® @@ -1676,6 +1770,7 @@ List<RowRenderData> rows = new ArrayList<>(); List<TextRenderData> text = new ArrayList<>(); RowRenderData rowRenderData = null; List<Map<String,Object>> cableTagEnclosureTables = new ArrayList<>(); // æ¥è¯¢æ£éªå 容 List<SampleProductExportDto> sampleProductDto2s = insOrderMapper.selectSampleBySampleId(insSamples.stream() @@ -1686,21 +1781,167 @@ List<SampleProductExportDto> sampleList = new ArrayList<>(); Integer max = insSamples.stream().mapToInt(InsSample::getQuantity).sum(); TableRenderData tableRenderData = new TableRenderData(); String templateName; if(StringUtils.equals(OrderType.WG.getValue(),ifsInventoryQuantity.getOrderType())){ //è¿æ»¤ä¸å¤å®çæ£æµé¡¹ List<SampleProductExportDto> filterItems = sampleProductDto2s.stream().filter(f -> f.getInsResult() != 3).collect(Collectors.toList()); int maxCableTag = 5;//åä¸ªè¡¨æ ¼ï¼çµç¼é¢è²æ è¯æå¤§ä¸ªæ° templateName = "/static/small-wg-report-template.docx"; //æ¥è¯¢æ£éªåæ¶æ¯ InsSampleUserVO insSampleUser = insSampleUserMapper.selectUserNameByOrderId(orderId); if(Objects.nonNull(insSampleUser)){ enterFactoryReport.setPartDesc(insSampleUser.getModel()); enterFactoryReport.setInspector(insSampleUser.getInspector()); enterFactoryReport.setInspectDate(insSampleUser.getInspectDate()); } // 转æMpaè¿è¡æåº Map<String, List<SampleProductExportDto>> sortedMap = sampleProductDto2s.stream() .filter(sampleProductDto2 -> StringUtils.isNotBlank(sampleProductDto2.getInspectionItem())) .collect(Collectors.groupingBy(SampleProductExportDto::getInspectionItem)); List<Map.Entry<String, List<SampleProductExportDto>>> entries = new ArrayList<>(sortedMap.entrySet()); entries.sort((o1, o2) -> (o1.getValue().get(0).getSort() == null ? 0 : o1.getValue().get(0).getSort()) - (o2.getValue().get(0).getSort() == null ? 0 : o2.getValue().get(0).getSort())); // å建ä¸ä¸ª LinkedHashMap æ¥ä¿ææå ¥é¡ºåº Map<String, List<SampleProductExportDto>> item = new LinkedHashMap<>(); for (Map.Entry<String, List<SampleProductExportDto>> entry : entries) { item.put(entry.getKey(), entry.getValue()); Map<String, List<SampleProductExportDto>> totalItem = new LinkedHashMap<>();//æ£æµé¡¹å表 Map<String, List<SampleProductExportDto>> cableTagItem = new LinkedHashMap<>();//çµç¼é ç½®æ£æµé¡¹ Map<String, List<SampleProductExportDto>> cableTagEnclosureItem = new LinkedHashMap<>();//çµç¼é ç½®æ£æµé¡¹éä»¶ AtomicInteger finalIndex = new AtomicInteger(1); List<String> cableTags = insOrderMapper.selectSampleCableTag(insSample.getId()); max = Math.max(cableTags.size(),1); //å¤ççµç¼é ç½®æ£æµé¡¹ Map<String, List<SampleProductExportDto>> tempMap = new HashMap<>(); Map<String, List<SampleProductExportDto>> tempMap2 = new HashMap<>(); Map<String, List<SampleProductExportDto>> listMap2 = filterItems.stream() .filter(f -> StringUtils.isNotBlank(f.getCableTag()) && StringUtils.isNotBlank(f.getInspectionItem())) .collect(Collectors.groupingBy(SampleProductExportDto::getInspectionItem)); for (String key : listMap2.keySet()) { List<SampleProductExportDto> sampleProductExportDtos; List<SampleProductExportDto> sampleProductExportDtos2; //å¤ççµç¼é 置项 Map<String, List<SampleProductExportDto>> collect = listMap2.get(key).stream().collect(Collectors.groupingBy(SampleProductExportDto::getInspectionItemSubclass)); if(cableTags.size()>maxCableTag){ sampleProductExportDtos = transformSampleProduct(cableTags,collect,0,maxCableTag); sampleProductExportDtos2 = transformSampleProduct(cableTags,collect,maxCableTag,cableTags.size()); tempMap2.put(key,sampleProductExportDtos2); }else{ sampleProductExportDtos = transformSampleProduct(cableTags,collect,0,cableTags.size()); } cableTagItem.put(key,sampleProductExportDtos); } //å¤çéçµç¼é ç½®æ£æµé¡¹ Map<String, List<SampleProductExportDto>> listMap = filterItems.stream() .filter(f -> StringUtils.isBlank(f.getCableTag()) && StringUtils.isNotBlank(f.getInspectionItem())) .collect(Collectors.groupingBy(s->s.getInspectionItem()+"&")); //åå¹¶æ£æµé¡¹å表 tempMap.putAll(cableTagItem); tempMap.putAll(listMap); sortSampleProduct(tempMap,totalItem); int tagNum = Math.min(max,maxCableTag); List<String> tagList = cableTags.isEmpty()?new ArrayList<>():cableTags.subList(0,tagNum); handlerSampleItems(OrderType.WG.getValue(),totalItem,finalIndex,sampleList,tagNum,text,rows,rowRenderData,resultCh,tagList,true); if(CollectionUtil.isNotEmpty(tempMap2)){ sortSampleProduct(tempMap2,cableTagEnclosureItem); //çæéä»¶çµç¼è¡¨æ ¼ TableRenderData tableRenderData2 = new TableRenderData(); List<String> newCableTags = cableTags.subList(maxCableTag,cableTags.size()); AtomicInteger finalIndex2 = new AtomicInteger(1); List<TextRenderData> newText = new ArrayList<TextRenderData>(); List<RowRenderData> newRows = new ArrayList<>(); RowRenderData newRowRenderData = null; handlerSampleItems(OrderType.WG.getValue(),cableTagEnclosureItem,finalIndex2, new ArrayList<>(),newCableTags.size(),newText,newRows,newRowRenderData,resultCh,newCableTags,true); tableRenderData2.setRows(newRows); tableRenderData2.setTableStyle(setTableStyle(newCableTags.size())); HashMap<String, Object> tableMap = new HashMap<>(); tableMap.put("enclosureTable",tableRenderData2); tableMap.put("resultCh", resultCh); tableMap.put("writeUrl", null); tableMap.put("examineUrl", null); tableMap.put("ratifyUrl", null); tableMap.put("writeDateUrl", null); tableMap.put("examineDateUrl", null); tableMap.put("ratifyDateUrl", null); tableMap.put("seal1", null); cableTagEnclosureTables.add(tableMap); } tableRenderData.setRows(rows); tableRenderData.setTableStyle(setTableStyle(tagNum)); if (!resultCh.get().isEmpty()) { resultCh.set("ç»æ£éªï¼" + resultCh.get() + "ææ£é¡¹ç®ä¸åæ ¼ï¼å ¶ä½ææ£é¡¹ç®ååæ ¼ãï¼çç« ææï¼"); } else { resultCh.set("æ¬äº§å符åç¸å ³æ åè¦æ±ï¼ç»æ£éªåæ ¼åäºåºåï¼çç« ææï¼"); } }else{ templateName = "/static/small-report-template.docx"; // 转æMpaè¿è¡æåº Map<String, List<SampleProductExportDto>> sortedMap = sampleProductDto2s.stream() .filter(sampleProductDto2 -> StringUtils.isNotBlank(sampleProductDto2.getInspectionItem())) .collect(Collectors.groupingBy(SampleProductExportDto::getInspectionItem)); // // å建ä¸ä¸ª LinkedHashMap æ¥ä¿ææå ¥é¡ºåº Map<String, List<SampleProductExportDto>> item = new LinkedHashMap<>(); sortSampleProduct(sortedMap,item); AtomicInteger finalIndex = new AtomicInteger(1); handlerSampleItems(OrderType.RAW.getValue(), item,finalIndex,sampleList,max,text,rows,rowRenderData,resultCh,null,true); tableRenderData.setRows(rows); tableRenderData.setTableStyle(setTableStyle(max)); if (!resultCh.get().equals("")) { resultCh.set("ç»æ£éªï¼" + resultCh.get() + "ææ£é¡¹ç®ä¸åæ ¼ï¼å ¶ä½ææ£é¡¹ç®ååæ ¼ã"); } else { resultCh.set("ç»æ£éªæ¤æ¹" + enterFactoryReport.getSample() + "å项ç®åç¬¦åæ£éªè§èè¦æ±ã"); } } AtomicInteger finalIndex = new AtomicInteger(1); ConfigureBuilder builder = Configure.builder(); builder.useSpringEL(true); InputStream inputStream = this.getClass().getResourceAsStream(templateName); XWPFTemplate template = XWPFTemplate.compile(inputStream, builder.build()).render( new HashMap<String, Object>() {{ put("report", enterFactoryReport); put("standardMethod", standardMethod2.toString().equals("null") ? "" : standardMethod2); put("orderType", orderType); put("table", tableRenderData); put("enclosureTables", cableTagEnclosureTables.isEmpty()?null:cableTagEnclosureTables); put("resultCh", resultCh); put("writeUrl", null); put("examineUrl", null); put("ratifyUrl", null); put("writeDateUrl", null); put("examineDateUrl", null); put("ratifyDateUrl", null); put("seal1", null); }}); try { // ä¿®æ¹æ¢è¡ååå¹¶é®é¢ updaeMerge(template.getXWPFDocument(), true); String name = insReport.getCode().replace("/", "") + "-J.docx"; template.writeAndClose(Files.newOutputStream(Paths.get(wordUrl + "/" + name))); insReport.setUrl("/word/" + name); insReport.setIsPass(0); insReport.setWriteUserId(SecurityUtils.getUserId().intValue());//æäº¤äºº insReport.setWriteTime(LocalDateTime.now());//æäº¤æ¶é´ // æ¥è¯¢æ¥å, 夿ä¹åæ¯å¦æ·»å è¿, æ·»å è¿å é¤ insReportMapper.delete(Wrappers.<InsReport>lambdaQuery() .eq(InsReport::getInsOrderId, insOrder.getId())); insReportMapper.insert(insReport); inputStream.close(); } catch (IOException e) { throw new RuntimeException(e); } } /** * å¤çå¸¸è§æ£æµé¡¹ * @param item * @param finalIndex * @param sampleList * @param max * @param text * @param rows * @param rowRenderData * @param resultCh */ private static void handlerSampleItems(String orderType,Map<String, List<SampleProductExportDto>> item,AtomicInteger finalIndex,List<SampleProductExportDto> sampleList,Integer max,List<TextRenderData> text,List<RowRenderData> rows,RowRenderData rowRenderData,AtomicReference<String> resultCh,List<String> cableTagList,Boolean hasAddHead ){ item.forEach((s, sampleProductDtoInside) -> { // æ·»å æ£éªé¡¹ SampleProductExportDto dto2 = new SampleProductExportDto(); @@ -1713,19 +1954,23 @@ // å¤çéå Map<String, SampleProductExportDto> map = new LinkedHashMap<>(); for (SampleProductExportDto productDto2 : sampleProductDtoInside) { String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem(); String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem() + productDto2.getCableTag(); if (map.containsKey(productName)) { // 妿åç§°å·²ç»åå¨ï¼æ·»å lastValue å¼å° lastValueList å表 map.get(productName) .getLastValueList() .add(productDto2.getLastValue()); if(CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){ map.get(productName) .getLastValueList() .add(productDto2.getLastValue()); } map.get(productName) .getInsResultList() .add(productDto2.getInsResult()); } else { // 妿åç§°ä¸åå¨ï¼ç´æ¥æ¾å ¥ map productDto2.setLastValueList(new ArrayList<>()); // æ£éªå 容 productDto2.getLastValueList().add(productDto2.getLastValue()); if(CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){ productDto2.setLastValueList(new ArrayList<>()); // æ£éªå 容 productDto2.getLastValueList().add(productDto2.getLastValue()); } productDto2.setInsResultList(new ArrayList<>()); // ç»æ productDto2.getInsResultList().add(productDto2.getInsResult()); @@ -1754,19 +1999,23 @@ // å¤çéå Map<String, SampleProductExportDto> map = new LinkedHashMap<>(); for (SampleProductExportDto productDto2 : sampleProductDtoInside) { String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem() + productDto2.getInspectionItemSubclass(); String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem() + productDto2.getInspectionItemSubclass() + productDto2.getCableTag(); if (map.containsKey(productName)) { // 妿åç§°å·²ç»åå¨ï¼æ·»å lastValue å¼å° lastValueList å表 map.get(productName) .getLastValueList() .add(productDto2.getLastValue()); if(CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){ map.get(productName) .getLastValueList() .add(productDto2.getLastValue()); } map.get(productName) .getInsResultList() .add(productDto2.getInsResult()); } else { // 妿åç§°ä¸åå¨ï¼ç´æ¥æ¾å ¥ map productDto2.setLastValueList(new ArrayList<>()); // æ£éªå 容 productDto2.getLastValueList().add(productDto2.getLastValue()); if(CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){ productDto2.setLastValueList(new ArrayList<>()); // æ£éªå 容 productDto2.getLastValueList().add(productDto2.getLastValue()); } productDto2.setInsResultList(new ArrayList<>()); // ç»æ productDto2.getInsResultList().add(productDto2.getInsResult()); @@ -1784,8 +2033,9 @@ }); // æ·»å å°æ¥å表头 text = addSmallHead(text, max, rows); if(hasAddHead){ text = addSmallHead(text, max, rows,cableTagList); } // ä¸é´æ£æµå¼æ·»å for (int i = 0; i < sampleList.size(); i++) { @@ -1802,7 +2052,9 @@ // æ£éªé¡¹ç® TextRenderData middleRenderData2 = new TextRenderData(); middleRenderData2.setText(sample.getInspectionName()); String[] split = sample.getInspectionName().split("&"); String itemName = split.length>0?split[0]:sample.getInspectionName(); middleRenderData2.setText(itemName+"â"+itemName+i+"_"+finalIndex); Style middleStyle2 = new Style(); middleStyle2.setFontFamily("å®ä½"); middleStyle2.setColor("000000"); @@ -1889,7 +2141,7 @@ TextRenderData middleRenderData6 = new TextRenderData(); middleRenderData6.setText((StringUtils.isNotEmpty(sample.getLastValue()) ? sample.getLastValue() : "") + "â" + (7 + i)); + "â" + (finalIndex.get() +"_"+ i)); Style middleStyle6 = new Style(); middleStyle6.setFontFamily("å®ä½"); middleStyle6.setColor("000000"); @@ -1927,7 +2179,7 @@ String type; if (count.equals(0)) { // æ·»å ä¸åæ ¼æè¿° String item1 = (max == 1 ? "" : "第" + Integer.toString(index) + "次") String item1 = (max == 1 ? "" : "第" + index + "次") + sample.getInspectionItem() + (StringUtils.isBlank(sample.getInspectionItemSubclass()) ? "" : "" + sample.getInspectionItemSubclass()); if (resultCh.get().equals("")) { @@ -1967,95 +2219,16 @@ text = new ArrayList<>(); } TableRenderData tableRenderData = new TableRenderData(); tableRenderData.setRows(rows); //è®¾ç½®æ ·å¼ TableStyle tableStyle = new TableStyle(); for (int i = 1; i <= max; i++) { // æ ¹æ®ååé£ç»æä¸ªæ°ä¿®æ¹é¿åº¦ switch (i) { case 1: tableStyle.setColWidths(new int[]{650, 2900, 850, 2300, 2100, 1200}); break; case 2: tableStyle.setColWidths(new int[]{650, 2700, 850, 2200, 1200, 1200, 1200}); break; case 3: tableStyle.setColWidths(new int[]{650, 2700, 850, 1600, 1000, 1000, 1000, 1200}); break; case 4: tableStyle.setColWidths(new int[]{650, 2400, 850, 1500, 850, 850, 850, 850, 1200}); break; case 5: tableStyle.setColWidths(new int[]{650, 2200, 850, 1350, 750, 750, 750, 750, 750, 1200}); break; } } tableStyle.setWidth("10000"); tableStyle.setAlign(TableRowAlign.CENTER); BorderStyle borderStyle = new BorderStyle(); borderStyle.setColor("000000"); borderStyle.setType(XWPFTable.XWPFBorderType.SINGLE); borderStyle.setSize(4); tableStyle.setLeftBorder(borderStyle); tableStyle.setRightBorder(borderStyle); tableStyle.setInsideHBorder(borderStyle); // 设置水平å è¾¹æ¡ tableStyle.setInsideVBorder(borderStyle); tableRenderData.setTableStyle(tableStyle); if (!resultCh.get().equals("")) { resultCh.set("ç»æ£éªï¼" + resultCh.get() + "ææ£é¡¹ç®ä¸åæ ¼ï¼å ¶ä½ææ£é¡¹ç®ååæ ¼ã"); } else { resultCh.set("ç»æ£éªæ¤æ¹" + enterFactoryReport.getSample() + "å项ç®åç¬¦åæ£éªè§èè¦æ±ã"); } ConfigureBuilder builder = Configure.builder(); builder.useSpringEL(true); InputStream inputStream = this.getClass().getResourceAsStream("/static/small-report-template.docx"); XWPFTemplate template = XWPFTemplate.compile(inputStream, builder.build()).render( new HashMap<String, Object>() {{ put("report", enterFactoryReport); put("standardMethod", standardMethod2.toString().equals("null") ? "" : standardMethod2); put("orderType", orderType); put("table", tableRenderData); put("resultCh", resultCh); put("writeUrl", null); put("examineUrl", null); put("ratifyUrl", null); put("writeDateUrl", null); put("examineDateUrl", null); put("ratifyDateUrl", null); put("seal1", null); }}); try { // ä¿®æ¹æ¢è¡ååå¹¶é®é¢ updaeMerge(template.getXWPFDocument(), true); String name = insReport.getCode().replace("/", "") + "-J.docx"; template.writeAndClose(Files.newOutputStream(Paths.get(wordUrl + "/" + name))); insReport.setUrl("/word/" + name); insReport.setIsPass(0); insReport.setWriteUserId(SecurityUtils.getUserId().intValue());//æäº¤äºº insReport.setWriteTime(LocalDateTime.now());//æäº¤æ¶é´ // æ¥è¯¢æ¥å, 夿ä¹åæ¯å¦æ·»å è¿, æ·»å è¿å é¤ insReportMapper.delete(Wrappers.<InsReport>lambdaQuery() .eq(InsReport::getInsOrderId, insOrder.getId())); insReportMapper.insert(insReport); inputStream.close(); } catch (IOException e) { throw new RuntimeException(e); } } /** * æ·»å å°å®è¡¨å¤´ * æ·»å å°æ¥å表头 * @param text * @param max * @param rows * @return */ private static List<TextRenderData> addSmallHead(List<TextRenderData> text, Integer max, List<RowRenderData> rows) { private static List<TextRenderData> addSmallHead(List<TextRenderData> text, Integer max, List<RowRenderData> rows,List<String> cableTagList) { RowRenderData rowRenderData; // // 头 TextRenderData headRenderData1 = new TextRenderData(); @@ -2113,7 +2286,7 @@ text = new ArrayList<>(); // 第äºè¡(å¯è½æ²¡æ) if (max > 1) { if (max > 1 && CollectionUtil.isEmpty(cableTagList)) { TextRenderData tagRenderData1 = new TextRenderData(); tagRenderData1.setText(""); Style tagStyle1 = new Style(); @@ -2170,7 +2343,62 @@ } //妿æçµç¼é¢è²ï¼çæé¢è²æ è¯è¡ if(CollectionUtil.isNotEmpty(cableTagList)){ TextRenderData tagRenderData1 = new TextRenderData(); tagRenderData1.setText(""); Style tagStyle1 = new Style(); tagStyle1.setFontFamily("å®ä½"); tagStyle1.setColor("000000"); tagRenderData1.setStyle(tagStyle1); text.add(tagRenderData1); TextRenderData tagRenderData2 = new TextRenderData(); tagRenderData2.setText("ç»ç¼çº¿è¯é¢è²åæ å¿"); Style tagStyle2 = new Style(); tagStyle2.setFontFamily("å®ä½"); tagStyle2.setColor("000000"); tagRenderData2.setStyle(tagStyle2); text.add(tagRenderData2); TextRenderData tagRenderData4 = new TextRenderData(); tagRenderData4.setText("/"); Style tagStyle4 = new Style(); tagStyle4.setFontFamily("å®ä½"); tagStyle4.setColor("000000"); tagRenderData4.setStyle(tagStyle4); text.add(tagRenderData4); TextRenderData tagRenderData5 = new TextRenderData(); tagRenderData5.setText("/"); Style tagStyle5 = new Style(); tagStyle5.setFontFamily("å®ä½"); tagStyle5.setColor("000000"); tagRenderData5.setStyle(tagStyle5); text.add(tagRenderData5); for (String cableTag : cableTagList) { TextRenderData tagRenderData6 = new TextRenderData(); tagRenderData6.setText(cableTag); Style tagStyle6 = new Style(); tagStyle6.setFontFamily("å®ä½"); tagStyle6.setColor("000000"); tagRenderData6.setStyle(tagStyle6); text.add(tagRenderData6); } TextRenderData tagRenderData7 = new TextRenderData(); tagRenderData7.setText("/"); Style tagStyle7 = new Style(); tagStyle7.setFontFamily("å®ä½"); tagStyle7.setColor("000000"); tagRenderData7.setStyle(tagStyle7); text.add(tagRenderData7); TextRenderData[] text4 = text.toArray(new TextRenderData[0]); rowRenderData = Rows.of(text4).center().rowAtleastHeight(1).create(); rows.add(rowRenderData); text = new ArrayList<>(); } return text; } inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderServiceImpl.java
@@ -26,6 +26,7 @@ import com.ruoyi.common.constant.InsOrderTypeConstants; import com.ruoyi.common.core.domain.Result; import com.ruoyi.common.core.domain.entity.User; import com.ruoyi.common.enums.OrderType; import com.ruoyi.common.numgen.NumberGenerator; import com.ruoyi.common.utils.LimsDateUtil; import com.ruoyi.common.utils.QueryWrappers; @@ -39,6 +40,7 @@ import com.ruoyi.inspect.service.InsOrderStateService; import com.ruoyi.inspect.service.InsProductService; import com.ruoyi.inspect.service.InsSampleService; import com.ruoyi.inspect.vo.IfsOrderVO; import com.ruoyi.inspect.vo.InsOrderPrintingVo; import com.ruoyi.system.mapper.UserMapper; import lombok.AllArgsConstructor; @@ -312,9 +314,9 @@ } } }); //æ¯å¦ä¸ºåææä¸å if (insOrder.getTypeSource() != null && insOrder.getTypeSource().equals(1)) { // åææä¸å: å§æäººå°±æ¯æ¥æ£äºº, ç产åä½å°±æ¯ä¾åºååä½ //åææä¸åæå¤è´æåä¸å if (Objects.nonNull(insOrder.getTypeSource())&&Objects.nonNull(insOrder.getIfsInventoryId())) { // å§æäººå°±æ¯æ¥æ£äºº, ç产åä½å°±æ¯ä¾åºååä½ IfsInventoryQuantity ifsInventoryQuantity = ifsInventoryQuantityMapper.selectById(insOrder.getIfsInventoryId()); Integer declareUserId = ifsInventoryQuantity.getDeclareUserId(); User user = userMapper.selectById(declareUserId); @@ -352,47 +354,51 @@ upInsOrderOfState(insOrder); // åé æ£éªäºº upInsOrder(insOrder.getId(), null, appointed != null ? appointed.toString() : null, SecurityUtils.getUserId().intValue(), "åææ"); String sonLaboratory = insOrder.getTypeSource().equals(1)?"åææ":"æåå®éªå®¤"; upInsOrder(insOrder.getId(), null, appointed != null ? appointed.toString() : null, SecurityUtils.getUserId().intValue(), sonLaboratory); // æ ¹æ®é¶ä»¶å·å¤ææ¯å¦æ¯è¾ æ boolean isRaw = false; StructureTestObject productObject = insOrderMapper.selectProductByPartNo(ifsInventoryQuantity.getPartNo()); // æ¥è¯¢äº§å if (productObject != null && StrUtil.isNotBlank(productObject.getObjectType()) && productObject.getObjectType().equals("1")) { isRaw = true; } else { // æ¥è¯¢å¯¹è±¡ StructureTestObject testObject = insOrderMapper.selectByPartNo(ifsInventoryQuantity.getPartNo()); if (testObject != null && StrUtil.isNotBlank(testObject.getObjectType()) && testObject.getObjectType().equals("1")) { //æ¯å¦ä¸ºåææä¸å if(insOrder.getTypeSource().equals(1)){ // æ ¹æ®é¶ä»¶å·å¤ææ¯å¦æ¯è¾ æ boolean isRaw = false; StructureTestObject productObject = insOrderMapper.selectProductByPartNo(ifsInventoryQuantity.getPartNo()); // æ¥è¯¢äº§å if (productObject != null && StrUtil.isNotBlank(productObject.getObjectType()) && productObject.getObjectType().equals("1")) { isRaw = true; } else { // æ¥è¯¢å¯¹è±¡ StructureTestObject testObject = insOrderMapper.selectByPartNo(ifsInventoryQuantity.getPartNo()); if (testObject != null && StrUtil.isNotBlank(testObject.getObjectType()) && testObject.getObjectType().equals("1")) { isRaw = true; } } } if (isRaw) { // è·åå½åå£åº¦çå¼å§æ¶é´åç»ææ¶é´ LocalDateTime now = LocalDateTime.now(); // è·åå½åæä»½ int month = now.getMonthValue(); // ç¡®å®å½åå£åº¦çå¼å§æä»½ int startMonth = (month - 1) / 3 * 3 + 1; // æé å£åº¦çå¼å§æ¶é´ LocalDateTime startOfQuarter = LocalDateTime.of(now.getYear(), Month.of(startMonth), 1, 0, 0); // 计ç®ä¸ä¸ä¸ªå£åº¦çå¼å§æ¶é´ LocalDateTime startOfNextQuarter = startOfQuarter.plusMonths(3); // 计ç®å½åå£åº¦çç»ææ¶é´ LocalDateTime endOfQuarter = startOfNextQuarter.minusSeconds(1); if (isRaw) { // è·åå½åå£åº¦çå¼å§æ¶é´åç»ææ¶é´ LocalDateTime now = LocalDateTime.now(); // è·åå½åæä»½ int month = now.getMonthValue(); // ç¡®å®å½åå£åº¦çå¼å§æä»½ int startMonth = (month - 1) / 3 * 3 + 1; // æé å£åº¦çå¼å§æ¶é´ LocalDateTime startOfQuarter = LocalDateTime.of(now.getYear(), Month.of(startMonth), 1, 0, 0); // 计ç®ä¸ä¸ä¸ªå£åº¦çå¼å§æ¶é´ LocalDateTime startOfNextQuarter = startOfQuarter.plusMonths(3); // 计ç®å½åå£åº¦çç»ææ¶é´ LocalDateTime endOfQuarter = startOfNextQuarter.minusSeconds(1); // æ ¹æ®ä¸åçè§æ ¼åå·å¤ææ¯å¦ä¸ºå£åº¦é¦æ¬¡åºç° Integer count = ifsInventoryQuantityMapper.selectIsFirst(insOrder.getPartDetail(), ifsInventoryQuantity.getSupplierName(), startOfNextQuarter, endOfQuarter); // æ ¹æ®ä¸åçè§æ ¼åå·å¤ææ¯å¦ä¸ºå£åº¦é¦æ¬¡åºç° Integer count = ifsInventoryQuantityMapper.selectIsFirst(insOrder.getPartDetail(), ifsInventoryQuantity.getSupplierName(), startOfNextQuarter, endOfQuarter); if(count == 0) { ifsInventoryQuantity.setIsFirst(1); ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate() .eq(IfsInventoryQuantity::getId, insOrder.getIfsInventoryId()) .set(IfsInventoryQuantity::getIsFirst, 1)); if (count == 0) { ifsInventoryQuantity.setIsFirst(1); ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate() .eq(IfsInventoryQuantity::getId, insOrder.getIfsInventoryId()) .set(IfsInventoryQuantity::getIsFirst, 1)); } } } } @@ -516,9 +522,10 @@ @Override public Map<String, Object> getInsOrderAndSample(Integer id, String laboratory) { Map<String, Object> map = new HashMap<>(); InsOrder insOrder = insOrderMapper.selectById(id); // InsOrder insOrder = insOrderMapper.selectById(id); IfsOrderVO ifsOrderVO = insOrderMapper.selectOrderInfoById(id); List<SampleProductDto> list = insSampleMapper.getInsOrderAndSample(id, laboratory); map.put("insOrder", insOrder); map.put("insOrder", ifsOrderVO); map.put("sampleProduct", list); //æ¥è¯¢ææè®°å½æ¨¡çå»é List<Map<Integer, Object>> list2 = insOrderMapper.selectReportModelByOrderId(id, laboratory); @@ -1207,9 +1214,12 @@ * TODO åç»éè¦è°ç¨IFSçæ¥å£ ç§»å ¥çåºä½å· toLocation */ // æ£éªåç§»åº if(one.getIsSplitOrder().equals(1)){ //å¦æè®¢åä¸ºåææçæå订åï¼åç§»å°å¤è´åºä½ toLocation = "W03"; //1301:åææåæ ¼åºï¼CP-02-001:æååº if(StringUtils.equals(inventoryQuantity.getOrderType(), OrderType.RAW.getValue())){ //å¦æè®¢åä¸ºåææçæå订åï¼åç§»å°å¤è´åææåºä½W03 toLocation = one.getIsSplitOrder().equals(1)?"W03":"1301"; }else if(StringUtils.equals(inventoryQuantity.getOrderType(), OrderType.WG.getValue())){ toLocation = "CP-02-001"; }else{ toLocation = "1301"; } inspect-server/src/main/java/com/ruoyi/inspect/service/impl/OutsourcingFinishProductInspectionServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,50 @@ package com.ruoyi.inspect.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.basic.dto.IfsInventoryQuantityDto; import com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto; import com.ruoyi.basic.mapper.StandardTreeMapper; import com.ruoyi.basic.pojo.IfsInventoryQuantity; import com.ruoyi.basic.vo.IfsInventoryQuantityVO; import com.ruoyi.common.enums.OrderType; import com.ruoyi.common.utils.QueryWrappers; import com.ruoyi.inspect.service.OutsourcingFinishProductInspectionService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * å¤è´æåæ£éªserviceImpl */ @Slf4j @Service public class OutsourcingFinishProductInspectionServiceImpl implements OutsourcingFinishProductInspectionService { @Autowired private StandardTreeMapper standardTreeMapper; @Override public IPage<IfsInventoryQuantityVO> getWarehouseSubmit(Page page, IfsInventoryQuantity ifsInventoryQuantity) { ifsInventoryQuantity.setOrderType(OrderType.WG.getValue()); return standardTreeMapper.selectIfsPage(page, QueryWrappers.queryWrappers(ifsInventoryQuantity)); } @Override public IPage<IfsInventoryQuantitySupplierDto> getIfsByOver(Page<IfsInventoryQuantitySupplierDto> page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto) { String beginDeclareDate = ifsInventoryQuantityDto.getBeginDeclareDate(); String endDeclareDate = ifsInventoryQuantityDto.getEndDeclareDate(); ifsInventoryQuantityDto.setBeginDeclareDate(null); ifsInventoryQuantityDto.setEndDeclareDate(null); ifsInventoryQuantityDto.setOrderType(OrderType.WG.getValue()); IPage<IfsInventoryQuantitySupplierDto> ifsByOver = standardTreeMapper.getIfsByOver(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate); ifsByOver.getRecords().forEach(r->r.setOrderTypeName(OrderType.getLabelByValue(r.getOrderType()))); return ifsByOver; } @Override public IPage<IfsInventoryQuantityDto> getIfsByStateOne(IPage<IfsInventoryQuantityDto> page, IfsInventoryQuantityDto ifsInventoryQuantityDto) { ifsInventoryQuantityDto.setOrderType(OrderType.WG.getValue()); return standardTreeMapper.getIfsByStateOne(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto)); } } inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java
@@ -20,21 +20,25 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.basic.dto.*; import com.ruoyi.basic.mapper.IfsInventoryQuantityMapper; import com.ruoyi.basic.mapper.StandardTreeMapper; import com.ruoyi.basic.pojo.IfsInventoryQuantity; import com.ruoyi.basic.vo.IfsInventoryQuantityVO; import com.ruoyi.common.config.WechatProperty; import com.ruoyi.common.constant.InsOrderTypeConstants; import com.ruoyi.common.core.domain.Result; import com.ruoyi.common.core.domain.entity.User; import com.ruoyi.common.config.WechatProperty; import com.ruoyi.common.enums.OrderType; import com.ruoyi.common.numgen.NumberGenerator; import com.ruoyi.common.utils.LimsDateUtil; 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.framework.exception.ErrorException; 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; @@ -48,9 +52,6 @@ import com.ruoyi.inspect.service.InsOrderService; import com.ruoyi.inspect.service.InsReportService; import com.ruoyi.inspect.service.RawMaterialOrderService; import com.ruoyi.common.numgen.NumberGenerator; import com.ruoyi.framework.exception.ErrorException; import com.ruoyi.basic.vo.IfsInventoryQuantityVO; import com.ruoyi.performance.mapper.AuxiliaryOutputWorkingHoursMapper; import com.ruoyi.performance.pojo.AuxiliaryOutputWorkingHours; import com.ruoyi.system.mapper.UserMapper; @@ -148,6 +149,9 @@ @Override public IPage<IfsInventoryQuantityVO> getWarehouseSubmit(IPage<IfsInventoryQuantity> page, IfsInventoryQuantity ifsInventoryQuantity) { if(ifsInventoryQuantity.getIsInspect().equals(1)){ ifsInventoryQuantity.setOrderType(OrderType.RAW.getValue()); } IPage<IfsInventoryQuantityVO> ifsInventoryQuantityIPage = standardTreeMapper.selectIfsPage(page, QueryWrappers.queryWrappers(ifsInventoryQuantity)); ifsInventoryQuantityIPage.getRecords().forEach(f->{ Long count = ifsInventoryQuantityMapper.selectCount(Wrappers.<IfsInventoryQuantity>lambdaQuery() @@ -160,6 +164,7 @@ @Override public IPage<IfsInventoryQuantityDto> getIfsByStateOne(IPage<IfsInventoryQuantityDto> page, IfsInventoryQuantityDto ifsInventoryQuantityDto) { ifsInventoryQuantityDto.setOrderType(OrderType.RAW.getValue()); return standardTreeMapper.getIfsByStateOne(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto)); } @@ -170,13 +175,14 @@ * @return */ @Override public int inspectionReport(List<Long> ids) { public int inspectionReport(List<Long> ids,String orderType) { Integer userId = SecurityUtils.getUserId().intValue(); ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate() .in(IfsInventoryQuantity::getId, ids) .set(IfsInventoryQuantity::getDeclareUser, userMapper.selectById(userId).getName()) .set(IfsInventoryQuantity::getDeclareUserId, userId) .set(IfsInventoryQuantity::getIsInspect, 1) .set(IfsInventoryQuantity::getOrderType,orderType) .set(IfsInventoryQuantity::getDeclareDate, LocalDateTime.now()) ); threadPoolTaskExecutor.execute(() -> { @@ -230,6 +236,13 @@ return ifsInventoryQuantityMapper.printLabel(ids); } @Override @Transactional(rollbackFor = Exception.class,isolation = Isolation.READ_COMMITTED) public Long getOrderCountByIfsId(Long ifsId) { return insOrderMapper.selectCount(Wrappers.<InsOrder>lambdaQuery().eq(InsOrder::getIfsInventoryId,ifsId).ne(InsOrder::getState,-1)); } /** * æ¥æ£ * @param ifsInventoryQuantity @@ -238,6 +251,12 @@ @Override public int inspectionReportOne(IfsInventoryQuantity ifsInventoryQuantity) { Integer userId = SecurityUtils.getUserId().intValue(); boolean validateValue = OrderType.validateValue(ifsInventoryQuantity.getOrderType()); if(!validateValue){ throw new ErrorException("æ¥æ£å¤±è´¥ï¼éæ³çéå®è®¢ååç±»æä¸¾"); } //æ¹æ¬¡å·åæ¯è½¬å¤§å ifsInventoryQuantity.setUpdateBatchNo(ifsInventoryQuantity.getUpdateBatchNo().toUpperCase(Locale.ROOT)); ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate() .eq(IfsInventoryQuantity::getId, ifsInventoryQuantity.getId()) .set(IfsInventoryQuantity::getDeclareUser, userMapper.selectById(userId).getName()) @@ -245,6 +264,7 @@ .set(IfsInventoryQuantity::getIsInspect, 1) .set(IfsInventoryQuantity::getDeclareDate, LocalDateTime.now()) .set(IfsInventoryQuantity::getUpdateBatchNo, ifsInventoryQuantity.getUpdateBatchNo()) .set(IfsInventoryQuantity::getOrderType,ifsInventoryQuantity.getOrderType()) ); threadPoolTaskExecutor.execute(() -> { @@ -415,8 +435,9 @@ String endDeclareDate = ifsInventoryQuantityDto.getEndDeclareDate(); ifsInventoryQuantityDto.setBeginDeclareDate(null); ifsInventoryQuantityDto.setEndDeclareDate(null); ifsInventoryQuantityDto.setOrderType(OrderType.RAW.getValue()); IPage<IfsInventoryQuantitySupplierDto> ifsByOver = standardTreeMapper.getIfsByOver(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate); ifsByOver.getRecords().forEach(r->r.setOrderTypeName(OrderType.getLabelByValue(r.getOrderType()))); return ifsByOver; } @@ -533,6 +554,9 @@ ifsInventoryQuantity.setIsSource(0); ifsInventoryQuantity.setState(0); ifsInventoryQuantity.setIsFinish(0); if(!OrderType.validateValue(ifsInventoryQuantity.getOrderType())){ throw new ErrorException("æ°å¢æ¥æ£ä¿¡æ¯å¤±è´¥ï¼éæ³çéå®è®¢ååç±»æä¸¾"); } ifsInventoryQuantityMapper.insert(ifsInventoryQuantity); } @@ -796,7 +820,7 @@ String endDeclareDate = ifsInventoryQuantityDto.getEndDeclareDate(); ifsInventoryQuantityDto.setBeginDeclareDate(null); ifsInventoryQuantityDto.setEndDeclareDate(null); ifsInventoryQuantityDto.setOrderType(OrderType.RAW.getValue()); return standardTreeMapper.getIfsByQuarter(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate); } @@ -948,7 +972,7 @@ if(Objects.nonNull(splitOrderList) && !splitOrderList.isEmpty()){ List<Long> ids = splitOrderList.stream().map(IfsInventoryQuantity::getId).collect(Collectors.toList()); ids.add(ifsInventoryQuantity.getId()); this.inspectionReport(ids); this.inspectionReport(ids,OrderType.RAW.getValue()); } //å¾é忥å°MESï¼ä¿å订åæåè®°å½ if(orderSplitDTO.getPushToMes()){ inspect-server/src/main/java/com/ruoyi/inspect/vo/IfsOrderVO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,76 @@ package com.ruoyi.inspect.vo; import com.ruoyi.inspect.pojo.InsOrder; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; /** * ifs订åvo */ @Data public class IfsOrderVO extends InsOrder implements Serializable { /** * é¶ä»¶æ¹æ¬¡å±æ§ä¸»é®id */ @ApiModelProperty("é¶ä»¶æ¹æ¬¡å±æ§ä¸»é®id") private Long lotPartId; /** * ç»ç¼é¢è² */ @ApiModelProperty("ç»ç¼é¢è²") private String insulationColor; /** * 夿¤é¢è² */ @ApiModelProperty("夿¤é¢è²") private String outerColor; /** * çå· */ @ApiModelProperty("çå·") private String drumNo; /** * å°åä¿¡æ¯ */ @ApiModelProperty("å°åä¿¡æ¯") private String letteringInfo; /** * èµ·å§ç±³æ */ @ApiModelProperty("èµ·å§ç±³æ ") private BigDecimal startMeterMark; /** * æªæ¢ç±³æ */ @ApiModelProperty("æªæ¢ç±³æ ") private BigDecimal endMeterMark; /** * æ¯å¦æ¯æå订å(0:å¦ 1:æ¯) */ @ApiModelProperty("æ¯å¦æ¯æå订å(0:å¦ 1:æ¯)") private Integer isSplitOrder; /** * ifs订ååç±»(01raw:åææ 02wg:å¤è´æå) */ @ApiModelProperty("ifs订ååç±»(01raw:åææ 02wg:å¤è´æå)") private String ifsOrderType; private String partNo; private String lotBatchNo; } inspect-server/src/main/java/com/ruoyi/inspect/vo/InsSampleUserVO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,33 @@ package com.ruoyi.inspect.vo; import com.ruoyi.inspect.pojo.InsSampleUser; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; @Data public class InsSampleUserVO extends InsSampleUser implements Serializable { /** * æ£éªå */ @ApiModelProperty("æ£éªå") private String inspector; /** * æ£éªæ¥æ */ @ApiModelProperty("æ£éªæ¥æ") private String inspectDate; /** * åå· */ @ApiModelProperty("åå·") private String model; } inspect-server/src/main/resources/mapper/IfsPartPropsRecordMapper.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,34 @@ <?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.IfsPartPropsRecordMapper"> <resultMap id="BaseResultMap" type="com.ruoyi.inspect.pojo.IfsPartPropsRecord"> <id property="id" column="id" jdbcType="BIGINT"/> <result property="ifsInventoryId" column="ifs_inventory_id" jdbcType="BIGINT"/> <result property="drumNo" column="drum_no" jdbcType="VARCHAR"/> <result property="startMeterMark" column="start_meter_mark" jdbcType="DECIMAL"/> <result property="endMeterMark" column="end_meter_mark" 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="partPropsFlag" column="part_props_flag" jdbcType="BIT"/> </resultMap> <sql id="Base_Column_List"> id,ifs_inventory_id,drum_no, start_meter_mark,end_meter_mark,insulation_color, outer_color,lettering_info,part_props_flag </sql> <select id="selectCountByPartNoAndLotBatchNo" resultType="java.lang.Long"> select COUNT(iiq.id) from ifs_inventory_quantity iiq left join ifs_part_props_record ippr on iiq.id = ippr.ifs_inventory_id where iiq.part_no = #{partNo} and iiq.update_batch_no= #{lotBatchNo} and ippr.id is not null </select> </mapper> inspect-server/src/main/resources/mapper/InsOrderMapper.xml
@@ -469,4 +469,42 @@ and ip.structure_item_parameter_id = #{itmeId} group by io.id) a </select> <select id="selectOrderInfoById" resultType="com.ruoyi.inspect.vo.IfsOrderVO"> select io.*, iiq.is_split_order, iiq.order_type AS ifs_order_type, iiq.part_no, iiq.update_batch_no AS lot_batch_no, ipps.id AS lot_part_id, case when ipps.drum_no is not null and ipps.drum_no!='' then ipps.drum_no else isor.drum_no end AS drum_no, case when ipps.insulation_color is not null and ipps.insulation_color!='' then ipps.insulation_color else isor.insulation_color end AS insulation_color, case when ipps.outer_color is not null and ipps.outer_color!='' then ipps.outer_color else isor.outer_color end AS outer_color, case when ipps.lettering_info is not null and ipps.lettering_info!='' then ipps.lettering_info else isor.lettering_info end AS lettering_info, ipps.start_meter_mark, ipps.end_meter_mark from ins_order io left join ifs_inventory_quantity iiq on io.ifs_inventory_id=iiq.id left join ifs_split_order_record isor on 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 AND iiq.update_batch_no = isor.lot_batch_no LEFT JOIN ifs_part_props_record ipps ON iiq.id = ipps.ifs_inventory_id where io.state !=-1 AND io.id = #{id} LIMIT 1 </select> </mapper> inspect-server/src/main/resources/mapper/InsSampleUserMapper.xml
@@ -1,4 +1,16 @@ <?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.InsSampleUserMapper"> <select id="selectUserNameByOrderId" resultType="com.ruoyi.inspect.vo.InsSampleUserVO"> select group_concat(DISTINCT u.name separator ',') AS inspector, date_format(isu.create_time,'%Y-%m-%d') AS inspect_date, isa.model from ins_sample_user isu left join ins_sample isa on isu.ins_sample_id = isa.ins_order_id left join user u on isu.user_id=u.id where isu.ins_sample_id=#{orderId} and isu.state=0 group by isu.ins_sample_id order by isu.create_time </select> </mapper> inspect-server/src/main/resources/static/small-wg-report-template.docxBinary files differ
performance-server/src/main/java/com/ruoyi/performance/mapper/AuxiliaryOutputWorkingHoursMapper.java
@@ -8,6 +8,7 @@ import com.ruoyi.performance.dto.AuxiliaryOriginalHoursLookDto; import com.ruoyi.performance.dto.AuxiliaryOutputWorkingHoursDto; import com.ruoyi.performance.pojo.AuxiliaryOutputWorkingHours; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -21,6 +22,7 @@ * @author æ±èéµ·éç½ç»ç§ææéå ¬å¸ * @since 2024-05-28 03:48:48 */ @Mapper public interface AuxiliaryOutputWorkingHoursMapper extends BaseMapper<AuxiliaryOutputWorkingHours> { IPage<AuxiliaryOutputWorkingHoursDto> selectAuxiliaryOutputWorkingHours(Page page, @Param("ew") QueryWrapper<AuxiliaryOutputWorkingHoursDto> ew, @Param("ids") List<Long> ids); ruoyi-common/src/main/java/com/ruoyi/common/enums/OrderType.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,44 @@ package com.ruoyi.common.enums; import org.apache.commons.lang3.StringUtils; public enum OrderType { RAW("åææ","01raw"), WG("å¤è´æå","02wg"); private String label,value; public String getLabel() { return label; } public String getValue() { return value; } OrderType(String label, String value) { this.label = label; this.value = value; } public static boolean validateValue(String value){ boolean flag = false; for (OrderType orderType : OrderType.values()) { if(StringUtils.isNotBlank(value)&&StringUtils.equals(orderType.getValue(),value)){ flag = true; } } return flag; } public static String getLabelByValue(String value){ for (OrderType orderType : OrderType.values()) { if(validateValue(value)&&StringUtils.equals(orderType.getValue(), value)){ return orderType.getLabel(); } } return ""; } } ruoyi-common/src/main/java/com/ruoyi/common/utils/QueryWrappers.java
@@ -51,8 +51,10 @@ if (!field.getName().equals("orderBy")) { if(value.getClass()== LocalDateTime.class){ wrapper.like(StrUtil.toUnderlineCase(field.getName()), ((LocalDateTime) value).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); }else{ }else if(value.getClass()== String.class){ wrapper.like(StrUtil.toUnderlineCase(field.getName()), value); }else{ wrapper.eq(StrUtil.toUnderlineCase(field.getName()), value); } } else { Map<String, String> map = (Map<String, String>) value; ruoyi-common/src/main/java/com/ruoyi/common/utils/api/IfsApiUtils.java
@@ -79,7 +79,15 @@ return getResult("MODIFY_PURCH_RECEIPT_LOT_STD", inAttr, ifsProperties.getCustorder(), "ä¿®æ¹éè´è®¢åæ¹æ¬¡å·-->"); } /** * åºåç©ææ¹æ¬¡å±æ§æ°å¢ä¿®æ¹æ¥å£ * * @param inAttr * @return */ public Result importPartLotAttr(String inAttr) { return getResult("IMPORT_PART_LOT_ATTR_STD", inAttr, ifsProperties.getCustorder(), "åºåç©ææ¹æ¬¡å±æ§æ°å¢ä¿®æ¹æ¥å£-->"); } /** * æ¥è¯¢åºåæ°æ®