Merge branch 'dev_New' of http://114.132.189.42:9002/r/product-inventory-management-after into dev_New
| | |
| | | alter table process_route |
| | | add process_route_code varchar(255) null comment 'å·¥èºè·¯çº¿ç¼ç '; |
| | | |
| | | alter table procurement_record_storage |
| | | add product_model_id bigint null comment '产åè§æ ¼id'; |
| | | alter table procurement_record_out |
| | | add product_model_id bigint null comment '产åè§æ ¼id'; |
| | | |
| | | |
| | | alter table quality_inspect |
| | | add product_model_id bigint null comment '产åè§æ ¼id'; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | alter table staff_join_leave_record |
| | | add dimission_reason varchar(255) null, |
| | | add dimission_remark text null; |
| | |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.project.system.service.ISysNoticeService; |
| | | import com.ruoyi.sales.mapper.CommonFileMapper; |
| | | import com.ruoyi.sales.mapper.SalesQuotationMapper; |
| | | import com.ruoyi.sales.mapper.SalesQuotationProductMapper; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import com.ruoyi.sales.pojo.SalesQuotation; |
| | | import com.ruoyi.sales.service.impl.CommonFileServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private CommonFileMapper fileMapper; |
| | | @Autowired |
| | | private DeviceRepairMapper deviceRepairMapper; |
| | | |
| | | @Autowired |
| | | private SalesQuotationMapper salesQuotationMapper; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | deviceRepairMapper.updateById(deviceRepair); |
| | | } |
| | | // é宿¥ä»·ç¶æä¿®æ¹ |
| | | if(approveProcess.getApproveType().equals(6)){ |
| | | SalesQuotation salesQuote = salesQuotationMapper.selectOne(new LambdaQueryWrapper<SalesQuotation>() |
| | | .eq(SalesQuotation::getQuotationNo, approveProcess.getApproveReason()) |
| | | .last("limit 1")); |
| | | // åæ |
| | | if(status.equals(2) && salesQuote != null){ |
| | | salesQuote.setStatus("éè¿"); |
| | | }else if(status.equals(3) && salesQuote != null){ |
| | | salesQuote.setStatus("æç»"); |
| | | }else if(status.equals(1) && salesQuote != null){ |
| | | salesQuote.setStatus("å®¡æ ¸ä¸"); |
| | | } |
| | | |
| | | salesQuotationMapper.updateById(salesQuote); |
| | | } |
| | | // ç»å®éä»¶ |
| | | if(!CollectionUtils.isEmpty(approveNode.getTempFileIds()) && approveNode.getApproveNodeStatus() == 1){ |
| | | tempFileService.migrateTempFilesToFormal(approveNode.getId(), approveNode.getTempFileIds(), FileNameType.ApproveNode.getValue()); |
| | |
| | | approveProcess.setApproveReason(approveProcessVO.getApproveReason()); |
| | | approveProcess.setDeviceRepairId(approveProcessVO.getDeviceRepairId()); |
| | | approveProcess.setMaintenancePrice(approveProcessVO.getMaintenancePrice()); |
| | | approveProcess.setPrice(approveProcessVO.getPrice()); |
| | | approveProcess.setApproveOverTime(null); |
| | | approveProcess.setApproveStatus(0); |
| | | approveProcess.setApproveDelete(0); |
| | |
| | | |
| | | private final ApproveNodeMapper approveNodeMapper; |
| | | |
| | | // æ¥ä»·å®¡æ¹ç¼è¾å®¡æ ¸äºº |
| | | public void updateApproveUser(ApproveGetAndUpdateVo approveGetAndUpdateVo){ |
| | | LambdaQueryWrapper<ApproveProcess> approveProcessLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | approveProcessLambdaQueryWrapper.eq(ApproveProcess::getApproveType, approveGetAndUpdateVo.getApproveType()) |
| | | .eq(ApproveProcess::getApproveReason, approveGetAndUpdateVo.getApproveReason()) |
| | | .last("limit 1"); |
| | | ApproveProcess approveProcess = approveProcessMapper.selectOne(approveProcessLambdaQueryWrapper); |
| | | if(approveProcess == null) throw new RuntimeException("è¯·éæ©å®¡æ¹äºº"); |
| | | String[] split = approveGetAndUpdateVo.getApproveUserIds().split(","); |
| | | if(split.length == 0){ |
| | | throw new RuntimeException("è¯·éæ©å®¡æ¹äºº"); |
| | | } |
| | | List<SysUser> sysUsers = sysUserMapper.selectUserByIds(Arrays.asList(split).stream().map(Long::parseLong).collect(Collectors.toList())); |
| | | if(CollectionUtils.isEmpty(sysUsers)) throw new RuntimeException("è¯·éæ©å®¡æ¹äºº"); |
| | | //å®¡æ ¸ä¸ä¸å¯ä»¥ç¼è¾å®¡æ ¸äºº |
| | | if(approveProcess.getApproveStatus() != 1){ |
| | | approveProcess.setApproveUserCurrentId(Long.parseLong(split[0])); |
| | | approveProcess.setApproveUserCurrentName(sysUsers.stream().filter(user -> user.getUserId().equals(Long.parseLong(split[0]))).collect(Collectors.toList()).get(0).getNickName()); |
| | | } |
| | | if(approveGetAndUpdateVo.getApproveStatus() != null){ |
| | | approveProcess.setApproveStatus(approveGetAndUpdateVo.getApproveStatus()); |
| | | } |
| | | approveProcess.setApproveUserIds(approveGetAndUpdateVo.getApproveUserIds()); |
| | | updateById(approveProcess); |
| | | //ä¿®æ¹å®¡æ¹äºº |
| | | // å
å é¤ åæ°å¢ |
| | | LambdaQueryWrapper<ApproveNode> approveNodeLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | approveNodeLambdaQueryWrapper.eq(ApproveNode::getApproveProcessId, approveProcess.getApproveId()) |
| | | .eq(ApproveNode::getDeleteFlag, 0) |
| | | .eq(ApproveNode::getTenantId, SecurityUtils.getLoginUser().getTenantId()) |
| | | .orderByAsc(ApproveNode::getApproveNodeOrder); |
| | | approveNodeMapper.delete(approveNodeLambdaQueryWrapper); |
| | | approveNodeService.initApproveNodes(approveGetAndUpdateVo.getApproveUserIds(),approveProcess.getApproveId(),approveProcess.getTenantId()); |
| | | /*æ¶æ¯éç¥*/ |
| | | String id = approveProcess.getApproveUserIds().split(",")[0]; |
| | | sysNoticeService.simpleNoticeByUser(approveProcessType(approveProcess.getApproveType()), |
| | | approveProcess.getApproveId()+"æµç¨ç¼å·ç审æ¹éè¦æ¨å®¡æ ¸!!!!!", |
| | | Arrays.asList(Long.valueOf(id)), |
| | | approveProcess.getApproveDeptId(), |
| | | "/collaborativeApproval/approvalProcess?approveType="+approveProcess.getApproveType()+"&approveId="+approveProcess.getApproveId()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void updateByApproveId(ApproveGetAndUpdateVo approveGetAndUpdateVo) throws IOException { |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.production.dto.ProductStructureDto; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ProductModelDto extends ProductModel { |
| | | private List<ProductStructureDto> productStructureList; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | /** |
| | | * éä»¶è®°å½ç±»åæä¸¾ |
| | | * |
| | | */ |
| | | @AllArgsConstructor |
| | | public enum StaffJoinLeaveRecordDimissionReason { |
| | | StaffJoinLeaveRecordDimissionReasonSalary("salary","èªèµå¾
é"), |
| | | StaffJoinLeaveRecordDimissionReasonCareerDevelopment("career_development","èä¸åå±"), |
| | | StaffJoinLeaveRecordDimissionReasonWorkEnvironment("work_environment","å·¥ä½ç¯å¢"), |
| | | StaffJoinLeaveRecordDimissionReasonPersonalReason("personal_reason","个人åå "), |
| | | StaffJoinLeaveRecordDimissionReasonOther("other","å
¶ä»åå "); |
| | | |
| | | |
| | | private final String code; |
| | | private final String info; |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public String getInfo() { |
| | | return info; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.utils.uuid.UUID; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | // æ§è¡æ¥è¯¢ |
| | | Long aLong = mapper.selectCount(queryWrapper); |
| | | // æ¼æ¥è®¢åç¼å· preFix + æ¶é´ï¼yyyyMMddï¼ + è®¢åæ°é(001) |
| | | return preFix + LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE).replaceAll("-", "") + String.format("%03d", (aLong + 1)); |
| | | return preFix + LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE).replaceAll("-", "") + String.format("%03d", (aLong + 1)) + "-" + new Date().getTime(); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Data |
| | | public class Details { |
| | | private Integer id; // 产åid |
| | | private Integer id; // å°è´¦äº§åid |
| | | private BigDecimal inboundQuantity; // å
¥åºæ°é |
| | | private BigDecimal warnNum; // é¢è¦æ°éï¼éè´å
¥åºææï¼ |
| | | //åä»· |
| | | private BigDecimal unitPrice; |
| | | private BigDecimal totalPrice; |
| | | private Long productModelId; // åºç¡äº§åid |
| | | } |
| | |
| | | */ |
| | | private Integer type; |
| | | |
| | | private Long productModelId;// åºç¡äº§åID |
| | | |
| | | } |
| | |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordStorage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | IPage<ProcurementPageDtoCopy> listPageCopyByProduction(Page page, @Param("req") ProcurementPageDto procurementDto); |
| | | |
| | | IPage<ProcurementPageDtoCopy> listPagePRS(Page page, @Param("req") ProcurementPageDto procurementDto); |
| | | |
| | | BigDecimal getSumQuantity(@Param("productModelId") Long productModelId); |
| | | } |
| | |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordOut; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | IPage<ProcurementRecordOutPageDto> listPageByProduct(Page page,@Param("req") ProcurementRecordOutPageDto procurementDto); |
| | | |
| | | IPage<ProcurementRecordOutPageDto> listPageByCustom(Page page,@Param("req") ProcurementRecordOutPageDto procurementDto); |
| | | |
| | | BigDecimal getSumQuantity(@Param("productModelId") Long productModelId); |
| | | } |
| | |
| | | package com.ruoyi.procurementrecord.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | |
| | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | /** |
| | | * 产åID |
| | | */ |
| | | private Long productModelId; |
| | | |
| | | } |
| | |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | /** |
| | | * 产åID |
| | | */ |
| | | private Long productModelId; |
| | | } |
| | |
| | | import com.ruoyi.procurementrecord.dto.ProcurementUpdateDto; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordOut; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordStorage; |
| | | import com.ruoyi.procurementrecord.service.ProcurementRecordOutService; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.text.DateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | |
| | | .createUser(Long.valueOf(procurementRecordOutAdd.getUserId())) |
| | | .createBy(sysUser.getNickName()) |
| | | .updateUser(Long.valueOf(procurementRecordOutAdd.getUserId())) |
| | | .updateTime(LocalDateTime.now()); |
| | | .updateTime(LocalDateTime.now()) |
| | | .productModelId(procurementRecordOutAdd.getProductModelId()); |
| | | this.save(procurementRecordOut.build()); |
| | | return 0; |
| | | } |
| | |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper; |
| | | import com.ruoyi.procurementrecord.pojo.CustomStorage; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordStorage; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordOut; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordStorage; |
| | | import com.ruoyi.procurementrecord.service.ProcurementRecordService; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | |
| | | .createUser(loginUser.getUserId()) |
| | | .updateTime(LocalDateTime.now()) |
| | | .updateUser(loginUser.getUserId()) |
| | | .createBy(procurementDto.getNickName()); |
| | | .createBy(procurementDto.getNickName()) |
| | | .productModelId(detail.getProductModelId()); |
| | | this.save(procurementRecordBuilder.build()); |
| | | // å
¥åºæååæéè´æ°é |
| | | // LambdaQueryWrapper<SalesLedgerProduct> salesLedgerProductLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.utils; |
| | | |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Component |
| | | @RequiredArgsConstructor |
| | | public class StockUtils { |
| | | private final ProcurementRecordOutMapper procurementRecordOutMapper; |
| | | private final ProcurementRecordMapper procurementRecordMapper; |
| | | |
| | | // è·åååå©ä½åºå |
| | | public BigDecimal getStockQuantity(Long productModelId) { |
| | | // å
¥åºæ°é |
| | | BigDecimal sumQuantity = procurementRecordMapper.getSumQuantity(productModelId); |
| | | // åºåºæ°é |
| | | BigDecimal outQuantity = procurementRecordOutMapper.getSumQuantity(productModelId); |
| | | return outQuantity.compareTo(sumQuantity) > 0 ? BigDecimal.ZERO : sumQuantity.subtract(outQuantity); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.production.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.basic.dto.ProductModelDto; |
| | | import com.ruoyi.production.dto.ProductStructureDto; |
| | | import com.ruoyi.production.pojo.ProductStructure; |
| | | |
| | |
| | | public interface ProductStructureService extends IService<ProductStructure> { |
| | | |
| | | |
| | | List<ProductStructureDto> listByproductModelId(Long productId); |
| | | ProductModelDto listByproductModelId(Long productId); |
| | | |
| | | Boolean addProductStructureDto(ProductStructureDto productStructureDto); |
| | | |
| | |
| | | |
| | | 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.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.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 java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | |
| | | @Autowired |
| | | private ProductStructureMapper productStructureMapper; |
| | | @Autowired |
| | | private ProductModelMapper productModelMapper; |
| | | @Autowired |
| | | private ProductMapper productMapper; |
| | | |
| | | @Override |
| | | public List<ProductStructureDto> listByproductModelId(Long productModelId) { |
| | | return productStructureMapper.listByproductModelId( productModelId); |
| | | public ProductModelDto listByproductModelId(Long productModelId) { |
| | | ProductModel productModel = productModelMapper.selectById(productModelId); |
| | | Product product = productMapper.selectById(productModel.getProductId()); |
| | | ProductModelDto productModelDto = new ProductModelDto(); |
| | | BeanUtils.copyProperties(productModel,productModelDto); |
| | | productModelDto.setProductName(product.getProductName()); |
| | | List<ProductStructureDto> productStructureDtos = productStructureMapper.listByproductModelId(productModelId); |
| | | productModelDto.setProductStructureList(productStructureDtos); |
| | | return productModelDto; |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.procurementrecord.utils.StockUtils; |
| | | import com.ruoyi.production.controller.ProductWorkOrderController; |
| | | import com.ruoyi.production.dto.ProductStructureDto; |
| | | import com.ruoyi.production.dto.ProductionProductMainDto; |
| | |
| | | private ProductOrderMapper productOrderMapper; |
| | | |
| | | private SalesLedgerProductionAccountingMapper salesLedgerProductionAccountingMapper; |
| | | |
| | | private StockUtils stockUtils; |
| | | |
| | | |
| | | @Override |
| | |
| | | qualityInspect.setInspectState(0); |
| | | qualityInspect.setInspectType(inspectType); |
| | | qualityInspect.setProductMainId(productionProductMain.getId()); |
| | | qualityInspect.setProductModelId(productModel.getId()); |
| | | qualityInspectMapper.insert(qualityInspect); |
| | | |
| | | List<QualityTestStandardParam> qualityTestStandardParams = qualityTestStandardParamMapper.selectListByProductId(product.getId()); |
| | |
| | | if (productModel != null) { |
| | | List<ProductStructureDto> productStructureDtos = productStructureMapper.listByproductModelId(productModel.getId()); |
| | | for (ProductStructureDto productStructureDto : productStructureDtos) { |
| | | ProductModel productModel1 = productModelMapper.selectById(productStructureDto.getProductModelId()); |
| | | |
| | | BigDecimal stockQuantity = stockUtils.getStockQuantity(productModel1.getId()); |
| | | if (!(stockQuantity.compareTo(BigDecimal.ZERO) > 0)) { |
| | | throw new RuntimeException("åºåä¸è¶³"); |
| | | } |
| | | ProductionProductInput productionProductInput = new ProductionProductInput(); |
| | | productionProductInput.setProductModelId(productStructureDto.getProductModelId()); |
| | | productionProductInput.setQuantity(productStructureDto.getUnitQuantity().multiply(dto.getQuantity())); |
| | |
| | | } |
| | | |
| | | /** |
| | | * ä¾åºå徿¥å页æ¥å£ |
| | | */ |
| | | @GetMapping("/supplierNameListPage") |
| | | public AjaxResult supplierNameListPage(PaymentLedgerDto paymentLedgerDto, Page page){ |
| | | return success(paymentRegistrationService.supplierNameListPage(page,paymentLedgerDto)); |
| | | } |
| | | |
| | | /** |
| | | * ä¾åºå徿¥å页æ¥å£ |
| | | */ |
| | | @GetMapping("/supplierNameListPageDetails") |
| | | public AjaxResult supplierNameListPageDetails(PaymentLedgerDto paymentLedgerDto){ |
| | | return success(paymentRegistrationService.supplierNameListPageDetails(paymentLedgerDto)); |
| | | } |
| | | |
| | | /** |
| | | * è·åæ¬æåºä»ä¿¡æ¯ |
| | | */ |
| | | @GetMapping(value = "/paymentMonthList") |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.purchase.dto.PaymentHistoryRecordVo; |
| | | import com.ruoyi.purchase.dto.PaymentLedgerDto; |
| | | import com.ruoyi.purchase.dto.PaymentRegistrationDto; |
| | | import com.ruoyi.purchase.pojo.PaymentRegistration; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | * @return 仿¬¾ç»è®°éå |
| | | */ |
| | | IPage<PaymentRegistrationDto> paymentHistoryListPage(Page page, @Param("params") PaymentRegistrationDto paymentRegistrationDto); |
| | | |
| | | IPage<PaymentRegistrationDto> supplierNameListPage(Page page,@Param("req") PaymentLedgerDto paymentLedgerDto); |
| | | |
| | | List<PaymentRegistrationDto> supplierNameListPageDetails(@Param("req") PaymentLedgerDto paymentLedgerDto); |
| | | } |
| | |
| | | /** |
| | | * éè´è®¢å产åid |
| | | */ |
| | | private Long saleLedgerProductId; |
| | | private Long salesLedgerProductId; |
| | | |
| | | /** |
| | | * ä¾åºåid |
| | |
| | | /** |
| | | * ç»è®°äºº |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long registrantId; |
| | | |
| | | // ç§æ·id |
| | |
| | | Boolean delete(Long[] ids); |
| | | |
| | | int delPaymentRegistration(Long ids); |
| | | |
| | | IPage<PaymentRegistrationDto> supplierNameListPage(Page page, PaymentLedgerDto paymentLedgerDto); |
| | | |
| | | List<PaymentRegistrationDto> supplierNameListPageDetails(PaymentLedgerDto paymentLedgerDto); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public int insertPaymentRegistration(List<PaymentRegistration> paymentRegistrationList) { |
| | | Long userId = SecurityUtils.getLoginUser().getUser().getUserId(); |
| | | for (PaymentRegistration paymentRegistration : paymentRegistrationList) { |
| | | PaymentRegistration byId = paymentRegistration; |
| | | if (!ObjectUtils.isEmpty(paymentRegistration.getId())){ |
| | |
| | | PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(paymentRegistration.getPurchaseLedgerId()); |
| | | if(null==purchaseLedger) throw new RuntimeException("æªæ¾å°éè´å"); |
| | | // 已忬¾éé¢ |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(paymentRegistration.getSaleLedgerProductId()); |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(paymentRegistration.getSalesLedgerProductId()); |
| | | if(null==salesLedgerProduct) throw new RuntimeException("æªæ¾å°éè´å产å"); |
| | | if (salesLedgerProduct.getPendingInvoiceTotal().compareTo(paymentRegistration.getCurrentPaymentAmount())<0){ |
| | | if (salesLedgerProduct.getPendingTicketsTotal().compareTo(paymentRegistration.getCurrentPaymentAmount())<0){ |
| | | throw new RuntimeException("æ¬æ¬¡å款éé¢ä¸è½å¤§äºå¾
忬¾éé¢"); |
| | | } |
| | | paymentRegistration.setCreateTime(DateUtils.getNowDate()); |
| | | paymentRegistration.setUpdateTime(DateUtils.getNowDate()); |
| | | salesLedgerProduct.setInvoiceTotal(salesLedgerProduct.getInvoiceTotal().add(paymentRegistration.getCurrentPaymentAmount())); |
| | | salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProduct.getTaxInclusiveTotalPrice().subtract(salesLedgerProduct.getInvoiceTotal())); |
| | | paymentRegistration.setRegistrantId(userId); |
| | | salesLedgerProduct.setTicketsTotal(salesLedgerProduct.getTicketsTotal().add(paymentRegistration.getCurrentPaymentAmount())); |
| | | salesLedgerProduct.setPendingTicketsTotal(salesLedgerProduct.getTaxInclusiveTotalPrice().subtract(salesLedgerProduct.getTicketsTotal())); |
| | | paymentRegistrationMapper.insert(paymentRegistration); |
| | | salesLedgerProductMapper.updateById(salesLedgerProduct); |
| | | } |
| | |
| | | return paymentRegistrationMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<PaymentRegistrationDto> supplierNameListPage(Page page, PaymentLedgerDto paymentLedgerDto) { |
| | | return paymentRegistrationMapper.supplierNameListPage(page, paymentLedgerDto); |
| | | } |
| | | |
| | | @Override |
| | | public List<PaymentRegistrationDto> supplierNameListPageDetails(PaymentLedgerDto paymentLedgerDto) { |
| | | return paymentRegistrationMapper.supplierNameListPageDetails(paymentLedgerDto); |
| | | } |
| | | |
| | | // æ¹éæ¥è¯¢éè´å°è´¦ï¼å½æï¼ |
| | | private Map<Long, List<PurchaseLedger>> batchQueryPurchaseLedgers(List<Long> supplierIds, LocalDate startDate, LocalDate endDate) { |
| | | LambdaQueryWrapper<PurchaseLedger> query = new LambdaQueryWrapper<>(); |
| | |
| | | qualityInspect.setProductId(saleProduct.getId()); |
| | | qualityInspect.setProductName(saleProduct.getProductCategory()); |
| | | qualityInspect.setModel(saleProduct.getSpecificationModel()); |
| | | qualityInspect.setProductModelId(saleProduct.getProductModelId()); |
| | | qualityInspect.setUnit(saleProduct.getUnit()); |
| | | qualityInspect.setQuantity(saleProduct.getQuantity()); |
| | | qualityInspectMapper.insert(qualityInspect); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.quality.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.quality.pojo.QualityTestStandardParam; |
| | | import com.ruoyi.quality.service.QualityReportService; |
| | | import com.ruoyi.quality.service.QualityTestStandardParamService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * è´¨é管ççæ¥è¡¨ç®¡ç å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-14 03:39:49 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/qualityReport") |
| | | public class QualityReportController { |
| | | |
| | | @Autowired |
| | | private QualityReportService qualityReportService; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | return AjaxResult.success(qualityTestStandardService.copyParam(qualityTestStandard)); |
| | | } |
| | | |
| | | /** |
| | | * æ£æµæ åæ¹éå®¡æ ¸ |
| | | * @param qualityTestStandards |
| | | * @return |
| | | */ |
| | | @PostMapping("/qualityTestStandardAudit") |
| | | public AjaxResult qualityTestStandardAudit(@RequestBody List<QualityTestStandard> qualityTestStandards) { |
| | | return AjaxResult.success(qualityTestStandardService.updateBatchById(qualityTestStandards)); |
| | | } |
| | | |
| | | } |
| | |
| | | public class QualityTestStandardBindingDto { |
| | | |
| | | private String productName; |
| | | |
| | | private Long qualityTestStandardBindingId; |
| | | } |
| | |
| | | * æ¥å·¥id |
| | | */ |
| | | private Long productMainId; |
| | | |
| | | private Long productModelId; |
| | | //ä¸åæ ¼ç°è±¡ |
| | | private String defectivePhenomena; |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.quality.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.quality.pojo.QualityTestStandardParam; |
| | | |
| | | /** |
| | | * <p> |
| | | * è´¨é管ççæ¥è¡¨ç®¡ç æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-13 03:39:49 |
| | | */ |
| | | public interface QualityReportService { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.quality.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | |
| | | 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.quality.dto.QualityInspectDto; |
| | | import com.ruoyi.quality.mapper.QualityInspectMapper; |
| | |
| | | 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; |
| | |
| | | |
| | | ArrayList<Details> detailss = new ArrayList<>(); |
| | | Details details = new Details(); |
| | | details.setId(Math.toIntExact(qualityInspect.getProductId())); |
| | | 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); |
| | | 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(details1.getId()) |
| | | .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()); |
| | | procurementRecordService.save(procurementRecordBuilder.build()); |
| | | |
| | | |
| | | |
| | | }else if (qualityInspect.getInspectType() == 2) { |
| | | //æ¥è¯¢UnitPrice/TotalPrice |
| | |
| | | List<Details> details = new ArrayList<>(); |
| | | Details details1 = new Details(); |
| | | details1.setInboundQuantity(qualityInspect.getQuantity()); |
| | | details1.setId(Math.toIntExact(salesLedgerProduct.getId())); |
| | | details1.setId(Math.toIntExact(salesLedgerProduct.getProductId())); |
| | | details1.setUnitPrice(salesLedgerProduct.getTaxInclusiveUnitPrice()); |
| | | details1.setTotalPrice(salesLedgerProduct.getTaxInclusiveTotalPrice()); |
| | | details1.setProductModelId(salesLedgerProduct.getProductModelId()); |
| | | details.add(details1); |
| | | procurementRecordOutAdd.setDetails(details); |
| | | procurementRecordService.add(procurementRecordOutAdd); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.quality.service.impl; |
| | | |
| | | import com.ruoyi.quality.service.QualityReportService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | |
| | | @Service |
| | | public class QualityReportServiceImpl implements QualityReportService { |
| | | } |
| | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.purchase.dto.InvoicePurchaseDto; |
| | | import com.ruoyi.sales.dto.InvoiceLedgerDto; |
| | | import com.ruoyi.sales.dto.ReceiptPaymentDto; |
| | | import com.ruoyi.sales.dto.ReceiptPaymentRecordDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/customerInteractions") |
| | | public AjaxResult customerInteractions (ReceiptPaymentDto receiptPaymentDto) { |
| | | public AjaxResult customerInteractions (InvoiceLedgerDto receiptPaymentDto) { |
| | | return AjaxResult.success(receiptPaymentService.customerInteractions(receiptPaymentDto)); |
| | | } |
| | | |
| | |
| | | IPage<ProcurementPageDtoCopy> result = procurementRecordService.listPageCopyByProduction(new Page<>(1,-1), procurementDto); |
| | | if(result.getRecords().size()>0) { |
| | | ProcurementPageDtoCopy procurementDtoCopy = result.getRecords().get(0); |
| | | if (item.getQuantity().compareTo(procurementDtoCopy.getInboundNum0()) >= 0) { |
| | | if (item.getQuantity().compareTo(procurementDtoCopy.getInboundNum0()) >= 0 && item.getApproveStatus() == 0) { |
| | | item.setApproveStatus(1); |
| | | salesLedgerProductService.addOrUpdateSalesLedgerProduct(item); |
| | | } |
| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.aftersalesservice.dto.AfterSalesServiceDto; |
| | | import com.ruoyi.aftersalesservice.pojo.AfterSalesService; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | 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.web.domain.AjaxResult; |
| | | import com.ruoyi.sales.dto.SalesQuotationDto; |
| | | import com.ruoyi.sales.pojo.SalesQuotation; |
| | | import com.ruoyi.sales.service.SalesQuotationService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | return AjaxResult.success(salesQuotationService.listPage(page, salesQuotationDto)); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response) { |
| | | Page page = new Page(-1,-1); |
| | |
| | | import com.ruoyi.procurementrecord.dto.ProcurementAddDto; |
| | | import com.ruoyi.procurementrecord.dto.ProcurementRecordOutAdd; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordOut; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordStorage; |
| | | import com.ruoyi.procurementrecord.service.ProcurementRecordOutService; |
| | | import com.ruoyi.procurementrecord.service.ProcurementRecordService; |
| | | import com.ruoyi.sales.mapper.ShipmentApprovalMapper; |
| | | import com.ruoyi.sales.mapper.ShippingInfoMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | |
| | | private ISalesLedgerProductService salesLedgerProductService; |
| | | @Autowired |
| | | private ProcurementRecordOutService procurementRecordOutService; |
| | | @Autowired |
| | | private ProcurementRecordService procurementRecordStorageService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("å货审æ¹å表") |
| | |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductService.getById(shipmentApproval.getSalesLedgerProductId()); |
| | | salesLedgerProduct.setApproveStatus(req.getApproveStatus()); |
| | | salesLedgerProductService.updateById(salesLedgerProduct); |
| | | |
| | | if(req.getApproveStatus()==3){ |
| | | ProcurementRecordStorage procurementRecordStorage = procurementRecordStorageService.getOne(new LambdaQueryWrapper<ProcurementRecordStorage>() |
| | | .eq(ProcurementRecordStorage::getSalesLedgerProductId, req.getSalesLedgerProductId())); |
| | | if(procurementRecordStorage==null){ |
| | | return AjaxResult.error("éè´è®°å½ä¸åå¨"); |
| | | } |
| | | //å货审æ¹éè¿ï¼ç产该订ååºåºè®°å½ |
| | | ProcurementRecordOutAdd procurementRecordOutAdd = new ProcurementRecordOutAdd(); |
| | | procurementRecordOutAdd.setId(procurementRecordStorage.getId()); |
| | | procurementRecordOutAdd.setSalesLedgerProductId(Math.toIntExact(salesLedgerProduct.getId())); |
| | | procurementRecordOutAdd.setType(2); |
| | | procurementRecordOutAdd.setUserId(Math.toIntExact(getUserId())); |
| | | procurementRecordOutAdd.setQuantity(String.valueOf(salesLedgerProduct.getQuantity())); |
| | | //è·åå½åæ¶é´ |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDate now = LocalDate.now(); |
| | | procurementRecordOutAdd.setTime(now.toString()); |
| | | procurementRecordOutService.stockout(procurementRecordOutAdd); |
| | | } |
| | |
| | | /** åºæ¶éé¢ */ |
| | | private BigDecimal unReceiptAmount; |
| | | |
| | | /** éå®ååå· */ |
| | | private String salesContractNo; |
| | | |
| | | /** éè´ååå· */ |
| | | private String purchaseContractNo; |
| | | |
| | | /** åçæ¥æ */ |
| | | private LocalDate happenTime; |
| | | |
| | |
| | | package com.ruoyi.sales.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.vo.FileVo; |
| | | import com.ruoyi.sales.pojo.InvoiceLedger; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | |
| | | @ApiModelProperty(value = "客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | @ApiModelProperty(value = "客æ·ID") |
| | | private Integer customerId; |
| | | |
| | | @ApiModelProperty(value = "客æ·ååå·") |
| | | private String customerContractNo; |
| | | |
| | |
| | | @ApiModelProperty(value = "忬¾éé¢") |
| | | private BigDecimal receiptPaymentAmount; |
| | | |
| | | @ApiModelProperty(value = "忬¾æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date receiptPaymentDate; |
| | | |
| | | @ApiModelProperty(value = "æªå款éé¢") |
| | | private BigDecimal unReceiptPaymentAmount; |
| | | |
| | |
| | | @Excel(name = "ä¾åºååç§°") |
| | | private String supplierName; |
| | | |
| | | /** |
| | | * ä¾åºåid |
| | | */ |
| | | private Long supplierId; |
| | | |
| | | } |
| | |
| | | public class SalesQuotationDto extends SalesQuotation { |
| | | @ApiModelProperty(value = "æ¥ä»·åå") |
| | | private List<SalesQuotationProduct> products; |
| | | |
| | | /** |
| | | * 审æ¹äººidå表 |
| | | */ |
| | | // 审æ¹äºº |
| | | private String approveUserIds; |
| | | } |
| | |
| | | List<CustomerInteractionDto> customerInteractions (ReceiptPaymentDto receiptPaymentDto); |
| | | |
| | | /** |
| | | * 客æ·åæ¬¾è®°å½æ¥è¯¢ |
| | | * @param invoiceLedgerDto |
| | | * @return |
| | | */ |
| | | List<InvoiceLedgerDto> invoiceLedgerSalesAccount(@Param("invoiceLedgerDto") InvoiceLedgerDto invoiceLedgerDto); |
| | | |
| | | /** |
| | | * æ¥è¯¢å款记å½ä¸å页 |
| | | */ |
| | | List<ReceiptPaymentDto> receiptPaymentHistoryListNoPage( @Param("params") ReceiptPaymentDto receiptPaymentDto); |
| | |
| | | private BigDecimal pendingInvoiceTotal; |
| | | |
| | | @ApiModelProperty(value = "忬¾æ»éé¢") |
| | | private BigDecimal invoiceTotal; |
| | | private BigDecimal invoiceTotal = BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty(value = "å¾
仿¬¾æ»éé¢") |
| | | private BigDecimal pendingTicketsTotal; |
| | | |
| | | @ApiModelProperty(value = "仿¬¾æ»éé¢") |
| | | private BigDecimal ticketsTotal; |
| | | private BigDecimal ticketsTotal = BigDecimal.ZERO; |
| | | } |
| | |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | |
| | | private String status; |
| | | @ApiModelProperty(value = "æ¥ä»·æ»éé¢") |
| | | @Excel(name = "æ¥ä»·éé¢") |
| | | private Double totalAmount; |
| | | private BigDecimal totalAmount; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | |
| | | * @param receiptPaymentDto |
| | | * @return |
| | | */ |
| | | List<CustomerInteractionDto> customerInteractions (ReceiptPaymentDto receiptPaymentDto); |
| | | List<InvoiceLedgerDto> customerInteractions (InvoiceLedgerDto receiptPaymentDto); |
| | | |
| | | /** |
| | | * æ¥è¯¢å款记å½å页 |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<CustomerInteractionDto> customerInteractions(ReceiptPaymentDto receiptPaymentDto) { |
| | | ArrayList<CustomerInteractionDto> result = new ArrayList<>(); |
| | | List<CustomerInteractionDto> customerInteractionDtos = receiptPaymentMapper.customerInteractions(receiptPaymentDto); |
| | | if(CollectionUtils.isEmpty(customerInteractionDtos)){ |
| | | return result; |
| | | } |
| | | // åºæ¶æ»éé¢éé¢è®¡ç® |
| | | BigDecimal amountTotal = BigDecimal.ZERO; |
| | | Map<LocalDate, List<CustomerInteractionDto>> dateListMap = customerInteractionDtos.stream().collect( |
| | | Collectors.groupingBy( |
| | | CustomerInteractionDto::getHappenTime, |
| | | LinkedHashMap::new, |
| | | Collectors.toList() |
| | | ) |
| | | ); |
| | | for (LocalDate localDate : dateListMap.keySet()) { |
| | | BigDecimal currentReceiptAmount = BigDecimal.ZERO; |
| | | BigDecimal invoiceAmount = BigDecimal.ZERO; |
| | | BigDecimal currentDateTotal = BigDecimal.ZERO; |
| | | List<CustomerInteractionDto> customerInteractionDtoList = dateListMap.get(localDate); |
| | | // 计ç®å½å¤©æ¶æ¬¾æ° |
| | | currentReceiptAmount = customerInteractionDtoList.stream() |
| | | .filter(item ->item.getType() == 0) |
| | | .map(CustomerInteractionDto::getReceiptAmount) |
| | | .reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | // 计ç®å½å¤©å¼ç¥¨æ° |
| | | invoiceAmount = customerInteractionDtoList.stream() |
| | | .filter(item ->item.getType() == 1) |
| | | .map(CustomerInteractionDto::getInvoiceAmount) |
| | | .reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | // 计ç®å½æ¥æ±æ» |
| | | currentDateTotal = currentDateTotal.add(invoiceAmount).subtract(currentReceiptAmount); |
| | | CustomerInteractionDto customerInteractionDto = new CustomerInteractionDto(); |
| | | customerInteractionDto.setHappenTime(localDate); |
| | | customerInteractionDto.setInvoiceAmount(invoiceAmount); |
| | | customerInteractionDto.setReceiptAmount(currentReceiptAmount); |
| | | amountTotal = customerInteractionDto.getInvoiceAmount().subtract(customerInteractionDto.getReceiptAmount()); |
| | | customerInteractionDto.setUnReceiptAmount(amountTotal); |
| | | result.add(customerInteractionDto); |
| | | } |
| | | ArrayList<CustomerInteractionDto> newResult = new ArrayList<>(); |
| | | for (int i = 0; i < result.size(); i++) { |
| | | CustomerInteractionDto customerInteractionDto = result.get(i); |
| | | if (i == 0) { |
| | | customerInteractionDto.setUnReceiptAmount(customerInteractionDto.getInvoiceAmount().subtract(customerInteractionDto.getReceiptAmount())); |
| | | }else { |
| | | CustomerInteractionDto customerInteractionDto1 = result.get(i-1); |
| | | customerInteractionDto.setUnReceiptAmount(customerInteractionDto1.getUnReceiptAmount() |
| | | .add(customerInteractionDto.getInvoiceAmount()).subtract(customerInteractionDto.getReceiptAmount())); |
| | | } |
| | | newResult.add(customerInteractionDto); |
| | | } |
| | | return newResult; |
| | | public List<InvoiceLedgerDto> customerInteractions(InvoiceLedgerDto receiptPaymentDto) { |
| | | return receiptPaymentMapper.invoiceLedgerSalesAccount(receiptPaymentDto); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import com.ruoyi.approve.pojo.ApproveProcess; |
| | | import com.ruoyi.approve.service.IApproveProcessService; |
| | | import com.ruoyi.approve.service.impl.ApproveProcessServiceImpl; |
| | | import com.ruoyi.approve.vo.ApproveGetAndUpdateVo; |
| | | import com.ruoyi.approve.vo.ApproveProcessVO; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.utils.uuid.UUID; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.sales.dto.SalesQuotationDto; |
| | | import com.ruoyi.sales.mapper.SalesQuotationMapper; |
| | | import com.ruoyi.sales.mapper.SalesQuotationProductMapper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private SalesQuotationProductMapper salesQuotationProductMapper; |
| | | @Autowired |
| | | private SalesQuotationProductService salesQuotationProductService; |
| | | |
| | | @Autowired |
| | | private ApproveProcessServiceImpl approveProcessService; |
| | | @Override |
| | | public IPage<SalesQuotationDto> listPage(Page page, SalesQuotationDto salesQuotationDto) { |
| | | IPage<SalesQuotationDto> salesQuotationDtoIPage = salesQuotationMapper.listPage(page, salesQuotationDto); |
| | |
| | | |
| | | @Override |
| | | public boolean add(SalesQuotationDto salesQuotationDto) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | SalesQuotation salesQuotation = new SalesQuotation(); |
| | | BeanUtils.copyProperties(salesQuotationDto, salesQuotation); |
| | | String quotationNo = salesQuotation.getQuotationNo(); |
| | | String quotationNo = OrderUtils.countTodayByCreateTime(salesQuotationMapper, "QT"); |
| | | salesQuotation.setQuotationNo(quotationNo); |
| | | salesQuotation.setStatus("å¾
审æ¹"); |
| | | salesQuotationMapper.insert(salesQuotation); |
| | | // if(salesQuotationMapper.insert(salesQuotation)!=1){ |
| | | // return false; |
| | | // } |
| | | if(CollectionUtils.isEmpty(salesQuotationDto.getProducts())){ |
| | | return true; |
| | | } |
| | | List<SalesQuotationProduct> products = salesQuotationDto.getProducts().stream().map(product -> { |
| | | SalesQuotationProduct salesQuotationProduct = new SalesQuotationProduct(); |
| | | BeanUtils.copyProperties(product, salesQuotationProduct); |
| | | salesQuotationProduct.setSalesQuotationId(salesQuotationMapper.selectOne(new LambdaQueryWrapper<SalesQuotation>().eq(SalesQuotation::getQuotationNo, quotationNo)).getId()); |
| | | salesQuotationProduct.setSalesQuotationId(salesQuotation.getId()); |
| | | return salesQuotationProduct; |
| | | }).collect(Collectors.toList()); |
| | | salesQuotationProductService.saveBatch(products); |
| | | // æ¥ä»·å®¡æ¹ |
| | | ApproveProcessVO approveProcessVO = new ApproveProcessVO(); |
| | | approveProcessVO.setApproveType(6); |
| | | approveProcessVO.setApproveDeptId(loginUser.getTenantId()); |
| | | approveProcessVO.setApproveReason(quotationNo); |
| | | approveProcessVO.setApproveUserIds(salesQuotationDto.getApproveUserIds()); |
| | | approveProcessVO.setApproveUser(loginUser.getUserId()); |
| | | approveProcessVO.setApproveTime(LocalDate.now().toString()); |
| | | approveProcessVO.setPrice(salesQuotationDto.getTotalAmount()); |
| | | try { |
| | | approveProcessService.addApprove(approveProcessVO); |
| | | }catch (Exception e){ |
| | | log.error("SalesQuotationServiceImpl error:{}", e); |
| | | throw new RuntimeException("审æ¹å¤±è´¥"); |
| | | } |
| | | return true; |
| | | } |
| | | @Override |
| | | public boolean edit(SalesQuotationDto salesQuotationDto) { |
| | | SalesQuotation salesQuotation = new SalesQuotation(); |
| | | BeanUtils.copyProperties(salesQuotationDto, salesQuotation); |
| | | ApproveGetAndUpdateVo vo = new ApproveGetAndUpdateVo(); |
| | | if("æç»".equals(salesQuotationDto.getStatus())){ |
| | | vo.setApproveStatus(0); |
| | | salesQuotation.setStatus("å¾
审æ¹"); |
| | | } |
| | | if(salesQuotationMapper.updateById(salesQuotation)!=1){ |
| | | return false; |
| | | } |
| | |
| | | salesQuotationProduct.setSalesQuotationId(salesQuotation.getId()); |
| | | return salesQuotationProduct; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | salesQuotationProductService.saveBatch(products); |
| | | // ä¿®æ¹æ¥ä»·å®¡æ¹ |
| | | vo.setApproveUserIds(salesQuotationDto.getApproveUserIds()); |
| | | vo.setApproveType(6); |
| | | vo.setApproveReason(salesQuotationDto.getQuotationNo()); |
| | | approveProcessService.updateApproveUser(vo); |
| | | return true; |
| | | } |
| | | @Override |
| | |
| | | @Excel(name = "夿³¨ï¼ç¦å©å¾
éï¼") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 离èåå |
| | | */ |
| | | @Excel(name = "离èåå ",readConverterExp = "salary=èªèµå¾
é,career_development=èä¸åå±,work_environment=å·¥ä½ç¯å¢,personal_reason=个人åå ,other=å
¶ä»") |
| | | private String dimissionReason; |
| | | |
| | | /** |
| | | * 离è夿³¨ |
| | | */ |
| | | @Excel(name = "离è夿³¨") |
| | | private String dimissionRemark; |
| | | |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | |
| | | import static com.ruoyi.common.enums.StaffJoinLeaveRecordDimissionReason.StaffJoinLeaveRecordDimissionReasonOther; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | staffOnJobMapper.updateById(staffOnJob); |
| | | }else { |
| | | throw new BaseException("æ²¡ææ¾å°"+staffJoinLeaveRecord.getStaffNo()+"ç¼å·çåå·¥,æ æ³æ°å¢ç¦»è!!!"); |
| | | } |
| | | if (staffJoinLeaveRecord.getDimissionReason()==null){ |
| | | throw new BaseException("离èåå ä¸è½ä¸ºç©º!!!"); |
| | | } |
| | | if (!StaffJoinLeaveRecordDimissionReasonOther.getCode().equals(staffJoinLeaveRecord.getDimissionReason())){ |
| | | staffJoinLeaveRecord.setDimissionRemark(""); |
| | | } |
| | | } |
| | | return staffJoinLeaveRecordMapper.insert(staffJoinLeaveRecord); |
| | |
| | | }else { |
| | | /*离è*/ |
| | | //离èçç¼è¾ä¸ä¼å½±åå¨è表 |
| | | if (staffJoinLeaveRecord.getDimissionReason()==null){ |
| | | throw new BaseException("离èåå ä¸è½ä¸ºç©º!!!"); |
| | | } |
| | | if (!StaffJoinLeaveRecordDimissionReasonOther.getCode().equals(staffJoinLeaveRecord.getDimissionReason())){ |
| | | staffJoinLeaveRecord.setDimissionRemark(""); |
| | | } |
| | | } |
| | | return staffJoinLeaveRecordMapper.updateById(staffJoinLeaveRecord); |
| | | } |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getSumQuantity" resultType="BigDecimal"> |
| | | select COALESCE(sum(inbound_num), 0) |
| | | from procurement_record_storage |
| | | where product_model_id = #{productModelId} |
| | | </select> |
| | | </mapper> |
| | |
| | | </where> |
| | | order by t1.create_time desc |
| | | </select> |
| | | |
| | | <select id="getSumQuantity" resultType="BigDecimal"> |
| | | select COALESCE(sum(inbound_num), 0) |
| | | from procurement_record_out |
| | | where type = 1 |
| | | and product_model_id = #{productModelId} |
| | | </select> |
| | | </mapper> |
| | |
| | | </where> |
| | | ORDER BY T1.payment_date,T1.create_time DESC |
| | | </select> |
| | | <select id="supplierNameListPage" resultType="com.ruoyi.purchase.dto.PaymentRegistrationDto"> |
| | | SELECT |
| | | T1.supplier_id, |
| | | T1.supplier_name, |
| | | SUM(contract_amount) AS invoiceAmount, |
| | | IFNULL( SUM(T2.current_payment_amount) , 0 ) AS paymentAmount, |
| | | IFNULL((IFNULL(SUM(contract_amount),0) - IFNULL(SUM(T2.current_payment_amount),0)),0) AS payableAmount |
| | | FROM purchase_ledger T1 |
| | | LEFT JOIN payment_registration T2 ON T1.id = T2.sales_ledger_id |
| | | <where> |
| | | <if test="req.supplierName != null and req.supplierName != '' "> |
| | | T1.supplier_name LIKE CONCAT ('%',#{req.supplierName},'%') |
| | | </if> |
| | | </where> |
| | | GROUP BY T1.supplier_name |
| | | </select> |
| | | <select id="supplierNameListPageDetails" resultType="com.ruoyi.purchase.dto.PaymentRegistrationDto"> |
| | | SELECT |
| | | T1.supplier_id, |
| | | T1.supplier_name, |
| | | SUM(contract_amount) AS invoiceAmount, |
| | | IFNULL( SUM(T2.current_payment_amount) , 0 ) AS paymentAmount, |
| | | IFNULL((IFNULL(SUM(contract_amount),0) - IFNULL(SUM(T2.current_payment_amount),0)),0) AS payableAmount, |
| | | T1.purchase_contract_number, |
| | | T2.payment_date |
| | | FROM purchase_ledger T1 |
| | | LEFT JOIN payment_registration T2 ON T1.id = T2.sales_ledger_id |
| | | <where> |
| | | T1.supplier_id = #{req.supplierId} |
| | | <if test="req.supplierName != null and req.supplierName != '' "> |
| | | T1.supplier_name LIKE CONCAT ('%',#{req.supplierName},'%') |
| | | </if> |
| | | </where> |
| | | GROUP BY T1.purchase_contract_number,T2.payment_date |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="tenant_id" property="tenantId"/> |
| | | </resultMap> |
| | | <select id="listBinding" resultType="com.ruoyi.quality.dto.QualityTestStandardBindingDto"> |
| | | select * |
| | | select t2.product_name, |
| | | t1.id qualityTestStandardBindingId |
| | | from quality_test_standard_binding t1 |
| | | left join product t2 on t1.product_id = t2.id |
| | | where t1.test_standard_id = #{testStandardId} |
| | |
| | | FROM quality_test_standard |
| | | where |
| | | 1=1 |
| | | <if test="qualityTestStandard.standardNo != null and qualityTestStandard.standardNo != '' "> |
| | | AND standard_no like concat('%',#{qualityTestStandard.standardNo},'%') |
| | | <if test="c.standardNo != null and c.standardNo != '' "> |
| | | AND standard_no like concat('%',#{c.standardNo},'%') |
| | | </if> |
| | | <if test="qualityTestStandard.standardName != null and qualityTestStandard.standardName != '' "> |
| | | AND standard_name like concat('%',#{qualityTestStandard.standardName},'%') |
| | | <if test="c.standardName != null and c.standardName != '' "> |
| | | AND standard_name like concat('%',#{c.standardName},'%') |
| | | </if> |
| | | <if test="qualityTestStandard.state != null and qualityTestStandard.state != '' "> |
| | | AND state = #{qualityTestStandard.state} |
| | | <if test="c.state != null and c.state != '' "> |
| | | AND state = #{c.state} |
| | | </if> |
| | | <if test="qualityTestStandard.inspectType != null and qualityTestStandard.inspectType != '' "> |
| | | AND inspect_type = #{qualityTestStandard.inspectType} |
| | | <if test="c.inspectType != null and c.inspectType != '' "> |
| | | AND inspect_type = #{c.inspectType} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | select t1.* from quality_test_standard_param t1 |
| | | left join quality_test_standard t2 on t1.test_standard_id = t2.id |
| | | left join quality_test_standard_binding t3 on t2.id = t3.test_standard_id |
| | | where product_id = #{productId} |
| | | where t3.product_id = #{productId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | <select id="invoiceLedgerSalesAccount" resultType="com.ruoyi.sales.dto.InvoiceLedgerDto"> |
| | | SELECT |
| | | T4.id,T4.customer_name , |
| | | SUM(invoice_total) AS invoice_total, |
| | | IFNULL( SUM(T5.receipt_payment_amount) , 0 ) AS receipt_payment_amount, |
| | | IFNULL((IFNULL(SUM(invoice_total),0) - IFNULL(SUM(T5.receipt_payment_amount),0)),0) AS unReceipt_payment_amount |
| | | FROM |
| | | invoice_ledger T1 |
| | | LEFT JOIN invoice_registration_product T2 ON T1.invoice_registration_product_id = T2.id |
| | | LEFT JOIN sales_ledger T3 ON T3.id = T2.sales_ledger_id |
| | | LEFT JOIN customer T4 ON T4.id = T3.customer_id |
| | | LEFT JOIN ( SELECT invoice_ledger_id, SUM( receipt_payment_amount ) AS receipt_payment_amount FROM receipt_payment GROUP BY invoice_ledger_id ) T5 ON T5.invoice_ledger_id = T1.id |
| | | T1.customer_id as id, |
| | | T1.customer_name, |
| | | SUM(contract_amount) AS invoice_total, |
| | | IFNULL( SUM(T2.receipt_payment_amount) , 0 ) AS receipt_payment_amount, |
| | | IFNULL((IFNULL(SUM(contract_amount),0) - IFNULL(SUM(T2.receipt_payment_amount),0)),0) AS unReceipt_payment_amount |
| | | FROM sales_ledger T1 |
| | | LEFT JOIN receipt_payment T2 ON T1.id = T2.sales_ledger_id |
| | | <where> |
| | | <if test="invoiceLedgerDto.searchText != null and invoiceLedgerDto.searchText != '' "> |
| | | T4.customer_name LIKE CONCAT ('%',#{invoiceLedgerDto.searchText},'%') |
| | | T1.customer_name LIKE CONCAT ('%',#{invoiceLedgerDto.searchText},'%') |
| | | </if> |
| | | </where> |
| | | GROUP BY T4.id,T4.customer_name |
| | | GROUP BY T1.customer_name |
| | | </select> |
| | | |
| | | <select id="invoiceLedgerProductInfo" resultType="com.ruoyi.sales.dto.InvoiceRegistrationProductDto"> |
| | |
| | | </where> |
| | | |
| | | </select> |
| | | <select id="invoiceLedgerSalesAccount" resultType="com.ruoyi.sales.dto.InvoiceLedgerDto"> |
| | | SELECT |
| | | T1.sales_contract_no, |
| | | SUM(contract_amount) AS invoice_total, |
| | | IFNULL( SUM(T2.receipt_payment_amount) , 0 ) AS receipt_payment_amount, |
| | | IFNULL((IFNULL(SUM(contract_amount),0) - IFNULL(SUM(T2.receipt_payment_amount),0)),0) AS unReceipt_payment_amount, |
| | | T2.receipt_payment_date |
| | | FROM sales_ledger T1 |
| | | LEFT JOIN receipt_payment T2 ON T1.id = T2.sales_ledger_id |
| | | <where> |
| | | T1.customer_id = #{invoiceLedgerDto.customerId} |
| | | <if test="invoiceLedgerDto.searchText != null and invoiceLedgerDto.searchText != '' "> |
| | | T1.customer_name LIKE CONCAT ('%',#{invoiceLedgerDto.searchText},'%') |
| | | </if> |
| | | </where> |
| | | GROUP BY T1.sales_contract_no,T2.receipt_payment_date |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | t3.shipping_date |
| | | FROM |
| | | sales_ledger_product T1 |
| | | left join shipping_info t3 on T1.id = t3.sales_ledger_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 != '' "> |
| | |
| | | select slp.*, |
| | | sl.project_name, |
| | | sl.supplier_name, |
| | | sl.supplier_id, |
| | | sl.sales_contract_no, |
| | | sl.purchase_contract_number |
| | | from sales_ledger_product slp |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.sales.mapper.SalesQuotationMapper"> |
| | | <select id="listPage" resultType="com.ruoyi.sales.dto.SalesQuotationDto"> |
| | | SELECT * FROM sales_quotation |
| | | SELECT t1.*, |
| | | t2.approve_user_ids |
| | | FROM sales_quotation t1 |
| | | LEFT JOIN approve_process t2 ON t1.quotation_no = t2.approve_reason and t2.approve_type = 6 |
| | | WHERE 1=1 |
| | | <if test="salesQuotationDto.quotationNo != null and salesQuotationDto.quotationNo != '' "> |
| | | AND quotation_no LIKE CONCAT('%',#{salesQuotationDto.quotationNo},'%') |
| | | AND t1.quotation_no LIKE CONCAT('%',#{salesQuotationDto.quotationNo},'%') |
| | | </if> |
| | | <if test="salesQuotationDto.customer != null and salesQuotationDto.customer != '' "> |
| | | AND customer = #{salesQuotationDto.customer} |
| | | AND t1.customer = #{salesQuotationDto.customer} |
| | | </if> |
| | | <if test="salesQuotationDto.status != null and salesQuotationDto.status != '' "> |
| | | AND status = #{salesQuotationDto.status} |
| | | AND t1.status = #{salesQuotationDto.status} |
| | | </if> |
| | | </select> |
| | | </mapper> |