| | |
| | | import com.ruoyi.sales.mapper.CommonFileMapper; |
| | | import com.ruoyi.sales.mapper.SalesQuotationMapper; |
| | | import com.ruoyi.sales.mapper.SalesQuotationProductMapper; |
| | | import com.ruoyi.sales.mapper.ShippingInfoMapper; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import com.ruoyi.sales.pojo.SalesQuotation; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import com.ruoyi.sales.service.impl.CommonFileServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private SalesQuotationMapper salesQuotationMapper; |
| | | |
| | | @Autowired |
| | | private ShippingInfoMapper shippingInfoMapper; |
| | | |
| | | |
| | | |
| | |
| | | }else if(status.equals(1) && salesQuote != null){ |
| | | salesQuote.setStatus("å®¡æ ¸ä¸"); |
| | | } |
| | | |
| | | salesQuotationMapper.updateById(salesQuote); |
| | | } |
| | | // åºåºå®¡æ¹ä¿®æ¹ |
| | | if(approveProcess.getApproveType().equals(7)){ |
| | | String[] split = approveProcess.getApproveReason().split(":"); |
| | | ShippingInfo shippingInfo = shippingInfoMapper.selectOne(new LambdaQueryWrapper<ShippingInfo>() |
| | | .eq(ShippingInfo::getShippingNo, split[1]) |
| | | .orderByDesc(ShippingInfo::getCreateTime) |
| | | .last("limit 1")); |
| | | if(shippingInfo != null){ |
| | | if(status.equals(2)){ |
| | | shippingInfo.setStatus("å®¡æ ¸éè¿"); |
| | | }else if(status.equals(3)){ |
| | | shippingInfo.setType("å®¡æ ¸æç»"); |
| | | }else if(status.equals(1)){ |
| | | shippingInfo.setStatus("å®¡æ ¸ä¸"); |
| | | } |
| | | shippingInfoMapper.updateById(shippingInfo); |
| | | } |
| | | |
| | | } |
| | | // ç»å®éä»¶ |
| | | if(!CollectionUtils.isEmpty(approveNode.getTempFileIds()) && approveNode.getApproveNodeStatus() == 1){ |
| | | tempFileService.migrateTempFilesToFormal(approveNode.getId(), approveNode.getTempFileIds(), FileNameType.ApproveNode.getValue()); |
| | |
| | | package com.ruoyi.basic.controller; |
| | | |
| | | import com.ruoyi.basic.utils.EnumUtils; |
| | | import com.ruoyi.common.enums.StockRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.utils.EnumUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Anonymous; |
| | | import com.ruoyi.framework.web.domain.R; |
| | |
| | | @GetMapping("/stockRecordType") |
| | | @Anonymous |
| | | public R getStockRecordTypeEnum(){ |
| | | List<Map<String, Object>> list = EnumUtil.toList(StockRecordTypeEnum.class); |
| | | List<Map<String, Object>> list = EnumUtil.toList(StockQualifiedRecordTypeEnum.class); |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.procurementrecord.dto.ProcurementPageDto; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * ã请填ååè½åç§°ãMapperæ¥å£ |
| | |
| | | |
| | | ProductModel selectLatestRecord(); |
| | | |
| | | List<Map<String, Object>> getProductAndModelList(); |
| | | } |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import com.ruoyi.approve.pojo.ApproveProcess; |
| | | |
| | | public enum FileNameType { |
| | | |
| | |
| | | MEASURING(5), //计éå¨å
·å°è´¦ |
| | | MEASURINGRecord(6),//计éå¨å
·å°è´¦è®°å½ |
| | | ApproveNode(7), //åå审æ¹èç¹å®¡æ ¸ |
| | | ApproveProcess(8); //åå审æ¹ä¸»æ°æ® |
| | | ApproveProcess(8),//åå审æ¹ä¸»æ°æ® |
| | | SHIP(9),//åè´§å°è´¦ |
| | | INSPECTION_PRODUCTION_BEFORE(10), |
| | | INSPECTION_PRODUCTION_AFTER(11), |
| | | INSPECTION(12);//å·¡æ£ ç产å |
| | | |
| | | private final int value; |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | |
| | | @Getter |
| | | public enum StockQualifiedRecordTypeEnum implements BaseEnum<String> { |
| | | CUSTOMIZATION_STOCK_IN("0", "åæ ¼èªå®ä¹å
¥åº"), |
| | | CUSTOMIZATION_STOCK_OUT("1", "åæ ¼èªå®ä¹åºåº"), |
| | | PRODUCTION_REPORT_STOCK_IN("2", "ç产æ¥å·¥-å
¥åº"), |
| | | PRODUCTION_REPORT_STOCK_OUT("3", "ç产æ¥å·¥-åºåº"), |
| | | DEFECTIVE_PASS("6", "ä¸åæ ¼å¤ç-è®©æ¥æ¾è¡"), |
| | | PURCHASE_STOCK_IN("7", "éè´-å
¥åº"), |
| | | SALE_STOCK_OUT("8", "éå®-åºåº"), |
| | | QUALITYINSPECT_STOCK_IN("11", "è´¨æ£-åæ ¼å
¥åº"); |
| | | |
| | | private final String code; |
| | | private final String value; |
| | | |
| | | StockQualifiedRecordTypeEnum(String code, String value) { |
| | | this.code = code; |
| | | this.value = value; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | |
| | | @Getter |
| | | public enum StockUnQualifiedRecordTypeEnum implements BaseEnum<String> { |
| | | |
| | | |
| | | PRODUCTION_SCRAP("4", "ç产æ¥å·¥-æ¥åº"), |
| | | DEFECTIVE_SCRAP("5", "ä¸åæ ¼å¤ç-æ¥åº"), |
| | | CUSTOMIZATION_UNSTOCK_IN("9", "ä¸åæ ¼èªå®ä¹å
¥åº"), |
| | | CUSTOMIZATION_UNSTOCK_OUT("10", "ä¸åæ ¼èªå®ä¹åºåº"), |
| | | QUALITYINSPECT_UNSTOCK_IN("12", "è´¨æ£-ä¸åæ ¼å
¥åº"); |
| | | |
| | | |
| | | private final String code; |
| | | private final String value; |
| | | |
| | | StockUnQualifiedRecordTypeEnum(String code, String value) { |
| | | this.code = code; |
| | | this.value = value; |
| | | } |
| | | |
| | | } |
| | |
| | | return new Date();
|
| | | }
|
| | |
|
| | | public static LocalDate toLocalDate(Date date){
|
| | | if(date == null) return LocalDate.now();
|
| | | // 2. æå®åºå®æ¶åºè½¬æ¢ï¼å¦ä¸å
«åºUTC+8ãUTCé¶æ¶åºï¼
|
| | | return date.toInstant()
|
| | | .atZone(ZoneId.of("Asia/Shanghai")) // ä¸å
«åºï¼å京/䏿µ·æ¶åºï¼
|
| | | // .atZone(ZoneId.of("UTC")) // å¯éï¼UTCé¶æ¶åº
|
| | | .toLocalDate();
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åå½åæ¥æ, é»è®¤æ ¼å¼ä¸ºyyyy-MM-dd
|
| | | *
|
| | |
| | | */ |
| | | public static <E extends Enum<E> & BaseEnum> E fromCode(Class<E> enumClass, int code) { |
| | | for (E e : enumClass.getEnumConstants()) { |
| | | if ((int)e.getCode() == code) { |
| | | if (Integer.parseInt(String.valueOf(e.getCode())) == code) { |
| | | return e; |
| | | } |
| | | } |
| | |
| | | |
| | | public static <E extends Enum<E> & BaseEnum> E fromCodeHasNull(Class<E> enumClass, int code) { |
| | | for (E e : enumClass.getEnumConstants()) { |
| | | if ((int)e.getCode() == code) { |
| | | if (Integer.parseInt(String.valueOf(e.getCode())) == code) { |
| | | return e; |
| | | } |
| | | } |
| | |
| | | |
| | | public static <E extends Enum<E> & BaseEnum> E fromCodeHasDefault(Class<E> enumClass, int code,E defaultE) { |
| | | for (E e : enumClass.getEnumConstants()) { |
| | | if ((int)e.getCode() == code) { |
| | | if (Integer.parseInt(String.valueOf(e.getCode())) == code) { |
| | | return e; |
| | | } |
| | | } |
| | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | |
| | | @ApiModelProperty("åä½") |
| | | private String unit; |
| | | |
| | | @ApiModelProperty("é¨é¨id") |
| | | private Long deptId; |
| | | |
| | | @ApiModelProperty("å®è£
ä½ç½®") |
| | | private String instationLocation; |
| | | |
| | | private String cycle; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.procurementrecord.utils; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper; |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.dto.StockUninventoryDto; |
| | | import com.ruoyi.stock.pojo.StockInRecord; |
| | | import com.ruoyi.stock.service.StockInRecordService; |
| | | import com.ruoyi.stock.service.StockInventoryService; |
| | | import com.ruoyi.stock.service.StockUninventoryService; |
| | | import com.ruoyi.stock.service.impl.StockInRecordServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | private final ProcurementRecordMapper procurementRecordMapper; |
| | | private final StockUninventoryService stockUninventoryService; |
| | | private final StockInventoryService stockInventoryService; |
| | | private final StockInRecordService stockInRecordService; |
| | | |
| | | // è·åååå
¥åºæ°é,åºåºæ°é,å©ä½åºå |
| | | public Map<String, BigDecimal> getStockQuantity(Long productModelId) { |
| | |
| | | * @param recordType |
| | | * @param recordId |
| | | */ |
| | | public void addUnStock(Long productModelId, BigDecimal quantity, Integer recordType,Long recordId) { |
| | | public void addUnStock(Long productModelId, BigDecimal quantity, String recordType,Long recordId) { |
| | | StockUninventoryDto stockUninventoryDto = new StockUninventoryDto(); |
| | | stockUninventoryDto.setRecordId(recordId); |
| | | stockUninventoryDto.setRecordType(String.valueOf(recordType)); |
| | |
| | | * @param recordType |
| | | * @param recordId |
| | | */ |
| | | public void addStock(Long productModelId, BigDecimal quantity, Integer recordType,Long recordId) { |
| | | public void addStock(Long productModelId, BigDecimal quantity, String recordType,Long recordId) { |
| | | StockInventoryDto stockInventoryDto = new StockInventoryDto(); |
| | | stockInventoryDto.setRecordId(recordId); |
| | | stockInventoryDto.setRecordType(String.valueOf(recordType)); |
| | |
| | | * @param recordType |
| | | * @param recordId |
| | | */ |
| | | public void substractStock(Long productModelId, BigDecimal quantity, Integer recordType,Long recordId) { |
| | | public void substractStock(Long productModelId, BigDecimal quantity, String recordType,Long recordId) { |
| | | StockInventoryDto stockInventoryDto = new StockInventoryDto(); |
| | | stockInventoryDto.setRecordId(recordId); |
| | | stockInventoryDto.setRecordType(String.valueOf(recordType)); |
| | |
| | | stockInventoryDto.setProductModelId(productModelId); |
| | | stockInventoryService.subtractStockInventory(stockInventoryDto); |
| | | } |
| | | |
| | | //ä¸åæ ¼åºåå é¤ |
| | | public void deleteStockRecord(Long recordId, String recordType) { |
| | | StockInRecord one = stockInRecordService.getOne(new QueryWrapper<StockInRecord>() |
| | | .lambda().eq(StockInRecord::getRecordId, recordId) |
| | | .eq(StockInRecord::getRecordType, recordType)); |
| | | |
| | | stockInRecordService.batchDelete(Collections.singletonList(one.getId())); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.production.dto.ProductBomDto; |
| | | import com.ruoyi.production.dto.ProductProcessDto; |
| | | import com.ruoyi.production.pojo.ProcessRoute; |
| | | import com.ruoyi.production.pojo.ProductBom; |
| | | import com.ruoyi.production.pojo.ProductProcess; |
| | | import com.ruoyi.production.pojo.ProductProcessRoute; |
| | | import com.ruoyi.production.service.ProcessRouteService; |
| | | import com.ruoyi.production.service.ProductBomService; |
| | | import com.ruoyi.production.service.ProductProcessRouteService; |
| | | import com.ruoyi.production.service.ProductProcessService; |
| | | import com.ruoyi.production.pojo.*; |
| | | import com.ruoyi.production.service.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | @Autowired |
| | | private ProductProcessRouteService productProcessRouteService; |
| | | |
| | | @Autowired |
| | | private ProductStructureService productStructureService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "BOM-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | //å é¤bomå表 |
| | | productStructureService.remove(Wrappers.<ProductStructure>lambdaQuery().in(ProductStructure::getBomId,ids)); |
| | | return AjaxResult.success(productBomService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.production.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.ruoyi.production.pojo.ProductStructure; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class ProductStructureDto extends ProductStructure { |
| | | |
| | | @ApiModelProperty(value = "å·¥èºåç§°") |
| | | private String processName; |
| | | |
| | | @ApiModelProperty(value = "产ååç§°") |
| | | private String productName; |
| | | |
| | | @ApiModelProperty(value = "产åid") |
| | | private Long productId; |
| | | |
| | | private String model; |
| | | |
| | | private List<ProductStructure> productStructureList; |
| | | @TableField(exist = false) |
| | | private String tempId; |
| | | |
| | | @TableField(exist = false) |
| | | private String parentTempId; |
| | | |
| | | @TableField(exist = false) |
| | | private List<ProductStructureDto> children; |
| | | } |
| | |
| | | */ |
| | | private Long bomId; |
| | | |
| | | |
| | | /** |
| | | * ç¶èç¹ID |
| | | */ |
| | | private Long parentId; |
| | | } |
| | |
| | | package com.ruoyi.production.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.basic.service.IProductModelService; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.production.dto.ProductBomDto; |
| | | import com.ruoyi.production.dto.ProductProcessDto; |
| | | import com.ruoyi.production.pojo.ProductBom; |
| | | import com.ruoyi.production.mapper.ProductBomMapper; |
| | | import com.ruoyi.production.pojo.ProductProcess; |
| | | import com.ruoyi.production.mapper.ProductStructureMapper; |
| | | import com.ruoyi.production.pojo.ProductBom; |
| | | import com.ruoyi.production.pojo.ProductStructure; |
| | | import com.ruoyi.production.service.ProductBomService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Autowired |
| | | private ProductBomMapper productBomMapper; |
| | | |
| | | @Autowired |
| | | private IProductModelService productModelService; |
| | | |
| | | @Autowired |
| | | private ProductStructureMapper productStructureMapper; |
| | | |
| | | @Override |
| | | public IPage<ProductBomDto> listPage(Page page, ProductBomDto productBomDto) { |
| | | return productBomMapper.listPage(page,productBomDto); |
| | | return productBomMapper.listPage(page, productBomDto); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(ProductBom productBom) { |
| | | boolean save = productBomMapper.insert(productBom) > 0; |
| | | if (save) { |
| | |
| | | String no = "BM." + String.format("%05d", productBom.getId()); |
| | | productBom.setBomNo(no); |
| | | productBomMapper.updateById(productBom); |
| | | |
| | | // æ¥è¯¢åºäº§å模åä¿¡æ¯ |
| | | if (productBom.getProductModelId() == null) { |
| | | throw new ServiceException("è¯·éæ©äº§åæ¨¡å"); |
| | | } |
| | | |
| | | ProductModel productModel = productModelService.getById(productBom.getProductModelId()); |
| | | if (productModel == null) { |
| | | throw new ServiceException("éæ©çäº§åæ¨¡åä¸åå¨"); |
| | | } |
| | | |
| | | // æ·»å åå§ç产åç»æ |
| | | ProductStructure productStructure = new ProductStructure(); |
| | | productStructure.setProductModelId(productBom.getProductModelId()); |
| | | productStructure.setUnit(productModel.getUnit()); |
| | | productStructure.setUnitQuantity(BigDecimal.valueOf(1)); |
| | | productStructure.setBomId(Long.valueOf(productBom.getId())); |
| | | |
| | | productStructureMapper.insert(productStructure); |
| | | |
| | | return AjaxResult.success(); |
| | | } |
| | | return AjaxResult.error(); |
| | |
| | | package com.ruoyi.production.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.dto.ProductModelDto; |
| | | import com.ruoyi.basic.dto.ProductTreeDto; |
| | | import com.ruoyi.basic.mapper.ProductMapper; |
| | | import com.ruoyi.basic.mapper.ProductModelMapper; |
| | | import com.ruoyi.basic.pojo.Product; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.production.dto.ProductStructureDto; |
| | | import com.ruoyi.production.mapper.ProductBomMapper; |
| | | import com.ruoyi.production.mapper.ProductStructureMapper; |
| | | import com.ruoyi.production.pojo.ProductStructure; |
| | | import com.ruoyi.production.service.ProductStructureService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | @Slf4j |
| | | @Service |
| | | public class ProductStructureServiceImpl extends ServiceImpl<ProductStructureMapper, ProductStructure> implements ProductStructureService { |
| | | |
| | | @Autowired |
| | | private ProductStructureMapper productStructureMapper; |
| | | |
| | | private ProductStructureMapper productStructureMapper; |
| | | |
| | | |
| | | @Override |
| | | public Boolean addProductStructureDto(ProductStructureDto productStructureDto) { |
| | | this.remove(new QueryWrapper<ProductStructure>().lambda().eq(ProductStructure::getBomId, productStructureDto.getBomId())); |
| | | productStructureDto.getProductStructureList().forEach(productStructure -> { |
| | | productStructure.setBomId(productStructureDto.getBomId()); |
| | | }); |
| | | return this.saveBatch(productStructureDto.getProductStructureList()); |
| | | @Transactional |
| | | public Boolean addProductStructureDto(ProductStructureDto dto) { |
| | | |
| | | Long bomId = dto.getBomId(); |
| | | |
| | | // å°æ æå¹³å |
| | | List<ProductStructureDto> flatDtoList = new ArrayList<>(); |
| | | flattenTree(dto.getChildren(), flatDtoList); |
| | | |
| | | // æ¥è¯¢æ°æ®åºä¸å·²æç BOM æ°æ® |
| | | List<ProductStructure> dbList = this.list(new LambdaQueryWrapper<ProductStructure>().eq(ProductStructure::getBomId, bomId)); |
| | | |
| | | // æ¥æ¾å·²åå¨çèç¹ - ID |
| | | Set<Long> frontendIds = flatDtoList.stream() |
| | | .map(ProductStructureDto::getId) |
| | | .filter(Objects::nonNull) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | // éè¦å é¤çèç¹ - ID |
| | | Set<Long> deleteIds = dbList.stream() |
| | | .map(ProductStructure::getId) |
| | | .filter(id -> !frontendIds.contains(id)) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | if (!deleteIds.isEmpty()) { |
| | | this.removeByIds(deleteIds); |
| | | } |
| | | |
| | | // æ°å¢ / æ´æ° |
| | | List<ProductStructure> insertList = new ArrayList<>(); |
| | | List<ProductStructure> updateList = new ArrayList<>(); |
| | | |
| | | // ç¨äºåå parentId |
| | | Map<String, ProductStructure> tempEntityMap = new HashMap<>(); |
| | | |
| | | for (ProductStructureDto psDto : flatDtoList) { |
| | | ProductStructure entity = new ProductStructure(); |
| | | BeanUtils.copyProperties(psDto, entity); |
| | | entity.setBomId(bomId); |
| | | |
| | | if (psDto.getId() == null) { |
| | | // æ°å¢ |
| | | entity.setId(null); |
| | | entity.setParentId(null); |
| | | insertList.add(entity); |
| | | tempEntityMap.put(psDto.getTempId(), entity); |
| | | } else { |
| | | // æ´æ° |
| | | updateList.add(entity); |
| | | } |
| | | } |
| | | |
| | | // æå
¥æ°èç¹ |
| | | if (!insertList.isEmpty()) { |
| | | this.saveBatch(insertList); |
| | | } |
| | | |
| | | // ååæ°å¢èç¹ parentId |
| | | List<ProductStructure> parentFixList = new ArrayList<>(); |
| | | // çå®çç¶èç¹ ID |
| | | Long realParentId; |
| | | for (ProductStructureDto psDto : flatDtoList) { |
| | | if (psDto.getId() == null && psDto.getParentTempId() != null) { |
| | | ProductStructure child = tempEntityMap.get(psDto.getTempId()); |
| | | if (tempEntityMap.containsKey(psDto.getParentTempId())) { |
| | | // ç¶èç¹æ¯æ°èç¹ |
| | | realParentId = tempEntityMap.get(psDto.getParentTempId()).getId(); |
| | | } else { |
| | | // ç¶èç¹æ¯èèç¹ |
| | | realParentId = Long.valueOf(psDto.getParentTempId()); |
| | | } |
| | | |
| | | child.setParentId(realParentId); |
| | | parentFixList.add(child); |
| | | } |
| | | } |
| | | |
| | | if (!parentFixList.isEmpty()) { |
| | | this.updateBatchById(parentFixList); |
| | | } |
| | | |
| | | if (!updateList.isEmpty()) { |
| | | this.updateBatchById(updateList); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * å°åç«¯ä¼ å
¥çæ è¿è¡æå¹³å |
| | | * |
| | | * @param source æ°æ®æ |
| | | * @param result æå¹³åæ°æ® |
| | | */ |
| | | private void flattenTree(List<ProductStructureDto> source, List<ProductStructureDto> result) { |
| | | if (source == null) { |
| | | return; |
| | | } |
| | | for (ProductStructureDto node : source) { |
| | | result.add(node); |
| | | flattenTree(node.getChildren(), result); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<ProductStructureDto> listBybomId(Long bomId) { |
| | | List<ProductStructureDto> tree = productStructureMapper.listBybomId(bomId); |
| | | return tree; |
| | | List<ProductStructureDto> list = productStructureMapper.listBybomId(bomId); |
| | | |
| | | Map<Long, ProductStructureDto> map = new HashMap<>(); |
| | | for (ProductStructureDto node : list) { |
| | | node.setChildren(new ArrayList<>()); |
| | | map.put(node.getId(), node); |
| | | } |
| | | |
| | | List<ProductStructureDto> tree = new ArrayList<>(); |
| | | for (ProductStructureDto node : list) { |
| | | Long parentId = node.getParentId(); |
| | | if (parentId == null || parentId == 0) { |
| | | tree.add(node); |
| | | } else { |
| | | ProductStructureDto parent = map.get(parentId); |
| | | if (parent != null) { |
| | | parent.getChildren().add(node); |
| | | } |
| | | } |
| | | } |
| | | return tree; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | import com.ruoyi.basic.mapper.ProductModelMapper; |
| | | import com.ruoyi.basic.pojo.Product; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.enums.StockQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockUnQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordOut; |
| | |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.quality.mapper.*; |
| | | import com.ruoyi.quality.pojo.*; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.ruoyi.production.mapper.ProductionProductMainMapper; |
| | | import oshi.driver.mac.net.NetStat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | salesLedgerProductionAccountingMapper.insert(salesLedgerProductionAccounting); |
| | | } |
| | | //妿æ¥åºæ°é>0,éè¦è¿å
¥æ¥åºçåºå |
| | | if (dto.getScrapQty().compareTo(BigDecimal.ZERO) > 0) { |
| | | stockUtils.addUnStock(productModel.getId(), dto.getScrapQty(), StockUnQualifiedRecordTypeEnum.PRODUCTION_SCRAP.getCode(), productionProductMain.getId()); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | |
| | | .eq(ProcurementRecordOut::getSalesLedgerProductId, productionProductMain.getId())); |
| | | productionProductInputMapper.delete(new LambdaQueryWrapper<ProductionProductInput>() |
| | | .eq(ProductionProductInput::getProductMainId, productionProductMain.getId())); |
| | | //å 餿¥åºçå
¥åºè®°å½ |
| | | stockUtils.deleteStockRecord(productionProductMain.getId(), StockUnQualifiedRecordTypeEnum.PRODUCTION_SCRAP.getCode()); |
| | | // å é¤ä¸»è¡¨ |
| | | productionProductMainMapper.deleteById(productionProductMain.getId()); |
| | | return true; |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.deepoove.poi.XWPFTemplate; |
| | | import com.deepoove.poi.config.Configure; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.enums.StockQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.utils.HackLoopTableRenderPolicy; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.procurementrecord.dto.Details; |
| | | import com.ruoyi.procurementrecord.dto.ProcurementAddDto; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordStorage; |
| | | import com.ruoyi.procurementrecord.service.ProcurementRecordService; |
| | | import com.ruoyi.procurementrecord.utils.StockUtils; |
| | | import com.ruoyi.quality.dto.QualityInspectDto; |
| | | import com.ruoyi.quality.mapper.QualityInspectMapper; |
| | | import com.ruoyi.quality.mapper.QualityTestStandardMapper; |
| | |
| | | import com.ruoyi.quality.service.IQualityInspectParamService; |
| | | import com.ruoyi.quality.service.IQualityInspectService; |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | @AllArgsConstructor |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class QualityInspectServiceImpl extends ServiceImpl<QualityInspectMapper, QualityInspect> implements IQualityInspectService { |
| | | public class QualityInspectServiceImpl extends ServiceImpl<QualityInspectMapper, QualityInspect> implements IQualityInspectService { |
| | | |
| | | private final StockUtils stockUtils; |
| | | private QualityInspectMapper qualityInspectMapper; |
| | | |
| | | private IQualityInspectParamService qualityInspectParamService; |
| | |
| | | @Override |
| | | public int add(QualityInspectDto qualityInspectDto) { |
| | | QualityInspect qualityInspect = new QualityInspect(); |
| | | BeanUtils.copyProperties(qualityInspectDto,qualityInspect); |
| | | BeanUtils.copyProperties(qualityInspectDto, qualityInspect); |
| | | qualityInspect.setInspectState(0);//é»è®¤æªæäº¤ |
| | | qualityInspectMapper.insert(qualityInspect); |
| | | for (QualityInspectParam qualityInspectParam : qualityInspectDto.getQualityInspectParams()) { |
| | |
| | | QualityInspect qualityInspect = qualityInspectMapper.selectById(id); |
| | | List<QualityInspectParam> qualityInspectParams = qualityInspectParamService.list(Wrappers.<QualityInspectParam>lambdaQuery().eq(QualityInspectParam::getInspectId, id)); |
| | | QualityInspectDto qualityInspectDto = new QualityInspectDto(); |
| | | BeanUtils.copyProperties(qualityInspect,qualityInspectDto); |
| | | BeanUtils.copyProperties(qualityInspect, qualityInspectDto); |
| | | qualityInspectDto.setQualityInspectParams(qualityInspectParams); |
| | | return qualityInspectDto; |
| | | } |
| | |
| | | public int submit(QualityInspect inspect) { |
| | | QualityInspect qualityInspect = qualityInspectMapper.selectById(inspect.getId()); |
| | | /*夿ä¸åæ ¼*/ |
| | | if (ObjectUtils.isNotNull(qualityInspect.getCheckResult()) && qualityInspect.getCheckResult().equals("ä¸åæ ¼")){ |
| | | if (ObjectUtils.isNotNull(qualityInspect.getCheckResult()) && qualityInspect.getCheckResult().equals("ä¸åæ ¼")) { |
| | | QualityUnqualified qualityUnqualified = new QualityUnqualified(); |
| | | BeanUtils.copyProperties(qualityInspect,qualityUnqualified); |
| | | BeanUtils.copyProperties(qualityInspect, qualityUnqualified); |
| | | qualityUnqualified.setInspectState(0);//å¾
å¤ç |
| | | List<QualityInspectParam> inspectParams = qualityInspectParamService.list(Wrappers.<QualityInspectParam>lambdaQuery().eq(QualityInspectParam::getInspectId, inspect.getId())); |
| | | String text = inspectParams.stream().map(QualityInspectParam::getParameterItem).collect(Collectors.joining(",")); |
| | | qualityUnqualified.setDefectivePhenomena(text+"è¿äºææ ä¸åå¨ä¸åæ ¼");//ä¸åæ ¼ç°è±¡ |
| | | qualityUnqualified.setDefectivePhenomena(text + "è¿äºææ ä¸åå¨ä¸åæ ¼");//ä¸åæ ¼ç°è±¡ |
| | | qualityUnqualified.setInspectId(qualityInspect.getId()); |
| | | qualityUnqualifiedMapper.insert(qualityUnqualified); |
| | | } |
| | | |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | if (qualityInspect.getInspectType() == 0) { |
| | | if ("åæ ¼".equals(qualityInspect.getCheckResult())) { |
| | | ProcurementAddDto procurementRecordOutAdd = new ProcurementAddDto(); |
| | | procurementRecordOutAdd.setType(1); |
| | | procurementRecordOutAdd.setTypeName("éè´åæææ£éªåæ ¼å
¥åº"); |
| | | procurementRecordOutAdd.setNickName(loginUser.getNickName()); |
| | | procurementRecordOutAdd.setPurchaseLedgerId(Math.toIntExact(qualityInspect.getPurchaseLedgerId())); |
| | | if (qualityInspect.getPurchaseLedgerId() == null) { |
| | | throw new BaseException("è¯·éæ©éè´å"); |
| | | } |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(qualityInspect.getProductId()); |
| | | |
| | | ArrayList<Details> detailss = new ArrayList<>(); |
| | | Details details = new Details(); |
| | | details.setId(Math.toIntExact(salesLedgerProduct.getId())); |
| | | details.setInboundQuantity(qualityInspect.getQuantity()); |
| | | details.setWarnNum(salesLedgerProduct.getWarnNum()); |
| | | details.setUnitPrice(salesLedgerProduct.getTaxInclusiveUnitPrice()); |
| | | details.setTotalPrice(salesLedgerProduct.getTaxInclusiveTotalPrice()); |
| | | details.setProductModelId(qualityInspect.getProductModelId()); |
| | | detailss.add( details); |
| | | procurementRecordOutAdd.setDetails(detailss); |
| | | procurementRecordOutAdd.setQualityInspectId(qualityInspect.getId()); |
| | | procurementRecordService.add(procurementRecordOutAdd); |
| | | } |
| | | }else if (qualityInspect.getInspectType() == 1) { |
| | | //æ¥è¯¢UnitPrice/TotalPrice |
| | | ProcurementAddDto procurementRecordOutAdd = new ProcurementAddDto(); |
| | | procurementRecordOutAdd.setType(2); |
| | | procurementRecordOutAdd.setTypeName("ç产è¿ç¨æ£éªåæ ¼å
¥åº"); |
| | | procurementRecordOutAdd.setNickName(loginUser.getNickName()); |
| | | List<Details> details = new ArrayList<>(); |
| | | Details details1 = new Details(); |
| | | details1.setInboundQuantity(qualityInspect.getQuantity()); |
| | | details1.setProductModelId(qualityInspect.getProductModelId()); |
| | | procurementRecordOutAdd.setDetails(details); |
| | | |
| | | ProcurementRecordStorage.ProcurementRecordStorageBuilder procurementRecordBuilder = ProcurementRecordStorage.builder() |
| | | .salesLedgerProductId(0) |
| | | .inboundBatches( "ç产åæåå
¥åº") |
| | | .inboundNum(details1.getInboundQuantity()) |
| | | .type(2) |
| | | .warnNum(new BigDecimal(0)) |
| | | .unitPrice(new BigDecimal(0)) |
| | | .totalPrice(new BigDecimal(0)) |
| | | .createTime(LocalDateTime.now()) |
| | | .createUser(loginUser.getUserId()) |
| | | .updateTime(LocalDateTime.now()) |
| | | .updateUser(loginUser.getUserId()) |
| | | .createBy(procurementRecordOutAdd.getNickName()) |
| | | .productModelId(details1.getProductModelId()) |
| | | .qualityInspectId(qualityInspect.getId()); |
| | | procurementRecordService.save(procurementRecordBuilder.build()); |
| | | |
| | | |
| | | |
| | | }else if (qualityInspect.getInspectType() == 2) { |
| | | //æ¥è¯¢UnitPrice/TotalPrice |
| | | if (ObjectUtils.isNull(qualityInspect.getProductMainId())){ |
| | | //å¦ææ¯æå¨æ°å¢çåºåæ£ |
| | | }else { |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectSalesLedgerProductByMainId(qualityInspect.getProductMainId()); |
| | | ProcurementAddDto procurementRecordOutAdd = new ProcurementAddDto(); |
| | | procurementRecordOutAdd.setType(2); |
| | | procurementRecordOutAdd.setTypeName("ç产åºåæ£éªåæ ¼å
¥åº"); |
| | | procurementRecordOutAdd.setNickName(loginUser.getNickName()); |
| | | List<Details> details = new ArrayList<>(); |
| | | Details details1 = new Details(); |
| | | details1.setInboundQuantity(qualityInspect.getQuantity()); |
| | | details1.setId(Math.toIntExact(salesLedgerProduct.getId())); |
| | | details1.setUnitPrice(salesLedgerProduct.getTaxInclusiveUnitPrice()); |
| | | details1.setTotalPrice(salesLedgerProduct.getTaxInclusiveTotalPrice()); |
| | | details1.setProductModelId(salesLedgerProduct.getProductModelId()); |
| | | details.add(details1); |
| | | procurementRecordOutAdd.setDetails(details); |
| | | procurementRecordOutAdd.setQualityInspectId(qualityInspect.getId()); |
| | | procurementRecordService.add(procurementRecordOutAdd); |
| | | } |
| | | } else { |
| | | //åæ ¼ç´æ¥å
¥åº |
| | | stockUtils.addStock(inspect.getProductModelId(), inspect.getQuantity(), StockQualifiedRecordTypeEnum.QUALITYINSPECT_STOCK_IN.getCode(), inspect.getId()); |
| | | } |
| | | qualityInspect.setInspectState(1);//å·²æäº¤ |
| | | return qualityInspectMapper.updateById(qualityInspect); |
| | |
| | | @Override |
| | | public void down(HttpServletResponse response, QualityInspect qualityInspect) { |
| | | QualityInspect inspect = qualityInspectMapper.selectById(qualityInspect.getId()); |
| | | String inspectType=""; |
| | | switch (inspect.getInspectType()){ |
| | | String inspectType = ""; |
| | | switch (inspect.getInspectType()) { |
| | | case 0: |
| | | inspectType="åæææ£éª"; |
| | | inspectType = "åæææ£éª"; |
| | | break; |
| | | case 1: |
| | | inspectType="è¿ç¨æ£éª"; |
| | | inspectType = "è¿ç¨æ£éª"; |
| | | break; |
| | | case 2: |
| | | inspectType="åºåæ£éª"; |
| | | inspectType = "åºåæ£éª"; |
| | | break; |
| | | } |
| | | List<QualityInspectParam> paramList = qualityInspectParamService.list(Wrappers.<QualityInspectParam>lambdaQuery().eq(QualityInspectParam::getInspectId, inspect.getId())); |
| | |
| | | @Override |
| | | public int updateQualityInspect(QualityInspectDto qualityInspectDto) { |
| | | if (ObjectUtils.isNotNull(qualityInspectDto.getQualityInspectParams())) { |
| | | qualityInspectParamService.remove(Wrappers.<QualityInspectParam>lambdaQuery().eq(QualityInspectParam::getInspectId,qualityInspectDto.getId())); |
| | | qualityInspectParamService.remove(Wrappers.<QualityInspectParam>lambdaQuery().eq(QualityInspectParam::getInspectId, qualityInspectDto.getId())); |
| | | for (QualityInspectParam qualityInspectParam : qualityInspectDto.getQualityInspectParams()) { |
| | | qualityInspectParam.setInspectId(qualityInspectDto.getId()); |
| | | } |
| | | qualityInspectParamService.saveBatch(qualityInspectDto.getQualityInspectParams()); |
| | | } |
| | | QualityInspect qualityInspect = new QualityInspect(); |
| | | BeanUtils.copyProperties(qualityInspectDto,qualityInspect); |
| | | BeanUtils.copyProperties(qualityInspectDto, qualityInspect); |
| | | return qualityInspectMapper.updateById(qualityInspect); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<QualityInspect> qualityInspectListPage(Page page, QualityInspect qualityInspect) { |
| | | return qualityInspectMapper.qualityInspectListPage(page,qualityInspect); |
| | | return qualityInspectMapper.qualityInspectListPage(page, qualityInspect); |
| | | } |
| | | |
| | | @Override |
| | | public void qualityInspectExport(HttpServletResponse response, QualityInspect qualityInspect) { |
| | | List<QualityInspect> qualityInspects =qualityInspectMapper.qualityInspectExport(qualityInspect); |
| | | List<QualityInspect> qualityInspects = qualityInspectMapper.qualityInspectExport(qualityInspect); |
| | | ExcelUtil<QualityInspect> util = new ExcelUtil<QualityInspect>(QualityInspect.class); |
| | | switch (qualityInspect.getInspectType()){ |
| | | switch (qualityInspect.getInspectType()) { |
| | | case 0: |
| | | util.exportExcel(response, qualityInspects, "åæææ£éªå¯¼åº"); |
| | | break; |
| | | case 1: |
| | | case 1: |
| | | util.exportExcel(response, qualityInspects, "è¿ç¨æ£éªå¯¼åº"); |
| | | break; |
| | | case 2: |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.enums.StockQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockUnQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.procurementrecord.utils.StockUtils; |
| | | import com.ruoyi.production.mapper.ProductProcessRouteItemMapper; |
| | | import com.ruoyi.production.mapper.ProductProcessRouteMapper; |
| | | import com.ruoyi.production.mapper.ProductWorkOrderMapper; |
| | | import com.ruoyi.production.mapper.ProductionProductMainMapper; |
| | | import com.ruoyi.production.pojo.*; |
| | | import com.ruoyi.production.service.ProductOrderService; |
| | | import com.ruoyi.quality.mapper.QualityInspectMapper; |
| | | import com.ruoyi.quality.mapper.QualityUnqualifiedMapper; |
| | | import com.ruoyi.quality.pojo.QualityInspect; |
| | | import com.ruoyi.quality.pojo.QualityTestStandard; |
| | | import com.ruoyi.quality.pojo.QualityUnqualified; |
| | | import com.ruoyi.quality.service.IQualityInspectService; |
| | | import com.ruoyi.quality.service.IQualityUnqualifiedService; |
| | | import com.ruoyi.stock.service.StockUninventoryService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @AllArgsConstructor |
| | | @Service |
| | | public class QualityUnqualifiedServiceImpl extends ServiceImpl<QualityUnqualifiedMapper, QualityUnqualified> implements IQualityUnqualifiedService { |
| | | public class QualityUnqualifiedServiceImpl extends ServiceImpl<QualityUnqualifiedMapper, QualityUnqualified> implements IQualityUnqualifiedService { |
| | | |
| | | private final StockUtils stockUtils; |
| | | private QualityUnqualifiedMapper qualityUnqualifiedMapper; |
| | | private IQualityInspectService qualityInspectService; |
| | | private ProductOrderService productOrderService; |
| | |
| | | private ProductProcessRouteMapper productProcessRouteMapper; |
| | | private ProductProcessRouteItemMapper productProcessRouteItemMapper; |
| | | private ProductWorkOrderMapper productWorkOrderMapper; |
| | | |
| | | private StockUninventoryService stockUninventoryService; |
| | | |
| | | @Override |
| | | public IPage<QualityUnqualified> qualityUnqualifiedListPage(Page page, QualityUnqualified qualityUnqualified) { |
| | | return qualityUnqualifiedMapper.qualityUnqualifiedListPage(page,qualityUnqualified); |
| | | return qualityUnqualifiedMapper.qualityUnqualifiedListPage(page, qualityUnqualified); |
| | | } |
| | | |
| | | @Override |
| | | public void qualityUnqualifiedExport(HttpServletResponse response, QualityUnqualified qualityUnqualified) { |
| | | List<QualityUnqualified> qualityUnqualifieds =qualityUnqualifiedMapper.qualityUnqualifiedExport(qualityUnqualified); |
| | | List<QualityUnqualified> qualityUnqualifieds = qualityUnqualifiedMapper.qualityUnqualifiedExport(qualityUnqualified); |
| | | ExcelUtil<QualityUnqualified> util = new ExcelUtil<QualityUnqualified>(QualityUnqualified.class); |
| | | util.exportExcel(response, qualityUnqualifieds, "ä¸åæ ¼ç®¡ç导åº"); |
| | | } |
| | |
| | | case "è¿ä¿®": |
| | | case "è¿å·¥": |
| | | //å¤æè´¨æ£è¡¨æ¯å¦æç¸å
³çæ¥å·¥id,å¦æææ¥å·¥id,é£ä¹è¿å·¥éè¦éæ°å建ç产订åéæ°ç产 |
| | | if (ObjectUtils.isNotNull(qualityInspect.getProductMainId())){ |
| | | if (ObjectUtils.isNotNull(qualityInspect.getProductMainId())) { |
| | | //è¿å·¥éè¦éæ°å建ç产订åéæ°ç产 |
| | | ProductOrder productOrder = productionProductMainMapper.getOrderByMainId(qualityInspect.getProductMainId()); |
| | | ProductOrder order = new ProductOrder(); |
| | |
| | | order.setEndTime(null); |
| | | productOrderService.save(order); |
| | | //æ°å¢ç产订åä¸çå·¥èºè·¯çº¿ä¸»è¡¨ |
| | | ProductProcessRoute productProcessRoute = productProcessRouteMapper.selectList(Wrappers.<ProductProcessRoute>lambdaQuery().eq(ProductProcessRoute::getProductOrderId,productOrder.getId()).orderByDesc(ProductProcessRoute::getId)).get(0); |
| | | ProductProcessRoute productProcessRoute = productProcessRouteMapper.selectList(Wrappers.<ProductProcessRoute>lambdaQuery().eq(ProductProcessRoute::getProductOrderId, productOrder.getId()).orderByDesc(ProductProcessRoute::getId)).get(0); |
| | | ProductProcessRoute newProcessRoute = new ProductProcessRoute(); |
| | | BeanUtils.copyProperties(productProcessRoute, newProcessRoute); |
| | | newProcessRoute.setId(null); |
| | |
| | | } |
| | | break; |
| | | case "æ¥åº": |
| | | //è°ç¨ä¸åæ ¼åºåæ¥å£ å
¥ä¸åæ ¼åº |
| | | stockUtils.addUnStock(qualityInspect.getProductModelId(), unqualified.getQuantity(), StockUnQualifiedRecordTypeEnum.DEFECTIVE_SCRAP.getCode(),unqualified.getId()); |
| | | break; |
| | | case "è®©æ¥æ¾è¡": |
| | | //è°ç¨æäº¤åæ ¼çæ¥å£ |
| | | stockUtils.addStock(qualityInspect.getProductModelId(), unqualified.getQuantity(), StockQualifiedRecordTypeEnum.DEFECTIVE_PASS.getCode(),unqualified.getId()); |
| | | qualityInspect.setCheckResult("åæ ¼"); |
| | | qualityInspectService.submit(qualityInspect); |
| | | break; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | |
| | | @RequestMapping("/sales/ledger") |
| | | @AllArgsConstructor |
| | | @Api(tags = "éå®å°è´¦") |
| | | @Slf4j |
| | | public class SalesLedgerController extends BaseController { |
| | | |
| | | private ISalesLedgerService salesLedgerService; |
| | |
| | | return salesLedgerService.importData(file); |
| | | } |
| | | |
| | | @ApiOperation("导åºéå®å°è´¦æ¨¡æ¿") |
| | | @PostMapping("/exportTemplate") |
| | | public void exportTemplate(HttpServletResponse response) { |
| | | // 1. æ¨¡æ¿æä»¶å¨resources/staticä¸çè·¯å¾ |
| | | String templatePath = "static/éå®å°è´¦å¯¼å
¥æ¨¡æ¿.xlsx"; |
| | | |
| | | // 2. è·åæ¨¡æ¿æä»¶çè¾å
¥æµ |
| | | try (InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(templatePath)) { |
| | | if (inputStream == null) { |
| | | throw new FileNotFoundException("æ¨¡æ¿æä»¶ä¸åå¨ï¼" + templatePath); |
| | | } |
| | | |
| | | // 3. 设置ååºå¤´ï¼è§¦åæµè§å¨ä¸è½½ |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | String fileName = URLEncoder.encode("éå®å°è´¦å¯¼å
¥æ¨¡æ¿.xlsx", "utf-8").replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName); |
| | | |
| | | // 4. å°æ¨¡æ¿æä»¶åå
¥ååºè¾åºæµ |
| | | try (OutputStream outputStream = response.getOutputStream()) { |
| | | byte[] buffer = new byte[1024]; |
| | | int len; |
| | | while ((len = inputStream.read(buffer)) > 0) { |
| | | outputStream.write(buffer, 0, len); |
| | | } |
| | | outputStream.flush(); |
| | | } |
| | | } catch (IOException e) { |
| | | log.error("导åºéå®å°è´¦æ¨¡æ¿å¤±è´¥", e); |
| | | // è¥æ¨¡æ¿æä»¶è¯»å失败ï¼è¿åé误æç¤º |
| | | try { |
| | | response.getWriter().write("模æ¿å¯¼åºå¤±è´¥ï¼" + e.getMessage()); |
| | | } catch (IOException ex) { |
| | | log.error("ååºè¾åºé误", ex); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢éå®å°è´¦å表 |
| | | */ |
| | |
| | | // procurementDto.setSalesLedgerProductId(item.getId()); |
| | | // procurementDto.setProductCategory(item.getProductCategory()); |
| | | // IPage<ProcurementPageDtoCopy> result = procurementRecordService.listPageCopyByProduction(new Page<>(1,-1), procurementDto); |
| | | BigDecimal stockQuantity = stockUtils.getStockQuantity(item.getProductModelId()).get("stockQuantity"); |
| | | if(stockQuantity != null) { |
| | | // BigDecimal stockQuantity = stockUtils.getStockQuantity(item.getProductModelId()).get("stockQuantity"); |
| | | |
| | | // ProcurementPageDtoCopy procurementDtoCopy = result.getRecords().get(0); |
| | | if (item.getQuantity().compareTo(stockQuantity) <= 0 && item.getApproveStatus() == 0) { |
| | | item.setApproveStatus(1); |
| | | salesLedgerProductService.addOrUpdateSalesLedgerProduct(item); |
| | | if (item.getApproveStatus() != 2) { |
| | | if (item.getHasSufficientStock() == 0) { |
| | | item.setApproveStatus(0); |
| | | }else { |
| | | item.setApproveStatus(1); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(list); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.approve.mapper.ApproveProcessMapper; |
| | | import com.ruoyi.approve.service.impl.ApproveProcessServiceImpl; |
| | | import com.ruoyi.approve.vo.ApproveProcessVO; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.other.service.impl.TempFileServiceImpl; |
| | | import com.ruoyi.sales.dto.ShippingInfoDto; |
| | | import com.ruoyi.sales.mapper.ShipmentApprovalMapper; |
| | | import com.ruoyi.sales.mapper.ShippingInfoMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | |
| | | import com.ruoyi.sales.service.ISalesLedgerProductService; |
| | | import com.ruoyi.sales.service.ISalesLedgerService; |
| | | import com.ruoyi.sales.service.ShippingInfoService; |
| | | import com.ruoyi.sales.service.impl.CommonFileServiceImpl; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private ISalesLedgerProductService salesLedgerProductService; |
| | | |
| | | @Autowired |
| | | private TempFileServiceImpl tempFileService; |
| | | |
| | | @Autowired |
| | | private CommonFileServiceImpl commonFileService; |
| | | |
| | | @Autowired |
| | | private ApproveProcessServiceImpl approveProcessService; |
| | | |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("åè´§ä¿¡æ¯å表") |
| | |
| | | @PostMapping("/add") |
| | | @ApiOperation("æ·»å åè´§ä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody ShippingInfo req) { |
| | | LambdaQueryWrapper<ShippingInfo> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(ShippingInfo::getSalesLedgerId, req.getSalesLedgerId()); |
| | | wrapper.eq(ShippingInfo::getSalesLedgerProductId, req.getSalesLedgerProductId()); |
| | | List<ShippingInfo> list = shippingInfoService.list(wrapper); |
| | | if(!CollectionUtils.isEmpty(list)){ |
| | | return AjaxResult.error("åè´§ä¿¡æ¯å·²åå¨"); |
| | | } |
| | | @Log(title = "åè´§ä¿¡æ¯ç®¡ç", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody ShippingInfoDto req) throws Exception { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | String sh = OrderUtils.countTodayByCreateTime(shippingInfoMapper, "SH"); |
| | | // åè´§å®¡æ¹ |
| | | ApproveProcessVO approveProcessVO = new ApproveProcessVO(); |
| | | approveProcessVO.setApproveType(7); |
| | | approveProcessVO.setApproveDeptId(loginUser.getTenantId()); |
| | | approveProcessVO.setApproveReason(req.getType() + ":" +sh); |
| | | approveProcessVO.setApproveUserIds(req.getApproveUserIds()); |
| | | approveProcessVO.setApproveUser(loginUser.getUserId()); |
| | | approveProcessVO.setApproveTime(LocalDate.now().toString()); |
| | | approveProcessService.addApprove(approveProcessVO); |
| | | // æ·»å åè´§æ¶æ¯ |
| | | req.setShippingNo(sh); |
| | | req.setStatus("å¾
å®¡æ ¸"); |
| | | boolean save = shippingInfoService.save(req); |
| | | if(save){ |
| | | ShippingInfo shippingInfo = shippingInfoService.getOne(wrapper); |
| | | ShipmentApproval shipmentApproval = new ShipmentApproval(); |
| | | shipmentApproval.setSalesLedgerId(req.getSalesLedgerId()); |
| | | shipmentApproval.setSalesLedgerProductId(req.getSalesLedgerProductId()); |
| | | shipmentApproval.setApproveUserId(req.getApproverId()); |
| | | shipmentApproval.setApproveStatus(2); |
| | | shipmentApproval.setShippingInfoId(shippingInfo.getId()); |
| | | shipmentApprovalMapper.insert(shipmentApproval); |
| | | |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductService.getById(req.getSalesLedgerProductId()); |
| | | if(salesLedgerProduct != null){ |
| | | salesLedgerProduct.setApproveStatus(2); |
| | | salesLedgerProductService.updateById(salesLedgerProduct); |
| | | } |
| | | |
| | | } |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("ä¿®æ¹åè´§ä¿¡æ¯") |
| | | public AjaxResult update(@RequestBody ShippingInfo req) { |
| | | @ApiOperation("åè´§æ£åºå") |
| | | @PostMapping("/deductStock") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "åè´§ä¿¡æ¯ç®¡ç", businessType = BusinessType.UPDATE) |
| | | public AjaxResult deductStock(@RequestBody ShippingInfoDto req) throws IOException { |
| | | ShippingInfo byId = shippingInfoService.getById(req.getId()); |
| | | if (byId == null) { |
| | | return AjaxResult.error("åè´§ä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | Long userId = getLoginUser().getUserId(); |
| | | if(!userId.equals(Long.parseLong(byId.getCreateUser().toString()))){ |
| | | return AjaxResult.error("æ¨æ²¡ææéä¿®æ¹æ¤åè´§ä¿¡æ¯"); |
| | | byId.setExpressNumber(req.getExpressNumber()); |
| | | byId.setExpressCompany(req.getExpressCompany()); |
| | | byId.setShippingCarNumber(req.getShippingCarNumber()); |
| | | boolean update = shippingInfoService.updateById(req); |
| | | // è¿ç§»æä»¶ |
| | | if(CollectionUtils.isNotEmpty(req.getTempFileIds())){ |
| | | tempFileService.migrateTempFilesToFormal(req.getId(), req.getTempFileIds(), FileNameType.SHIP.getValue()); |
| | | } |
| | | return update ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("ä¿®æ¹åè´§ä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "åè´§ä¿¡æ¯ç®¡ç", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody ShippingInfo req) { |
| | | ShippingInfo byId = shippingInfoService.getById(req.getId()); |
| | | if (byId == null) { |
| | | return AjaxResult.error("åè´§ä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | boolean update = shippingInfoService.updateById(req); |
| | | return update ? AjaxResult.success() : AjaxResult.error(); |
| | |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("å é¤åè´§ä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "åè´§ä¿¡æ¯ç®¡ç", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | Long userId = getLoginUser().getUserId(); |
| | | ids.forEach(id -> { |
| | | ShippingInfo byId = shippingInfoService.getById(id); |
| | | if (byId == null) { |
| | | throw new RuntimeException("åè´§ä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | if(!userId.equals(Long.parseLong(byId.getCreateUser().toString()))){ |
| | | throw new RuntimeException("æ¨æ²¡ææéå 餿¤åè´§ä¿¡æ¯"); |
| | | } |
| | | }); |
| | | commonFileService.deleteByBusinessIds(ids, FileNameType.SHIP.getValue()); |
| | | boolean delete = shippingInfoService.removeBatchByIds(ids); |
| | | return delete ? AjaxResult.success("å 餿å") : AjaxResult.error("å é¤å¤±è´¥"); |
| | | } |
| | |
| | | private String salesman; |
| | | @Excel(name = "客æ·åç§°") |
| | | private String customerName; |
| | | @Excel(name = "项ç®åç§°") |
| | | private String projectName; |
| | | @Excel(name = "å½å
¥äºº") |
| | | private String entryPerson; |
| | | @Excel(name = "夿³¨") |
| | |
| | | @Excel(name = "ååéé¢") |
| | | private BigDecimal contractAmount; |
| | | |
| | | @ApiModelProperty(value = "仿¬¾æ¹å¼") |
| | | @Excel(name = "仿¬¾æ¹å¼") |
| | | private String paymentMethod; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2026/1/23 16:35 |
| | | */ |
| | | @Data |
| | | public class ShippingInfoDto extends ShippingInfo { |
| | | |
| | | /** |
| | | * 审æ¹äººidå表 |
| | | */ |
| | | // 审æ¹äºº |
| | | private String approveUserIds; |
| | | |
| | | private String type; // åè´§ç±»å |
| | | |
| | | @TableField(exist = false) |
| | | private List<String> tempFileIds; |
| | | @TableField(exist = false) |
| | | private List<CommonFile> commonFileList; |
| | | |
| | | } |
| | |
| | | * @date 2025-05-08 |
| | | */ |
| | | public interface SalesLedgerProductMapper extends MyBaseMapper<SalesLedgerProduct> { |
| | | List<SalesLedgerProduct> selectProduct() ; |
| | | |
| | | List<SalesLedgerProduct> selectSalesLedgerProductList(@Param("salesLedgerProduct") SalesLedgerProduct salesLedgerProduct); |
| | | |
| | | SalesLedgerProduct selectSalesLedgerProductByMainId(@Param("productMainId") Long productMainId); |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date shippingDate; |
| | | |
| | | // @TableField(exist = false) |
| | | // @ApiModelProperty(value = "çäº§ç¶æ") |
| | | // private String productionStatus = "æªå¼å§"; |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "åè´§ç¶æ") |
| | | private String shippingStatus; |
| | | /** |
| | | * å货审æ¹ç¶æ |
| | | * 产åç¶æ |
| | | */ |
| | | // @TableField(exist = false) |
| | | @ApiModelProperty(value = "审æ¹ç¶æï¼0æªç产,1å·²ç产,2å·²åè´§") |
| | | @ApiModelProperty(value = "产åç¶æï¼1-å
è¶³") |
| | | private Integer approveStatus; |
| | | |
| | | @ApiModelProperty(value = "å¾
忬¾æ»éé¢") |
| | |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦è´¨æ£") |
| | | private Boolean isChecked; |
| | | |
| | | @TableField(exist = false) |
| | | private Integer hasSufficientStock; |
| | | } |
| | |
| | | @TableName("shipping_info") |
| | | public class ShippingInfo { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "éå®å°è´¦id") |
| | | private Long salesLedgerId; |
| | | @ApiModelProperty(value = "é宿¥ä»·äº§å表id") |
| | | private Long salesLedgerProductId; |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "éå®ååå·") |
| | | @Excel(name = "éå®ååå·") |
| | |
| | | @Excel(name = "客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "éå®å°è´¦id") |
| | | private Long salesLedgerId; |
| | | |
| | | @ApiModelProperty(value = "é宿¥ä»·äº§å表id") |
| | | private Long salesLedgerProductId; |
| | | |
| | | @ApiModelProperty(value = "ç¶æ") |
| | | @Excel(name = "ç¶æ") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "åè´§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "åè´§æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date shippingDate; |
| | | |
| | | @ApiModelProperty(value = "åè´§ç¼å·") |
| | | @Excel(name = "åè´§ç¼å·") |
| | | private String shippingNo; |
| | | |
| | | @ApiModelProperty(value = "å¿«éåå·") |
| | | @Excel(name = "å¿«éåå·") |
| | | private String expressNumber; |
| | | |
| | | @ApiModelProperty(value = "å¿«éå
¬å¸") |
| | | @Excel(name = "å¿«éå
¬å¸") |
| | | private String expressCompany; |
| | | |
| | | @ApiModelProperty(value = "åè´§ç±»å") |
| | | @Excel(name = "åè´§ç±»å") |
| | | private String type; |
| | | |
| | | @ApiModelProperty(value = "å货车çå·") |
| | | @Excel(name = "å货车çå·") |
| | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | @ApiModelProperty(value = "审æ¹äººid") |
| | | @TableField(exist = false) |
| | | private Integer approverId; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.sales.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.other.mapper.TempFileMapper; |
| | |
| | | @Value("${file.upload-dir}") |
| | | private String uploadDir; |
| | | |
| | | public void deleteByBusinessId(Long businessId,Integer type) { |
| | | commonFileMapper.delete(new LambdaQueryWrapper<CommonFile>().eq(CommonFile::getCommonId, businessId) |
| | | .eq(CommonFile::getType, type)); |
| | | } |
| | | |
| | | public void deleteByBusinessIds(List<Long> businessId,Integer type) { |
| | | commonFileMapper.delete(new LambdaQueryWrapper<CommonFile>().in(CommonFile::getCommonId, businessId) |
| | | .eq(CommonFile::getType, type)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int deleteSalesLedgerByIds(Long[] ids) { |
| | |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | |
| | | if (CollectionUtils.isEmpty(salesLedgerProductImportDtoList)) return AjaxResult.error("éå®äº§åæ°æ®ä¸ºç©ºï¼"); |
| | | // å®¢æ·æ°æ® |
| | | List<Customer> customers = customerMapper.selectList(new LambdaQueryWrapper<Customer>().in(Customer::getCustomerName, |
| | | salesLedgerImportDtoList.stream().map(SalesLedgerImportDto::getCustomerName).toArray(String[]::new))); |
| | | // è§æ ¼åå·æ°æ® |
| | | List<ProductModel> productModels = productModelMapper.selectList(new LambdaQueryWrapper<ProductModel>().in(ProductModel::getModel, |
| | | salesLedgerImportDtoList.stream().map(SalesLedgerImportDto::getSpecificationModel).toArray(String[]::new))); |
| | | // 产åå¤§ç±»æ°æ® |
| | | List<Product> productList = productMapper.selectList(new LambdaQueryWrapper<Product>().in(Product::getProductName, |
| | | salesLedgerImportDtoList.stream().map(SalesLedgerImportDto::getProductCategory).toArray(String[]::new))); |
| | | salesLedgerImportDtoList.stream().map(SalesLedgerImportDto::getCustomerName).collect(Collectors.toList()))); |
| | | // // è§æ ¼åå·æ°æ® |
| | | // List<ProductModel> productModels = productModelMapper.selectList(new LambdaQueryWrapper<ProductModel>().in(ProductModel::getModel, |
| | | // salesLedgerProductImportDtoList.stream().map(SalesLedgerImportDto::getSpecificationModel).collect(Collectors.toList()))); |
| | | // // 产åå¤§ç±»æ°æ® |
| | | // List<Product> productList = productMapper.selectList(new LambdaQueryWrapper<Product>().in(Product::getProductName, |
| | | // salesLedgerProductImportDtoList.stream().map(SalesLedgerImportDto::getProductCategory).collect(Collectors.toList()))); |
| | | List<Map<String,Object>> list = productModelMapper.getProductAndModelList(); |
| | | // å½å
¥äººæ°æ® |
| | | List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>().in(SysUser::getNickName, |
| | | salesLedgerImportDtoList.stream().map(SalesLedgerImportDto::getEntryPerson).toArray(String[]::new))); |
| | | salesLedgerImportDtoList.stream().map(SalesLedgerImportDto::getEntryPerson).collect(Collectors.toList()))); |
| | | for (SalesLedgerImportDto salesLedgerImportDto : salesLedgerImportDtoList) { |
| | | SalesLedger salesLedger = new SalesLedger(); |
| | | BeanUtils.copyProperties(salesLedgerImportDto, salesLedger); |
| | | salesLedger.setExecutionDate(DateUtils.toLocalDate(salesLedgerImportDto.getExecutionDate())); |
| | | // éè¿å®¢æ·åç§°æ¥è¯¢å®¢æ·IDï¼å®¢æ·ååå· |
| | | salesLedger.setCustomerId(customers.stream() |
| | | .filter(customer -> customer.getCustomerName().equals(salesLedger.getCustomerName())) |
| | |
| | | salesLedgerProduct.setTaxExclusiveTotalPrice(salesLedgerProduct.getTaxInclusiveTotalPrice().divide(new BigDecimal(1).add(salesLedgerProduct.getTaxRate().divide(new BigDecimal(100))), 2, RoundingMode.HALF_UP)); |
| | | salesLedgerProduct.setNoInvoiceNum(salesLedgerProduct.getQuantity()); |
| | | salesLedgerProduct.setNoInvoiceAmount(salesLedgerProduct.getTaxExclusiveTotalPrice()); |
| | | |
| | | salesLedgerProduct.setProductId(productList.stream() |
| | | .filter(product -> product.getProductName().equals(salesLedgerProduct.getProductCategory())) |
| | | list.stream() |
| | | .filter(map -> map.get("productName").equals(salesLedgerProduct.getProductCategory()) && map.get("model").equals(salesLedgerProduct.getSpecificationModel())) |
| | | .findFirst() |
| | | .map(Product::getId) |
| | | .orElse(null)); |
| | | salesLedgerProduct.setProductModelId(productModels.stream() |
| | | .filter(productModel -> productModel.getModel().equals(salesLedgerProduct.getSpecificationModel())) |
| | | .findFirst() |
| | | .map(ProductModel::getId) |
| | | .orElse(null)); |
| | | .ifPresent(map -> { |
| | | salesLedgerProduct.setProductModelId(Long.parseLong(map.get("modelId").toString())); |
| | | salesLedgerProduct.setProductId(Long.parseLong(map.get("id").toString())); |
| | | }); |
| | | // salesLedgerProduct.setProductId(productList.stream() |
| | | // .filter(product -> product.getProductName().equals(salesLedgerProduct.getProductCategory())) |
| | | // .findFirst() |
| | | // .map(Product::getId) |
| | | // .orElse(null)); |
| | | // salesLedgerProduct.setProductModelId(productModels.stream() |
| | | // .filter(productModel -> productModel.getModel().equals(salesLedgerProduct.getSpecificationModel())) |
| | | // .findFirst() |
| | | // .map(ProductModel::getId) |
| | | // .orElse(null)); |
| | | salesLedgerProduct.setRegister(loginUser.getNickName()); |
| | | salesLedgerProduct.setRegisterDate(LocalDateTime.now()); |
| | | salesLedgerProduct.setApproveStatus(0); |
| | | salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProductImportDto.getTaxInclusiveTotalPrice()); |
| | | salesLedgerProductMapper.insert(salesLedgerProduct); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | return AjaxResult.success("导å
¥æå"); |
| | |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.service.StockInRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | |
| | | return AjaxResult.success(stockInRecordService.batchDelete(ids)); |
| | | } |
| | | |
| | | @PostMapping("/exportStockInRecord") |
| | | @ApiOperation("导åºå
¥åºè®°å½") |
| | | public void exportStockInRecord(HttpServletResponse response, StockInRecordDto stockInRecordDto) { |
| | | stockInRecordService.exportStockInRecord(response,stockInRecordDto); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.enums.StockRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.compensationperformance.pojo.CompensationPerformance; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.pojo.StockInventory; |
| | | import com.ruoyi.stock.execl.StockInventoryExportData; |
| | | import com.ruoyi.stock.service.StockInventoryService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @PostMapping("/addstockInventory") |
| | | @ApiOperation("æ°å¢åºå") |
| | | public R addstockInventory(@RequestBody StockInventoryDto stockInventoryDto) { |
| | | stockInventoryDto.setRecordType(String.valueOf(StockRecordTypeEnum.CUSTOMIZATION_STOCK_IN.getCode())); |
| | | stockInventoryDto.setRecordType(String.valueOf(StockQualifiedRecordTypeEnum.CUSTOMIZATION_STOCK_IN.getCode())); |
| | | stockInventoryDto.setRecordId(0L); |
| | | return R.ok(stockInventoryService.addstockInventory(stockInventoryDto)); |
| | | } |
| | |
| | | @PostMapping("/subtractStockInventory") |
| | | @ApiOperation("æ£ååºå") |
| | | public R subtractStockInventory(@RequestBody StockInventoryDto stockInventoryDto) { |
| | | stockInventoryDto.setRecordType(String.valueOf(StockRecordTypeEnum.CUSTOMIZATION_STOCK_OUT.getCode())); |
| | | stockInventoryDto.setRecordType(String.valueOf(StockQualifiedRecordTypeEnum.CUSTOMIZATION_STOCK_OUT.getCode())); |
| | | stockInventoryDto.setRecordId(0L); |
| | | return R.ok(stockInventoryService.subtractStockInventory(stockInventoryDto)); |
| | | } |
| | |
| | | @GetMapping("importStockInventory") |
| | | @ApiOperation("导å
¥åºå") |
| | | public R importStockInventory(MultipartFile file) { |
| | | return R.ok(stockInventoryService.importStockInventory(file)); |
| | | return stockInventoryService.importStockInventory(file); |
| | | } |
| | | |
| | | @Log(title = "ä¸è½½åºå导å
¥æ¨¡æ¿", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/downloadStockInventory") |
| | | public void downloadStockInventory(HttpServletResponse response) { |
| | | List<StockInventoryExportData> list = new ArrayList<>(); |
| | | ExcelUtil<StockInventoryExportData> util = new ExcelUtil<>(StockInventoryExportData.class); |
| | | util.exportExcel(response, list, "åºå模æ¿"); |
| | | } |
| | | |
| | | @PostMapping("/exportStockInventory") |
| | | @ApiOperation("导åºåºå") |
| | | public void exportStockInventory(HttpServletResponse response,StockInventoryDto stockInventoryDto) { |
| | | stockInventoryService.exportStockInventory(response,stockInventoryDto); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | | import com.ruoyi.stock.dto.StockOutRecordDto; |
| | | import com.ruoyi.stock.pojo.StockOutRecord; |
| | | import com.ruoyi.stock.service.StockOutRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | } |
| | | return AjaxResult.success(stockOutRecordService.batchDelete(ids)); |
| | | } |
| | | |
| | | @PostMapping("/exportStockOutRecord") |
| | | @ApiOperation("导åºåºåºè®°å½") |
| | | public void exportStockOutRecord(HttpServletResponse response, StockOutRecordDto stockOutRecordDto) { |
| | | stockOutRecordService.exportStockOutRecord(response,stockOutRecordDto); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.enums.StockRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockUnQualifiedRecordTypeEnum; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.dto.StockUninventoryDto; |
| | | import com.ruoyi.stock.service.StockInventoryService; |
| | | import com.ruoyi.stock.service.StockUninventoryService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @PostMapping("/addstockUninventory") |
| | | @ApiOperation("æ°å¢åºå") |
| | | public R addstockUninventory(@RequestBody StockUninventoryDto stockUninventoryDto) { |
| | | stockUninventoryDto.setRecordType(String.valueOf(StockRecordTypeEnum.CUSTOMIZATION_UNSTOCK_IN.getCode())); |
| | | stockUninventoryDto.setRecordType(String.valueOf(StockUnQualifiedRecordTypeEnum.CUSTOMIZATION_UNSTOCK_IN.getCode())); |
| | | stockUninventoryDto.setRecordId(0L); |
| | | return R.ok(stockUninventoryService.addStockUninventory(stockUninventoryDto)); |
| | | } |
| | |
| | | @PostMapping("/subtractstockUninventory") |
| | | @ApiOperation("æ£ååºå") |
| | | public R subtractstockUninventory(@RequestBody StockUninventoryDto stockUninventoryDto) { |
| | | stockUninventoryDto.setRecordType(String.valueOf(StockRecordTypeEnum.CUSTOMIZATION_UNSTOCK_OUT.getCode())); |
| | | stockUninventoryDto.setRecordType(String.valueOf(StockUnQualifiedRecordTypeEnum.CUSTOMIZATION_UNSTOCK_OUT.getCode())); |
| | | stockUninventoryDto.setRecordId(0L); |
| | | return R.ok(stockUninventoryService.subtractStockUninventory(stockUninventoryDto)); |
| | | } |
| | | |
| | | @PostMapping("/exportStockUninventory") |
| | | @ApiOperation("导åºåºå") |
| | | public void exportStockUninventory(HttpServletResponse response, StockUninventoryDto stockUninventoryDto) { |
| | | stockUninventoryService.exportStockUninventory(response,stockUninventoryDto); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.stock.execl; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class StockInRecordExportData { |
| | | |
| | | @Excel(name = "å
¥åºæ¹æ¬¡") |
| | | private String inboundBatches; |
| | | @Excel(name = "产ååç§°") |
| | | private String productName; |
| | | @Excel(name = "è§æ ¼åå·") |
| | | private String model; |
| | | @Excel(name = "åä½") |
| | | private String unit; |
| | | @Excel(name = "å
¥åºæ¥æº") |
| | | private String recordType; |
| | | @Excel(name = "å
¥åºæ°é") |
| | | private String stockInNum; |
| | | @Excel(name = "å
¥åºæ¶é´") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @Excel(isExport = false) |
| | | private String type; |
| | | } |
| | |
| | | package com.ruoyi.stock.execl; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class StockInventoryExportData { |
| | | |
| | | |
| | | |
| | | @Excel(name = "产ååç§°") |
| | | private String productName; |
| | | |
| | | @Excel(name = "è§æ ¼") |
| | | private String model; |
| | | |
| | | @Excel(name = "åä½") |
| | | private String unit; |
| | | |
| | | @Excel(name = "åºåæ°é") |
| | | private BigDecimal qualitity; |
| | | |
| | | @Excel(name = "夿³¨") |
| | | private String remark; |
| | | |
| | | @Excel(name = "ææ°æ´æ°æ¶é´") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.stock.execl; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class StockOutRecordExportData { |
| | | @Excel(name = "åºåºæ¹æ¬¡") |
| | | private String outboundBatches; |
| | | @Excel(name = "产ååç§°") |
| | | private String productName; |
| | | @Excel(name = "è§æ ¼åå·") |
| | | private String model; |
| | | @Excel(name = "åä½") |
| | | private String unit; |
| | | @Excel(name = "åºåºæ¥æº") |
| | | private String recordType; |
| | | @Excel(name = "åºåºæ°é") |
| | | private String stockInNum; |
| | | @Excel(name = "åºåºæ¶é´") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @Excel(isExport = false) |
| | | private String type; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | | import com.ruoyi.stock.execl.StockInRecordExportData; |
| | | import com.ruoyi.stock.pojo.StockInRecord; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface StockInRecordMapper extends BaseMapper<StockInRecord> { |
| | | IPage<StockInRecordDto> listPage(Page page, @Param("params") StockInRecordDto stockInRecordDto); |
| | | |
| | | List<StockInRecordExportData> listStockInRecordExportData(@Param("params") StockInRecordDto stockInRecordDto); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.execl.StockInventoryExportData; |
| | | import com.ruoyi.stock.pojo.StockInventory; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | int updateAddStockInventory(@Param("ew") StockInventoryDto stockInventoryDto); |
| | | |
| | | int updateSubtractStockInventory(@Param("ew") StockInventoryDto stockInventoryDto); |
| | | |
| | | List<StockInventoryExportData> listStockInventoryExportData(@Param("ew") StockInventoryDto stockInventoryDto); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.stock.dto.StockOutRecordDto; |
| | | import com.ruoyi.stock.execl.StockOutRecordExportData; |
| | | import com.ruoyi.stock.pojo.StockOutRecord; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public interface StockOutRecordMapper extends BaseMapper<StockOutRecord> { |
| | | IPage<StockOutRecordDto> listPage(Page page, @Param("params") StockOutRecordDto stockOutRecordDto); |
| | | |
| | | List<StockOutRecordExportData> listStockOutRecordExportData(@Param("params") StockOutRecordDto stockOutRecordDto); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.stock.dto.StockUninventoryDto; |
| | | import com.ruoyi.stock.execl.StockInventoryExportData; |
| | | import com.ruoyi.stock.pojo.StockUninventory; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | int updateSubtractStockUnInventory(StockUninventoryDto stockUninventoryDto); |
| | | |
| | | int updateAddStockUnInventory(StockUninventoryDto stockUninventoryDto); |
| | | |
| | | List<StockInventoryExportData> listStockInventoryExportData(@Param("ew") StockUninventoryDto stockUninventoryDto); |
| | | } |
| | |
| | | @ApiModelProperty(value = "å
¥åºæ°é") |
| | | private BigDecimal stockInNum; |
| | | |
| | | @ApiModelProperty(value = "è®°å½ç±»å éè´å
¥åº/ç产å
¥åº/è´¨éå
¥åº/èªå®ä¹å
¥åº") |
| | | @ApiModelProperty(value = "è®°å½ç±»å æä¸¾") |
| | | private String recordType; |
| | | |
| | | @ApiModelProperty(value = "è®°å½ID salesProductId/ProductrMainId/qualityInspectId/0") |
| | | @ApiModelProperty(value = "è®°å½ID ") |
| | | private Long recordId; |
| | | |
| | | @ApiModelProperty(value = "产åè§æ ¼ID") |
| | |
| | | |
| | | @ApiModelProperty("é¢è¦æ°é") |
| | | private Integer warnNum; |
| | | |
| | | @ApiModelProperty("夿³¨") |
| | | private String remark; |
| | | } |
| | |
| | | @ApiModelProperty("çæ¬å·") |
| | | private Integer version; |
| | | |
| | | @ApiModelProperty("夿³¨") |
| | | private String remark; |
| | | |
| | | } |
| | |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | | import com.ruoyi.stock.pojo.StockInRecord; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | public interface StockInRecordService extends IService<StockInRecord> { |
| | |
| | | |
| | | int batchDelete(List<Long> ids); |
| | | |
| | | void exportStockInRecord(HttpServletResponse response, StockInRecordDto stockInRecordDto); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * <p> |
| | | * åºå表 æå¡ç±» |
| | |
| | | |
| | | Boolean subtractStockInventory(StockInventoryDto stockInventoryDto); |
| | | |
| | | Boolean importStockInventory(MultipartFile file); |
| | | R importStockInventory(MultipartFile file); |
| | | |
| | | void exportStockInventory(HttpServletResponse response, StockInventoryDto stockInventoryDto); |
| | | } |
| | |
| | | import com.ruoyi.stock.dto.StockOutRecordDto; |
| | | import com.ruoyi.stock.pojo.StockOutRecord; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | int update(Long id, StockOutRecordDto stockOutRecordDto); |
| | | |
| | | int batchDelete(List<Long> ids); |
| | | |
| | | void exportStockOutRecord(HttpServletResponse response, StockOutRecordDto stockOutRecordDto); |
| | | } |
| | |
| | | import com.ruoyi.stock.pojo.StockUninventory; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * <p> |
| | | * ä¸åæ ¼åºå表 æå¡ç±» |
| | |
| | | Integer addStockUninventory(StockUninventoryDto stockUninventoryDto); |
| | | |
| | | Integer subtractStockUninventory(StockUninventoryDto stockUninventoryDto); |
| | | |
| | | void exportStockUninventory(HttpServletResponse response, StockUninventoryDto stockUninventoryDto); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.enums.StockQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockUnQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.EnumUtil; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.dto.StockUninventoryDto; |
| | | import com.ruoyi.stock.execl.StockInRecordExportData; |
| | | import com.ruoyi.stock.execl.StockInventoryExportData; |
| | | import com.ruoyi.stock.mapper.StockInRecordMapper; |
| | | import com.ruoyi.stock.mapper.StockInventoryMapper; |
| | | import com.ruoyi.stock.mapper.StockUninventoryMapper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | } |
| | | return stockInRecordMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public void exportStockInRecord(HttpServletResponse response, StockInRecordDto stockInRecordDto) { |
| | | List<StockInRecordExportData> list = stockInRecordMapper.listStockInRecordExportData(stockInRecordDto); |
| | | for (StockInRecordExportData stockInRecordExportData : list) { |
| | | if (stockInRecordExportData.getType().equals("0")) { |
| | | stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue()); |
| | | }else { |
| | | stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockUnQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue()); |
| | | } |
| | | } |
| | | ExcelUtil<StockInRecordExportData> util = new ExcelUtil<>(StockInRecordExportData.class); |
| | | util.exportExcel(response,list, "å
¥åºè®°å½ä¿¡æ¯"); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.excel.SupplierManageExcelDto; |
| | | import com.ruoyi.basic.pojo.SupplierManage; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.account.pojo.BorrowInfo; |
| | | import com.ruoyi.common.enums.StockQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.dto.StockOutRecordDto; |
| | | import com.ruoyi.stock.execl.StockInventoryExportData; |
| | | import com.ruoyi.stock.pojo.StockInRecord; |
| | | import com.ruoyi.stock.pojo.StockInventory; |
| | | import com.ruoyi.stock.mapper.StockInventoryMapper; |
| | | import com.ruoyi.stock.service.StockInRecordService; |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.stock.service.StockOutRecordService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.ArrayList; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private StockInventoryMapper stockInventoryMapper; |
| | | private StockInRecordService stockInRecordService; |
| | | private StockOutRecordService stockOutRecordService; |
| | | |
| | | private SalesLedgerProductMapper salesLedgerProductMapper; |
| | | @Override |
| | | public IPage<StockInventoryDto> pagestockInventory(Page page, StockInventoryDto stockInventoryDto) { |
| | | return stockInventoryMapper.pagestockInventory(page, stockInventoryDto); |
| | |
| | | newStockInventory.setProductModelId(stockInventoryDto.getProductModelId()); |
| | | newStockInventory.setQualitity(stockInventoryDto.getQualitity()); |
| | | newStockInventory.setVersion(1); |
| | | newStockInventory.setRemark(stockInventoryDto.getRemark()); |
| | | stockInventoryMapper.insert(newStockInventory); |
| | | }else { |
| | | stockInventoryMapper.updateAddStockInventory(stockInventoryDto); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Boolean importStockInventory(MultipartFile file) { |
| | | public R importStockInventory(MultipartFile file) { |
| | | try { |
| | | final StringBuffer[] errorMsg = {new StringBuffer()}; |
| | | //æ¥è¯¢ææç产å |
| | | List<SalesLedgerProduct> salesLedgerProducts =salesLedgerProductMapper.selectProduct(); |
| | | |
| | | ExcelUtil<StockInventoryExportData> util = new ExcelUtil<StockInventoryExportData>(StockInventoryExportData.class); |
| | | List<StockInventoryExportData> list = util.importExcel(file.getInputStream()); |
| | | ArrayList<StockInventory> stockInventories = new ArrayList<>(); |
| | | list.stream().forEach(dto -> { |
| | | // TODO: 2026/1/21 æ·»å å
¥åºè®°å½ |
| | | salesLedgerProducts.stream().forEach(item->{ |
| | | if (item.getProductCategory().equals(dto.getProductName())&&item.getSpecificationModel().equals(dto.getModel())) { |
| | | //æ´æ°åºå |
| | | StockInventoryDto stockInventoryDto = new StockInventoryDto(); |
| | | stockInventoryDto.setRecordId(0L); |
| | | stockInventoryDto.setRecordType(StockQualifiedRecordTypeEnum.CUSTOMIZATION_STOCK_IN.getCode()); |
| | | stockInventoryDto.setQualitity(dto.getQualitity()); |
| | | stockInventoryDto.setProductModelId(item.getProductModelId()); |
| | | this.addstockInventory(stockInventoryDto); }else { |
| | | errorMsg[0] = errorMsg[0].append("产ååç§°ï¼"+dto.getProductName()+"è§æ ¼ï¼"+dto.getModel()+"ä¸åå¨").append("\n"); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | this.saveOrUpdateBatch(stockInventories); |
| | | return true; |
| | | return R.ok(errorMsg[0]); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return false; |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | | public void exportStockInventory(HttpServletResponse response, StockInventoryDto stockInventoryDto) { |
| | | |
| | | List<StockInventoryExportData> list = stockInventoryMapper.listStockInventoryExportData(stockInventoryDto); |
| | | ExcelUtil<StockInventoryExportData> util = new ExcelUtil<>(StockInventoryExportData.class); |
| | | util.exportExcel(response,list, "åºåä¿¡æ¯"); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.enums.StockQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockUnQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.EnumUtil; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.dto.StockOutRecordDto; |
| | | import com.ruoyi.stock.dto.StockUninventoryDto; |
| | | import com.ruoyi.stock.execl.StockInRecordExportData; |
| | | import com.ruoyi.stock.execl.StockOutRecordExportData; |
| | | import com.ruoyi.stock.mapper.StockInventoryMapper; |
| | | import com.ruoyi.stock.mapper.StockOutRecordMapper; |
| | | import com.ruoyi.stock.mapper.StockUninventoryMapper; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | } |
| | | return stockOutRecordMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public void exportStockOutRecord(HttpServletResponse response, StockOutRecordDto stockOutRecordDto) { |
| | | List<StockOutRecordExportData> list = stockOutRecordMapper.listStockOutRecordExportData(stockOutRecordDto); |
| | | for (StockOutRecordExportData stockInRecordExportData : list) { |
| | | if (stockInRecordExportData.getType().equals("0")) { |
| | | stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue()); |
| | | }else { |
| | | stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockUnQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue()); |
| | | } |
| | | } |
| | | ExcelUtil<StockOutRecordExportData> util = new ExcelUtil<>(StockOutRecordExportData.class); |
| | | util.exportExcel(response,list, "åºåºè®°å½ä¿¡æ¯"); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | | import com.ruoyi.stock.dto.StockOutRecordDto; |
| | | import com.ruoyi.stock.dto.StockUninventoryDto; |
| | | import com.ruoyi.stock.execl.StockInventoryExportData; |
| | | import com.ruoyi.stock.pojo.StockInventory; |
| | | import com.ruoyi.stock.pojo.StockUninventory; |
| | | import com.ruoyi.stock.mapper.StockUninventoryMapper; |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | newStockUnInventory.setProductModelId(stockUninventoryDto.getProductModelId()); |
| | | newStockUnInventory.setQualitity(stockUninventoryDto.getQualitity()); |
| | | newStockUnInventory.setVersion(1); |
| | | newStockUnInventory.setRemark(stockUninventoryDto.getRemark()); |
| | | stockUninventoryMapper.insert(newStockUnInventory); |
| | | }else { |
| | | stockUninventoryMapper.updateAddStockUnInventory(stockUninventoryDto); |
| | |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | @Override |
| | | public void exportStockUninventory(HttpServletResponse response, StockUninventoryDto stockUninventoryDto) { |
| | | List<StockInventoryExportData> list = stockUninventoryMapper.listStockInventoryExportData(stockUninventoryDto); |
| | | ExcelUtil<StockInventoryExportData> util = new ExcelUtil<>(StockInventoryExportData.class); |
| | | util.exportExcel(response,list, "ä¸åæ ¼åºåä¿¡æ¯"); |
| | | } |
| | | } |
| | |
| | | |
| | | ORDER BY pm.id DESC |
| | | </select> |
| | | <select id="getProductAndModelList" resultType="java.util.Map"> |
| | | select p.id as id, |
| | | pm.id as modelId, |
| | | p.product_name as productName , |
| | | pm.model as model |
| | | from product_model pm |
| | | left join product p on p.id = pm.product_id |
| | | order by p.id,pm.id desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | create_time, |
| | | update_user, |
| | | update_time, |
| | | tenant_id |
| | | tenant_id, |
| | | unit, |
| | | dept_id, |
| | | instation_location, |
| | | cycle |
| | | FROM |
| | | measuring_instrument_ledger |
| | | <where> |
| | |
| | | SELECT |
| | | T1.*, |
| | | t3.shipping_car_number, |
| | | t3.shipping_date |
| | | t3.shipping_date, |
| | | t3.status as shippingStatus |
| | | t3.shipping_date, |
| | | CASE |
| | | WHEN t2.qualitity > T1.quantity THEN 1 |
| | | ELSE 0 |
| | | END as has_sufficient_stock |
| | | FROM |
| | | sales_ledger_product T1 |
| | | left join shipping_info t3 on T1.id = t3.sales_ledger_product_id |
| | | LEFT JOIN stock_inventory t2 ON T1.product_model_id = t2.product_model_id |
| | | LEFT JOIN shipping_info t3 ON T1.id = t3.sales_ledger_product_id |
| | | <where> |
| | | 1=1 |
| | | <if test="salesLedgerProduct.salesLedgerId != null and salesLedgerProduct.salesLedgerId != '' "> |
| | |
| | | WHERE sl.id = #{salesLedegerId}) A |
| | | group by a.model, a.product_name, a.unit |
| | | </select> |
| | | <select id="selectProduct" resultType="com.ruoyi.sales.pojo.SalesLedgerProduct"> |
| | | select |
| | | p.product_name as product_category, |
| | | pm.model as specification_model, |
| | | pm.id |
| | | from product_model pm |
| | | left join product p on pm.product_id = p.id |
| | | </select> |
| | | </mapper> |
| | |
| | | s.sales_ledger_id, |
| | | s.shipping_date, |
| | | s.shipping_car_number, |
| | | s.express_number, |
| | | s.express_company, |
| | | s.shipping_no, |
| | | s.type, |
| | | s.status, |
| | | s.create_time, |
| | | s.update_time, |
| | | s.create_user, |
| | |
| | | <select id="listPage" resultType="com.ruoyi.stock.dto.StockInRecordDto"> |
| | | SELECT |
| | | sir.*, |
| | | p.product_name as productName, |
| | | p.product_name as product_name, |
| | | pm.model, |
| | | pm.unit, |
| | | u.nick_name as createBy |
| | |
| | | <if test="params.type != null and params.type != ''"> |
| | | and sir.type = #{params.type} |
| | | </if> |
| | | <if test="params.recordType != null and params.recordType != ''"> |
| | | and sir.record_type = #{params.recordType} |
| | | </if> |
| | | </where> |
| | | order by sir.id desc |
| | | </select> |
| | | <select id="listStockInRecordExportData" resultType="com.ruoyi.stock.execl.StockInRecordExportData"> |
| | | SELECT |
| | | sir.*, |
| | | p.product_name as product_name, |
| | | pm.model, |
| | | pm.unit, |
| | | u.nick_name as createBy |
| | | FROM stock_in_record as sir |
| | | LEFT JOIN product_model as pm on sir.product_model_id = pm.id |
| | | LEFT JOIN product as p on pm.product_id = p.id |
| | | LEFT JOIN sys_user as u on sir.create_user = u.user_id |
| | | <where> |
| | | <if test="params.timeStr != null and params.timeStr != ''"> |
| | | and sir.create_time like concat('%',#{params.timeStr},'%') |
| | | </if> |
| | | <if test="params.productName != null and params.productName != ''"> |
| | | and p.product_name like concat('%',#{params.productName},'%') |
| | | </if> |
| | | <if test="params.type != null and params.type != ''"> |
| | | and sir.type = #{params.type} |
| | | </if> |
| | | <if test="params.recordType != null and params.recordType != ''"> |
| | | and sir.record_type = #{params.recordType} |
| | | </if> |
| | | </where> |
| | | order by sir.id desc |
| | | </select> |
| | |
| | | <if test="ew.version != null"> |
| | | version = version + 1, |
| | | </if> |
| | | <if test="ew.remark != null and ew.remark !=''"> |
| | | remark = #{ew.remark}, |
| | | </if> |
| | | update_time = now() |
| | | </set> |
| | | where product_model_id = #{ew.productModelId} |
| | |
| | | <if test="ew.version != null"> |
| | | version = version + 1, |
| | | </if> |
| | | <if test="ew.remark != null and ew.remark !=''"> |
| | | remark = #{ew.remark}, |
| | | </if> |
| | | update_time = now() |
| | | </set> |
| | | where product_model_id = #{ew.productModelId} and qualitity >= #{ew.qualitity} |
| | |
| | | and p.product_name like concat('%',#{ew.productName},'%') |
| | | </if> |
| | | </select> |
| | | <select id="listStockInventoryExportData" resultType="com.ruoyi.stock.execl.StockInventoryExportData"> |
| | | select si.qualitity, |
| | | pm.model, |
| | | pm.unit, |
| | | p.product_name, |
| | | si.remark, |
| | | si.update_time |
| | | from stock_inventory si |
| | | left join product_model pm on si.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | where 1 = 1 |
| | | <if test="ew.productName != null and ew.productName !=''"> |
| | | and p.product_name like concat('%',#{ew.productName},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <if test="params.type != null and params.type != ''"> |
| | | and sor.type = #{params.type} |
| | | </if> |
| | | <if test="params.recordType != null and params.recordType != ''"> |
| | | and sor.record_type = #{params.recordType} |
| | | </if> |
| | | </where> |
| | | order by sor.id desc |
| | | </select> |
| | | <select id="listStockOutRecordExportData" resultType="com.ruoyi.stock.execl.StockOutRecordExportData"> |
| | | SELECT |
| | | sor.*, |
| | | p.product_name as productName, |
| | | pm.model, |
| | | pm.unit, |
| | | u.nick_name as createBy |
| | | FROM stock_out_record as sor |
| | | LEFT JOIN product_model as pm on sor.product_model_id = pm.id |
| | | LEFT JOIN product as p on pm.product_id = p.id |
| | | LEFT JOIN sys_user as u on sor.create_user = u.user_id |
| | | <where> |
| | | <if test="params.timeStr != null and params.timeStr != ''"> |
| | | and sor.create_time like concat('%',#{params.timeStr},'%') |
| | | </if> |
| | | <if test="params.productName != null and params.productName != ''"> |
| | | and p.product_name like concat('%',#{params.productName},'%') |
| | | </if> |
| | | <if test="params.type != null and params.type != ''"> |
| | | and sor.type = #{params.type} |
| | | </if> |
| | | <if test="params.recordType != null and params.recordType != ''"> |
| | | and sor.record_type = #{params.recordType} |
| | | </if> |
| | | </where> |
| | | order by sor.id desc |
| | | </select> |
| | |
| | | <if test="ew.version != null"> |
| | | version = version + 1, |
| | | </if> |
| | | <if test="ew.remark != null and ew.remark !=''"> |
| | | remark = #{ew.remark}, |
| | | </if> |
| | | update_time = now() |
| | | </set> |
| | | where product_model_id = #{ew.productModelId} and qualitity >= #{ew.qualitity} |
| | |
| | | <if test="ew.version != null"> |
| | | version = version + 1, |
| | | </if> |
| | | <if test="ew.remark != null and ew.remark !=''"> |
| | | remark = #{ew.remark}, |
| | | </if> |
| | | update_time = now() |
| | | </set> |
| | | where product_model_id = #{ew.productModelId} |
| | |
| | | and p.product_name like concat('%',#{ew.productName},'%') |
| | | </if> |
| | | </select> |
| | | <select id="listStockInventoryExportData" resultType="com.ruoyi.stock.execl.StockInventoryExportData"> |
| | | select su.*, |
| | | pm.model, |
| | | pm.unit, |
| | | p.product_name |
| | | from stock_uninventory su |
| | | left join product_model pm on su.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | where 1 = 1 |
| | | <if test="ew.productName != null and ew.productName !=''"> |
| | | and p.product_name like concat('%',#{ew.productName},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |