Merge branch 'refs/heads/dev_New' into dev_New_kthg
# Conflicts:
# src/main/java/com/ruoyi/compensationperformance/service/impl/CompensationPerformanceServiceImpl.java
# src/main/java/com/ruoyi/customervisits/service/impl/CustomerVisitsServiceImpl.java
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #åå·¥èå¤è¡¨ |
| | | drop table if exists personal_attendance_records; |
| | | create table personal_attendance_records |
| | | ( |
| | | id bigint auto_increment primary key, |
| | | staff_on_job_id bigint not null default 0 comment 'åå·¥å¨èid', |
| | | date date not null comment 'æ¥æ', |
| | | work_start_at datetime null comment 'å·¥ä½å¼å§æ¶é´', |
| | | work_end_at datetime null comment 'å·¥ä½ç»ææ¶é´', |
| | | work_hours decimal(5,2) null comment '工使¶é¿', |
| | | status tinyint not null default 0 comment 'ç¶æ 0æ£å¸¸ 1è¿å° 2æ©é', |
| | | remark text null comment '夿³¨', |
| | | tenant_id bigint not null comment 'ç§æ·id', |
| | | create_time datetime null comment 'å½å
¥æ¶é´', |
| | | update_time datetime null comment 'æ´æ°æ¶é´', |
| | | index idx_staff_on_job_id (staff_on_job_id), |
| | | unique idx_staff_on_job_id_date (staff_on_job_id, date) |
| | | ); |
| | |
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-starter-parent</artifactId>
|
| | | <version>2.5.15</version>
|
| | | <relativePath />
|
| | | <relativePath/>
|
| | | </parent>
|
| | |
|
| | | <properties>
|
| | |
| | | <spring-security.version>5.7.12</spring-security.version>
|
| | | <spring-framework.version>5.3.39</spring-framework.version>
|
| | | <mybatis-plus.version>3.5.3.1</mybatis-plus.version>
|
| | | <getui-sdk.version>1.0.7.0</getui-sdk.version>
|
| | | </properties>
|
| | |
|
| | | <dependencies>
|
| | |
| | | </dependency>
|
| | |
|
| | |
|
| | |
|
| | | <!-- minio -->
|
| | | <dependency>
|
| | | <groupId>io.minio</groupId>
|
| | |
| | | <artifactId>easyexcel</artifactId>
|
| | | <version>4.0.3</version>
|
| | | </dependency>
|
| | | |
| | | <dependency>
|
| | |
|
| | | <dependency>
|
| | | <groupId>com.google.zxing</groupId>
|
| | | <artifactId>core</artifactId>
|
| | | <version>3.3.3</version>
|
| | | </dependency>
|
| | |
|
| | | <dependency>
|
| | | <groupId>com.getui.push</groupId>
|
| | | <artifactId>restful-sdk</artifactId>
|
| | | <version>${getui-sdk.version}</version>
|
| | | <scope>compile</scope>
|
| | | </dependency>
|
| | |
|
| | | </dependencies>
|
| | |
|
| | | <build>
|
| | | <finalName>${project.artifactId}</finalName>
|
| | | <plugins>
|
| | | <plugin>
|
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-maven-plugin</artifactId>
|
| | | <configuration>
|
| | | <fork>true</fork> <!-- å¦ææ²¡æè¯¥é
ç½®ï¼devtoolsä¸ä¼çæ -->
|
| | | </configuration>
|
| | | </plugin>
|
| | | <build>
|
| | | <finalName>${project.artifactId}</finalName>
|
| | | <plugins>
|
| | | <plugin>
|
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-maven-plugin</artifactId>
|
| | | <configuration>
|
| | | <fork>true</fork> <!-- å¦ææ²¡æè¯¥é
ç½®ï¼devtoolsä¸ä¼çæ -->
|
| | | </configuration>
|
| | | </plugin>
|
| | | </plugins>
|
| | | </build>
|
| | | </build>
|
| | |
|
| | | <repositories>
|
| | | <repository>
|
| | | <id>public</id>
|
| | | <name>aliyun nexus</name>
|
| | | <url>https://maven.aliyun.com/repository/public</url>
|
| | | <releases>
|
| | | <enabled>true</enabled>
|
| | | </releases>
|
| | | </repository>
|
| | | </repositories>
|
| | | <repositories>
|
| | | <repository>
|
| | | <id>public</id>
|
| | | <name>aliyun nexus</name>
|
| | | <url>https://maven.aliyun.com/repository/public</url>
|
| | | <releases>
|
| | | <enabled>true</enabled>
|
| | | </releases>
|
| | | </repository>
|
| | | </repositories>
|
| | |
|
| | | <pluginRepositories>
|
| | | <pluginRepository>
|
| | | <id>public</id>
|
| | | <name>aliyun nexus</name>
|
| | | <url>https://maven.aliyun.com/repository/public</url>
|
| | | <releases>
|
| | | <enabled>true</enabled>
|
| | | </releases>
|
| | | <snapshots>
|
| | | <enabled>false</enabled>
|
| | | </snapshots>
|
| | | </pluginRepository>
|
| | | </pluginRepositories>
|
| | | <pluginRepositories>
|
| | | <pluginRepository>
|
| | | <id>public</id>
|
| | | <name>aliyun nexus</name>
|
| | | <url>https://maven.aliyun.com/repository/public</url>
|
| | | <releases>
|
| | | <enabled>true</enabled>
|
| | | </releases>
|
| | | <snapshots>
|
| | | <enabled>false</enabled>
|
| | | </snapshots>
|
| | | </pluginRepository>
|
| | | </pluginRepositories>
|
| | |
|
| | | </project>
|
| | |
| | | // æ¼ç¤ºä¾åï¼æ§è¡ main æ¹æ³æ§å¶å°è¾å
¥æ¨¡å表åå车èªå¨çæå¯¹åºé¡¹ç®ç®å½ä¸ |
| | | public class CodeGenerator { |
| | | |
| | | public static String database_url = "jdbc:mysql://localhost:3306/product-inventory-management-new"; |
| | | public static String database_url = "jdbc:mysql://1.15.17.182:9999/product-inventory-management-new"; |
| | | public static String database_username = "root"; |
| | | public static String database_password= "123456"; |
| | | public static String database_password= "xd@123456.."; |
| | | public static String author = "è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸"; |
| | | public static String model = "purchase"; // 模å |
| | | public static String model = "staff"; // 模å |
| | | public static String setParent = "com.ruoyi."+ model; // å
è·¯å¾ |
| | | public static String tablePrefix = ""; // è®¾ç½®è¿æ»¤è¡¨åç¼ |
| | | public static void main(String[] args) { |
| | |
| | | private Date expenseDate; |
| | | |
| | | /** |
| | | * æ¯åºç±»å(åå
¬ç¨åï¼å工工èµï¼å·®æ
è´¹ï¼è®¾å¤è´¹ç¨ï¼å
¶ä») |
| | | * æ¯åºç±»å(åå
¬ç¨åï¼å工工èµï¼å·®æ
è´¹ï¼è®¾å¤è´¹ç¨ï¼æ¥ç¥¨ä»æ¬¾ï¼å
¶ä») |
| | | */ |
| | | @Excel(name = "æ¯åºç±»å",readConverterExp = "0=åå
¬ç¨å,1=å工工èµ,2=å·®æ
è´¹,3=设å¤è´¹ç¨,4=å
¶ä»") |
| | | @Excel(name = "æ¯åºç±»å",readConverterExp = "0=åå
¬ç¨å,1=å工工èµ,2=å·®æ
è´¹,3=设å¤è´¹ç¨,4=æ¥ç¥¨ä»æ¬¾,5=å
¶ä»") |
| | | @NotBlank(message = "æ¯åºç±»åä¸è½ä¸ºç©º!!") |
| | | private String expenseType; |
| | | |
| | |
| | | /** |
| | | * æ¶å
¥ç±»å(é宿¶å
¥ï¼æå¡æ¶å
¥ï¼å
¶ä»æ¶å
¥) |
| | | */ |
| | | @Excel(name = "æ¶å
¥ç±»å",readConverterExp = "0=é宿¶å
¥,1=æå¡æ¶å
¥,2=å
¶ä»æ¶å
¥") |
| | | @Excel(name = "æ¶å
¥ç±»å",readConverterExp = "0=é宿¶å
¥,1=æå¡æ¶å
¥,2=å
¶ä»æ¶å
¥,3=忬¾æ¶å
¥") |
| | | @NotBlank(message = "æ¶å
¥ç±»åä¸è½ä¸ºç©º!!") |
| | | private String incomeType; |
| | | |
| | |
| | | accountExpense.setBusinessId(borrowInfo.getId()); |
| | | accountExpense.setBusinessType(2); |
| | | accountExpense.setExpenseDate(DateUtils.toDate(borrowInfo.getRepayDate())); |
| | | accountExpense.setExpenseType("4"); |
| | | accountExpense.setExpenseType("5"); |
| | | accountExpense.setExpenseMoney(borrowInfo.getBorrowAmount()); |
| | | accountExpense.setExpenseDescribed("è¿æ¬¾"); |
| | | accountExpense.setExpenseMethod("3"); |
| | |
| | | import com.ruoyi.project.system.mapper.SysDeptMapper; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.project.system.service.ISysNoticeService; |
| | | import com.ruoyi.purchase.mapper.PurchaseLedgerMapper; |
| | | import com.ruoyi.purchase.pojo.PurchaseLedger; |
| | | import com.ruoyi.sales.mapper.CommonFileMapper; |
| | | import com.ruoyi.sales.mapper.ShippingInfoMapper; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import com.ruoyi.sales.service.impl.CommonFileServiceImpl; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | return sysDeptList; |
| | | } |
| | | |
| | | @Autowired |
| | | private PurchaseLedgerMapper purchaseLedgerMapper; |
| | | |
| | | @Autowired |
| | | private ShippingInfoMapper shippingInfoMapper; |
| | | |
| | | @Override |
| | | public IPage<ApproveProcess> listAll(Page page, ApproveProcess approveProcess) { |
| | | IPage<ApproveProcess> approveProcessIPage = approveProcessMapper.listPage(page, approveProcess); |
| | | List<ApproveProcess> records = approveProcessIPage.getRecords(); |
| | | |
| | | for (ApproveProcess record : records) { |
| | | List<CommonFile> commonFiles = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>() |
| | | .eq(CommonFile::getCommonId, record.getId()) |
| | | .eq(CommonFile::getType, FileNameType.ApproveProcess.getValue())); |
| | | record.setCommonFileList(commonFiles); |
| | | List<CommonFile> allFiles = new ArrayList<>(); |
| | | |
| | | // éè´å®¡æ¹æ¥è¯¢ |
| | | if (record.getApproveType() == 5) { |
| | | String contractNo = record.getApproveReason(); |
| | | PurchaseLedger ledger = purchaseLedgerMapper.selectOne(new LambdaQueryWrapper<PurchaseLedger>() |
| | | .eq(PurchaseLedger::getPurchaseContractNumber, contractNo) |
| | | .last("limit 1")); |
| | | |
| | | if (ledger != null) { |
| | | allFiles = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>() |
| | | .eq(CommonFile::getCommonId, ledger.getId()) |
| | | .eq(CommonFile::getType, FileNameType.PURCHASE.getValue())); |
| | | } |
| | | } |
| | | |
| | | // åè´§å®¡æ¹æ¥è¯¢ |
| | | else if (record.getApproveType() == 7) { |
| | | String reason = record.getApproveReason(); // æ ¼å¼ä¸º "xx:...-..." |
| | | if (StringUtils.hasText(reason) && reason.contains(":")) { |
| | | // æååå·åé¢çåè´§åå· |
| | | String shippingNo = reason.split(":")[1]; |
| | | // æ ¹æ®åè´§åå·æ¥è¯¢åè´§å°è´¦è®°å½ |
| | | ShippingInfo shippingInfo = shippingInfoMapper.selectOne(new LambdaQueryWrapper<ShippingInfo>() |
| | | .eq(ShippingInfo::getShippingNo, shippingNo) |
| | | .last("limit 1")); |
| | | if (shippingInfo != null) { |
| | | // 使ç¨åè´§å°è´¦ç éå®å°è´¦ID 廿¥éä»¶ |
| | | allFiles = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>() |
| | | .eq(CommonFile::getCommonId, shippingInfo.getSalesLedgerId()) |
| | | .eq(CommonFile::getType, FileNameType.SALE.getValue())); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ¥è¯¢å®¡æ¹åèªèº«çéä»¶ |
| | | else { |
| | | allFiles = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>() |
| | | .eq(CommonFile::getCommonId, record.getId()) |
| | | .eq(CommonFile::getType, FileNameType.ApproveProcess.getValue())); |
| | | } |
| | | |
| | | record.setCommonFileList(allFiles); |
| | | } |
| | | return approveProcessIPage; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.dto.ProductDto; |
| | | import com.ruoyi.basic.dto.ProductModelDto; |
| | | import com.ruoyi.basic.dto.ProductModelExportDto; |
| | | import com.ruoyi.basic.dto.ProductTreeDto; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.basic.service.IProductModelService; |
| | | import com.ruoyi.basic.service.IProductService; |
| | | 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.controller.BaseController; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | |
| | | /** |
| | | * 导å
¥äº§å |
| | | */ |
| | | @Log(title = "导å
¥äº§å",businessType = BusinessType.IMPORT) |
| | | @PostMapping("import") |
| | | public AjaxResult importProduct(MultipartFile file) { |
| | | return AjaxResult.success(productModelService.importProduct(file)); |
| | | @PostMapping("/import") |
| | | @Log(title = "导å
¥äº§å", businessType = BusinessType.IMPORT) |
| | | public AjaxResult importProductModel(@RequestParam("file") MultipartFile file, Integer productId) { |
| | | return productModelService.importProductModel(file, productId); |
| | | } |
| | | |
| | | /** |
| | | * 产å导å
¥æ¨¡æ¿ |
| | | */ |
| | | @GetMapping("/export") |
| | | @ApiOperation("产å导å
¥æ¨¡æ¿") |
| | | @Log(title = "产å导å
¥æ¨¡æ¿", businessType = BusinessType.EXPORT) |
| | | public void importProduct(HttpServletResponse response) { |
| | | ExcelUtil<ProductModelExportDto> excelUtil = new ExcelUtil<>(ProductModelExportDto.class); |
| | | excelUtil.importTemplateExcel(response, "产åè§æ ¼å¯¼å
¥æ¨¡æ¿"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * <br> |
| | | * 产åå¯¼åºæ¨¡æ¿ |
| | | * </br> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/02/10 14:39 |
| | | */ |
| | | @Data |
| | | public class ProductModelExportDto { |
| | | |
| | | @Excel(name = "è§æ ¼åå·") |
| | | private String model; |
| | | |
| | | @Excel(name = "åä½") |
| | | private String unit; |
| | | |
| | | } |
| | |
| | | import com.ruoyi.basic.dto.ProductDto; |
| | | import com.ruoyi.basic.dto.ProductModelDto; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | IPage<ProductModel> modelListPage(Page page , ProductDto productDto); |
| | | |
| | | Boolean importProduct(MultipartFile file); |
| | | AjaxResult importProductModel(MultipartFile file, Integer productId); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.dto.ProductDto; |
| | |
| | | import com.ruoyi.basic.pojo.Product; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.basic.service.IProductModelService; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | |
| | | if (productModelDto.getId() == null) { |
| | | ProductModel productModel = new ProductModel(); |
| | | BeanUtils.copyProperties(productModelDto,productModel); |
| | | BeanUtils.copyProperties(productModelDto, productModel); |
| | | return productModelMapper.insert(productModel); |
| | | } else { |
| | | return productModelMapper.updateById(productModelDto); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®idæ¥è¯¢äº§åè§æ ¼å页æ¥è¯¢ |
| | | * |
| | | * @param page |
| | | * @param productDto |
| | | * @return |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Boolean importProduct(MultipartFile file) { |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult importProductModel(MultipartFile file, Integer productId) { |
| | | if (productId == null) { |
| | | return AjaxResult.error("请å
éæ©äº§åå导å
¥è§æ ¼åå·"); |
| | | } |
| | | |
| | | Product product = productMapper.selectById(productId); |
| | | if (product == null) { |
| | | return AjaxResult.error("éæ©ç产åä¸åå¨"); |
| | | } |
| | | |
| | | try { |
| | | ExcelUtil<ProductModel> productModelExcelUtil = new ExcelUtil<>(ProductModel.class); |
| | | List<ProductModel> productModelList = productModelExcelUtil.importExcel(file.getInputStream()); |
| | | Map<String, List<ProductModel>> collect = productModelList.stream().collect(Collectors.groupingBy(ProductModel::getProductName)); |
| | | collect.forEach((k,v)->{ |
| | | Product product = productMapper.selectOne(new LambdaQueryWrapper<Product>().eq(Product::getProductName, k).last("LIMIT 1")); |
| | | if (product != null) { |
| | | v.forEach(productModel -> { |
| | | productModel.setProductId(product.getId()); |
| | | }); |
| | | this.saveOrUpdateBatch(v); |
| | | |
| | | if (CollectionUtils.isEmpty(productModelList)) { |
| | | return AjaxResult.error("导å
¥æ°æ®ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | // è·åå½å产å䏿æçè§æ ¼åå·å |
| | | List<ProductModel> existingModels = list(new LambdaQueryWrapper<ProductModel>().eq(ProductModel::getProductId, productId)); |
| | | Set<String> existingModelNames = existingModels.stream().map(ProductModel::getModel).collect(Collectors.toSet()); |
| | | |
| | | List<ProductModel> waitToSaveList = new ArrayList<>(); |
| | | int skipCount = 0; |
| | | |
| | | for (int i = 0; i < productModelList.size(); i++) { |
| | | ProductModel item = productModelList.get(i); |
| | | int rowNum = i + 2; |
| | | |
| | | if (StringUtils.isEmpty(item.getModel())) { |
| | | return AjaxResult.error("第 " + rowNum + " è¡å¯¼å
¥å¤±è´¥: [è§æ ¼åå·] ä¸è½ä¸ºç©º"); |
| | | } |
| | | }); |
| | | return true; |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | if (StringUtils.isEmpty(item.getUnit())) { |
| | | return AjaxResult.error("第 " + rowNum + " è¡å¯¼å
¥å¤±è´¥: [åä½] ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | // å»é,妿已å
å«è¯¥åå·,åè·³è¿ |
| | | if (existingModelNames.contains(item.getModel())) { |
| | | skipCount++; |
| | | continue; |
| | | } |
| | | |
| | | item.setProductId(product.getId()); |
| | | waitToSaveList.add(item); |
| | | |
| | | existingModelNames.add(item.getModel()); |
| | | } |
| | | |
| | | if (!waitToSaveList.isEmpty()) { |
| | | saveBatch(waitToSaveList); |
| | | } |
| | | |
| | | if (skipCount == 0) { |
| | | return AjaxResult.success(String.format("æå导å
¥ %d æ¡æ°æ®", waitToSaveList.size())); |
| | | } else { |
| | | return AjaxResult.success(String.format("æå导å
¥ %d æ¡ï¼è·³è¿å·²å卿°æ® %d æ¡", waitToSaveList.size(), skipCount)); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("导å
¥äº§åè§æ ¼å¼å¸¸", e); |
| | | throw new ServiceException("导å
¥å¤±è´¥"); |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | |
| | | @Autowired |
| | | private CompensationPerformanceService compensationPerformanceService; |
| | | |
| | | @Autowired |
| | | private StaffOnJobMapper staffOnJobMapper; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "èªé
¬ç»©æ-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("èªé
¬ç»©æ-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, CompensationPerformance compensationPerformance){ |
| | | IPage<CompensationPerformance> listPage = compensationPerformanceService.listPage(page, compensationPerformance); |
| | | public AjaxResult listPage(Page page, String staffName, String payDateStr) { |
| | | IPage<CompensationPerformance> listPage = compensationPerformanceService.listPage(page, staffName, payDateStr); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | |
| | | @Log(title = "èªé
¬ç»©æ-æ·»å ", businessType = BusinessType.INSERT) |
| | | @ApiOperation("èªé
¬ç»©æ-æ·»å ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody CompensationPerformance compensationPerformance){ |
| | | public AjaxResult add(@RequestBody CompensationPerformance compensationPerformance) { |
| | | boolean save = compensationPerformanceService.save(compensationPerformance); |
| | | return save ? AjaxResult.success("æ·»å æå") : AjaxResult.error("æ·»å 失败"); |
| | | } |
| | |
| | | @Log(title = "èªé
¬ç»©æ-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("èªé
¬ç»©æ-ä¿®æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody CompensationPerformance compensationPerformance){ |
| | | public AjaxResult update(@RequestBody CompensationPerformance compensationPerformance) { |
| | | boolean update = compensationPerformanceService.updateById(compensationPerformance); |
| | | return update ? AjaxResult.success("ä¿®æ¹æå") : AjaxResult.error("ä¿®æ¹å¤±è´¥"); |
| | | } |
| | |
| | | @Log(title = "èªé
¬ç»©æ-å é¤", businessType = BusinessType.DELETE) |
| | | @ApiOperation("èªé
¬ç»©æ-å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | boolean delete = compensationPerformanceService.removeBatchByIds(ids); |
| | | return delete ? AjaxResult.success("å 餿å") : AjaxResult.error("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | @Log(title = "导åºèªèµç®¡çå表", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response ) { |
| | | List<CompensationPerformance> list = compensationPerformanceService.list(); |
| | | ExcelUtil<CompensationPerformance> util = new ExcelUtil<CompensationPerformance>(CompensationPerformance.class); |
| | | public void export(HttpServletResponse response) { |
| | | List<CompensationPerformance> list = compensationPerformanceService.exportList(); |
| | | ExcelUtil<CompensationPerformance> util = new ExcelUtil<>(CompensationPerformance.class); |
| | | util.exportExcel(response, list, "导åºèªèµç®¡çå表"); |
| | | } |
| | | |
| | |
| | | util.exportExcel(response, list, "ä¸è½½èªèµç®¡çå表模æ¿"); |
| | | } |
| | | |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Log(title = "导å
¥èªèµç®¡çå表", businessType = BusinessType.IMPORT) |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file) throws Exception { |
| | | ExcelUtil<CompensationPerformance> util = new ExcelUtil<>(CompensationPerformance.class); |
| | | List<CompensationPerformance> list = util.importExcel(file.getInputStream()); |
| | | list.forEach(item->{ |
| | | SysUser staffOnJob = sysUserMapper.selectUserByNickName(item.getName()); |
| | | if(staffOnJob!=null){ |
| | | item.setStaffId(staffOnJob.getUserId()); |
| | | list.forEach(item -> { |
| | | StaffOnJob staffOnJob = staffOnJobMapper.selectStaffByNickName(item.getStaffName()); |
| | | if (staffOnJob != null) { |
| | | item.setStaffId(staffOnJob.getId()); |
| | | } |
| | | }); |
| | | boolean b = compensationPerformanceService.saveBatch(list); |
| | |
| | | import com.ruoyi.compensationperformance.pojo.CompensationPerformance; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/8/8 9:54 |
| | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param page |
| | | * @param compensationPerformance |
| | | * @return |
| | | * @param page å页 |
| | | * @param staffName åå·¥å§å |
| | | * @param payDateStr èªèµæ¥æ |
| | | * @return æ¥è¯¢ç人åèªèµä¿¡æ¯ |
| | | */ |
| | | IPage<CompensationPerformance> listPage(Page page,@Param("req") CompensationPerformance compensationPerformance); |
| | | IPage<CompensationPerformance> listPage(Page page, @Param("staffName") String staffName, @Param("payDateStr") String payDateStr); |
| | | |
| | | /** |
| | | * 导åºäººåèªèµ |
| | | * |
| | | * @return 人åèªèµä¿¡æ¯ |
| | | */ |
| | | List<CompensationPerformance> exportList(); |
| | | } |
| | |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * èªé
¬ç»©ææç» |
| | | * |
| | | * @author :yys |
| | | * @date : 2025/8/8 9:40 |
| | | * @date : 2025/8/8 |
| | | */ |
| | | @Data |
| | | @TableName("compensation_performance") |
| | | @ApiModel |
| | | public class CompensationPerformance { |
| | | |
| | | @ApiModel("èªé
¬ç»©ææç»") |
| | | public class CompensationPerformance implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ApiModelProperty("主é®") |
| | | private Long id; |
| | | |
| | | /** |
| | | * ç¨æ·id |
| | | * åå·¥id |
| | | */ |
| | | @ApiModelProperty("ç¨æ·id") |
| | | @ApiModelProperty("åå·¥id") |
| | | private Long staffId; |
| | | |
| | | /** |
| | | * å§å |
| | | * åå·¥å§å |
| | | */ |
| | | @ApiModelProperty("å§å") |
| | | @Excel(name = "å§å") |
| | | private String name; |
| | | @ApiModelProperty("åå·¥å§å") |
| | | @Excel(name = "åå·¥å§å") |
| | | @TableField(exist = false) |
| | | private String staffName; |
| | | |
| | | /** |
| | | * èªèµæä»½(æ¥è¯¢) |
| | | * å²ä½åç§° |
| | | */ |
| | | @ApiModelProperty("èªèµæä»½(æ¥è¯¢)") |
| | | @ApiModelProperty("å²ä½åç§°") |
| | | @Excel(name = "å²ä½åç§°") |
| | | @TableField(exist = false) |
| | | private String payDateStr; |
| | | private String postName; |
| | | |
| | | /** |
| | | * é¨é¨åç§° |
| | | */ |
| | | @ApiModelProperty("é¨é¨åç§°") |
| | | @Excel(name = "é¨é¨åç§°") |
| | | @TableField(exist = false) |
| | | private String deptName; |
| | | |
| | | /** |
| | | * èªèµæä»½ |
| | | */ |
| | | @ApiModelProperty("èªèµæä»½") |
| | | @Excel(name = "èªèµæä»½", dateFormat = "yyyy-MM", width = 30) |
| | | @Excel(name = "æä»½", dateFormat = "yyyy-MM", width = 20) |
| | | @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM") |
| | | private Date payDate; |
| | | |
| | | |
| | | /** |
| | | * åºåºå¤å¤©æ° |
| | | */ |
| | | @ApiModelProperty("åºåºå¤å¤©æ°") |
| | | // @Excel(name = "åºåºå¤å¤©æ°") |
| | | private BigDecimal shouldAttendedNum; |
| | | |
| | | /** |
| | | * å®é
åºå¤å¤©æ° |
| | | */ |
| | | @ApiModelProperty("å®é
åºå¤å¤©æ°") |
| | | // @Excel(name = "å®é
åºå¤å¤©æ°") |
| | | private BigDecimal actualAttendedNum; |
| | | |
| | | |
| | | /** |
| | | * åºæ¬å·¥èµ |
| | | */ |
| | | @ApiModelProperty("åºæ¬å·¥èµ") |
| | | // @Excel(name = "åºæ¬å·¥èµ") |
| | | @Excel(name = "åºæ¬å·¥èµ") |
| | | private BigDecimal basicSalary; |
| | | |
| | | /** |
| | | * å²ä½å·¥èµ |
| | | * è®¡ä»¶å·¥èµ |
| | | */ |
| | | @ApiModelProperty("å²ä½å·¥èµ") |
| | | // @Excel(name = "å²ä½å·¥èµ") |
| | | private BigDecimal postSalary; |
| | | @ApiModelProperty("计件工èµ") |
| | | @Excel(name = "计件工èµ") |
| | | private BigDecimal pieceworkSalary; |
| | | |
| | | /** |
| | | * å
¥ç¦»èç¼ºå¤æ£æ¬¾ |
| | | * 计æ¶å·¥èµ |
| | | */ |
| | | @ApiModelProperty("å
¥ç¦»èç¼ºå¤æ£æ¬¾") |
| | | // @Excel(name = "å
¥ç¦»èç¼ºå¤æ£æ¬¾") |
| | | private BigDecimal deductionAbsenteeism; |
| | | |
| | | @ApiModelProperty("计æ¶å·¥èµ") |
| | | @Excel(name = "计æ¶å·¥èµ") |
| | | private BigDecimal hourlySalary; |
| | | |
| | | /** |
| | | * ç
åæ£æ¬¾ |
| | | * å
¶ä»æ¶å
¥ |
| | | */ |
| | | @ApiModelProperty("ç
åæ£æ¬¾") |
| | | // @Excel(name = "ç
åæ£æ¬¾") |
| | | private BigDecimal sickLeaveDeductions; |
| | | |
| | | /** |
| | | * äºåæ£æ¬¾ |
| | | */ |
| | | @ApiModelProperty("äºåæ£æ¬¾") |
| | | // @Excel(name = "äºåæ£æ¬¾") |
| | | private BigDecimal deductionPersonalLeave; |
| | | /** |
| | | * å¿è®°æå¡æ£æ¬¾ |
| | | */ |
| | | @ApiModelProperty("å¿è®°æå¡æ£æ¬¾") |
| | | // @Excel(name = "å¿è®°æå¡æ£æ¬¾") |
| | | private BigDecimal forgetClockDeduct; |
| | | |
| | | /** |
| | | * 绩æå¾å |
| | | */ |
| | | @ApiModelProperty("绩æå¾å") |
| | | // @Excel(name = "绩æå¾å") |
| | | private BigDecimal performanceScore; |
| | | |
| | | /** |
| | | * 绩æå·¥èµ |
| | | */ |
| | | @ApiModelProperty("绩æå·¥èµ") |
| | | // @Excel(name = "绩æå·¥èµ") |
| | | private BigDecimal performancePay; |
| | | |
| | | |
| | | /** |
| | | * åºåå计 |
| | | */ |
| | | @ApiModelProperty("åºåå计") |
| | | // @Excel(name = "åºåå计") |
| | | private BigDecimal payableWages; |
| | | @ApiModelProperty("å
¶ä»æ¶å
¥") |
| | | @Excel(name = "å
¶ä»æ¶å
¥") |
| | | private BigDecimal otherIncome; |
| | | |
| | | /** |
| | | * 社ä¿ä¸ªäºº |
| | | */ |
| | | @ApiModelProperty("社ä¿ä¸ªäºº") |
| | | // @Excel(name = "社ä¿ä¸ªäºº") |
| | | @Excel(name = "社ä¿ä¸ªäºº") |
| | | private BigDecimal socialSecurityIndividuals; |
| | | /** |
| | | * 社ä¿å
¬å¸ |
| | | */ |
| | | @ApiModelProperty("社ä¿å
¬å¸") |
| | | // @Excel(name = "社ä¿å
¬å¸") |
| | | private BigDecimal socialSecurityCompanies; |
| | | |
| | | /** |
| | | * 社ä¿å计 |
| | | */ |
| | | @ApiModelProperty("社ä¿å计") |
| | | // @Excel(name = "社ä¿å计") |
| | | private BigDecimal socialSecurityTotal; |
| | | |
| | | /** |
| | | * å
¬ç§¯éå计 |
| | | */ |
| | | @ApiModelProperty("å
¬ç§¯éå计") |
| | | // @Excel(name = "å
¬ç§¯éå计") |
| | | private BigDecimal providentFundTotal; |
| | | /** |
| | | * å
¬ç§¯éå
¬å¸ |
| | | */ |
| | | @ApiModelProperty("å
¬ç§¯éå
¬å¸") |
| | | // @Excel(name = "å
¬ç§¯éå
¬å¸") |
| | | private BigDecimal providentFundCompany; |
| | | |
| | | /** |
| | | * å
¬ç§¯é个人 |
| | | */ |
| | | @ApiModelProperty("å
¬ç§¯é个人") |
| | | // @Excel(name = "å
¬ç§¯é个人") |
| | | @Excel(name = "å
¬ç§¯é个人") |
| | | private BigDecimal providentFundIndividuals; |
| | | |
| | | /** |
| | | * åºç¨å·¥èµ |
| | | * å·¥èµä¸ªç¨ |
| | | */ |
| | | @ApiModelProperty("åºç¨å·¥èµ") |
| | | // @Excel(name = "åºç¨å·¥èµ") |
| | | private BigDecimal taxableWaget; |
| | | /** |
| | | * 个人æå¾ç¨ |
| | | */ |
| | | @ApiModelProperty("个人æå¾ç¨") |
| | | // @Excel(name = "个人æå¾ç¨") |
| | | @ApiModelProperty("å·¥èµä¸ªç¨") |
| | | @Excel(name = "å·¥èµä¸ªç¨") |
| | | private BigDecimal personalIncomeTax; |
| | | |
| | | /** |
| | | * å
¶ä»æ¯åº |
| | | */ |
| | | @ApiModelProperty("å
¶ä»æ¯åº") |
| | | @Excel(name = "å
¶ä»æ¯åº") |
| | | private BigDecimal otherDeductions; |
| | | |
| | | /** |
| | | * åºåå·¥èµ |
| | | */ |
| | | @ApiModelProperty("åºåå·¥èµ") |
| | | @Excel(name = "åºåå·¥èµ") |
| | | private BigDecimal payableWages; |
| | | |
| | | /** |
| | | * åºæ£å·¥èµ |
| | | */ |
| | | @ApiModelProperty("åºæ£å·¥èµ") |
| | | @Excel(name = "åºæ£å·¥èµ") |
| | | private BigDecimal deductibleWages; |
| | | |
| | | /** |
| | | * å®åå·¥èµ |
| | | */ |
| | | @ApiModelProperty("å®åå·¥èµ") |
| | | @Excel(name = "å®åå·¥èµ", width = 30) |
| | | @Excel(name = "å®åå·¥èµ") |
| | | private BigDecimal actualWages; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty("夿³¨") |
| | | @Excel(name = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | /** |
| | | * å建è
|
| | |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.compensationperformance.pojo.CompensationPerformance; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/8/8 9:55 |
| | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param page |
| | | * @param compensationPerformance |
| | | * @param page å页æä»¶ |
| | | * @param staffName åå·¥å§å |
| | | * @param payDateStr èªèµæ¥æ |
| | | * @return |
| | | */ |
| | | IPage<CompensationPerformance> listPage(Page page, CompensationPerformance compensationPerformance); |
| | | IPage<CompensationPerformance> listPage(Page page, String staffName, String payDateStr); |
| | | |
| | | /** |
| | | * 导åºäººåæ°å¢ |
| | | * |
| | | * @return 人åèªèµ |
| | | */ |
| | | List<CompensationPerformance> exportList(); |
| | | } |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/8/8 9:55 |
| | |
| | | |
| | | |
| | | @Override |
| | | public IPage<CompensationPerformance> listPage(Page page, CompensationPerformance compensationPerformance) { |
| | | return compensationPerformanceMapper.listPage(page, compensationPerformance); |
| | | public IPage<CompensationPerformance> listPage(Page page, String staffName, String payDateStr) { |
| | | return compensationPerformanceMapper.listPage(page, staffName, payDateStr); |
| | | } |
| | | |
| | | @Override |
| | | public List<CompensationPerformance> exportList() { |
| | | return compensationPerformanceMapper.exportList(); |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | public IPage<CustomerVisits> listPage(Page page, CustomerVisits customerVisits) { |
| | | LambdaQueryWrapper<CustomerVisits> customerVisitsLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if (customerVisits != null && !StringUtils.isEmpty(customerVisits.getCustomerName())) { |
| | | customerVisitsLambdaQueryWrapper.like(CustomerVisits::getCustomerName, customerVisits.getCustomerName()); |
| | | LambdaQueryWrapper<CustomerVisits> wrapper = new LambdaQueryWrapper<>(); |
| | | |
| | | if (customerVisits != null) { |
| | | if (StringUtils.hasText(customerVisits.getCustomerName())) { |
| | | wrapper.like(CustomerVisits::getCustomerName, customerVisits.getCustomerName()); |
| | | } |
| | | |
| | | if (StringUtils.hasText(customerVisits.getVisitingPeople())) { |
| | | wrapper.like(CustomerVisits::getVisitingPeople, customerVisits.getVisitingPeople()); |
| | | } |
| | | } |
| | | return customerVisitsMapper.selectPage(page, customerVisitsLambdaQueryWrapper); |
| | | |
| | | return customerVisitsMapper.selectPage(page, wrapper); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.mapper.AccountIncomeMapper; |
| | | import com.ruoyi.account.pojo.AccountExpense; |
| | |
| | | |
| | | @Autowired |
| | | private ProductProcessMapper productProcessMapper; |
| | | |
| | | @Autowired |
| | | private AccountExpenseMapper accountExpenseMapper; |
| | | |
| | | @Autowired |
| | | private AccountIncomeMapper accountIncomeMapper; |
| | | |
| | | @Override |
| | | public HomeBusinessDto business() { |
| | |
| | | LambdaQueryWrapper<PurchaseLedger> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.ge(PurchaseLedger::getEntryDate, currentMonth.atDay(1).atStartOfDay()) // 大äºçäºæ¬æç¬¬ä¸å¤© |
| | | .lt(PurchaseLedger::getEntryDate, currentMonth.plusMonths(1).atDay(1).atStartOfDay()); // å°äºä¸æç¬¬ä¸å¤© |
| | | // æ§è¡æ¥è¯¢å¹¶è®¡ç®æ»å |
| | | |
| | | List<PurchaseLedger> purchaseLedgers = purchaseLedgerMapper.selectList(queryWrapper); |
| | | if (!CollectionUtils.isEmpty(purchaseLedgers)) { |
| | | LambdaQueryWrapper<SalesLedgerProduct> salesLedgerProductMapperLambdaQueryWrapperCopy = new LambdaQueryWrapper<SalesLedgerProduct>(); |
| | | salesLedgerProductMapperLambdaQueryWrapperCopy.eq(SalesLedgerProduct::getType, 2) |
| | | LambdaQueryWrapper<SalesLedgerProduct> salesLedgerProductMapperLambdaQueryWrapperCopy = new LambdaQueryWrapper<>(); |
| | | salesLedgerProductMapperLambdaQueryWrapperCopy.eq(SalesLedgerProduct::getType, 2) // éè´ç±»å |
| | | .in(SalesLedgerProduct::getSalesLedgerId, |
| | | purchaseLedgers.stream().map(PurchaseLedger::getId).collect(Collectors.toList())); |
| | | |
| | | List<SalesLedgerProduct> salesLedgerProductsCopy = salesLedgerProductMapper |
| | | .selectList(salesLedgerProductMapperLambdaQueryWrapperCopy); |
| | | // å计ååéé¢ |
| | | |
| | | // å计ååæ»éé¢ |
| | | BigDecimal receiveAmount = purchaseLedgers.stream() |
| | | .map(PurchaseLedger::getContractAmount) |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // æªå¼ç¥¨éé¢ |
| | | |
| | | // å¾
仿¬¾æ»éé¢ |
| | | BigDecimal unReceiptPaymentAmount = salesLedgerProductsCopy.stream() |
| | | .map(SalesLedgerProduct::getNoInvoiceAmount) |
| | | .map(SalesLedgerProduct::getPendingTicketsTotal) |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | |
| | | homeBusinessDto.setMonthPurchaseMoney(receiveAmount.setScale(2, RoundingMode.HALF_UP).toString()); |
| | | homeBusinessDto |
| | | .setMonthPurchaseHaveMoney(unReceiptPaymentAmount.setScale(2, RoundingMode.HALF_UP).toString()); |
| | | homeBusinessDto.setMonthPurchaseHaveMoney(unReceiptPaymentAmount.setScale(2, RoundingMode.HALF_UP).toString()); |
| | | } |
| | | // ç»è®¡åºå |
| | | BigDecimal stockQuantityTotal = stockInventoryMapper.selectTotal(); |
| | |
| | | // 彿çç»ææ¥æï¼æ¯ææåä¸å¤©ï¼ |
| | | LocalDate monthEnd = currentMonth.withDayOfMonth(currentMonth.lengthOfMonth()); |
| | | |
| | | // æå»ºå½æçæ¥è¯¢æ¡ä»¶ï¼å¦ææ³ä¸æ¬¡æ§æ¥å
¨4ä¸ªææ°æ®åå
åçéï¼å¯ä¼å为å
æ¥å
¨å循ç¯çéï¼ |
| | | // æå»ºå½æçæ¥è¯¢æ¡ä»¶ |
| | | LambdaQueryWrapper<QualityInspect> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.ge(QualityInspect::getCheckTime, monthStart) |
| | | .le(QualityInspect::getCheckTime, monthEnd); // çéå½ææ°æ® |
| | | queryWrapper.ge(QualityInspect::getCheckTime, monthStart.toString()) |
| | | .le(QualityInspect::getCheckTime, monthEnd.toString()); |
| | | List<QualityInspect> monthInspects = qualityStatisticsMapper.selectList(queryWrapper); |
| | | BigDecimal reduce = monthInspects.stream() |
| | | .filter(inspect -> inspect.getInspectType().equals(0)) |
| | |
| | | } |
| | | // åºæ¶ |
| | | List<SalesLedger> salesLedgers = salesLedgerMapper.selectList(new LambdaQueryWrapper<SalesLedger>() |
| | | // .ge(SalesLedger::getEntryDate, startDate) |
| | | // .lt(SalesLedger::getEntryDate, endDate) |
| | | // .ge(SalesLedger::getEntryDate, startDate) |
| | | // .lt(SalesLedger::getEntryDate, endDate) |
| | | ); |
| | | // BigDecimal receivableMoney = |
| | | // salesLedgers.stream().map(SalesLedger::getContractAmount).reduce(BigDecimal.ZERO, |
| | |
| | | // åºä» |
| | | List<PurchaseLedger> procurementRecords = purchaseLedgerMapper |
| | | .selectList(new LambdaQueryWrapper<PurchaseLedger>() |
| | | // .ge(PurchaseLedger::getEntryDate, startDate) |
| | | // .lt(PurchaseLedger::getEntryDate, endDate) |
| | | // .ge(PurchaseLedger::getEntryDate, startDate) |
| | | // .lt(PurchaseLedger::getEntryDate, endDate) |
| | | ); |
| | | // BigDecimal payableMoney = |
| | | // procurementRecords.stream().map(PurchaseLedger::getContractAmount).reduce(BigDecimal.ZERO, |
| | |
| | | BigDecimal payableMoney = sumAmount(procurementRecords, PurchaseLedger::getContractAmount); |
| | | // 颿¶ |
| | | List<ReceiptPayment> receiptPayments = receiptPaymentMapper.selectList(new LambdaQueryWrapper<ReceiptPayment>() |
| | | // .ge(ReceiptPayment::getReceiptPaymentDate, startDate) |
| | | // .lt(ReceiptPayment::getReceiptPaymentDate, endDate) |
| | | // .ge(ReceiptPayment::getReceiptPaymentDate, startDate) |
| | | // .lt(ReceiptPayment::getReceiptPaymentDate, endDate) |
| | | ); |
| | | // BigDecimal advanceMoney = |
| | | // receiptPayments.stream().map(ReceiptPayment::getReceiptPaymentAmount).reduce(BigDecimal.ZERO, |
| | |
| | | // é¢ä» |
| | | List<PaymentRegistration> paymentRegistrations = paymentRegistrationMapper |
| | | .selectList(new LambdaQueryWrapper<PaymentRegistration>() |
| | | // .ge(PaymentRegistration::getPaymentDate, startDate) |
| | | // .lt(PaymentRegistration::getPaymentDate, endDate) |
| | | // .ge(PaymentRegistration::getPaymentDate, startDate) |
| | | // .lt(PaymentRegistration::getPaymentDate, endDate) |
| | | ); |
| | | // BigDecimal prepayMoney = |
| | | // paymentRegistrations.stream().map(PaymentRegistration::getCurrentPaymentAmount).reduce(BigDecimal.ZERO, |
| | |
| | | productionProgressDto.setCompletedOrderDetails(productOrderDtos); |
| | | long totalCount = productOrderDtos.size(); |
| | | long count = productOrderDtos.stream().filter( |
| | | productOrderDto -> productOrderDto.getCompleteQuantity().compareTo(productOrderDto.getQuantity()) >= 0) |
| | | productOrderDto -> productOrderDto.getCompleteQuantity().compareTo(productOrderDto.getQuantity()) >= 0) |
| | | .count(); |
| | | long count2 = productOrderDtos.stream() |
| | | .filter(productOrderDto -> productOrderDto.getCompleteQuantity().compareTo(BigDecimal.ZERO) == 0) |
| | |
| | | |
| | | @Override |
| | | public List<MapDto> salesPurchaseStorageProductCount() { |
| | | LocalDate now = LocalDate.now(); |
| | | DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDateTime currentMonthStart = now.with(TemporalAdjusters.firstDayOfMonth()).with(LocalTime.MIN); |
| | | LocalDateTime lastMonth = now.minusMonths(1); |
| | | LocalDateTime lastMonthStart = lastMonth.with(TemporalAdjusters.firstDayOfMonth()).with(LocalTime.MIN); |
| | | LocalDateTime lastMonthEnd = lastMonth.with(TemporalAdjusters.lastDayOfMonth()).with(LocalTime.MAX); |
| | | |
| | | String currentMonthStart = now.with(TemporalAdjusters.firstDayOfMonth()).format(dtf); |
| | | String currentMonthNow = now.format(dtf); |
| | | |
| | | LocalDate lastMonth = now.minusMonths(1); |
| | | String lastMonthStart = lastMonth.with(TemporalAdjusters.firstDayOfMonth()).format(dtf); |
| | | String lastMonthEnd = lastMonth.with(TemporalAdjusters.lastDayOfMonth()).format(dtf); |
| | | |
| | | // éå® |
| | | int currentSales = salesLedgerProductMapper.selectProductCountByTypeAndDate(1, currentMonthStart, |
| | | currentMonthNow); |
| | | // éå® |
| | | int currentSales = salesLedgerProductMapper.selectProductCountByTypeAndDate(1, currentMonthStart, now); |
| | | int lastSales = salesLedgerProductMapper.selectProductCountByTypeAndDate(1, lastMonthStart, lastMonthEnd); |
| | | |
| | | // éè´ |
| | | int currentPurchase = salesLedgerProductMapper.selectProductCountByTypeAndDate(2, currentMonthStart, |
| | | currentMonthNow); |
| | | // éè´ |
| | | int currentPurchase = salesLedgerProductMapper.selectProductCountByTypeAndDate(2, currentMonthStart, now); |
| | | int lastPurchase = salesLedgerProductMapper.selectProductCountByTypeAndDate(2, lastMonthStart, lastMonthEnd); |
| | | |
| | | // å¨å |
| | | int currentStorage = stockInventoryMapper.selectStorageProductCountByDate(currentMonthStart, currentMonthNow); |
| | | // å¨å |
| | | int currentStorage = stockInventoryMapper.selectStorageProductCountByDate(currentMonthStart, now); |
| | | int lastStorage = stockInventoryMapper.selectStorageProductCountByDate(lastMonthStart, lastMonthEnd); |
| | | |
| | | List<MapDto> list = new ArrayList<>(); |
| | |
| | | public List<MapDto> productTurnoverDays() { |
| | | return homeMapper.productTurnoverDays(); |
| | | } |
| | | |
| | | @Autowired |
| | | private AccountExpenseMapper accountExpenseMapper; |
| | | |
| | | @Autowired |
| | | private AccountIncomeMapper accountIncomeMapper; |
| | | |
| | | public List<Map<String, Object>> incomeExpenseAnalysis(Integer type) { |
| | | |
| | |
| | | String startStr = startDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | String endStr = endDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | |
| | | // List<IncomeExpenseAnalysisDto> incomeList = |
| | | // salesLedgerMapper.selectIncomeStats(startStr, endStr, dateFormat); |
| | | List<IncomeExpenseAnalysisDto> incomeList = new ArrayList<>(); |
| | | List<IncomeExpenseAnalysisDto> purchaseList = purchaseLedgerMapper.selectPurchaseStats(startStr, endStr, |
| | | dateFormat); |
| | | List<IncomeExpenseAnalysisDto> expenseList = accountExpenseMapper.selectAccountExpenseStats(startStr, endStr, |
| | | dateFormat); |
| | | List<IncomeExpenseAnalysisDto> incomeList = accountIncomeMapper.selectIncomeStats(startStr, endStr, dateFormat); |
| | | List<IncomeExpenseAnalysisDto> expenseList = accountExpenseMapper.selectAccountExpenseStats(startStr, endStr, dateFormat); |
| | | |
| | | Map<String, BigDecimal> incomeMap = incomeList.stream().collect(Collectors |
| | | .toMap(IncomeExpenseAnalysisDto::getDateStr, IncomeExpenseAnalysisDto::getAmount, BigDecimal::add)); |
| | | Map<String, BigDecimal> purchaseMap = purchaseList.stream().collect(Collectors |
| | | .toMap(IncomeExpenseAnalysisDto::getDateStr, IncomeExpenseAnalysisDto::getAmount, BigDecimal::add)); |
| | | Map<String, BigDecimal> expenseMap = expenseList.stream().collect(Collectors |
| | | .toMap(IncomeExpenseAnalysisDto::getDateStr, IncomeExpenseAnalysisDto::getAmount, BigDecimal::add)); |
| | | |
| | | List<MapDto> result = new ArrayList<>(); |
| | | |
| | | for (String month : months) { |
| | | MapDto dto = new MapDto(); |
| | | dto.setName(month); |
| | | |
| | | BigDecimal income = incomeMap.getOrDefault(month, BigDecimal.ZERO); |
| | | |
| | | BigDecimal purchase = purchaseMap.getOrDefault(month, BigDecimal.ZERO); |
| | | income = BigDecimal.ZERO; |
| | | BigDecimal expense = expenseMap.getOrDefault(month, BigDecimal.ZERO); |
| | | BigDecimal totalExpense = purchase.add(expense); |
| | | |
| | | BigDecimal profit = income.subtract(totalExpense); |
| | | |
| | | BigDecimal profit = income.subtract(expense); |
| | | dto.setValue(profit.setScale(2, RoundingMode.HALF_UP).toString()); |
| | | result.add(dto); |
| | | } |
| | |
| | | LocalDate startDate = range[0]; |
| | | LocalDate endDate = range[1]; |
| | | |
| | | String startStr = startDate.atStartOfDay() |
| | | .format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | String endStr = endDate.atTime(LocalTime.MAX) |
| | | .format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | String startStr = startDate.toString(); |
| | | String endStr = endDate.toString(); |
| | | |
| | | List<QualityInspect> list = qualityInspectMapper.selectList( |
| | | new LambdaQueryWrapper<QualityInspect>() |
| | |
| | | endDate = today.with(DayOfWeek.SUNDAY); |
| | | } |
| | | |
| | | return new LocalDate[] { startDate, endDate }; |
| | | return new LocalDate[]{startDate, endDate}; |
| | | } |
| | | |
| | | private QualityQualifiedAnalysisDto buildQualifiedAnalysis(List<QualityInspect> list) { |
| | |
| | | |
| | | @Override |
| | | public QualityInspectionCountDto qualityInspectionCount() { |
| | | // è·åä»å¤©çå¼å§åç»ææ¥æ,å
嫿¶åç§ |
| | | LocalDateTime todayStart = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0).withNano(0); |
| | | LocalDateTime todayEnd = LocalDateTime.now().withHour(23).withMinute(59).withSecond(59).withNano(0); |
| | | // è·ååä¸å¤©çå¼å§åç»ææ¥æ,å
嫿¶åç§ |
| | | LocalDateTime prevStart = todayStart.minusDays(1); |
| | | LocalDateTime prevEnd = todayEnd.minusDays(1); |
| | | String todayStr = LocalDate.now().toString(); |
| | | String prevDayStr = LocalDate.now().minusDays(1).toString(); |
| | | // æ¥è¯¢åºæªæ¢ä»æ¥çæ»æ£éªæ° |
| | | List<QualityInspect> todayList = qualityInspectMapper.selectList(new LambdaQueryWrapper<QualityInspect>() |
| | | // .eq(QualityInspect::getInspectState, 1) |
| | | .le(QualityInspect::getCheckTime, todayEnd)); |
| | | .le(QualityInspect::getCheckTime, todayStr)); |
| | | // æ¥è¯¢åºæªæ¢åä¸å¤©çæ»æ£éªæ° |
| | | List<QualityInspect> prevList = qualityInspectMapper.selectList(new LambdaQueryWrapper<QualityInspect>() |
| | | // .eq(QualityInspect::getInspectState, 1) |
| | | .le(QualityInspect::getCheckTime, prevEnd)); |
| | | .le(QualityInspect::getCheckTime, prevDayStr)); |
| | | // 计ç®ä»æ¥çæ»æ£éªæ° |
| | | BigDecimal todayCount = todayList.stream() |
| | | .map(QualityInspect::getQuantity) |
| | |
| | | // 计ç®ä»å¤©çå¾
宿æ°é |
| | | List<QualityInspect> todayPendingList = qualityInspectMapper.selectList(new LambdaQueryWrapper<QualityInspect>() |
| | | .eq(QualityInspect::getInspectState, 0) |
| | | .ge(QualityInspect::getCheckTime, todayStart) |
| | | .le(QualityInspect::getCheckTime, todayEnd)); |
| | | .eq(QualityInspect::getCheckTime, todayStr)); |
| | | |
| | | // 计ç®åä¸å¤©çå¾
宿æ°é |
| | | List<QualityInspect> prevPendingList = qualityInspectMapper.selectList(new LambdaQueryWrapper<QualityInspect>() |
| | | .eq(QualityInspect::getInspectState, 0) |
| | | .ge(QualityInspect::getCheckTime, prevStart) |
| | | .le(QualityInspect::getCheckTime, prevEnd)); |
| | | .eq(QualityInspect::getCheckTime, prevDayStr)); |
| | | // 计ç®ä»å¤©çå¾
宿æ°é |
| | | BigDecimal todayPendingCount = todayPendingList.stream() |
| | | .map(QualityInspect::getQuantity) |
| | |
| | | List<QualityInspect> todayCompletedList = qualityInspectMapper |
| | | .selectList(new LambdaQueryWrapper<QualityInspect>() |
| | | .eq(QualityInspect::getInspectState, 1) |
| | | .ge(QualityInspect::getCheckTime, todayStart) |
| | | .le(QualityInspect::getCheckTime, todayEnd)); |
| | | .eq(QualityInspect::getCheckTime, todayStr)); |
| | | // 计ç®åä¸å¤©ç已宿æ°é |
| | | List<QualityInspect> prevCompletedList = qualityInspectMapper |
| | | .selectList(new LambdaQueryWrapper<QualityInspect>() |
| | | .eq(QualityInspect::getInspectState, 1) |
| | | .ge(QualityInspect::getCheckTime, prevStart) |
| | | .le(QualityInspect::getCheckTime, prevEnd)); |
| | | .eq(QualityInspect::getCheckTime, prevDayStr)); |
| | | // 计ç®ä»å¤©ç已宿æ°é |
| | | BigDecimal todayCompletedCount = todayCompletedList.stream() |
| | | .map(QualityInspect::getQuantity) |
| | |
| | | |
| | | @Override |
| | | public NonComplianceWarningDto nonComplianceWarning() { |
| | | |
| | | // è¿ä¸å¤©æ¶é´åºé´ |
| | | LocalDateTime[] range = lastSevenDaysRange(); |
| | | LocalDateTime startTime = range[0]; |
| | | LocalDateTime endTime = range[1]; |
| | | String[] range = lastSevenDaysDateRange(); |
| | | String startStr = range[0]; |
| | | String endStr = range[1]; |
| | | |
| | | // æ¥è¯¢è¿ä¸å¤©å·²å¤çä¸åæ ¼æ°æ® |
| | | List<QualityUnqualified> list = qualityUnqualifiedMapper.selectList( |
| | | new LambdaQueryWrapper<QualityUnqualified>() |
| | | .eq(QualityUnqualified::getInspectState, 1) |
| | | .ge(QualityUnqualified::getCheckTime, startTime) |
| | | .le(QualityUnqualified::getCheckTime, endTime)); |
| | | .ge(QualityUnqualified::getCheckTime, startStr) |
| | | .le(QualityUnqualified::getCheckTime, endStr)); |
| | | |
| | | NonComplianceWarningDto dto = new NonComplianceWarningDto(); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·åè¿ä¸å¤©çæ¶é´åºé´ï¼å
å«ä»å¤©ï¼ |
| | | * è·åè¿ä¸å¤©çæ¥æåºé´ï¼ä»
å«å¹´ææ¥ï¼ |
| | | */ |
| | | public static LocalDateTime[] lastSevenDaysRange() { |
| | | public static String[] lastSevenDaysDateRange() { |
| | | LocalDate today = LocalDate.now(); |
| | | |
| | | LocalDateTime startTime = today.minusDays(6).atStartOfDay(); |
| | | LocalDateTime endTime = today.atTime(23, 59, 59); |
| | | |
| | | return new LocalDateTime[] { startTime, endTime }; |
| | | return new String[]{today.minusDays(6).toString(), today.toString()}; |
| | | } |
| | | |
| | | @Override |
| | | public List<CompletedInspectionCountDto> completedInspectionCount() { |
| | | // è¿ä¸å¤©æ¶é´åºé´ |
| | | LocalDateTime[] range = lastSevenDaysRange(); |
| | | LocalDateTime startTime = range[0]; |
| | | LocalDateTime endTime = range[1]; |
| | | String[] range = lastSevenDaysDateRange(); |
| | | String startStr = range[0]; |
| | | String endStr = range[1]; |
| | | |
| | | // æ¥è¯¢è¿ä¸å¤©å·²å®æçæ£éªæ°æ® |
| | | List<QualityInspect> list = qualityInspectMapper.selectList(new LambdaQueryWrapper<QualityInspect>() |
| | | .eq(QualityInspect::getInspectState, 1) |
| | | .ge(QualityInspect::getCheckTime, startTime) |
| | | .le(QualityInspect::getCheckTime, endTime)); |
| | | .ge(QualityInspect::getCheckTime, startStr) |
| | | .le(QualityInspect::getCheckTime, endStr)); |
| | | |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM-dd"); |
| | | |
| | |
| | | |
| | | List<QualityInspect> qualityInspectList = qualityInspectMapper |
| | | .selectList(new LambdaQueryWrapper<QualityInspect>() |
| | | .ge(QualityInspect::getCheckTime, startDate) |
| | | .le(QualityInspect::getCheckTime, endDate) |
| | | .ge(QualityInspect::getCheckTime, startDate.toString()) |
| | | .le(QualityInspect::getCheckTime, endDate.toString()) |
| | | .eq(QualityInspect::getInspectState, 1)); |
| | | |
| | | QualityStatisticsDto dto = new QualityStatisticsDto(); |
| | |
| | | dto.setProcessNum(sumQuantity(qualityInspectList, 1)); // è¿ç¨ |
| | | dto.setFactoryNum(sumQuantity(qualityInspectList, 2)); // åºå |
| | | |
| | | // å设 qualityInspectList æ¯ä¸ä¸ª List<QualityInspect> ç±»åçéå |
| | | Map<String, List<QualityInspect>> groupedByCheckResult = qualityInspectList.stream() |
| | | .collect(Collectors.groupingBy(QualityInspect::getCheckResult)); |
| | | List<QualityInspect> qualityInspects = groupedByCheckResult.get("ä¸åæ ¼"); |
| | | if (ObjectUtils.isNull(qualityInspects) || qualityInspects.size() == 0) { |
| | | return null; |
| | | } |
| | | // 4. å¤çå¾è¡¨é¡¹ (Item) |
| | | List<QualityStatisticsItem> itemList = new ArrayList<>(); |
| | | |
| | |
| | | i -> i.getCheckTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate())); |
| | | if (type == 3) { |
| | | // å£åº¦æ¨¡å¼ï¼ææåç» |
| | | Map<String, List<QualityInspect>> groupByMonth = qualityInspectList.stream() |
| | | Map<String, List<QualityInspect>> groupByMonth = qualityInspects.stream() |
| | | .collect(Collectors.groupingBy(i -> { |
| | | LocalDate ld = dateMap.get(i); |
| | | return ld.format(DateTimeFormatter.ofPattern("yyyy-MM")); |
| | |
| | | } |
| | | } else { |
| | | // å¨æææ¨¡å¼ï¼æå¤©åç» |
| | | Map<String, List<QualityInspect>> groupByDay = qualityInspectList.stream() |
| | | Map<String, List<QualityInspect>> groupByDay = qualityInspects.stream() |
| | | .collect(Collectors.groupingBy(i -> { |
| | | LocalDate ld = dateMap.get(i); |
| | | return ld.format(DateTimeFormatter.ofPattern("MM/dd")); |
| | |
| | | |
| | | @Override |
| | | public List<processDataProductionStatisticsDto> processDataProductionStatistics(Integer type, |
| | | List<Long> processIds) { |
| | | List<Long> processIds) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | Long userId = SecurityUtils.isAdmin(loginUser.getUserId()) ? null : loginUser.getUserId(); |
| | | |
| | |
| | | |
| | | return productProcessMapper.calculateProductionStatistics(startDateTime, endDateTime, userId, processIds); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @date : 2025/9/19 10:52 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å·¡æ£ä»»å¡ç®¡ç") |
| | | @Api(tags = "å·¡æ£ä»»å¡è®°å½") |
| | | @RequestMapping("/inspectionTask") |
| | | public class InspectionTaskController extends BaseController { |
| | | |
| | |
| | | * @date : 2025/9/19 10:53 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "宿¶ä»»å¡ç®¡ç") |
| | | @Api(tags = "å·¡æ£ç®¡ç") |
| | | @RequestMapping("/timingTask") |
| | | public class TimingTaskController extends BaseController { |
| | | |
| | |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ProductOrderDto productOrderDto) { |
| | | List<ProductOrderDto> list = productOrderService.pageProductOrder(new Page<>(1, -1), productOrderDto).getRecords(); |
| | | |
| | | if (list != null && !list.isEmpty()) { |
| | | list.forEach(item -> { |
| | | // å¤ç©º |
| | | if (item.getQuantity() == null || item.getCompleteQuantity() == null) { |
| | | item.setCompletionStatus(BigDecimal.ZERO); |
| | | return; |
| | | } |
| | | |
| | | // å¤é¶ |
| | | if (item.getQuantity().compareTo(BigDecimal.ZERO) == 0) { |
| | | item.setCompletionStatus(BigDecimal.ZERO); |
| | | return; |
| | | } |
| | | BigDecimal progress = item.getCompleteQuantity() |
| | | .divide(item.getQuantity(), 4, BigDecimal.ROUND_HALF_UP) |
| | | .multiply(new BigDecimal(100)) |
| | | .setScale(2, BigDecimal.ROUND_HALF_UP); |
| | | |
| | | item.setCompletionStatus(progress); |
| | | }); |
| | | } |
| | | |
| | | ExcelUtil<ProductOrderDto> util = new ExcelUtil<>(ProductOrderDto.class); |
| | | util.exportExcel(response, list, "çäº§è®¢åæ°æ®"); |
| | | } |
| | |
| | | |
| | | @ApiOperation("å 餿¥å·¥") |
| | | @DeleteMapping("/delete") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R delete(@RequestBody ProductionProductMainDto productionProductMainDto) { |
| | | |
| | | return R.ok(productionProductMainService.removeProductMain(productionProductMainDto.getId())); |
| | | } |
| | | |
| | |
| | | private LocalDate schedulingDate; |
| | | private String schedulingUserName; |
| | | private String customerName; |
| | | //å·¥åº |
| | | @Excel(name = "å·¥åº") |
| | | private String process; |
| | | private BigDecimal workHours; |
| | | private BigDecimal wages; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | 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.StockOutQualifiedRecordTypeEnum; |
| | |
| | | |
| | | @Override |
| | | public Boolean delete(Long[] ids) { |
| | | |
| | | //æ¹éæ¥è¯¢productOrder |
| | | List<ProductOrder> productOrders = productOrderMapper.selectList( |
| | | new LambdaQueryWrapper<ProductOrder>() |
| | | .in(ProductOrder::getId, ids) |
| | | ); |
| | | if (!org.springframework.util.CollectionUtils.isEmpty(productOrders)) { |
| | | |
| | | |
| | | // æ¹éæ¥è¯¢processRouteItems |
| | | List<ProductProcessRouteItem> allRouteItems = productProcessRouteItemMapper.selectList( |
| | | new LambdaQueryWrapper<ProductProcessRouteItem>() |
| | | .in(ProductProcessRouteItem::getProductOrderId, ids) |
| | | ); |
| | | |
| | | if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(allRouteItems)) { |
| | | // è·åè¦å é¤çå·¥åºé¡¹ID |
| | | List<Long> routeItemIds = allRouteItems.stream() |
| | | .map(ProductProcessRouteItem::getId) |
| | | .collect(Collectors.toList()); |
| | | |
| | | // æ¥è¯¢å
³èçå·¥åID |
| | | List<ProductWorkOrder> workOrders = productWorkOrderMapper.selectList( |
| | | new LambdaQueryWrapper<ProductWorkOrder>() |
| | | .in(ProductWorkOrder::getProductProcessRouteItemId, routeItemIds) |
| | | ); |
| | | if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(workOrders)) { |
| | | List<Long> workOrderIds = workOrders.stream() |
| | | .map(ProductWorkOrder::getId) |
| | | .collect(Collectors.toList()); |
| | | |
| | | // æ¥è¯¢å
³èçç产主表ID |
| | | List<ProductionProductMain> productMains = productionProductMainMapper.selectList( |
| | | new LambdaQueryWrapper<ProductionProductMain>() |
| | | .in(ProductionProductMain::getWorkOrderId, workOrderIds) |
| | | ); |
| | | List<Long> productMainIds = productMains.stream() |
| | | .map(ProductionProductMain::getId) |
| | | .collect(Collectors.toList()); |
| | | |
| | | // å é¤äº§åºè¡¨ãæå
¥è¡¨æ°æ® |
| | | if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(productMainIds)) { |
| | | productionProductOutputMapper.deleteByProductMainIds(productMainIds); |
| | | productionProductInputMapper.deleteByProductMainIds(productMainIds); |
| | | List<QualityInspect> qualityInspects = qualityInspectMapper.selectList( |
| | | new LambdaQueryWrapper<QualityInspect>() |
| | | .in(QualityInspect::getProductMainId, productMainIds) |
| | | ); |
| | | //å é¤åºåºè®°å½ |
| | | for (Long productMainId : productMainIds) { |
| | | //å é¤ç产åºåºè®°å½ |
| | | stockUtils.deleteStockOutRecord(productMainId, StockOutQualifiedRecordTypeEnum.PRODUCTION_REPORT_STOCK_OUT.getCode()); |
| | | //å 餿¥åºçå
¥åºè®°å½ |
| | | stockUtils.deleteStockInRecord(productMainId, StockInUnQualifiedRecordTypeEnum.PRODUCTION_SCRAP.getCode()); |
| | | } |
| | | qualityInspects.forEach(qualityInspect -> { |
| | | //inspectState=1 å·²æäº¤ ä¸è½å é¤ |
| | | if (qualityInspect.getInspectState() == 1) { |
| | | throw new RuntimeException("å·²æäº¤çæ£éªåä¸è½å é¤"); |
| | | } |
| | | }); |
| | | qualityInspectMapper.deleteByProductMainIds(productMainIds); |
| | | salesLedgerProductionAccountingMapper.delete(new LambdaQueryWrapper<SalesLedgerProductionAccounting>() |
| | | .in(SalesLedgerProductionAccounting::getProductMainId, productMainIds)); |
| | | } |
| | | |
| | | // å é¤çäº§ä¸»è¡¨æ°æ® |
| | | productionProductMainMapper.deleteByWorkOrderIds(workOrderIds); |
| | | |
| | | // å é¤å·¥åæ°æ® |
| | | productWorkOrderMapper.delete(new LambdaQueryWrapper<ProductWorkOrder>() |
| | | .in(ProductWorkOrder::getProductProcessRouteItemId, routeItemIds)); |
| | | } |
| | | //妿已ç»å¼å§ç产,ä¸è½å é¤ |
| | | //æ¥è¯¢ç产订åä¸çå·¥å |
| | | List<ProductWorkOrder> productWorkOrders = productWorkOrderMapper.selectList(Wrappers.<ProductWorkOrder>lambdaQuery().in(ProductWorkOrder::getProductOrderId, ids)); |
| | | if (productWorkOrders.size()>0){ |
| | | //夿æ¯å¦ææ¥å·¥æ°æ® |
| | | List<ProductionProductMain> productionProductMains = productionProductMainMapper.selectList(Wrappers.<ProductionProductMain>lambdaQuery() |
| | | .in(ProductionProductMain::getWorkOrderId, productWorkOrders.stream().map(ProductWorkOrder::getId).collect(Collectors.toList()))); |
| | | if (productionProductMains.size()>0){ |
| | | throw new RuntimeException("ç产订åå·²ç»å¼å§ç产,ä¸è½å é¤"); |
| | | } |
| | | // æ¹éå é¤processRouteItem |
| | | productProcessRouteItemMapper.delete(new LambdaQueryWrapper<ProductProcessRouteItem>() |
| | | .in(ProductProcessRouteItem::getProductOrderId, ids)); |
| | | |
| | | // æ¹éå é¤productProcessRoute |
| | | productProcessRouteMapper.delete(new LambdaQueryWrapper<ProductProcessRoute>() |
| | | .in(ProductProcessRoute::getProductOrderId, ids)); |
| | | |
| | | // æ¹éå é¤productOrder |
| | | productOrderMapper.delete(new LambdaQueryWrapper<ProductOrder>() |
| | | .in(ProductOrder::getId, ids)); |
| | | //å é¤å·¥å |
| | | productWorkOrderMapper.delete(Wrappers.<ProductWorkOrder>lambdaQuery().in(ProductWorkOrder::getProductOrderId, ids)); |
| | | } |
| | | //å é¤å·¥èºè·¯çº¿ |
| | | productProcessRouteItemMapper.delete(new LambdaQueryWrapper<ProductProcessRouteItem>() |
| | | .in(ProductProcessRouteItem::getProductOrderId, ids)); |
| | | productProcessRouteMapper.delete(new LambdaQueryWrapper<ProductProcessRoute>() |
| | | .in(ProductProcessRoute::getProductOrderId, ids)); |
| | | //å é¤ç产订å |
| | | productOrderMapper.delete(new LambdaQueryWrapper<ProductOrder>() |
| | | .in(ProductOrder::getId, ids)); |
| | | return true; |
| | | } |
| | | |
| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | |
| | | private ProductModelMapper productModelMapper; |
| | | |
| | | private QualityInspectMapper qualityInspectMapper; |
| | | private QualityUnqualifiedMapper qualityUnqualifiedMapper; |
| | | |
| | | private ProductProcessMapper productProcessMapper; |
| | | private ProductProcessRouteMapper productProcessRouteMapper; |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean removeProductMain(Long id) { |
| | | //å¤æè¯¥æ¡æ¥å·¥æ¯å¦ä¸åæ ¼å¤ç,妿ä¸åæ ¼å¤çäºï¼åä¸å
许å é¤ |
| | | List<QualityInspect> qualityInspects = qualityInspectMapper.selectList(Wrappers.<QualityInspect>lambdaQuery().eq(QualityInspect::getProductMainId, id)); |
| | | if (qualityInspects.size() > 0){ |
| | | List<QualityUnqualified> qualityUnqualifieds = qualityUnqualifiedMapper.selectList(Wrappers.<QualityUnqualified>lambdaQuery() |
| | | .in(QualityUnqualified::getInspectId, qualityInspects.stream().map(QualityInspect::getId).collect(Collectors.toList()))); |
| | | if (qualityUnqualifieds.size() > 0 && qualityUnqualifieds.get(0).getInspectState()==1) { |
| | | throw new ServiceException("è¯¥æ¡æ¥å·¥å·²ç»ä¸åæ ¼å¤çäºï¼ä¸å
许å é¤"); |
| | | } |
| | | } |
| | | ProductionProductMain productionProductMain = productionProductMainMapper.selectById(id); |
| | | //该æ¥å·¥å¯¹åºçå·¥èºè·¯çº¿è¯¦æ
|
| | | ProductProcessRouteItem productProcessRouteItem = productProcessRouteItemMapper.selectById(productionProductMain.getProductProcessRouteItemId()); |
| | |
| | | } else { |
| | | throw new ServiceException("æä½å¤±è´¥ï¼å·¥åä¿¡æ¯æäº§åºè®°å½ä¸åå¨"); |
| | | } |
| | | |
| | | //夿æ¯å¦æ¯æåä¸éå·¥åº |
| | | List<ProductProcessRouteItem> productProcessRouteItems = productProcessRouteItemMapper.selectList(Wrappers.<ProductProcessRouteItem>lambdaQuery().eq(ProductProcessRouteItem::getProductRouteId, productProcessRouteItem.getProductRouteId())); |
| | | if (productProcessRouteItem.getDragSort() != null && productProcessRouteItems != null && productProcessRouteItem.getDragSort() == productProcessRouteItems.size()) { |
| | |
| | | BigDecimal orderCompleteQty = productOrder.getCompleteQuantity() == null ? BigDecimal.ZERO : productOrder.getCompleteQuantity(); |
| | | BigDecimal totalQty = productionProductOutput.getQuantity() != null ? productionProductOutput.getQuantity() : BigDecimal.ZERO; |
| | | BigDecimal scrapQty = productionProductOutput.getScrapQty() != null ? productionProductOutput.getScrapQty() : BigDecimal.ZERO; |
| | | |
| | | BigDecimal actualQualifiedQty = totalQty.subtract(scrapQty); |
| | | |
| | | BigDecimal newCompleteQty = orderCompleteQty.subtract(actualQualifiedQty); |
| | | |
| | | productOrder.setCompleteQuantity(newCompleteQty.compareTo(BigDecimal.ZERO) < 0 ? BigDecimal.ZERO : newCompleteQty); |
| | | |
| | | productOrder.setEndTime(null); |
| | | |
| | | productOrderMapper.updateById(productOrder); |
| | | } else { |
| | | throw new ServiceException("å
³èçç产订åä¸åå¨"); |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage;
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.ruoyi.framework.web.domain.R;
|
| | | import io.swagger.annotations.ApiOperation;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | |
| | | {
|
| | | return toAjax(noticeService.readAll());
|
| | | }
|
| | |
|
| | | @PostMapping("appReadNotice")
|
| | | @ApiOperation("ç§»å¨ç«¯æ ¹æ®æ¶æ¯IDè¿è¡å·²è¯»")
|
| | | public AjaxResult appReadNotice(@RequestParam("noticeId") Long noticeId) {
|
| | | boolean result = noticeService.appReadNotice(noticeId);
|
| | | return toAjax(result);
|
| | | }
|
| | | }
|
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.project.system.controller; |
| | | |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.project.system.domain.GetuiConfig; |
| | | import com.ruoyi.project.system.domain.SysUserClient; |
| | | import com.ruoyi.project.system.service.SysUserClientService; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * ç¨æ·å®å设å¤ç®¡çæ§å¶å± |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/2/9 |
| | | */ |
| | | @Api(tags = "ç¨æ·è®¾å¤ç»å®") |
| | | @RestController |
| | | @RequestMapping("/system/client") |
| | | public class SysUserClientController extends BaseController { |
| | | |
| | | @Autowired |
| | | private SysUserClientService sysUserClientService; |
| | | |
| | | /** |
| | | * æ·»å /æ´æ°ç¨æ·cid |
| | | */ |
| | | @PostMapping("/addOrUpdateClientId") |
| | | @ApiOperation("æ·»å /æ´æ°ç¨æ·cid") |
| | | public AjaxResult addOrUpdateClientId(@RequestBody SysUserClient sysUserClient) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | sysUserClient.setUserId(userId); |
| | | boolean result = sysUserClientService.addOrUpdateClientId(sysUserClient); |
| | | return result ? success() : error("设å¤ç»å®å¤±è´¥"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.project.system.domain; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * <p> |
| | | * ä¸ªæ¨ (Unipush v2) æ¶æ¯æ¨éé
置类 |
| | | * </p> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/2/9 |
| | | */ |
| | | @Data |
| | | @Component |
| | | @ConfigurationProperties(prefix = "ruoyi.getui") |
| | | public class GetuiConfig { |
| | | |
| | | /** |
| | | * AppID |
| | | */ |
| | | private String appId; |
| | | |
| | | /** |
| | | * AppKey |
| | | */ |
| | | private String appKey; |
| | | |
| | | /** |
| | | * MasterSecret |
| | | */ |
| | | private String masterSecret; |
| | | |
| | | /** |
| | | * ä¸ªæ¨ RESTful API ååå°å |
| | | */ |
| | | private String domain; |
| | | |
| | | /** |
| | | * 离线æ¨é Intent ç®æ ç»ä»¶å |
| | | * æ ¼å¼: å
å/å
¥å£Activityå |
| | | */ |
| | | private String intentComponent; |
| | | } |
| | |
| | | import javax.validation.constraints.NotBlank;
|
| | | import javax.validation.constraints.Size;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.FieldFill;
|
| | | import com.baomidou.mybatisplus.annotation.TableField;
|
| | | import com.baomidou.mybatisplus.annotation.*;
|
| | | import com.fasterxml.jackson.annotation.JsonFormat;
|
| | | import lombok.Data;
|
| | | import org.apache.commons.lang3.builder.ToStringBuilder;
|
| | |
| | | * @author ruoyi
|
| | | */
|
| | | @Data
|
| | | @TableName("sys_notice")
|
| | | public class SysNotice
|
| | | {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | /** å
ŒID */
|
| | | @TableId(value = "notice_id", type = IdType.AUTO)
|
| | | private Long noticeId;
|
| | |
|
| | | /** å
¬åæ é¢ */
|
| | |
| | | /** è·³è½¬è·¯å¾ */
|
| | | private String jumpPath;
|
| | |
|
| | | /** APPè·³è½¬è·¯å¾ */
|
| | | private String appJumpPath;
|
| | |
|
| | | /** å建è
*/
|
| | | @TableField(fill = FieldFill.INSERT)
|
| | | private String createBy;
|
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.project.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <br> |
| | | * ç¨æ·å®å设å¤å
³è对象 sys_user_client |
| | | * </br> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/2/9 |
| | | */ |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @TableName("sys_user_client") |
| | | public class SysUserClient implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ç¨æ·ID |
| | | */ |
| | | @TableId(type = IdType.INPUT) |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 个æ¨è®¾å¤æ è¯ (CID) |
| | | */ |
| | | private String cid; |
| | | |
| | | /** |
| | | * æåæ´»è·æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | } |
| | |
| | | */
|
| | | private String component;
|
| | |
|
| | |
|
| | | public String getAppComponent() {
|
| | | return appComponent;
|
| | | }
|
| | |
|
| | | public void setAppComponent(String appComponent) {
|
| | | this.appComponent = appComponent;
|
| | | }
|
| | |
|
| | | /**
|
| | | * appç»ä»¶å°å
|
| | | */
|
| | | private String appComponent;
|
| | |
|
| | | /**
|
| | | * è·¯ç±åæ°ï¼å¦ {"id": 1, "name": "ry"}
|
| | | */
|
| | |
| | | * @return ç»æ
|
| | | */
|
| | | public SysMenu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId);
|
| | |
|
| | | /**
|
| | | * æ ¹æ®è·¯ç±å°åæ¥è¯¢èå
|
| | | *
|
| | | * @param lastSegment è·¯ç±å°å
|
| | | * @return èå
|
| | | */
|
| | | SysMenu selectMenuByPath(String lastSegment);
|
| | | }
|
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.project.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.project.system.domain.SysUserClient; |
| | | |
| | | /** |
| | | * <br> |
| | | * ç¨æ·å®å设å¤å
³èmapper |
| | | * </br> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/2/9 |
| | | */ |
| | | |
| | | public interface SysUserClientMapper extends BaseMapper<SysUserClient> { |
| | | |
| | | } |
| | |
| | | */
|
| | | void simpleNoticeAll(final String title, final String message,final String jumpPath);
|
| | |
|
| | | /**
|
| | | * APPç¹å»æ¨éæ¶æ¯æ´æ¹ä¸ºå·²è¯»ç¶æ
|
| | | *
|
| | | * @param noticeId æ¶æ¯ID
|
| | | * @return 失败/æå
|
| | | */
|
| | | boolean appReadNotice(Long noticeId);
|
| | | }
|
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.project.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.project.system.domain.SysUserClient; |
| | | |
| | | /** |
| | | * <br> |
| | | * ç¨æ·å®å设å¤å
³èæ¥å£ |
| | | * </br> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/2/9 |
| | | */ |
| | | |
| | | public interface SysUserClientService extends IService<SysUserClient> { |
| | | |
| | | boolean addOrUpdateClientId(SysUserClient sysUserClient); |
| | | } |
| | |
| | | router.setName(getRouteName(menu));
|
| | | router.setPath(getRouterPath(menu));
|
| | | router.setComponent(getComponent(menu));
|
| | | router.setAppComponent(menu.getAppComponent());
|
| | | router.setQuery(menu.getQuery());
|
| | | router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
|
| | | List<SysMenu> cMenus = menu.getChildren();
|
| | |
| | | List<RouterVo> childrenList = new ArrayList<RouterVo>();
|
| | | RouterVo children = new RouterVo();
|
| | | children.setPath(menu.getPath());
|
| | | children.setAppComponent(menu.getAppComponent());
|
| | | children.setComponent(menu.getComponent());
|
| | | children.setName(getRouteName(menu.getRouteName(), menu.getPath()));
|
| | | children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
|
| | |
| | | RouterVo children = new RouterVo();
|
| | | String routerPath = innerLinkReplaceEach(menu.getPath());
|
| | | children.setPath(routerPath);
|
| | | children.setAppComponent(menu.getAppComponent());
|
| | | children.setComponent(UserConstants.INNER_LINK);
|
| | | children.setName(getRouteName(menu.getRouteName(), routerPath));
|
| | | children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), menu.getPath()));
|
| | |
| | | import com.ruoyi.project.system.domain.SysNotice;
|
| | | import com.ruoyi.project.system.mapper.SysNoticeMapper;
|
| | | import com.ruoyi.project.system.service.ISysNoticeService;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | /**
|
| | | * å
¬å æå¡å±å®ç°
|
| | |
| | | @Autowired
|
| | | @Lazy
|
| | | private ISysNoticeService sysNoticeService;
|
| | |
|
| | | @Autowired
|
| | | private UnipushService unipushService;
|
| | |
|
| | | /**
|
| | | * æ¥è¯¢å
¬åä¿¡æ¯
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void simpleNoticeByUser(String title, String message, List<Long> consigneeId, String jumpPath) {
|
| | | public void simpleNoticeByUser(String title, String message, List<Long> consigneeId, String jumpPath) {
|
| | | Long userId = SecurityUtils.getLoginUser().getUserId();
|
| | | Long tenantId = SecurityUtils.getLoginUser().getTenantId();
|
| | | List<SysNotice> sysNotices = consigneeId.stream().map(it -> convertSysNotice(title, message, it,tenantId, jumpPath, userId)).collect(Collectors.toList());
|
| | | List<SysNotice> sysNotices = consigneeId.stream()
|
| | | .map(it -> convertSysNotice(title, message, it, tenantId, jumpPath, unipushService.convertWebPathToAppPath(jumpPath), userId))
|
| | | .collect(Collectors.toList());
|
| | | sysNoticeService.saveBatch(sysNotices);
|
| | | try {
|
| | | unipushService.sendClientMessage(sysNotices);
|
| | | } catch (Exception e) {
|
| | | log.error("APPæ¨ééç¥å¤±è´¥ï¼åå : {}", e);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | it.getUserId(),
|
| | | it.getTenantId(),
|
| | | jumpPath,
|
| | | unipushService.convertWebPathToAppPath(jumpPath),
|
| | | userId
|
| | | ))
|
| | | .collect(Collectors.toList());
|
| | |
|
| | | sysNoticeService.saveBatch(collect);
|
| | | try {
|
| | | unipushService.sendClientMessage(collect);
|
| | | } catch (Exception e) {
|
| | | log.error("APPæ¨ééç¥å¤±è´¥ï¼åå : {}", e);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | private SysNotice convertSysNotice(String title,String message,Long consigneeId, Long tenantId,String jumpPath,Long currentUserId) {
|
| | | private SysNotice convertSysNotice(String title,String message,Long consigneeId, Long tenantId,String jumpPath,String appJumpPath,Long currentUserId) {
|
| | | SysNotice sysNotice = new SysNotice();
|
| | | sysNotice.setNoticeType("1");
|
| | | sysNotice.setNoticeTitle(title);//æ é¢
|
| | |
| | | sysNotice.setConsigneeId(consigneeId);
|
| | | sysNotice.setSenderId(currentUserId);
|
| | | sysNotice.setJumpPath(jumpPath);
|
| | | sysNotice.setAppJumpPath(appJumpPath);
|
| | | sysNotice.setTenantId(tenantId);
|
| | | return sysNotice;
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public boolean appReadNotice(Long noticeId) {
|
| | | if (noticeId == null) {
|
| | | return false;
|
| | | }
|
| | | SysNotice sysNotice = noticeMapper.selectNoticeById(noticeId);
|
| | | if (sysNotice == null) {
|
| | | return false;
|
| | | }
|
| | | sysNotice.setStatus("1");
|
| | | return noticeMapper.update(null, Wrappers.<SysNotice>lambdaUpdate()
|
| | | .eq(SysNotice::getNoticeId, noticeId)
|
| | | .eq(SysNotice::getStatus, "0")
|
| | | .set(SysNotice::getStatus, "1")) > 0;
|
| | | }
|
| | | }
|
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.project.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.project.system.domain.SysUserClient; |
| | | import com.ruoyi.project.system.mapper.SysUserClientMapper; |
| | | import com.ruoyi.project.system.service.SysUserClientService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * ç¨æ·å®å设å¤å
³èæ¥å£å®ç°ç±» |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/2/9 |
| | | */ |
| | | @Service |
| | | public class SysUserClientServiceImpl extends ServiceImpl<SysUserClientMapper, SysUserClient> implements SysUserClientService { |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean addOrUpdateClientId(SysUserClient sysUserClient) { |
| | | if (sysUserClient == null || sysUserClient.getUserId() == null || StringUtils.isEmpty(sysUserClient.getCid())) { |
| | | return false; |
| | | } |
| | | |
| | | String cid = sysUserClient.getCid(); |
| | | Long userId = sysUserClient.getUserId(); |
| | | |
| | | remove(new LambdaQueryWrapper<SysUserClient>().eq(SysUserClient::getCid, cid).ne(SysUserClient::getUserId, userId)); |
| | | |
| | | SysUserClient userClient = new SysUserClient(); |
| | | userClient.setUserId(userId); |
| | | userClient.setCid(cid); |
| | | userClient.setUpdateTime(new Date()); |
| | | |
| | | return saveOrUpdate(userClient); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.project.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.getui.push.v2.sdk.ApiHelper; |
| | | import com.getui.push.v2.sdk.GtApiConfiguration; |
| | | import com.getui.push.v2.sdk.api.PushApi; |
| | | import com.getui.push.v2.sdk.common.ApiResult; |
| | | import com.getui.push.v2.sdk.dto.req.Audience; |
| | | import com.getui.push.v2.sdk.dto.req.message.PushChannel; |
| | | import com.getui.push.v2.sdk.dto.req.message.PushDTO; |
| | | import com.getui.push.v2.sdk.dto.req.message.PushMessage; |
| | | import com.getui.push.v2.sdk.dto.req.message.android.AndroidDTO; |
| | | import com.getui.push.v2.sdk.dto.req.message.android.ThirdNotification; |
| | | import com.getui.push.v2.sdk.dto.req.message.android.Ups; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.project.system.domain.GetuiConfig; |
| | | import com.ruoyi.project.system.domain.SysMenu; |
| | | import com.ruoyi.project.system.domain.SysNotice; |
| | | import com.ruoyi.project.system.domain.SysUserClient; |
| | | import com.ruoyi.project.system.mapper.SysMenuMapper; |
| | | import com.ruoyi.project.system.service.SysUserClientService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * APPæ¶æ¯æ¨éæå¡ |
| | | * |
| | | * @author deslrey |
| | | * @version 1.4 |
| | | * @since 2026/2/9 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class UnipushService { |
| | | |
| | | @Autowired |
| | | private SysMenuMapper sysMenuMapper; |
| | | |
| | | @Autowired |
| | | private GetuiConfig getuiConfig; |
| | | |
| | | @Autowired |
| | | private SysUserClientService userClientService; |
| | | |
| | | private PushApi pushApi; |
| | | |
| | | private static final String DEFAULT_APP_PAGE = "pages/index"; |
| | | |
| | | @PostConstruct |
| | | public void init() { |
| | | GtApiConfiguration config = new GtApiConfiguration(); |
| | | config.setAppId(getuiConfig.getAppId()); |
| | | config.setAppKey(getuiConfig.getAppKey()); |
| | | config.setMasterSecret(getuiConfig.getMasterSecret()); |
| | | config.setDomain(getuiConfig.getDomain()); |
| | | ApiHelper apiHelper = ApiHelper.build(config); |
| | | this.pushApi = apiHelper.creatApi(PushApi.class); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éåééç¥å
¬åå°ç§»å¨ç«¯ |
| | | */ |
| | | @Async |
| | | public void sendClientMessage(List<SysNotice> sysNoticeList) { |
| | | if (sysNoticeList == null || sysNoticeList.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | for (SysNotice sysNotice : sysNoticeList) { |
| | | SysUserClient client = userClientService.getById(sysNotice.getConsigneeId()); |
| | | if (client == null || StringUtils.isEmpty(client.getCid())) { |
| | | log.warn("ç¨æ· {} æªç»å®ç§»å¨ç«¯ CID,è·³è¿æ¨é", sysNotice.getConsigneeId()); |
| | | continue; |
| | | } |
| | | |
| | | // 转æ¢è·¯å¾ |
| | | String appPath = convertWebPathToAppPath(sysNotice.getJumpPath()); |
| | | |
| | | // æ¨é |
| | | sendRoutingPush( |
| | | sysNotice.getNoticeId(), |
| | | client.getCid(), |
| | | sysNotice.getNoticeTitle(), |
| | | sysNotice.getRemark() != null ? sysNotice.getRemark() : sysNotice.getNoticeContent(), |
| | | appPath |
| | | ); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å° Web 端åå±å
¨è·¯å¾è½¬æ¢ä¸º App 端ç»ä»¶è·¯ç± |
| | | */ |
| | | public String convertWebPathToAppPath(String webPath) { |
| | | if (StringUtils.isEmpty(webPath)) { |
| | | return DEFAULT_APP_PAGE; |
| | | } |
| | | |
| | | String pathOnly = webPath; |
| | | String queryString = ""; |
| | | if (webPath.contains("?")) { |
| | | int index = webPath.indexOf("?"); |
| | | pathOnly = webPath.substring(0, index); |
| | | queryString = webPath.substring(index); |
| | | } |
| | | |
| | | String lastSegment; |
| | | int lastSlashIndex = pathOnly.lastIndexOf("/"); |
| | | if (lastSlashIndex != -1) { |
| | | lastSegment = pathOnly.substring(lastSlashIndex + 1); |
| | | } else { |
| | | lastSegment = pathOnly; |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(lastSegment)) { |
| | | return DEFAULT_APP_PAGE; |
| | | } |
| | | |
| | | SysMenu menu = sysMenuMapper.selectMenuByPath(lastSegment); |
| | | |
| | | if (menu != null && StringUtils.isNotEmpty(menu.getAppComponent())) { |
| | | String appPath = menu.getAppComponent(); |
| | | |
| | | if (appPath.startsWith("/")) { |
| | | appPath = appPath.substring(1); |
| | | } |
| | | |
| | | // æ¼æ¥ Web 端åå§åæ°å¹¶è¿å |
| | | return appPath + queryString; |
| | | } |
| | | |
| | | return DEFAULT_APP_PAGE; |
| | | } |
| | | |
| | | /** |
| | | * åéåäººè·¯ç±æ¨é |
| | | */ |
| | | private void sendRoutingPush(Long noticeId, String cid, String title, String content, String targetPath) { |
| | | log.info("å夿¨éæ¶æ¯:NoticeId={}, CID={}, Title={}, TargetPath={}", noticeId, cid, title, targetPath); |
| | | |
| | | PushDTO<Audience> pushDTO = new PushDTO<>(); |
| | | pushDTO.setRequestId("REQ_" + System.currentTimeMillis()); |
| | | |
| | | // å¨çº¿éä¼ å
容 |
| | | PushMessage pushMessage = new PushMessage(); |
| | | Map<String, Object> pushMessageMap = new HashMap<>(); |
| | | Map<String, Object> payloadMap = new HashMap<>(); |
| | | pushMessageMap.put("title", title); |
| | | pushMessageMap.put("content", content); |
| | | payloadMap.put("url", targetPath); |
| | | payloadMap.put("noticeId", noticeId); |
| | | pushMessageMap.put("payload", JSON.toJSONString(payloadMap)); |
| | | |
| | | String transmissionContent = JSON.toJSONString(pushMessageMap); |
| | | pushMessage.setTransmission(transmissionContent); |
| | | pushDTO.setPushMessage(pushMessage); |
| | | |
| | | // æ¥æ¶äºº |
| | | Audience audience = new Audience(); |
| | | audience.addCid(cid); |
| | | pushDTO.setAudience(audience); |
| | | |
| | | // 离线æ¨ééé |
| | | // pushDTO.setPushChannel(getPushChannel(noticeId, title, content, targetPath)); |
| | | |
| | | try { |
| | | ApiResult<Map<String, Map<String, String>>> result = pushApi.pushToSingleByCid(pushDTO); |
| | | if (result.isSuccess()) { |
| | | log.info("Unipush æ¨éæå: CID={}", cid); |
| | | } else { |
| | | log.error("Unipush æ¨é失败: CID={}, Code={}, Msg={}", cid, result.getCode(), result.getMsg()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("Unipush æ¨éå¼å¸¸: ", e); |
| | | } |
| | | } |
| | | |
| | | @NotNull |
| | | private PushChannel getPushChannel(Long noticeId, String title, String content, String targetPath) { |
| | | PushChannel pushChannel = new PushChannel(); |
| | | AndroidDTO androidDTO = new AndroidDTO(); |
| | | Ups ups = new Ups(); |
| | | ThirdNotification thirdNotification = new ThirdNotification(); |
| | | thirdNotification.setTitle(title); |
| | | thirdNotification.setBody(content); |
| | | thirdNotification.setClickType("intent"); |
| | | |
| | | String intent = "intent:#Intent;launchFlags=0x04000000;" |
| | | + "component=" + getuiConfig.getIntentComponent() + ";" |
| | | + "S.UP-OL-P9=true;" |
| | | + "S.path=" + targetPath + ";" |
| | | + "S.payload=" + targetPath + ";" |
| | | + "end"; |
| | | thirdNotification.setIntent(intent); |
| | | |
| | | ups.setNotification(thirdNotification); |
| | | androidDTO.setUps(ups); |
| | | pushChannel.setAndroid(androidDTO); |
| | | return pushChannel; |
| | | } |
| | | } |
| | |
| | | // 2. å¤çè´¦æ·æ¯åº |
| | | AccountExpense accountExpense = new AccountExpense(); |
| | | accountExpense.setExpenseDate(purchaseLedger.getEntryDate()); |
| | | accountExpense.setExpenseType("0"); |
| | | accountExpense.setExpenseType("4"); |
| | | accountExpense.setSupplierName(purchaseLedger.getSupplierName()); |
| | | accountExpense.setExpenseMoney(paymentRegistration.getCurrentPaymentAmount()); |
| | | accountExpense.setExpenseDescribed("仿¬¾æ¯åº"); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult updateRecord(ProductRecordDto productRecordDto) { |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(productRecordDto.getSaleLedgerProjectId()); |
| | | ProductRecord productRecord = productRecordMapper.selectById(productRecordDto.getId()); |
| | | if (productRecord == null) return AjaxResult.error("è®°å½ä¸åå¨"); |
| | | |
| | | // æ´æ°äº§åå°è´¦ |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(productRecord.getSaleLedgerProjectId()); |
| | | if (salesLedgerProduct != null) { |
| | | salesLedgerProduct.setFutureTicketsAmount(salesLedgerProduct.getFutureTicketsAmount().add(productRecord.getTicketsAmount()).subtract(productRecordDto.getTicketsAmount())); |
| | | salesLedgerProduct.setFutureTickets(salesLedgerProduct.getFutureTickets().add(productRecord.getTicketsNum().subtract(productRecordDto.getTicketsNum()))); |
| | | // æªæ¥ç¥¨éé¢ = åæªæ¥ç¥¨éé¢ + æ§è¡éé¢ - æ°è¡éé¢ |
| | | BigDecimal futureTicketsAmount = salesLedgerProduct.getFutureTicketsAmount() |
| | | .add(productRecord.getTicketsAmount()) |
| | | .subtract(productRecordDto.getTicketsAmount()); |
| | | salesLedgerProduct.setFutureTicketsAmount(futureTicketsAmount); |
| | | |
| | | // æªæ¥ç¥¨æ° = åæªæ¥ç¥¨æ° + æ§è¡æ°é - æ°è¡æ°é |
| | | BigDecimal futureTickets = salesLedgerProduct.getFutureTickets() |
| | | .add(productRecord.getTicketsNum()) |
| | | .subtract(productRecordDto.getTicketsNum()); |
| | | salesLedgerProduct.setFutureTickets(futureTickets); |
| | | |
| | | // æ´æ°äº§åè¡¨æ¬æ¬¡æ°å¼ |
| | | salesLedgerProduct.setTicketsAmount(productRecordDto.getTicketsAmount()); |
| | | salesLedgerProduct.setTicketsNum(productRecordDto.getTicketsNum()); |
| | | salesLedgerProductMapper.updateById(salesLedgerProduct); |
| | | } |
| | | PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(productRecord.getPurchaseLedgerId()); |
| | | if (purchaseLedger != null) { |
| | | purchaseLedger.setReceiptPaymentAmount(purchaseLedger.getReceiptPaymentAmount()); |
| | | } |
| | | // ä¿®æ¹åç¥¨å· |
| | | |
| | | // æ´æ°æ¥ç¥¨ç»è®° |
| | | TicketRegistration ticketRegistration = ticketRegistrationMapper.selectById(productRecord.getTicketRegistrationId()); |
| | | if(ticketRegistration != null){ |
| | | if (ticketRegistration != null) { |
| | | // éé¢ = æ°éé¢ - æ§éé¢ |
| | | BigDecimal amountDiff = productRecordDto.getTicketsAmount().subtract(productRecord.getTicketsAmount()); |
| | | // æ»éé¢ = åæ»éé¢ + å·®å¼ |
| | | ticketRegistration.setInvoiceAmount(ticketRegistration.getInvoiceAmount().add(amountDiff)); |
| | | // æ´æ°åç¥¨å· |
| | | ticketRegistration.setInvoiceNumber(productRecordDto.getInvoiceNumber()); |
| | | ticketRegistration.setInvoiceAmount(productRecordDto.getTicketsAmount()); |
| | | |
| | | ticketRegistrationMapper.updateById(ticketRegistration); |
| | | } |
| | | BeanUtils.copyProperties(productRecordDto,productRecord); |
| | | |
| | | BeanUtils.copyProperties(productRecordDto, productRecord); |
| | | // éæ°è®¡ç®æªæ¥ç¥¨éé¢ï¼æ ¹æ®å©ä½ç¥¨æ° * åä»·ï¼ |
| | | productRecord.setFutureTicketsAmount(productRecord.getFutureTickets().multiply(productRecord.getTaxInclusiveUnitPrice())); |
| | | productRecordMapper.updateById(productRecord); |
| | | |
| | | return AjaxResult.success("ä¿®æ¹æå"); |
| | | } |
| | | |
| | | @Override |
| | | @Override |
| | | public ProductRecordDto getProductRecordById(ProductRecordDto productRecordDto) { |
| | | List<ProductRecordDto> productRecordDtoList = productRecordMapper.getProductRecordById(productRecordDto); |
| | | if(CollectionUtils.isNotEmpty(productRecordDtoList)){ |
| | | if (CollectionUtils.isNotEmpty(productRecordDtoList)) { |
| | | ProductRecordDto productRecordDto1 = productRecordDtoList.stream() |
| | | .filter(item -> item.getId().equals(productRecordDto.getId())) |
| | | .findFirst() |
| | |
| | | .filter(item -> item.getProductModelId().equals(productRecordDto.getProductModelId())) |
| | | .map(ProductRecordDto::getTicketsNum) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | if(productRecordDto1 != null){ |
| | | if (productRecordDto1 != null) { |
| | | productRecordDto1.setFutureTickets(productRecordDto1.getQuantity().subtract(reduce)); |
| | | productRecordDto1.setFutureTicketsAmount(productRecordDto1.getFutureTickets().multiply(productRecordDto1.getTaxInclusiveUnitPrice())); |
| | | } |
| | |
| | | if (productList != null && !productList.isEmpty()) { |
| | | handleSalesLedgerProducts(purchaseLedger.getId(), productList, purchaseLedgerDto.getType()); |
| | | } |
| | | //æ°å¢åæææ£éª |
| | | if (productList != null) { |
| | | for (SalesLedgerProduct saleProduct : productList) { |
| | | //æ¯å¦æ¨éè´¨æ£ï¼å¦ætrue就添å |
| | | if (saleProduct.getIsChecked()) { |
| | | addQualityInspect(purchaseLedger, saleProduct); |
| | | } |
| | | } |
| | | } |
| | | //æ°å¢åæææ£éª 审æ¹ä¹åæçææ£éª |
| | | // if (productList != null) { |
| | | // for (SalesLedgerProduct saleProduct : productList) { |
| | | // //æ¯å¦æ¨éè´¨æ£ï¼å¦ætrue就添å |
| | | // if (saleProduct.getIsChecked()) { |
| | | // addQualityInspect(purchaseLedger, saleProduct); |
| | | // } |
| | | // } |
| | | // } |
| | | // 5. è¿ç§»ä¸´æ¶æä»¶å°æ£å¼ç®å½ |
| | | if (purchaseLedgerDto.getTempFileIds() != null && !purchaseLedgerDto.getTempFileIds().isEmpty()) { |
| | | migrateTempFilesToFormal(purchaseLedger.getId(), purchaseLedgerDto.getTempFileIds()); |
| | |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | //å¦æå·²ç»æäº¤å°±ä¸å
许å é¤ |
| | | List<QualityInspect> qualityInspects = qualityInspectService.listByIds(ids); |
| | | for (QualityInspect qualityInspect : qualityInspects) { |
| | | if(qualityInspect.getInspectState()==1){ |
| | | throw new RuntimeException("å·²æäº¤çæ°æ®ä¸å
许å é¤"); |
| | | } |
| | | } |
| | | //å 餿£éªåæ° |
| | | qualityInspectParamService.remove(Wrappers.<QualityInspectParam>lambdaQuery() |
| | | .in(QualityInspectParam::getInspectId,ids)); |
| | | //å 餿£éªéä»¶ |
| | | qualityInspectFileService.remove(Wrappers.<QualityInspectFile>lambdaQuery() |
| | | .in(QualityInspectFile::getInspectId,ids)); |
| | | //å é¤å
¥åºè®°å½ |
| | | for (Integer id : ids) { |
| | | stockUtils.deleteStockInRecord(Long.valueOf(id), StockInQualifiedRecordTypeEnum.QUALITYINSPECT_STOCK_IN.getCode()); |
| | | } |
| | | //å 餿£éªå |
| | | return AjaxResult.success(qualityInspectService.removeBatchByIds(ids)); |
| | | } |
| | |
| | | */ |
| | | @GetMapping("/{id}") |
| | | public AjaxResult QualityUnqualifiedDetail(@PathVariable("id") Integer id) { |
| | | return AjaxResult.success(qualityUnqualifiedService.getById(id)); |
| | | return AjaxResult.success(qualityUnqualifiedService.getUnqualified(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | IPage<QualityUnqualified> qualityUnqualifiedListPage(Page page, @Param("qualityUnqualified") QualityUnqualified qualityUnqualified); |
| | | |
| | | List<QualityUnqualified> qualityUnqualifiedExport(@Param("qualityUnqualified") QualityUnqualified qualityUnqualified); |
| | | |
| | | QualityUnqualified getUnqualified(@Param("id") Integer id); |
| | | |
| | | //æå¨æ°å¢ä¸åæ ¼çæ¶å,æ ¹æ®äº§ååç§°åè§æ ¼åå·æ¥åºå¯¹åºçè§æ ¼åå·id |
| | | Long getModelId(@Param("productName") String productName, @Param("model") String model); |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("å
³èæ£æµid") |
| | | private Long inspectId; |
| | | |
| | | |
| | | @ApiModelProperty("æ¯å¦ä¸åæ ¼å¤çèªå·±æ°å¢") |
| | | @TableField(exist = false) |
| | | private Boolean method; |
| | | } |
| | |
| | | |
| | | int deal(QualityUnqualified qualityUnqualified); |
| | | |
| | | QualityUnqualified getUnqualified(Integer id); |
| | | } |
| | |
| | | @Override |
| | | public int submit(QualityInspect inspect) { |
| | | QualityInspect qualityInspect = qualityInspectMapper.selectById(inspect.getId()); |
| | | //æäº¤åå¿
须夿æ¯å¦åæ ¼ |
| | | if (ObjectUtils.isNull(qualityInspect.getCheckResult())) { |
| | | throw new RuntimeException("请å
夿æ¯å¦åæ ¼"); |
| | | } |
| | | /*夿ä¸åæ ¼*/ |
| | | if (ObjectUtils.isNotNull(qualityInspect.getCheckResult()) && qualityInspect.getCheckResult().equals("ä¸åæ ¼")) { |
| | | if (qualityInspect.getCheckResult().equals("ä¸åæ ¼")) { |
| | | QualityUnqualified qualityUnqualified = new QualityUnqualified(); |
| | | BeanUtils.copyProperties(qualityInspect, qualityUnqualified); |
| | | qualityUnqualified.setInspectState(0);//å¾
å¤ç |
| | |
| | | public int deal(QualityUnqualified qualityUnqualified) { |
| | | QualityUnqualified unqualified = qualityUnqualifiedMapper.selectById(qualityUnqualified.getId()); |
| | | QualityInspect qualityInspect = qualityInspectService.getById(unqualified.getInspectId()); |
| | | if (ObjectUtils.isNotNull(qualityInspect) && qualityInspect.getInspectType()!=0) { |
| | | if (ObjectUtils.isNotNull(qualityInspect) && qualityInspect.getInspectType() != 0) { |
| | | switch (qualityUnqualified.getDealResult()) { |
| | | case "è¿ä¿®": |
| | | case "è¿å·¥": |
| | |
| | | } |
| | | } |
| | | // çæå®æ´çå·¥åå· |
| | | String workOrderNoStr ="FG" +String.format("%s%03d", datePrefix, sequenceNumber); |
| | | String workOrderNoStr = "FG" + String.format("%s%03d", datePrefix, sequenceNumber); |
| | | ProductWorkOrder productWorkOrder = new ProductWorkOrder(); |
| | | productWorkOrder.setProductProcessRouteItemId(productProcessRouteItem.getId()); |
| | | productWorkOrder.setProductOrderId(order.getId()); |
| | |
| | | case "è®©æ¥æ¾è¡": |
| | | //è°ç¨æäº¤åæ ¼çæ¥å£ |
| | | stockUtils.addStock(qualityInspect.getProductModelId(), unqualified.getQuantity(), StockInQualifiedRecordTypeEnum.DEFECTIVE_PASS.getCode(), unqualified.getId()); |
| | | qualityInspect.setCheckResult("åæ ¼"); |
| | | qualityInspectService.submit(qualityInspect); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } else { |
| | | //æ¥è¯¢å¯¹åºçè§æ ¼åå·id |
| | | Long modelId = qualityUnqualifiedMapper.getModelId(qualityUnqualified.getProductName(), qualityUnqualified.getModel()); |
| | | switch (qualityUnqualified.getDealResult()) { |
| | | case "æ¥åº": |
| | | //è°ç¨ä¸åæ ¼åºåæ¥å£ å
¥ä¸åæ ¼åº |
| | | stockUtils.addUnStock(modelId, unqualified.getQuantity(), StockInUnQualifiedRecordTypeEnum.DEFECTIVE_SCRAP.getCode(), unqualified.getId()); |
| | | break; |
| | | case "è®©æ¥æ¾è¡": |
| | | //è°ç¨æäº¤åæ ¼çæ¥å£ |
| | | stockUtils.addStock(modelId, unqualified.getQuantity(), StockInQualifiedRecordTypeEnum.DEFECTIVE_PASS.getCode(), unqualified.getId()); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | } |
| | | qualityUnqualified.setInspectState(1);//å·²å¤ç |
| | | return qualityUnqualifiedMapper.updateById(qualityUnqualified); |
| | | } |
| | | |
| | | @Override |
| | | public QualityUnqualified getUnqualified(Integer id) { |
| | | return qualityUnqualifiedMapper.getUnqualified(id); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.sales.dto.InvoiceLedgerDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | | import com.ruoyi.sales.mapper.InvoiceLedgerMapper; |
| | | import com.ruoyi.sales.mapper.InvoiceRegistrationProductMapper; |
| | | import com.ruoyi.sales.mapper.ReceiptPaymentMapper; |
| | | import com.ruoyi.sales.pojo.InvoiceLedger; |
| | | import com.ruoyi.sales.pojo.InvoiceRegistrationProduct; |
| | | import com.ruoyi.sales.pojo.ReceiptPayment; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import com.ruoyi.sales.service.ICommonFileService; |
| | |
| | | import java.io.OutputStream; |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private InvoiceLedgerMapper invoiceLedgerMapper; |
| | | |
| | | @Autowired |
| | | private InvoiceRegistrationProductMapper invoiceRegistrationProductMapper; |
| | | |
| | | @Autowired |
| | | private ReceiptPaymentMapper receiptPaymentMapper; |
| | |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public IPage<SalesLedger> listPage(Page page, SalesLedgerDto salesLedgerDto) { |
| | | IPage<SalesLedger> iPage = salesLedgerService.selectSalesLedgerListPage(page,salesLedgerDto); |
| | | // 计ç®å·²å¼ç¥¨éé¢/æªå¼ç¥¨éé¢(已填åå票éé¢ä¸ºå) |
| | | if(CollectionUtils.isEmpty(iPage.getRecords())){ |
| | | return iPage; |
| | | } |
| | | List<Long> salesLedgerIds = iPage.getRecords().stream().map(SalesLedger::getId).collect(Collectors.toList()); |
| | | List<InvoiceLedgerDto> invoiceLedgerDtoList = invoiceLedgerMapper.invoicedTotal(salesLedgerIds); |
| | | if(CollectionUtils.isEmpty(invoiceLedgerDtoList)){ |
| | | return iPage; |
| | | } |
| | | // 计ç®å款éé¢ï¼å¾
忬¾éé¢ |
| | | List<InvoiceRegistrationProduct> invoiceRegistrationProducts = invoiceRegistrationProductMapper.selectList(new LambdaQueryWrapper<InvoiceRegistrationProduct>() |
| | | .in(InvoiceRegistrationProduct::getSalesLedgerId, salesLedgerIds)); |
| | | IPage<SalesLedger> iPage = salesLedgerService.selectSalesLedgerListPage(page, salesLedgerDto); |
| | | |
| | | List<InvoiceLedger> invoiceLedgers = invoiceLedgerMapper.selectList(new LambdaQueryWrapper<InvoiceLedger>() |
| | | .in(InvoiceLedger::getInvoiceRegistrationProductId, invoiceRegistrationProducts.stream().map(InvoiceRegistrationProduct::getId).collect(Collectors.toList()))); |
| | | List<ReceiptPayment> receiptPayments = new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(invoiceLedgers)){ |
| | | receiptPayments = receiptPaymentMapper.selectList(new LambdaQueryWrapper<ReceiptPayment>() |
| | | .in(ReceiptPayment::getInvoiceLedgerId, invoiceLedgers.stream().map(InvoiceLedger::getId).collect(Collectors.toList()))); |
| | | // æ¥è¯¢ç»æä¸ºç©º,ç´æ¥è¿å |
| | | if (CollectionUtils.isEmpty(iPage.getRecords())) { |
| | | return iPage; |
| | | } |
| | | for (SalesLedger salesLedger : iPage.getRecords()) { |
| | | boolean existFlag = false; |
| | | BigDecimal noInvoiceAmountTotal = BigDecimal.ZERO; |
| | | BigDecimal invoiceTotal = BigDecimal.ZERO; |
| | | for (InvoiceLedgerDto invoiceLedgerDto : invoiceLedgerDtoList) { |
| | | if (salesLedger.getId().intValue() == invoiceLedgerDto.getSalesLedgerId()) { |
| | | noInvoiceAmountTotal = salesLedger.getContractAmount().subtract(invoiceLedgerDto.getInvoiceTotal()); |
| | | invoiceTotal = invoiceLedgerDto.getInvoiceTotal(); |
| | | existFlag = true; |
| | | if(!CollectionUtils.isEmpty(receiptPayments)){ |
| | | List<InvoiceRegistrationProduct> collect = invoiceRegistrationProducts.stream() |
| | | .filter(item -> salesLedger.getId().equals(Long.parseLong(item.getSalesLedgerId().toString()))) |
| | | .collect(Collectors.toList()); |
| | | List<Integer> collect1 = collect.stream() |
| | | .map(InvoiceRegistrationProduct::getId).collect(Collectors.toList()); |
| | | List<InvoiceLedger> collect2 = invoiceLedgers.stream() |
| | | .filter(item -> collect1.contains(item.getInvoiceRegistrationProductId())) |
| | | .collect(Collectors.toList()); |
| | | // è·å已忬¾éé¢ |
| | | List<ReceiptPayment> collect3 = receiptPayments.stream() |
| | | .filter(item -> collect2.stream().anyMatch(item1 -> item1.getId().equals(item.getInvoiceLedgerId()))) |
| | | .collect(Collectors.toList()); |
| | | BigDecimal receiptPaymentAmountTotal = collect3.stream().map(ReceiptPayment::getReceiptPaymentAmount) |
| | | .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // è·åå¾
忬¾éé¢ |
| | | BigDecimal noReceiptPaymentAmountTotal = invoiceLedgerDto.getInvoiceTotal().subtract(receiptPaymentAmountTotal); |
| | | salesLedger.setReceiptPaymentAmountTotal(receiptPaymentAmountTotal); |
| | | salesLedger.setNoReceiptAmount(noReceiptPaymentAmountTotal); |
| | | } |
| | | break; |
| | | |
| | | // è·åå½å页ææå°è´¦è®°å½ç ID éå |
| | | List<Long> salesLedgerIds = iPage.getRecords().stream().map(SalesLedger::getId).collect(Collectors.toList()); |
| | | |
| | | // æ¥è¯¢å票信æ¯çå·²å¼ç¥¨éé¢ |
| | | List<InvoiceLedgerDto> invoiceLedgerDtoList = invoiceLedgerMapper.invoicedTotal(salesLedgerIds); |
| | | if (CollectionUtils.isEmpty(invoiceLedgerDtoList)) { |
| | | invoiceLedgerDtoList = Collections.emptyList(); |
| | | } |
| | | |
| | | // 转æ¢åç¥¨æ°æ®, key 为å°è´¦ID, value 为该å°è´¦çæ»å¼ç¥¨éé¢ |
| | | Map<Long, BigDecimal> invoiceTotals = invoiceLedgerDtoList.stream() |
| | | .filter(dto -> dto.getSalesLedgerId() != null && dto.getInvoiceTotal() != null) |
| | | .collect(Collectors.toMap( |
| | | dto -> dto.getSalesLedgerId().longValue(), |
| | | InvoiceLedgerDto::getInvoiceTotal, |
| | | BigDecimal::add // åå¨éå¤IDæ§è¡ç´¯å |
| | | )); |
| | | |
| | | // æ¥è¯¢å款/仿¬¾è®°å½ |
| | | List<ReceiptPayment> receiptPayments = Collections.emptyList(); |
| | | if (!CollectionUtils.isEmpty(salesLedgerIds)) { |
| | | receiptPayments = receiptPaymentMapper.selectList(new LambdaQueryWrapper<ReceiptPayment>() |
| | | .in(ReceiptPayment::getSalesLedgerId, salesLedgerIds)); |
| | | } |
| | | |
| | | // 转æ¢åæ¬¾æ°æ®, key 为å°è´¦ID, value 为该å°è´¦çæ»å款éé¢ |
| | | Map<Long, BigDecimal> receiptTotals = new HashMap<>(); |
| | | if (!CollectionUtils.isEmpty(receiptPayments)) { |
| | | for (ReceiptPayment receiptPayment : receiptPayments) { |
| | | if (receiptPayment.getSalesLedgerId() != null && receiptPayment.getReceiptPaymentAmount() != null) { |
| | | // 妿 key åå¨åç¸å ,ä¸åå¨åæ¾å
¥ |
| | | receiptTotals.merge(receiptPayment.getSalesLedgerId(), receiptPayment.getReceiptPaymentAmount(), BigDecimal::add); |
| | | } |
| | | } |
| | | if(existFlag){ |
| | | salesLedger.setNoInvoiceAmountTotal(noInvoiceAmountTotal); |
| | | }else { |
| | | salesLedger.setNoInvoiceAmountTotal(salesLedger.getContractAmount()); |
| | | } |
| | | salesLedger.setInvoiceTotal(invoiceTotal); |
| | | } |
| | | |
| | | for (SalesLedger salesLedger : iPage.getRecords()) { |
| | | Long ledgerId = salesLedger.getId(); |
| | | // ååæ»éé¢ |
| | | BigDecimal contractAmount = salesLedger.getContractAmount() == null ? BigDecimal.ZERO : salesLedger.getContractAmount(); |
| | | // å¼ç¥¨æ»é¢å忬¾æ»é¢ |
| | | BigDecimal invoiceTotal = invoiceTotals.getOrDefault(ledgerId, BigDecimal.ZERO); |
| | | BigDecimal receiptPaymentAmountTotal = receiptTotals.getOrDefault(ledgerId, BigDecimal.ZERO); |
| | | |
| | | // æªå¼ç¥¨éé¢ = ååéé¢ - å·²å¼ç¥¨éé¢ |
| | | BigDecimal noInvoiceAmountTotal = contractAmount.subtract(invoiceTotal); |
| | | if (noInvoiceAmountTotal.compareTo(BigDecimal.ZERO) < 0) { |
| | | noInvoiceAmountTotal = BigDecimal.ZERO; |
| | | } |
| | | |
| | | // å¾
忬¾éé¢ = å·²å¼ç¥¨éé¢ - 已忬¾éé¢ |
| | | BigDecimal noReceiptPaymentAmountTotal = invoiceTotal.subtract(receiptPaymentAmountTotal); |
| | | if (noReceiptPaymentAmountTotal.compareTo(BigDecimal.ZERO) < 0) { |
| | | noReceiptPaymentAmountTotal = BigDecimal.ZERO; |
| | | } |
| | | |
| | | salesLedger.setNoInvoiceAmountTotal(noInvoiceAmountTotal); |
| | | salesLedger.setInvoiceTotal(invoiceTotal); |
| | | salesLedger.setReceiptPaymentAmountTotal(receiptPaymentAmountTotal); |
| | | salesLedger.setNoReceiptAmount(noReceiptPaymentAmountTotal); |
| | | |
| | | // å¦æå·²ç»æè¿å¼ç¥¨æå款æä½,åä¸å
许ç¼è¾ |
| | | boolean hasInvoiceOperation = invoiceTotal.compareTo(BigDecimal.ZERO) > 0; |
| | | boolean hasReceiptOperation = receiptPaymentAmountTotal.compareTo(BigDecimal.ZERO) > 0; |
| | | salesLedger.setIsEdit(!(hasInvoiceOperation || hasReceiptOperation)); |
| | | } |
| | | |
| | | if (ObjectUtils.isNotEmpty(salesLedgerDto.getStatus())) { |
| | | if (salesLedgerDto.getStatus()) { |
| | | iPage.getRecords().removeIf(salesLedger -> Objects.equals(salesLedger.getNoInvoiceAmountTotal(), new BigDecimal("0.00"))); |
| | | // æ¸
餿æâæªå¼ç¥¨éé¢â为 0 çè®°å½ |
| | | iPage.getRecords().removeIf(salesLedger -> |
| | | Objects.equals(salesLedger.getNoInvoiceAmountTotal(), new BigDecimal("0.00"))); |
| | | iPage.setTotal(iPage.getRecords().size()); |
| | | } |
| | | } |
| | |
| | | * æ¥è¯¢äº§åä¿¡æ¯å表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SalesLedgerProduct salesLedgerProduct) |
| | | { |
| | | public AjaxResult list(SalesLedgerProduct salesLedgerProduct) { |
| | | List<SalesLedgerProduct> list = salesLedgerProductService.selectSalesLedgerProductList(salesLedgerProduct); |
| | | list.forEach(item -> { |
| | | if (item.getFutureTickets().compareTo(BigDecimal.ZERO) == 0) { |
| | | item.setFutureTickets(item.getQuantity()); |
| | | } |
| | | if (item.getFutureTickets().compareTo(BigDecimal.ZERO) == 0) { |
| | | item.setFutureTickets(BigDecimal.ZERO); |
| | | } |
| | | if (item.getFutureTicketsAmount().compareTo(BigDecimal.ZERO) == 0) { |
| | | item.setFutureTicketsAmount(item.getTaxInclusiveTotalPrice()); |
| | | item.setFutureTicketsAmount(BigDecimal.ZERO); |
| | | } |
| | | // ProcurementPageDto procurementDto = new ProcurementPageDto(); |
| | | // procurementDto.setSalesLedgerProductId(item.getId()); |
| | |
| | | // BigDecimal stockQuantity = stockUtils.getStockQuantity(item.getProductModelId()).get("stockQuantity"); |
| | | |
| | | // ProcurementPageDtoCopy procurementDtoCopy = result.getRecords().get(0); |
| | | if (item.getApproveStatus() != 2) { |
| | | if (item.getHasSufficientStock() == 0) { |
| | | item.setApproveStatus(0); |
| | | }else { |
| | | item.setApproveStatus(1); |
| | | } |
| | | if (item.getApproveStatus() != 2) { |
| | | if (item.getHasSufficientStock() == 0) { |
| | | item.setApproveStatus(0); |
| | | } else { |
| | | item.setApproveStatus(1); |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(list); |
| | | } |
| | |
| | | private String productCategory; |
| | | |
| | | @ApiModelProperty(value = "å¼å§æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM") |
| | | private Date entryDateStart; |
| | | |
| | | @ApiModelProperty(value = "ç»ææ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM") |
| | | private Date entryDateEnd; |
| | | |
| | | } |
| | |
| | | "SUM(CASE WHEN slp.approve_status = 2 THEN 1 ELSE 0 END) / COUNT(DISTINCT sl.id) * 100), 2) AS ship_rate " + |
| | | "FROM sales_ledger sl " + |
| | | "LEFT JOIN sales_ledger_product slp ON sl.id = slp.sales_ledger_id " + |
| | | "WHERE sl.entry_date BETWEEN #{statisticsTableDto.entryDateStart} AND #{statisticsTableDto.entryDateEnd} " + |
| | | "WHERE sl.entry_date >= DATE_FORMAT(#{statisticsTableDto.entryDateStart}, '%Y-%m-01') " + |
| | | "AND sl.entry_date <= LAST_DAY(#{statisticsTableDto.entryDateEnd}) " + |
| | | // 产å大类çé |
| | | "<if test='statisticsTableDto.productCategory != null and statisticsTableDto.productCategory != \"\"'>" + |
| | | "AND slp.product_category = #{statisticsTableDto.productCategory} " + |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | * @date 2025-05-08 |
| | | */ |
| | | public interface SalesLedgerProductMapper extends MyBaseMapper<SalesLedgerProduct> { |
| | | List<SalesLedgerProduct> selectProduct() ; |
| | | List<SalesLedgerProduct> selectProduct(); |
| | | |
| | | List<SalesLedgerProduct> selectSalesLedgerProductList(@Param("salesLedgerProduct") SalesLedgerProduct salesLedgerProduct); |
| | | |
| | |
| | | |
| | | IPage<SalesLedgerProductDto> listPage(Page page, @Param("req") SalesLedgerProductDto salesLedgerProduct); |
| | | |
| | | IPage<SalesLedgerProductDto> listPagePurchaseLedger(Page page,@Param("req") SalesLedgerProductDto salesLedgerProduct); |
| | | IPage<SalesLedgerProductDto> listPagePurchaseLedger(Page page, @Param("req") SalesLedgerProductDto salesLedgerProduct); |
| | | |
| | | IPage<ProcurementBusinessSummaryDto> procurementBusinessSummaryListPage(Page page,@Param("req") ProcurementBusinessSummaryDto procurementBusinessSummaryDto); |
| | | IPage<ProcurementBusinessSummaryDto> procurementBusinessSummaryListPage(Page page, @Param("req") ProcurementBusinessSummaryDto procurementBusinessSummaryDto); |
| | | |
| | | List<LossProductModelDto> selectProductBomStructure(@Param("salesLedegerId") Long salesLedegerId); |
| | | |
| | |
| | | |
| | | List<Map<String, Object>> selectRawMaterialPurchaseAnalysis(); |
| | | |
| | | int selectProductCountByTypeAndDate(@Param("type") Integer type, @Param("startDate") String startDate, @Param("endDate") String endDate); |
| | | int selectProductCountByTypeAndDate(@Param("type") Integer type, @Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate); |
| | | |
| | | BigDecimal selectRawMaterialExpense(); |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | //æ¯å¦åè´§(å°è´¦é¡µé¢é¢è²æ§å¶) |
| | | private Boolean isFh; |
| | | |
| | | @TableField(exist = false) |
| | | //æ¯å¦å¯ç¼è¾ |
| | | private Boolean isEdit; |
| | | } |
| | | |
| | |
| | | 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.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.ruoyi.sales.dto.InvoiceRegistrationProductDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | | import com.ruoyi.sales.excel.InvoiceRegisAndProductExcelDto; |
| | | import com.ruoyi.sales.mapper.*; |
| | | import com.ruoyi.sales.mapper.InvoiceLedgerMapper; |
| | | import com.ruoyi.sales.mapper.InvoiceRegistrationMapper; |
| | | import com.ruoyi.sales.mapper.InvoiceRegistrationProductMapper; |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.pojo.InvoiceLedger; |
| | | import com.ruoyi.sales.pojo.InvoiceRegistration; |
| | | import com.ruoyi.sales.pojo.InvoiceRegistrationProduct; |
| | |
| | | throw new RuntimeException("éå®å°è´¦äº§åä¸åå¨ï¼IDï¼" + productDatum.getId()); |
| | | } |
| | | |
| | | // 计ç®ç´¯è®¡å¼ç¥¨ |
| | | BigDecimal newInvoiceNum = dbProduct.getInvoiceNum().add(currentInvoiceNum); |
| | | // æªå¼ç¥¨ |
| | | BigDecimal noInvoiceAmount = dbProduct.getNoInvoiceAmount(); |
| | | BigDecimal noInvoiceNum = dbProduct.getNoInvoiceNum(); |
| | | |
| | | BigDecimal newInvoiceAmount = dbProduct.getInvoiceAmount().add(currentInvoiceAmount); |
| | | // å©ä½æªå¼ç¥¨ |
| | | BigDecimal newNoInvoiceNum = noInvoiceNum.subtract(currentInvoiceNum); |
| | | BigDecimal newNoInvoiceAmount = noInvoiceAmount.subtract(currentInvoiceAmount); |
| | | |
| | | // è®¡ç®æªå¼ç¥¨ |
| | | BigDecimal newNoInvoiceNum = dbProduct.getQuantity().subtract(newInvoiceNum); |
| | | |
| | | BigDecimal newNoInvoiceAmount = dbProduct.getTaxInclusiveTotalPrice().subtract(newInvoiceAmount); |
| | | |
| | | if (newNoInvoiceNum.compareTo(BigDecimal.ZERO) < 0 |
| | | || newNoInvoiceAmount.compareTo(BigDecimal.ZERO) < 0) { |
| | | if (newNoInvoiceAmount.compareTo(BigDecimal.ZERO) < 0) { |
| | | throw new RuntimeException("å¼ç¥¨æ°éæéé¢è¶
è¿ååæ»é"); |
| | | } |
| | | |
| | |
| | | null, |
| | | new LambdaUpdateWrapper<SalesLedgerProduct>() |
| | | .eq(SalesLedgerProduct::getId, dbProduct.getId()) |
| | | .set(SalesLedgerProduct::getInvoiceNum, newInvoiceNum) |
| | | .set(SalesLedgerProduct::getInvoiceAmount, newInvoiceAmount) |
| | | .set(SalesLedgerProduct::getNoInvoiceNum, newNoInvoiceNum) |
| | | .set(SalesLedgerProduct::getNoInvoiceAmount, newNoInvoiceAmount) |
| | | ); |
| | |
| | | |
| | | public AjaxResult statisticsTable(StatisticsTableDto statisticsTableDto) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (statisticsTableDto.getEntryDateStart() == null || statisticsTableDto.getEntryDateEnd() == null) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | // ç»ææ¶é´é»è®¤æ¯å½åæ¶é´ |
| | | statisticsTableDto.setEntryDateEnd(new Date()); |
| | | // å¼å§æ¶é´é»è®¤æ¯6个æå |
| | | calendar.add(Calendar.MONTH, -6); |
| | | statisticsTableDto.setEntryDateStart(calendar.getTime()); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | |
| | | // ç»ææ¶é´é»è®¤æ¯å½åæ¶é´ |
| | | Date endDate = statisticsTableDto.getEntryDateEnd() != null ? statisticsTableDto.getEntryDateEnd() : new Date(); |
| | | statisticsTableDto.setEntryDateEnd(endDate); |
| | | |
| | | // å¼å§æ¶é´é»è®¤æ¯12个æå |
| | | Date startDate; |
| | | if (statisticsTableDto.getEntryDateStart() != null) { |
| | | startDate = statisticsTableDto.getEntryDateStart(); |
| | | } else { |
| | | calendar.setTime(endDate); |
| | | calendar.add(Calendar.MONTH, -11); // å11个æï¼å ä¸å½åæå
±12个æ |
| | | calendar.set(Calendar.DAY_OF_MONTH, 1); // 设为æå |
| | | startDate = calendar.getTime(); |
| | | } |
| | | statisticsTableDto.setEntryDateStart(startDate); |
| | | |
| | | // æ¥è¯¢æ°æ®åºè·åææ°æ®çæä»½ |
| | | List<SalesTrendDto> salesTrendDtos = salesLedgerMapper.statisticsTable(statisticsTableDto); |
| | | if(CollectionUtils.isEmpty(salesTrendDtos)) return AjaxResult.success(map); |
| | | map.put("dateList", salesTrendDtos.stream().map(SalesTrendDto::getMonth).collect(Collectors.toList())); |
| | | map.put("orderCountList", salesTrendDtos.stream().map(SalesTrendDto::getOrderCount).collect(Collectors.toList())); |
| | | map.put("salesAmountList", salesTrendDtos.stream().map(SalesTrendDto::getSalesAmount).collect(Collectors.toList())); |
| | | map.put("shippingRateList", salesTrendDtos.stream().map(SalesTrendDto::getShipRate).collect(Collectors.toList())); |
| | | |
| | | // å建æä»½å°æ°æ®çæ å° |
| | | Map<String, SalesTrendDto> trendMap = new HashMap<>(); |
| | | if (!CollectionUtils.isEmpty(salesTrendDtos)) { |
| | | for (SalesTrendDto dto : salesTrendDtos) { |
| | | trendMap.put(dto.getMonth(), dto); |
| | | } |
| | | } |
| | | |
| | | // çææä»½å表 |
| | | List<String> dateList = new ArrayList<>(); |
| | | List<BigDecimal> orderCountList = new ArrayList<>(); |
| | | List<BigDecimal> salesAmountList = new ArrayList<>(); |
| | | List<BigDecimal> shippingRateList = new ArrayList<>(); |
| | | |
| | | Calendar tempCalendar = Calendar.getInstance(); |
| | | tempCalendar.setTime(startDate); |
| | | tempCalendar.set(Calendar.DAY_OF_MONTH, 1); // ç¡®ä¿ä»æåå¼å§ |
| | | |
| | | Calendar endCalendar = Calendar.getInstance(); |
| | | endCalendar.setTime(endDate); |
| | | endCalendar.set(Calendar.DAY_OF_MONTH, 1); // ç¡®ä¿å°ææ« |
| | | |
| | | // 循ç¯çææä»½å表ï¼ç´å°è¾¾å°ç»ææä»½ |
| | | while (!tempCalendar.after(endCalendar)) { |
| | | String monthStr = String.format("%04d-%02d", tempCalendar.get(Calendar.YEAR), tempCalendar.get(Calendar.MONTH) + 1); |
| | | dateList.add(monthStr); |
| | | |
| | | // è·åå½åæä»½çæ°æ®ï¼å¦ææ²¡æå使ç¨é»è®¤å¼ |
| | | SalesTrendDto dto = trendMap.get(monthStr); |
| | | if (dto != null) { |
| | | orderCountList.add(new BigDecimal(dto.getOrderCount())); |
| | | salesAmountList.add(dto.getSalesAmount() != null ? dto.getSalesAmount() : BigDecimal.ZERO); |
| | | shippingRateList.add(new BigDecimal(String.valueOf(dto.getShipRate()))); |
| | | } else { |
| | | orderCountList.add(BigDecimal.ZERO); |
| | | salesAmountList.add(BigDecimal.ZERO); |
| | | shippingRateList.add(BigDecimal.ZERO); |
| | | } |
| | | |
| | | // ä¸ä¸ä¸ªæ |
| | | tempCalendar.add(Calendar.MONTH, 1); |
| | | } |
| | | |
| | | map.put("dateList", dateList); |
| | | map.put("orderCountList", orderCountList); |
| | | map.put("salesAmountList", salesAmountList); |
| | | map.put("shippingRateList", shippingRateList); |
| | | return AjaxResult.success(map); |
| | | } |
| | | } |
| | |
| | | // å¢å è´¢å¡æ¶å
¥è®°å½ |
| | | AccountIncome accountIncome = new AccountIncome(); |
| | | accountIncome.setIncomeDate(salesLedger.getEntryDate()); |
| | | accountIncome.setIncomeType("0"); |
| | | accountIncome.setIncomeType("3"); |
| | | accountIncome.setCustomerName(salesLedger.getCustomerName()); |
| | | accountIncome.setIncomeMoney(salesLedger.getContractAmount()); |
| | | accountIncome.setIncomeMoney(receiptPayment.getReceiptPaymentAmount()); |
| | | accountIncome.setIncomeMethod("0"); |
| | | accountIncome.setInputTime(new Date()); |
| | | accountIncome.setInputUser(salesLedger.getEntryPerson()); |
| | |
| | | byId.setExpressCompany(req.getExpressCompany()); |
| | | byId.setStatus("å·²åè´§"); |
| | | byId.setShippingCarNumber(req.getShippingCarNumber()); |
| | | byId.setShippingDate(req.getShippingDate()); |
| | | boolean update = this.updateById(byId); |
| | | // è¿ç§»æä»¶ |
| | | if(CollectionUtils.isNotEmpty(req.getTempFileIds())){ |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.staff.pojo.HolidayApplication; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.ruoyi.staff.service.HolidayApplicationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.staff.dto.PersonalAttendanceRecordsDto; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceLocationConfig; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.ruoyi.staff.service.PersonalAttendanceLocationConfigService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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-02-11 09:41:34 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/personalAttendanceLocationConfig") |
| | | @Api(tags = "人åæå¡è§åé
ç½®") |
| | | public class PersonalAttendanceLocationConfigController { |
| | | |
| | | @Autowired |
| | | private PersonalAttendanceLocationConfigService personalAttendanceLocationConfigService; |
| | | |
| | | @ApiOperation("æ°å¢/ä¿®æ¹äººåæå¡è§åé
ç½®") |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody PersonalAttendanceLocationConfig personalAttendanceLocationConfig){ |
| | | return R.ok(personalAttendanceLocationConfigService.saveOrUpdate(personalAttendanceLocationConfig)); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢äººåæå¡è§åé
ç½®") |
| | | @GetMapping("/listPage") |
| | | public R listPage(Page page){ |
| | | return R.ok(personalAttendanceLocationConfigService.page(page)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("å é¤äººåæå¡è§åé
ç½®") |
| | | @DeleteMapping("/del") |
| | | public R del(@RequestBody List<Integer> ids) { |
| | | return R.ok(personalAttendanceLocationConfigService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.staff.dto.PersonalAttendanceRecordsDto; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.ruoyi.staff.service.PersonalAttendanceRecordsService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @AllArgsConstructor |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-02-09 01:20:07 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/staff/personalAttendanceRecords") |
| | | @RequestMapping("/personalAttendanceRecords") |
| | | @Api(tags = "人åæå¡ç¾å°") |
| | | public class PersonalAttendanceRecordsController { |
| | | @Autowired |
| | | @Resource |
| | | private PersonalAttendanceRecordsService personalAttendanceRecordsService; |
| | | /** |
| | | * 个人èå¤è®°å½å页æ¥è¯¢ |
| | | */ |
| | | |
| | | @ApiOperation("æ°å¢æå¡ç¾å°") |
| | | @PostMapping("") |
| | | public AjaxResult add(@RequestBody PersonalAttendanceRecordsDto personalAttendanceRecordsDto){ |
| | | return AjaxResult.success(personalAttendanceRecordsService.add(personalAttendanceRecordsDto)); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢æå¡ç¾å°") |
| | | @GetMapping("/listPage") |
| | | public AjaxResult personalAttendanceRecordsListPage(Page page, PersonalAttendanceRecords personalAttendanceRecords) { |
| | | return AjaxResult.success(personalAttendanceRecordsService.listPage(page, personalAttendanceRecords)); |
| | | public AjaxResult listPage(Page page, PersonalAttendanceRecordsDto personalAttendanceRecordsDto){ |
| | | return AjaxResult.success(personalAttendanceRecordsService.listPage(page, personalAttendanceRecordsDto)); |
| | | } |
| | | /** |
| | | * æ°å¢ä¸ªäººèå¤è®°å½ |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody PersonalAttendanceRecords personalAttendanceRecords) { |
| | | return AjaxResult.success(personalAttendanceRecordsService.save(personalAttendanceRecords)); |
| | | |
| | | @ApiOperation("è·åå½å人çèå¤ç¸å
³æ°æ®") |
| | | @GetMapping("/today") |
| | | public AjaxResult todayInfo(PersonalAttendanceRecordsDto personalAttendanceRecordsDto){ |
| | | return AjaxResult.success(personalAttendanceRecordsService.todayInfo(personalAttendanceRecordsDto)); |
| | | } |
| | | /** |
| | | * ä¿®æ¹ä¸ªäººèå¤è®°å½ |
| | | */ |
| | | @PutMapping("/update") |
| | | public AjaxResult update(@RequestBody PersonalAttendanceRecords personalAttendanceRecords) { |
| | | return AjaxResult.success(personalAttendanceRecordsService.updateById(personalAttendanceRecords)); |
| | | |
| | | @ApiOperation("å¯¼åºæå¡ç¾å°") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, PersonalAttendanceRecordsDto personalAttendanceRecordsDto) { |
| | | personalAttendanceRecordsService.export(response, personalAttendanceRecordsDto); |
| | | } |
| | | /** |
| | | * å é¤ä¸ªäººèå¤è®°å½ |
| | | */ |
| | | @DeleteMapping("/delete/{id}") |
| | | public AjaxResult delete(@PathVariable("id") Long id) { |
| | | return AjaxResult.success(personalAttendanceRecordsService.removeById(id)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.dto; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class PersonalAttendanceRecordsDto extends PersonalAttendanceRecords { |
| | | @Excel(name = "å§å", sort = 3) |
| | | private String staffName; |
| | | |
| | | @Excel(name = "å·¥å·", sort = 4) |
| | | private String staffNo; |
| | | |
| | | @Excel(name = "é¨é¨", sort = 2) |
| | | private String deptName; |
| | | |
| | | private Long deptId; |
| | | |
| | | //æå¡çç»åº¦ |
| | | private Double longitude; |
| | | |
| | | //æå¡ç纬度 |
| | | private Double latitude; |
| | | |
| | | //æ åä¸çæ¶é´ |
| | | @JsonFormat(pattern = "HH:mm") |
| | | @DateTimeFormat(pattern = "HH:mm") |
| | | private LocalTime startAt; |
| | | |
| | | //æ åä¸çæ¶é´ |
| | | @JsonFormat(pattern = "HH:mm") |
| | | @DateTimeFormat(pattern = "HH:mm") |
| | | private LocalTime endAt; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.mapper; |
| | | |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceLocationConfig; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 人åæå¡è§åé
ç½® Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-02-11 09:41:34 |
| | | */ |
| | | @Mapper |
| | | public interface PersonalAttendanceLocationConfigMapper extends BaseMapper<PersonalAttendanceLocationConfig> { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.staff.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.staff.dto.PersonalAttendanceRecordsDto; |
| | | import com.ruoyi.staff.dto.StaffOnJobDto; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-02-09 01:20:07 |
| | | */ |
| | | @Mapper |
| | | public interface PersonalAttendanceRecordsMapper extends BaseMapper<PersonalAttendanceRecords> { |
| | | IPage<PersonalAttendanceRecordsDto> listPage(Page page, @Param("params") PersonalAttendanceRecordsDto personalAttendanceRecordsDto); |
| | | |
| | | List<StaffOnJob> selectStaffWithoutAttendanceRecordBeforeTime(@Param("date") LocalDate date, @Param("entryDeadline") LocalDateTime entryDeadline); |
| | | |
| | | boolean existsAttendanceRecord(@Param("staffOnJobId") Long staffOnJobId, @Param("date") LocalDate date); |
| | | } |
| | |
| | | |
| | | /** |
| | | * ç»è®¡æå®æ¥æçå¨èåå·¥æ° |
| | | * |
| | | * @param date æ¥æ |
| | | * @return å¨èåå·¥æ° |
| | | */ |
| | |
| | | |
| | | /** |
| | | * ç»è®¡æå®æä»½çæ°å
¥èåå·¥æ° |
| | | * |
| | | * @param monthStart æä»½å¼å§æ¥æ |
| | | * @param monthEnd æä»½ç»ææ¥æ |
| | | * @param monthEnd æä»½ç»ææ¥æ |
| | | * @return æ°å
¥èåå·¥æ° |
| | | */ |
| | | Integer countNewHireByMonth(@Param("monthStart") LocalDate monthStart, @Param("monthEnd") LocalDate monthEnd); |
| | | |
| | | /** |
| | | * æ ¹æ®åå·¥å§åæ¥è¯¢åå·¥ä¿¡æ¯ |
| | | * |
| | | * @param staffName åå·¥å§å |
| | | * @return åå·¥æ°æ® |
| | | */ |
| | | StaffOnJob selectStaffByNickName(String staffName); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * <p> |
| | | * 人åæå¡è§åé
ç½® |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-02-11 09:41:34 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("personal_attendance_location_config") |
| | | @ApiModel(value = "PersonalAttendanceLocationConfig对象", description = "人åæå¡è§åé
ç½®") |
| | | public class PersonalAttendanceLocationConfig implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("é¨é¨id") |
| | | private Integer sysDeptId; |
| | | |
| | | @ApiModelProperty("å°ç¹åç§°") |
| | | private String locationName; |
| | | |
| | | @ApiModelProperty("ç»åº¦") |
| | | private Double longitude; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | private Double latitude; |
| | | |
| | | @ApiModelProperty("æå¡èå´") |
| | | private Double radius; |
| | | |
| | | @ApiModelProperty("ä¸çæ¶é´") |
| | | @JsonFormat(pattern = "HH:mm") |
| | | @DateTimeFormat(pattern = "HH:mm") |
| | | private LocalTime startAt; |
| | | |
| | | @ApiModelProperty("ä¸çæ¶é´") |
| | | @JsonFormat(pattern = "HH:mm") |
| | | @DateTimeFormat(pattern = "HH:mm") |
| | | private LocalTime endAt; |
| | | } |
| | |
| | | package com.ruoyi.staff.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalTime; |
| | | |
| | | @Data |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-02-09 01:20:07 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("personal_attendance_records") |
| | | @ApiModel(value = "PersonalAttendanceRecords对象", description = "") |
| | | public class PersonalAttendanceRecords implements Serializable { |
| | | /** |
| | | * åºå· |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * æ¥æ |
| | | */ |
| | | |
| | | @ApiModelProperty("åå·¥å¨èid") |
| | | private Long staffOnJobId; |
| | | |
| | | @ApiModelProperty("æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "æ¥æ", sort = 1, dateFormat = "yyyy-MM-dd") |
| | | private LocalDate date; |
| | | /** |
| | | * ç¾å°æ¶é´ |
| | | */ |
| | | |
| | | @ApiModelProperty("å·¥ä½å¼å§æ¶é´") |
| | | @JsonFormat(pattern = "HH:mm") |
| | | @DateTimeFormat(pattern = "HH:mm") |
| | | private LocalTime checkIn; |
| | | /** |
| | | * ç¾éæ¶é´ |
| | | */ |
| | | @Excel(name = "ä¸çæ¶é´", sort = 5, dateFormat = "HH:mm") |
| | | private LocalDateTime workStartAt; |
| | | |
| | | @ApiModelProperty("å·¥ä½ç»ææ¶é´") |
| | | @JsonFormat(pattern = "HH:mm") |
| | | @DateTimeFormat(pattern = "HH:mm") |
| | | private LocalTime checkOut; |
| | | /** |
| | | * 工使¶é¿ |
| | | */ |
| | | private String workHours; |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | private String status; |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @Excel(name = "ä¸çæ¶é´", sort = 6, dateFormat = "HH:mm") |
| | | private LocalDateTime workEndAt; |
| | | |
| | | @ApiModelProperty("工使¶é¿") |
| | | @Excel(name = "å·¥æ¶(å°æ¶)", sort = 7) |
| | | private BigDecimal workHours; |
| | | |
| | | @ApiModelProperty("ç¶æ 0æ£å¸¸ 1è¿å° 2æ©é 3è¿å°æ©é 4缺å¤") |
| | | @Excel(name = "ç¶æ", sort = 8,readConverterExp = "0=æ£å¸¸,1=è¿å°,2=æ©é,3=è¿å°ãæ©é,4=缺å¤") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("夿³¨") |
| | | @Excel(name = "夿³¨", sort = 9) |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("ç§æ·id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | @ApiModelProperty("å½å
¥æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | } |
| | |
| | | /** |
| | | * é¨é¨ |
| | | */ |
| | | private Integer sysDeptId; |
| | | private Long sysDeptId; |
| | | |
| | | /** |
| | | * å®¶åºä½å |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.service; |
| | | |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceLocationConfig; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 人åæå¡è§åé
ç½® æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-02-11 09:41:34 |
| | | */ |
| | | public interface PersonalAttendanceLocationConfigService extends IService<PersonalAttendanceLocationConfig> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.staff.dto.PersonalAttendanceRecordsDto; |
| | | import com.ruoyi.staff.dto.StaffOnJobDto; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-02-09 01:20:07 |
| | | */ |
| | | public interface PersonalAttendanceRecordsService extends IService<PersonalAttendanceRecords> { |
| | | IPage listPage(Page page, PersonalAttendanceRecords personalAttendanceRecords); |
| | | IPage<PersonalAttendanceRecordsDto> listPage(Page page, PersonalAttendanceRecordsDto personalAttendanceRecordsDto); |
| | | |
| | | int add(PersonalAttendanceRecordsDto personalAttendanceRecordsDto); |
| | | |
| | | PersonalAttendanceRecordsDto todayInfo(PersonalAttendanceRecordsDto personalAttendanceRecordsDto); |
| | | |
| | | void export(HttpServletResponse response, PersonalAttendanceRecordsDto personalAttendanceRecordsDto); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceLocationConfig; |
| | | import com.ruoyi.staff.mapper.PersonalAttendanceLocationConfigMapper; |
| | | import com.ruoyi.staff.service.PersonalAttendanceLocationConfigService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 人åæå¡è§åé
ç½® æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-02-11 09:41:34 |
| | | */ |
| | | @Service |
| | | public class PersonalAttendanceLocationConfigServiceImpl extends ServiceImpl<PersonalAttendanceLocationConfigMapper, PersonalAttendanceLocationConfig> implements PersonalAttendanceLocationConfigService { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.staff.mapper.PersonalAttendanceRecordsMapper; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.mapper.SysDeptMapper; |
| | | import com.ruoyi.project.system.service.ISysDictDataService; |
| | | import com.ruoyi.staff.dto.PersonalAttendanceRecordsDto; |
| | | import com.ruoyi.staff.dto.StaffOnJobDto; |
| | | import com.ruoyi.staff.mapper.PersonalAttendanceLocationConfigMapper; |
| | | import com.ruoyi.staff.mapper.StaffOnJobMapper; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceLocationConfig; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.ruoyi.staff.mapper.PersonalAttendanceRecordsMapper; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import com.ruoyi.staff.service.PersonalAttendanceRecordsService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.staff.task.PersonalAttendanceRecordsTask; |
| | | import com.ruoyi.staff.utils.LocationUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-02-09 01:20:07 |
| | | */ |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class PersonalAttendanceRecordsServiceImpl extends ServiceImpl<PersonalAttendanceRecordsMapper, PersonalAttendanceRecords> implements PersonalAttendanceRecordsService { |
| | | @Autowired |
| | | private PersonalAttendanceRecordsMapper personalAttendanceRecordsMapper; |
| | | |
| | | @Autowired |
| | | private StaffOnJobMapper staffOnJobMapper; |
| | | |
| | | @Autowired |
| | | private PersonalAttendanceLocationConfigMapper personalAttendanceLocationConfigMapper; |
| | | |
| | | @Autowired |
| | | private ISysDictDataService dictDataService; |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | | |
| | | @Override |
| | | public IPage listPage(Page page, PersonalAttendanceRecords personalAttendanceRecords) { |
| | | // return personalAttendanceRecordsMapper.ListPage(page, personalAttendanceRecords); |
| | | return baseMapper.selectPage(page, new QueryWrapper<>(personalAttendanceRecords)); |
| | | public int add(PersonalAttendanceRecordsDto personalAttendanceRecordsDto) { |
| | | // å½åæ¶é´ |
| | | LocalDate currentDate = LocalDate.now(); |
| | | LocalDateTime currentDateTime = LocalDateTime.now(); |
| | | /*æ¥è¯¢å工信æ¯*/ |
| | | QueryWrapper<StaffOnJob> staffQueryWrapper = new QueryWrapper<>(); |
| | | staffQueryWrapper.eq("staff_no", SecurityUtils.getUsername()); |
| | | staffQueryWrapper.eq("staff_state", 1);//å¨è |
| | | StaffOnJob staffOnJob = staffOnJobMapper.selectOne(staffQueryWrapper); |
| | | if (staffOnJob == null) { |
| | | throw new BaseException("å½åç¨æ·æ²¡æå¯¹åºçå工信æ¯"); |
| | | } |
| | | /*夿æå¡ä½ç½®æ¯å¦å¨è§åèå´å
*/ |
| | | List<PersonalAttendanceLocationConfig> personalAttendanceLocationConfigs = personalAttendanceLocationConfigMapper.selectList(Wrappers.<PersonalAttendanceLocationConfig>lambdaQuery() |
| | | .eq(PersonalAttendanceLocationConfig::getSysDeptId, staffOnJob.getSysDeptId()) |
| | | .orderByDesc(PersonalAttendanceLocationConfig::getId)); |
| | | if (personalAttendanceLocationConfigs == null || personalAttendanceLocationConfigs.isEmpty()) { |
| | | throw new BaseException("å½åé¨é¨æ²¡æè®¾ç½®æå¡è§å"); |
| | | } |
| | | Double punchLongitude = personalAttendanceRecordsDto.getLongitude(); //æå¡çç»åº¦ |
| | | Double punchLatitude = personalAttendanceRecordsDto.getLatitude(); // æå¡ç纬度 |
| | | if (punchLongitude == null || punchLatitude == null) { |
| | | throw new BaseException("æå¡å¤±è´¥ï¼æªè·åå°æ¨çä½ç½®ä¿¡æ¯ï¼è¯·å¼å¯å®ä½æé"); |
| | | } |
| | | //è®¡ç®æå¡ä½ç½®ä¸èå¤ç¹çè·ç¦» |
| | | PersonalAttendanceLocationConfig locationConfig = personalAttendanceLocationConfigs.get(0);//è·åææ°ç䏿¡æ°æ® |
| | | double allowedRadius = locationConfig.getRadius(); // å
许çèå´ï¼ç±³ï¼ |
| | | double actualDistance = LocationUtils.calculateDistance( |
| | | punchLatitude, punchLongitude, // åå·¥æå¡çç»çº¬åº¦ |
| | | locationConfig.getLatitude(), locationConfig.getLongitude() // èå¤ç¹çç»çº¬åº¦ |
| | | ); |
| | | //夿æ¯å¦å¨èå´å
|
| | | if (actualDistance > allowedRadius) { |
| | | throw new BaseException(String.format("æå¡å¤±è´¥ï¼æ¨å½åä½ç½®è·ç¦»èå¤ç¹%.2fç±³ï¼è¶
åºå
许èå´ï¼%sç±³ï¼", actualDistance, allowedRadius)); |
| | | } |
| | | /*夿æå¡æ¶é´*/ |
| | | // æ ¹æ®åå·¥IDåå½åæ¥ææ¥è¯¢æå¡è®°å½ |
| | | QueryWrapper<PersonalAttendanceRecords> attendanceQueryWrapper = new QueryWrapper<>(); |
| | | attendanceQueryWrapper.eq("staff_on_job_id", staffOnJob.getId()) |
| | | .eq("date", currentDate); |
| | | PersonalAttendanceRecords attendanceRecord = personalAttendanceRecordsMapper.selectOne(attendanceQueryWrapper); |
| | | // æ ¹æ®è夿¶é´å¤æè¿å°æ©é |
| | | if (attendanceRecord == null) { |
| | | // ä¸å卿å¡è®°å½ï¼å建æ°è®°å½ |
| | | PersonalAttendanceRecords personalAttendanceRecords = new PersonalAttendanceRecords(); |
| | | personalAttendanceRecords.setStaffOnJobId(staffOnJob.getId()); |
| | | personalAttendanceRecords.setDate(currentDate); |
| | | personalAttendanceRecords.setWorkStartAt(currentDateTime); |
| | | personalAttendanceRecords.setStatus(determineAttendanceStatus(personalAttendanceRecords, true,locationConfig)); |
| | | personalAttendanceRecords.setRemark(personalAttendanceRecords.getRemark()); |
| | | personalAttendanceRecords.setTenantId(staffOnJob.getTenantId()); |
| | | return personalAttendanceRecordsMapper.insert(personalAttendanceRecords); |
| | | } else { |
| | | if (attendanceRecord.getWorkEndAt() == null) { |
| | | // æ´æ°å·¥ä½ç»ææ¶é´å工使¶é¿ |
| | | attendanceRecord.setWorkEndAt(currentDateTime); |
| | | // 计ç®å·¥ä½æ¶é¿ï¼ç²¾ç¡®å°åéï¼ä¿ç2ä½å°æ°ï¼ |
| | | LocalDateTime startTime = attendanceRecord.getWorkStartAt(); |
| | | LocalDateTime endTime = attendanceRecord.getWorkEndAt(); |
| | | // 计ç®ä¸¤ä¸ªæ¶é´ä¹é´çåéæ° |
| | | long totalMinutes = java.time.Duration.between(startTime, endTime).toMinutes(); |
| | | BigDecimal workHours = BigDecimal.valueOf(totalMinutes) |
| | | .divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); |
| | | attendanceRecord.setWorkHours(workHours); |
| | | // æ´æ°èå¤ç¶æ |
| | | attendanceRecord.setStatus(determineAttendanceStatus(attendanceRecord, false,locationConfig)); |
| | | return personalAttendanceRecordsMapper.updateById(attendanceRecord); |
| | | } else { |
| | | throw new BaseException("æ¨å·²ç»æè¿å¡äº,æ éé夿å¡!!!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ ¹æ®å®é
æ¶é´åæ¯å¦ä¸çæ¶é´å¤æèå¤ç¶æ |
| | | // 0 æ£å¸¸ 1 è¿å° 2 æ©é 3 è¿å°æ©é 4 ç¼ºå¤ |
| | | private Integer determineAttendanceStatus(PersonalAttendanceRecords attendanceRecord, boolean isStart,PersonalAttendanceLocationConfig locationConfig) { |
| | | //夿æ¯ä¸çæå¡è¿æ¯ä¸çæå¡ |
| | | LocalDateTime actualTime = isStart ? attendanceRecord.getWorkStartAt() : attendanceRecord.getWorkEndAt(); |
| | | try { |
| | | // è·åè夿¶é´é
ç½® |
| | | LocalTime startAt = locationConfig.getStartAt();//ä¸çæ¶é´ |
| | | LocalTime endAt = locationConfig.getEndAt();//ä¸çæ¶é´ |
| | | LocalTime timeConfig = isStart ? startAt : endAt; |
| | | // è§£æå°æ¶ååé |
| | | int standardHour = timeConfig.getHour(); |
| | | int standardMinute = timeConfig.getMinute(); |
| | | // è·åå®é
æ¶é´çæ¶å |
| | | int actualHour = actualTime.getHour(); |
| | | int actualMinute = actualTime.getMinute(); |
| | | // å¤æç¶æ |
| | | if (isStart) { |
| | | // ä¸çæå¡ï¼è¶
è¿æ åæ¶é´ç®è¿å° |
| | | if (actualHour > standardHour || (actualHour == standardHour && actualMinute > standardMinute)) { |
| | | return 1; // è¿å° |
| | | } |
| | | } else { |
| | | // ä¸çæå¡ï¼æ©äºæ åæ¶é´ç®æ©é |
| | | if (actualHour < standardHour || (actualHour == standardHour && actualMinute < standardMinute)) { |
| | | if (attendanceRecord.getStatus() == 1) { |
| | | return 3; // è¿å°æ©é |
| | | } |
| | | return 2; // æ©é |
| | | }else if (attendanceRecord.getStatus() == 1) { |
| | | return 1; // ä¸çæå¡æ£å¸¸ä½æ¯ä¸çè¿å° |
| | | } |
| | | } |
| | | return 0; // æ£å¸¸ |
| | | } catch (Exception e) { |
| | | // 妿è·åé
置失败ï¼é»è®¤è¿åæ£å¸¸ç¶æ |
| | | log.warn("è·åè夿¶é´é
置失败ï¼ä½¿ç¨é»è®¤ç¶æï¼" + e.getMessage()); |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public IPage<PersonalAttendanceRecordsDto> listPage(Page page, PersonalAttendanceRecordsDto personalAttendanceRecordsDto) { |
| | | boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId()); |
| | | if (!admin) { |
| | | QueryWrapper<StaffOnJob> staffQueryWrapper = new QueryWrapper<>(); |
| | | staffQueryWrapper.eq("staff_no", SecurityUtils.getUsername()); |
| | | staffQueryWrapper.eq("staff_state", 1);//å¨è |
| | | StaffOnJob staffOnJob = staffOnJobMapper.selectOne(staffQueryWrapper); |
| | | if (staffOnJob == null) { |
| | | return new Page<>(page.getCurrent(), page.getSize(), 0); |
| | | } |
| | | personalAttendanceRecordsDto.setStaffOnJobId(staffOnJob.getId()); |
| | | } |
| | | |
| | | return personalAttendanceRecordsMapper.listPage(page,personalAttendanceRecordsDto); |
| | | } |
| | | |
| | | @Override |
| | | public PersonalAttendanceRecordsDto todayInfo(PersonalAttendanceRecordsDto personalAttendanceRecordsDto) { |
| | | // è·åå½åæ¥æ |
| | | LocalDate currentDate = LocalDate.now(); |
| | | |
| | | // é¦å
æ ¹æ®ç¨æ·IDæ¥è¯¢åå·¥ä¿¡æ¯ |
| | | QueryWrapper<StaffOnJob> staffQueryWrapper = new QueryWrapper<>(); |
| | | staffQueryWrapper.eq("staff_no", SecurityUtils.getUsername()); |
| | | staffQueryWrapper.eq("staff_state", 1);//å¨è |
| | | StaffOnJob staffOnJob = staffOnJobMapper.selectOne(staffQueryWrapper); |
| | | |
| | | if (staffOnJob == null) { |
| | | throw new BaseException("å½åç¨æ·æ²¡æå¯¹åºçå工信æ¯"); |
| | | } |
| | | |
| | | // æ ¹æ®åå·¥IDåå½åæ¥ææ¥è¯¢æå¡è®°å½ |
| | | QueryWrapper<PersonalAttendanceRecords> attendanceQueryWrapper = new QueryWrapper<>(); |
| | | attendanceQueryWrapper.eq("staff_on_job_id", staffOnJob.getId()) |
| | | .eq("date", currentDate); |
| | | PersonalAttendanceRecords attendanceRecord = personalAttendanceRecordsMapper.selectOne(attendanceQueryWrapper); |
| | | |
| | | // è¿ååæ° |
| | | PersonalAttendanceRecordsDto resultDto = new PersonalAttendanceRecordsDto(); |
| | | |
| | | if (attendanceRecord != null) { |
| | | // 妿ææå¡è®°å½ï¼å¤å¶æå¡è®°å½ä¿¡æ¯ |
| | | BeanUtils.copyProperties(attendanceRecord, resultDto); |
| | | } |
| | | |
| | | // åå·¥ç¸å
³ä¿¡æ¯ |
| | | resultDto.setStaffName(staffOnJob.getStaffName()); |
| | | resultDto.setStaffNo(staffOnJob.getStaffNo()); |
| | | resultDto.setDeptId(staffOnJob.getSysDeptId() != null ? staffOnJob.getSysDeptId() : null); |
| | | SysDept dept = sysDeptMapper.selectDeptById(staffOnJob.getSysDeptId()); |
| | | resultDto.setDeptName(dept != null ? dept.getDeptName() : null); |
| | | //è·å该å工对åºçæå¡è§å |
| | | List<PersonalAttendanceLocationConfig> personalAttendanceLocationConfigs = personalAttendanceLocationConfigMapper.selectList(Wrappers.<PersonalAttendanceLocationConfig>lambdaQuery() |
| | | .eq(PersonalAttendanceLocationConfig::getSysDeptId, staffOnJob.getSysDeptId()) |
| | | .orderByDesc(PersonalAttendanceLocationConfig::getId)); |
| | | if (personalAttendanceLocationConfigs.size()>0){ |
| | | resultDto.setStartAt(personalAttendanceLocationConfigs.get(0).getStartAt()); |
| | | resultDto.setEndAt(personalAttendanceLocationConfigs.get(0).getEndAt()); |
| | | } |
| | | return resultDto; |
| | | } |
| | | |
| | | @Override |
| | | public void export(HttpServletResponse response, PersonalAttendanceRecordsDto personalAttendanceRecordsDto) { |
| | | boolean admin = SecurityUtils.isAdmin(SecurityUtils.getUserId()); |
| | | if (!admin) { |
| | | QueryWrapper<StaffOnJob> staffQueryWrapper = new QueryWrapper<>(); |
| | | staffQueryWrapper.eq("staff_no", SecurityUtils.getUsername()); |
| | | staffQueryWrapper.eq("staff_state", 1);//å¨è |
| | | StaffOnJob staffOnJob = staffOnJobMapper.selectOne(staffQueryWrapper); |
| | | if (staffOnJob == null) { |
| | | throw new ServiceException("没æå工信æ¯ï¼æ æ³å¯¼åºèå¤è®°å½"); |
| | | } |
| | | personalAttendanceRecordsDto.setStaffOnJobId(staffOnJob.getId()); |
| | | } |
| | | List<PersonalAttendanceRecordsDto> personalAttendanceRecords = personalAttendanceRecordsMapper.listPage(new Page<>(1, Integer.MAX_VALUE), personalAttendanceRecordsDto).getRecords(); |
| | | ExcelUtil<PersonalAttendanceRecordsDto> util = new ExcelUtil<PersonalAttendanceRecordsDto>(PersonalAttendanceRecordsDto.class); |
| | | util.exportExcel(response, personalAttendanceRecords, "èå¤è®°å½å¯¼åº"); |
| | | } |
| | | } |
| | |
| | | public void staffOnJobExport(HttpServletResponse response, StaffOnJob staffOnJob) { |
| | | List<StaffOnJobDto> staffOnJobs = staffOnJobMapper.staffOnJobList(staffOnJob); |
| | | ExcelUtil<StaffOnJobDto> util = new ExcelUtil<StaffOnJobDto>(StaffOnJobDto.class); |
| | | util.exportExcel(response, staffOnJobs, "å¨èåå·¥å°è´¦å¯¼åº"); |
| | | util.exportExcel(response, staffOnJobs, "åå·¥å°è´¦å¯¼åº"); |
| | | } |
| | | |
| | | @Override |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.task; |
| | | |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import com.ruoyi.staff.service.PersonalAttendanceRecordsService; |
| | | import com.ruoyi.staff.mapper.PersonalAttendanceRecordsMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 个人èå¤è®°å½å®æ¶ä»»å¡ |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-02-09 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class PersonalAttendanceRecordsTask { |
| | | |
| | | @Autowired |
| | | private PersonalAttendanceRecordsMapper personalAttendanceRecordsMapper; |
| | | |
| | | @Autowired |
| | | private PersonalAttendanceRecordsService personalAttendanceRecordsService; |
| | | |
| | | /** |
| | | * æ¯å¤©åæ¨çææ¨æ¥ç缺å¤è®°å½ |
| | | * 宿¶ä»»å¡ï¼æ¯å¤©åæ¨1ç¹æ§è¡ |
| | | * æé¤ä»å¤©åå
¥èçåå·¥ |
| | | */ |
| | | @Scheduled(cron = "0 0 1 * * ?") |
| | | public void generateAbsenceRecords() { |
| | | try { |
| | | // è·åæ¨æ¥æ¥æ |
| | | LocalDate yesterday = LocalDate.now().minusDays(1); |
| | | |
| | | // ç´æ¥æ¥è¯¢æ¨å¤©æ²¡æèå¤è®°å½çå¨èåå·¥ï¼æé¤ä»å¤©åå
¥èçï¼ |
| | | LocalDateTime todayStart = LocalDate.now().atStartOfDay(); |
| | | List<StaffOnJob> staffWithoutAttendance = personalAttendanceRecordsMapper.selectStaffWithoutAttendanceRecordBeforeTime(yesterday, todayStart); |
| | | |
| | | // éåæ²¡æèå¤è®°å½çåå·¥ï¼çæç¼ºå¤è®°å½ |
| | | for (StaffOnJob staff : staffWithoutAttendance) { |
| | | try { |
| | | boolean exists = personalAttendanceRecordsMapper.existsAttendanceRecord(staff.getId(), yesterday); |
| | | if (exists) { |
| | | continue; |
| | | } |
| | | |
| | | PersonalAttendanceRecords absenceRecord = new PersonalAttendanceRecords(); |
| | | absenceRecord.setStaffOnJobId(staff.getId()); |
| | | absenceRecord.setDate(yesterday); |
| | | absenceRecord.setStatus(4); // è®¾ç½®ç¶æä¸ºç¼ºå¤ |
| | | absenceRecord.setRemark("ç³»ç»èªå¨çæ-缺å¤"); |
| | | absenceRecord.setCreateTime(LocalDateTime.now()); |
| | | absenceRecord.setUpdateTime(LocalDateTime.now()); |
| | | absenceRecord.setTenantId(staff.getTenantId()); |
| | | personalAttendanceRecordsService.save(absenceRecord); |
| | | |
| | | } catch (Exception e) { |
| | | log.error("为åå·¥{}çæç¼ºå¤è®°å½å¤±è´¥ï¼{}", staff.getStaffName(), e.getMessage(), e); |
| | | } |
| | | } |
| | | |
| | | log.info("æ¨æ¥ç¼ºå¤è®°å½çæå®æ"); |
| | | } catch (Exception e) { |
| | | log.error("çææ¨æ¥ç¼ºå¤è®°å½ä»»å¡æ§è¡å¤±è´¥ï¼{}", e.getMessage(), e); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.utils; |
| | | |
| | | // å·¥å
·ç±»ï¼è®¡ç®ä¸¤ä¸ªç»çº¬åº¦ä¹é´çè·ç¦»ï¼çé¢è·ç¦»ï¼ |
| | | public class LocationUtils { |
| | | private static final double EARTH_RADIUS = 6371000; // å°çåå¾ï¼åä½ç±³ |
| | | |
| | | /** |
| | | * 计ç®ä¸¤ä¸ªç»çº¬åº¦ä¹é´çè·ç¦»ï¼ç±³ï¼ |
| | | * @param lat1 第ä¸ä¸ªç¹çº¬åº¦ |
| | | * @param lon1 第ä¸ä¸ªç¹ç»åº¦ |
| | | * @param lat2 第äºä¸ªç¹çº¬åº¦ |
| | | * @param lon2 第äºä¸ªç¹ç»åº¦ |
| | | * @return è·ç¦»ï¼ç±³ï¼ |
| | | */ |
| | | public static double calculateDistance(double lat1, double lon1, double lat2, double lon2) { |
| | | // 转弧度 |
| | | double radLat1 = Math.toRadians(lat1); |
| | | double radLon1 = Math.toRadians(lon1); |
| | | double radLat2 = Math.toRadians(lat2); |
| | | double radLon2 = Math.toRadians(lon2); |
| | | |
| | | // å·®å¼ |
| | | double deltaLat = radLat1 - radLat2; |
| | | double deltaLon = radLon1 - radLon2; |
| | | |
| | | // çé¢è·ç¦»å
¬å¼ |
| | | double distance = 2 * Math.asin(Math.sqrt( |
| | | Math.pow(Math.sin(deltaLat / 2), 2) + |
| | | Math.cos(radLat1) * Math.cos(radLat2) * |
| | | Math.pow(Math.sin(deltaLon / 2), 2) |
| | | )); |
| | | distance = distance * EARTH_RADIUS; |
| | | // ä¿ç两ä½å°æ° |
| | | distance = Math.round(distance * 100) / 100.0; |
| | | return distance; |
| | | } |
| | | } |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | BigDecimal selectTotal(); |
| | | |
| | | int selectStorageProductCountByDate(@Param("startDate") String startDate, @Param("endDate") String endDate); |
| | | int selectStorageProductCountByDate(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate); |
| | | |
| | | List<Map<String, Object>> selectDailyStockInCounts(@Param("rootCategoryId") Long rootCategoryId, @Param("startDate") String startDate, @Param("endDate") String endDate); |
| | | |
| | | List<Map<String, Object>> selectDailyStockOutCounts(@Param("rootCategoryId") Long rootCategoryId, @Param("startDate") String startDate, @Param("endDate") String endDate); |
| | | |
| | | BigDecimal selectTotalByDate( @Param("now") LocalDate now); |
| | | BigDecimal selectTotalByDate(@Param("now") LocalDate now); |
| | | } |
| | |
| | | captchaType: math |
| | | # åå审æ¹ç¼å·åç¼(é
ç½®æä»¶åç¼å½å) |
| | | approvalNumberPrefix: DEV |
| | | |
| | | # ä¸ªæ¨ Unipush é
ç½® |
| | | getui: |
| | | appId: PfjyAAE0FK64FaO1w2CMb1 |
| | | appKey: zTMb831OEL6J4GK1uE3Ob4 |
| | | masterSecret: K1GFtsv42v61tXGnF7SGE5 |
| | | domain: https://restapi.getui.cn/v2/ |
| | | # 离线æ¨é使ç¨çå
å/ç»ä»¶å |
| | | intentComponent: uni.app.UNI099A590/io.dcloud.PandoraEntry |
| | | |
| | | # å¼åç¯å¢é
ç½® |
| | | server: |
| | | # æå¡å¨çHTTP端å£ï¼é»è®¤ä¸º8080 |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # 项ç®ç¸å
³é
ç½® |
| | | ruoyi: |
| | | # åç§° |
| | | name: RuoYi |
| | | # çæ¬ |
| | | version: 3.8.9 |
| | | # çæå¹´ä»½ |
| | | copyrightYear: 2025 |
| | | # æä»¶è·¯å¾ 示ä¾ï¼ Windowsé
ç½®D:/ruoyi/uploadPathï¼Linuxé
ç½® /home/ruoyi/uploadPathï¼ |
| | | profile: /javaWork/product-inventory-management/file |
| | | |
| | | # è·åipå°åå¼å
³ |
| | | addressEnabled: false |
| | | # éªè¯ç ç±»å math æ°åè®¡ç® char å符éªè¯ |
| | | captchaType: math |
| | | # åå审æ¹ç¼å·åç¼(é
ç½®æä»¶åç¼å½å) |
| | | approvalNumberPrefix: KHL |
| | | # å¼åç¯å¢é
ç½® |
| | | server: |
| | | # æå¡å¨çHTTP端å£ï¼é»è®¤ä¸º8080 |
| | | port: 9214 |
| | | servlet: |
| | | # åºç¨ç访é®è·¯å¾ |
| | | context-path: / |
| | | tomcat: |
| | | # tomcatçURIç¼ç |
| | | uri-encoding: UTF-8 |
| | | # è¿æ¥æ°æ»¡åçæéæ°ï¼é»è®¤ä¸º100 |
| | | accept-count: 1000 |
| | | threads: |
| | | # tomcatæå¤§çº¿ç¨æ°ï¼é»è®¤ä¸º200 |
| | | max: 800 |
| | | # Tomcatå¯å¨åå§åççº¿ç¨æ°ï¼é»è®¤å¼10 |
| | | min-spare: 100 |
| | | |
| | | # æ¥å¿é
ç½® |
| | | logging: |
| | | level: |
| | | com.ruoyi: warn |
| | | org.springframework: warn |
| | | |
| | | minio: |
| | | endpoint: http://114.132.189.42/ |
| | | port: 7019 |
| | | secure: false |
| | | accessKey: admin |
| | | secretKey: 12345678 |
| | | preview-expiry: 24 # é¢è§å°åé»è®¤24å°æ¶ |
| | | default-bucket: jxc |
| | | # ç¨æ·é
ç½® |
| | | user: |
| | | password: |
| | | # å¯ç æå¤§éè¯¯æ¬¡æ° |
| | | maxRetryCount: 5 |
| | | # å¯ç é宿¶é´ï¼é»è®¤10åéï¼ |
| | | lockTime: 10 |
| | | |
| | | # Springé
ç½® |
| | | spring: |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | druid: |
| | | # ä¸»åºæ°æ®æº |
| | | master: |
| | | url: jdbc:mysql://172.17.0.1:3306/product-inventory-management-khlnew?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: xd@123456.. |
| | | # ä»åºæ°æ®æº |
| | | slave: |
| | | # 仿°æ®æºå¼å
³/é»è®¤å
³é |
| | | enabled: false |
| | | url: |
| | | username: |
| | | password: |
| | | # åå§è¿æ¥æ° |
| | | initialSize: 5 |
| | | # æå°è¿æ¥æ± æ°é |
| | | minIdle: 10 |
| | | # æå¤§è¿æ¥æ± æ°é |
| | | maxActive: 20 |
| | | # é
ç½®è·åè¿æ¥çå¾
è¶
æ¶çæ¶é´ |
| | | maxWait: 60000 |
| | | # é
ç½®è¿æ¥è¶
æ¶æ¶é´ |
| | | connectTimeout: 30000 |
| | | # é
ç½®ç½ç»è¶
æ¶æ¶é´ |
| | | socketTimeout: 60000 |
| | | # é
ç½®é´éå¤ä¹
æè¿è¡ä¸æ¬¡æ£æµï¼æ£æµéè¦å
³éç空é²è¿æ¥ï¼å使¯æ¯«ç§ |
| | | timeBetweenEvictionRunsMillis: 60000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿å°çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | minEvictableIdleTimeMillis: 300000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿大çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | maxEvictableIdleTimeMillis: 900000 |
| | | # é
ç½®æ£æµè¿æ¥æ¯å¦ææ |
| | | validationQuery: SELECT 1 FROM DUAL |
| | | testWhileIdle: true |
| | | testOnBorrow: false |
| | | testOnReturn: false |
| | | webStatFilter: |
| | | enabled: true |
| | | statViewServlet: |
| | | enabled: true |
| | | # 设置ç½ååï¼ä¸å¡«åå
许ææè®¿é® |
| | | allow: |
| | | url-pattern: /druid/* |
| | | # æ§å¶å°ç®¡çç¨æ·ååå¯ç |
| | | login-username: ruoyi |
| | | login-password: 123456 |
| | | filter: |
| | | stat: |
| | | enabled: true |
| | | # æ
¢SQLè®°å½ |
| | | log-slow-sql: true |
| | | slow-sql-millis: 1000 |
| | | merge-sql: true |
| | | wall: |
| | | config: |
| | | multi-statement-allow: true |
| | | # èµæºä¿¡æ¯ |
| | | messages: |
| | | # å½é
åèµæºæä»¶è·¯å¾ |
| | | basename: i18n/messages |
| | | # æä»¶ä¸ä¼ |
| | | servlet: |
| | | multipart: |
| | | # å个æä»¶å¤§å° |
| | | max-file-size: 1GB |
| | | # 设置æ»ä¸ä¼ çæä»¶å¤§å° |
| | | max-request-size: 2GB |
| | | # æå¡æ¨¡å |
| | | devtools: |
| | | restart: |
| | | # çé¨ç½²å¼å
³ |
| | | enabled: false |
| | | # redis é
ç½® |
| | | redis: |
| | | # å°å |
| | | # host: 127.0.0.1 |
| | | host: 172.17.0.1 |
| | | # 端å£ï¼é»è®¤ä¸º6379 |
| | | port: 6380 |
| | | # æ°æ®åºç´¢å¼ |
| | | database: 0 |
| | | # å¯ç |
| | | # password: root2022! |
| | | password: |
| | | |
| | | # è¿æ¥è¶
æ¶æ¶é´ |
| | | timeout: 10s |
| | | lettuce: |
| | | pool: |
| | | # è¿æ¥æ± ä¸çæå°ç©ºé²è¿æ¥ |
| | | min-idle: 0 |
| | | # è¿æ¥æ± ä¸çæå¤§ç©ºé²è¿æ¥ |
| | | max-idle: 8 |
| | | # è¿æ¥æ± çæå¤§æ°æ®åºè¿æ¥æ° |
| | | max-active: 8 |
| | | # #è¿æ¥æ± æå¤§é»å¡çå¾
æ¶é´ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | max-wait: -1ms |
| | | |
| | | # Quartz宿¶ä»»å¡é
ç½®ï¼æ°å¢é¨åï¼ |
| | | quartz: |
| | | job-store-type: jdbc # ä½¿ç¨æ°æ®åºåå¨ |
| | | jdbc: |
| | | initialize-schema: never # 馿¬¡è¿è¡æ¶èªå¨åå»ºè¡¨ç»æï¼æååæ¹ä¸ºnever |
| | | schema: classpath:org/quartz/impl/jdbcjobstore/tables_mysql_innodb.sql # MySQLè¡¨ç»æèæ¬ |
| | | properties: |
| | | org: |
| | | quartz: |
| | | scheduler: |
| | | instanceName: RuoYiScheduler |
| | | instanceId: AUTO |
| | | jobStore: |
| | | class: org.quartz.impl.jdbcjobstore.JobStoreTX |
| | | driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate # MySQLéé
|
| | | tablePrefix: qrtz_ # 表ååç¼ï¼ä¸èæ¬ä¸è´ |
| | | isClustered: false # åèç¹æ¨¡å¼ï¼éç¾¤éæ¹ä¸ºtrueï¼ |
| | | clusterCheckinInterval: 10000 |
| | | txIsolationLevelSerializable: true |
| | | threadPool: |
| | | class: org.quartz.simpl.SimpleThreadPool |
| | | threadCount: 10 # çº¿ç¨æ± å¤§å° |
| | | threadPriority: 5 |
| | | makeThreadsDaemons: true |
| | | updateCheck: false # å
³éçæ¬æ£æ¥ |
| | | # tokené
ç½® |
| | | token: |
| | | # 令çèªå®ä¹æ è¯ |
| | | header: Authorization |
| | | # 令çå¯é¥ |
| | | secret: abcdefghijklmnopqrstuvwxyz |
| | | # ä»¤çæææï¼é»è®¤30åéï¼ |
| | | expireTime: 450 |
| | | |
| | | # MyBatis Plusé
ç½® |
| | | mybatis-plus: |
| | | # æç´¢æå®å
å«å æ ¹æ®èªå·±çé¡¹ç®æ¥ |
| | | typeAliasesPackage: com.ruoyi.**.pojo |
| | | # é
ç½®mapperçæ«æï¼æ¾å°ææçmapper.xmlæ å°æä»¶ |
| | | mapperLocations: classpath*:mapper/**/*Mapper.xml |
| | | # å è½½å
¨å±çé
ç½®æä»¶ |
| | | configLocation: classpath:mybatis/mybatis-config.xml |
| | | global-config: |
| | | enable-sql-runner: true |
| | | db-config: |
| | | id-type: auto |
| | | |
| | | # PageHelperå页æä»¶ |
| | | pagehelper: |
| | | helperDialect: mysql |
| | | supportMethodsArguments: true |
| | | params: count=countSql |
| | | |
| | | # Swaggeré
ç½® |
| | | swagger: |
| | | # æ¯å¦å¼å¯swagger |
| | | enabled: true |
| | | # 请æ±åç¼ |
| | | pathMapping: /dev-api |
| | | |
| | | # 鲿¢XSSæ»å» |
| | | xss: |
| | | # è¿æ»¤å¼å
³ |
| | | enabled: true |
| | | # æé¤é¾æ¥ï¼å¤ä¸ªç¨éå·åéï¼ |
| | | excludes: /system/notice |
| | | # å¹é
龿¥ |
| | | urlPatterns: /system/*,/monitor/*,/tool/* |
| | | |
| | | # 代ç çæ |
| | | gen: |
| | | # ä½è
|
| | | author: ruoyi |
| | | # é»è®¤çæå
è·¯å¾ system éæ¹æèªå·±ç模ååç§° å¦ system monitor tool |
| | | packageName: com.ruoyi.project.system |
| | | # èªå¨å»é¤è¡¨åç¼ï¼é»è®¤æ¯true |
| | | autoRemovePre: false |
| | | # 表åç¼ï¼çæç±»åä¸ä¼å
å«è¡¨åç¼ï¼å¤ä¸ªç¨éå·åéï¼ |
| | | tablePrefix: sys_ |
| | | # æ¯å¦å
è®¸çææä»¶è¦çå°æ¬å°ï¼èªå®ä¹è·¯å¾ï¼ï¼é»è®¤ä¸å
许 |
| | | allowOverwrite: false |
| | | |
| | | file: |
| | | temp-dir: /javaWork/product-inventory-management/file/temp/uploads |
| | | upload-dir: /javaWork/product-inventory-management/file/prod/uploads |
| | |
| | | captchaType: math |
| | | # åå审æ¹ç¼å·åç¼(é
ç½®æä»¶åç¼å½å) |
| | | approvalNumberPrefix: NEW |
| | | |
| | | # ä¸ªæ¨ Unipush é
ç½® |
| | | getui: |
| | | appId: PfjyAAE0FK64FaO1w2CMb1 |
| | | appKey: zTMb831OEL6J4GK1uE3Ob4 |
| | | masterSecret: K1GFtsv42v61tXGnF7SGE5 |
| | | domain: https://restapi.getui.cn/v2/ |
| | | # 离线æ¨é使ç¨çå
å/ç»ä»¶å |
| | | intentComponent: uni.app.UNI099A590/io.dcloud.PandoraEntry |
| | | |
| | | # å¼åç¯å¢é
ç½® |
| | | server: |
| | | # æå¡å¨çHTTP端å£ï¼é»è®¤ä¸º8080 |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # 项ç®ç¸å
³é
ç½® |
| | | ruoyi: |
| | | # åç§° |
| | | name: RuoYi |
| | | # çæ¬ |
| | | version: 3.8.9 |
| | | # çæå¹´ä»½ |
| | | copyrightYear: 2025 |
| | | # æä»¶è·¯å¾ 示ä¾ï¼ Windowsé
ç½®D:/ruoyi/uploadPathï¼Linuxé
ç½® /home/ruoyi/uploadPathï¼ |
| | | profile: /javaWork/product-inventory-management/file |
| | | |
| | | # è·åipå°åå¼å
³ |
| | | addressEnabled: false |
| | | # éªè¯ç ç±»å math æ°åè®¡ç® char å符éªè¯ |
| | | captchaType: math |
| | | # åå审æ¹ç¼å·åç¼(é
ç½®æä»¶åç¼å½å) |
| | | approvalNumberPrefix: NEWTEST |
| | | # å¼åç¯å¢é
ç½® |
| | | server: |
| | | # æå¡å¨çHTTP端å£ï¼é»è®¤ä¸º8080 |
| | | port: 9007 |
| | | servlet: |
| | | # åºç¨ç访é®è·¯å¾ |
| | | context-path: / |
| | | tomcat: |
| | | # tomcatçURIç¼ç |
| | | uri-encoding: UTF-8 |
| | | # è¿æ¥æ°æ»¡åçæéæ°ï¼é»è®¤ä¸º100 |
| | | accept-count: 1000 |
| | | threads: |
| | | # tomcatæå¤§çº¿ç¨æ°ï¼é»è®¤ä¸º200 |
| | | max: 800 |
| | | # Tomcatå¯å¨åå§åççº¿ç¨æ°ï¼é»è®¤å¼10 |
| | | min-spare: 100 |
| | | |
| | | # æ¥å¿é
ç½® |
| | | logging: |
| | | level: |
| | | com.ruoyi: warn |
| | | org.springframework: warn |
| | | |
| | | minio: |
| | | endpoint: http://114.132.189.42/ |
| | | port: 7019 |
| | | secure: false |
| | | accessKey: admin |
| | | secretKey: 12345678 |
| | | preview-expiry: 24 # é¢è§å°åé»è®¤24å°æ¶ |
| | | default-bucket: jxc |
| | | # ç¨æ·é
ç½® |
| | | user: |
| | | password: |
| | | # å¯ç æå¤§éè¯¯æ¬¡æ° |
| | | maxRetryCount: 5 |
| | | # å¯ç é宿¶é´ï¼é»è®¤10åéï¼ |
| | | lockTime: 10 |
| | | |
| | | # Springé
ç½® |
| | | spring: |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | druid: |
| | | # ä¸»åºæ°æ®æº |
| | | master: |
| | | url: jdbc:mysql://172.17.0.1:3306/product-inventory-management-newtest?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: xd@123456.. |
| | | # ä»åºæ°æ®æº |
| | | slave: |
| | | # 仿°æ®æºå¼å
³/é»è®¤å
³é |
| | | enabled: false |
| | | url: |
| | | username: |
| | | password: |
| | | # åå§è¿æ¥æ° |
| | | initialSize: 5 |
| | | # æå°è¿æ¥æ± æ°é |
| | | minIdle: 10 |
| | | # æå¤§è¿æ¥æ± æ°é |
| | | maxActive: 20 |
| | | # é
ç½®è·åè¿æ¥çå¾
è¶
æ¶çæ¶é´ |
| | | maxWait: 60000 |
| | | # é
ç½®è¿æ¥è¶
æ¶æ¶é´ |
| | | connectTimeout: 30000 |
| | | # é
ç½®ç½ç»è¶
æ¶æ¶é´ |
| | | socketTimeout: 60000 |
| | | # é
ç½®é´éå¤ä¹
æè¿è¡ä¸æ¬¡æ£æµï¼æ£æµéè¦å
³éç空é²è¿æ¥ï¼å使¯æ¯«ç§ |
| | | timeBetweenEvictionRunsMillis: 60000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿å°çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | minEvictableIdleTimeMillis: 300000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿大çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | maxEvictableIdleTimeMillis: 900000 |
| | | # é
ç½®æ£æµè¿æ¥æ¯å¦ææ |
| | | validationQuery: SELECT 1 FROM DUAL |
| | | testWhileIdle: true |
| | | testOnBorrow: false |
| | | testOnReturn: false |
| | | webStatFilter: |
| | | enabled: true |
| | | statViewServlet: |
| | | enabled: true |
| | | # 设置ç½ååï¼ä¸å¡«åå
许ææè®¿é® |
| | | allow: |
| | | url-pattern: /druid/* |
| | | # æ§å¶å°ç®¡çç¨æ·ååå¯ç |
| | | login-username: ruoyi |
| | | login-password: 123456 |
| | | filter: |
| | | stat: |
| | | enabled: true |
| | | # æ
¢SQLè®°å½ |
| | | log-slow-sql: true |
| | | slow-sql-millis: 1000 |
| | | merge-sql: true |
| | | wall: |
| | | config: |
| | | multi-statement-allow: true |
| | | # èµæºä¿¡æ¯ |
| | | messages: |
| | | # å½é
åèµæºæä»¶è·¯å¾ |
| | | basename: i18n/messages |
| | | # æä»¶ä¸ä¼ |
| | | servlet: |
| | | multipart: |
| | | # å个æä»¶å¤§å° |
| | | max-file-size: 1GB |
| | | # 设置æ»ä¸ä¼ çæä»¶å¤§å° |
| | | max-request-size: 2GB |
| | | # æå¡æ¨¡å |
| | | devtools: |
| | | restart: |
| | | # çé¨ç½²å¼å
³ |
| | | enabled: false |
| | | # redis é
ç½® |
| | | redis: |
| | | # å°å |
| | | # host: 127.0.0.1 |
| | | host: 172.17.0.1 |
| | | # 端å£ï¼é»è®¤ä¸º6379 |
| | | port: 6379 |
| | | # æ°æ®åºç´¢å¼ |
| | | database: 6 |
| | | # å¯ç |
| | | # password: root2022! |
| | | password: |
| | | |
| | | # è¿æ¥è¶
æ¶æ¶é´ |
| | | timeout: 10s |
| | | lettuce: |
| | | pool: |
| | | # è¿æ¥æ± ä¸çæå°ç©ºé²è¿æ¥ |
| | | min-idle: 0 |
| | | # è¿æ¥æ± ä¸çæå¤§ç©ºé²è¿æ¥ |
| | | max-idle: 8 |
| | | # è¿æ¥æ± çæå¤§æ°æ®åºè¿æ¥æ° |
| | | max-active: 8 |
| | | # #è¿æ¥æ± æå¤§é»å¡çå¾
æ¶é´ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | max-wait: -1ms |
| | | |
| | | # Quartz宿¶ä»»å¡é
ç½®ï¼æ°å¢é¨åï¼ |
| | | quartz: |
| | | job-store-type: jdbc # ä½¿ç¨æ°æ®åºåå¨ |
| | | jdbc: |
| | | initialize-schema: never # 馿¬¡è¿è¡æ¶èªå¨åå»ºè¡¨ç»æï¼æååæ¹ä¸ºnever |
| | | schema: classpath:org/quartz/impl/jdbcjobstore/tables_mysql_innodb.sql # MySQLè¡¨ç»æèæ¬ |
| | | properties: |
| | | org: |
| | | quartz: |
| | | scheduler: |
| | | instanceName: RuoYiScheduler |
| | | instanceId: AUTO |
| | | jobStore: |
| | | class: org.quartz.impl.jdbcjobstore.JobStoreTX |
| | | driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate # MySQLéé
|
| | | tablePrefix: qrtz_ # 表ååç¼ï¼ä¸èæ¬ä¸è´ |
| | | isClustered: false # åèç¹æ¨¡å¼ï¼éç¾¤éæ¹ä¸ºtrueï¼ |
| | | clusterCheckinInterval: 10000 |
| | | txIsolationLevelSerializable: true |
| | | threadPool: |
| | | class: org.quartz.simpl.SimpleThreadPool |
| | | threadCount: 10 # çº¿ç¨æ± å¤§å° |
| | | threadPriority: 5 |
| | | makeThreadsDaemons: true |
| | | updateCheck: false # å
³éçæ¬æ£æ¥ |
| | | # tokené
ç½® |
| | | token: |
| | | # 令çèªå®ä¹æ è¯ |
| | | header: Authorization |
| | | # 令çå¯é¥ |
| | | secret: abcdefghijklmnopqrstuvwxyz |
| | | # ä»¤çæææï¼é»è®¤30åéï¼ |
| | | expireTime: 450 |
| | | |
| | | # MyBatis Plusé
ç½® |
| | | mybatis-plus: |
| | | # æç´¢æå®å
å«å æ ¹æ®èªå·±çé¡¹ç®æ¥ |
| | | typeAliasesPackage: com.ruoyi.**.pojo |
| | | # é
ç½®mapperçæ«æï¼æ¾å°ææçmapper.xmlæ å°æä»¶ |
| | | mapperLocations: classpath*:mapper/**/*Mapper.xml |
| | | # å è½½å
¨å±çé
ç½®æä»¶ |
| | | configLocation: classpath:mybatis/mybatis-config.xml |
| | | global-config: |
| | | enable-sql-runner: true |
| | | db-config: |
| | | id-type: auto |
| | | |
| | | # PageHelperå页æä»¶ |
| | | pagehelper: |
| | | helperDialect: mysql |
| | | supportMethodsArguments: true |
| | | params: count=countSql |
| | | |
| | | # Swaggeré
ç½® |
| | | swagger: |
| | | # æ¯å¦å¼å¯swagger |
| | | enabled: true |
| | | # 请æ±åç¼ |
| | | pathMapping: /dev-api |
| | | |
| | | # 鲿¢XSSæ»å» |
| | | xss: |
| | | # è¿æ»¤å¼å
³ |
| | | enabled: true |
| | | # æé¤é¾æ¥ï¼å¤ä¸ªç¨éå·åéï¼ |
| | | excludes: /system/notice |
| | | # å¹é
龿¥ |
| | | urlPatterns: /system/*,/monitor/*,/tool/* |
| | | |
| | | # 代ç çæ |
| | | gen: |
| | | # ä½è
|
| | | author: ruoyi |
| | | # é»è®¤çæå
è·¯å¾ system éæ¹æèªå·±ç模ååç§° å¦ system monitor tool |
| | | packageName: com.ruoyi.project.system |
| | | # èªå¨å»é¤è¡¨åç¼ï¼é»è®¤æ¯true |
| | | autoRemovePre: false |
| | | # 表åç¼ï¼çæç±»åä¸ä¼å
å«è¡¨åç¼ï¼å¤ä¸ªç¨éå·åéï¼ |
| | | tablePrefix: sys_ |
| | | # æ¯å¦å
è®¸çææä»¶è¦çå°æ¬å°ï¼èªå®ä¹è·¯å¾ï¼ï¼é»è®¤ä¸å
许 |
| | | allowOverwrite: false |
| | | |
| | | file: |
| | | temp-dir: /javaWork/product-inventory-management/file/temp/uploads |
| | | upload-dir: /javaWork/product-inventory-management/file/prod/uploads |
| | |
| | | IFNULL(SUM(income_money), 0) AS amount |
| | | FROM account_income |
| | | WHERE income_date BETWEEN #{startDate} AND #{endDate} |
| | | AND business_type = 1 |
| | | # AND business_type = 1 |
| | | GROUP BY dateStr |
| | | ORDER BY dateStr |
| | | |
| | |
| | | <mapper namespace="com.ruoyi.compensationperformance.mapper.CompensationPerformanceMapper"> |
| | | |
| | | <select id="listPage" resultType="com.ruoyi.compensationperformance.pojo.CompensationPerformance"> |
| | | select * from compensation_performance |
| | | SELECT |
| | | cp.*, |
| | | soj.staff_name AS staffName, |
| | | sp.post_name AS postName, |
| | | sd.dept_name AS deptName |
| | | FROM compensation_performance cp |
| | | LEFT JOIN staff_on_job soj ON soj.id = cp.staff_id |
| | | LEFT JOIN sys_post sp ON sp.post_id = soj.sys_post_id |
| | | LEFT JOIN sys_dept sd ON sd.dept_id = soj.sys_dept_id |
| | | <where> |
| | | <if test="req.name != null and req.name != ''"> |
| | | and `name` like concat('%',#{req.name},'%') |
| | | <if test="staffName != null and staffName != ''"> |
| | | AND soj.staff_name LIKE CONCAT('%', #{staffName}, '%') |
| | | </if> |
| | | <if test="req.payDateStr != null and req.payDateStr != ''"> |
| | | and pay_date like concat('%',#{req.payDateStr},'%') |
| | | <if test="payDateStr != null and payDateStr != ''"> |
| | | AND DATE_FORMAT(cp.pay_date, '%Y-%m') = #{payDateStr} |
| | | </if> |
| | | </where> |
| | | ORDER BY cp.pay_date DESC, cp.id DESC |
| | | </select> |
| | | |
| | | <select id="exportList" resultType="com.ruoyi.compensationperformance.pojo.CompensationPerformance"> |
| | | SELECT cp.*, |
| | | soj.staff_name AS staffName, |
| | | sp.post_name AS postName, |
| | | sd.dept_name AS deptName |
| | | FROM compensation_performance cp |
| | | LEFT JOIN staff_on_job soj ON soj.id = cp.staff_id |
| | | LEFT JOIN sys_post sp ON sp.post_id = soj.sys_post_id |
| | | LEFT JOIN sys_dept sd ON sd.dept_id = soj.sys_dept_id |
| | | ORDER BY cp.pay_date DESC, cp.id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | <select id="calculateProductionStatistics" resultType="com.ruoyi.home.dto.processDataProductionStatisticsDto"> |
| | | SELECT |
| | | pp.name AS processName, |
| | | SUM((ppo.quantity + ppo.scrap_qty) * pp.salary_quota) AS totalInput, |
| | | SUM(ppo.scrap_qty * pp.salary_quota) AS totalScrap, |
| | | SUM(ppo.quantity * pp.salary_quota) AS totalOutput |
| | | SUM(pi.quantity) AS totalInput, |
| | | SUM(distinct ppo.scrap_qty) AS totalScrap, |
| | | SUM(distinct (ppo.quantity - ppo.scrap_qty)) AS totalOutput |
| | | FROM |
| | | production_product_output ppo |
| | | INNER JOIN production_product_main ppm ON ppo.product_main_id = ppm.id |
| | | INNER JOIN product_process_route_item ppri ON ppm.product_process_route_item_id = ppri.id |
| | | INNER JOIN product_process pp ON ppri.process_id = pp.id |
| | | INNER JOIN production_product_input pi ON pi.product_main_id = ppm.id |
| | | <where> |
| | | <if test="startDateTime != null"> |
| | | AND ppo.create_time >= #{startDateTime} |
| | |
| | | |
| | | <select id="selectInputStats" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT(create_time, '%Y-%m-%d') as date, |
| | | SUM(quantity) as quantity |
| | | FROM |
| | | production_product_input |
| | | WHERE |
| | | create_time >= #{startDate} |
| | | AND create_time <= #{endDate} |
| | | DATE_FORMAT(ppi.create_time, '%Y-%m-%d') AS date, |
| | | -- æ¥å·¥æ°é * æå°ç³»æ° |
| | | SUM(ppi.quantity * IFNULL(distinct_ps.unit_quantity, 1)) AS quantity |
| | | FROM production_product_input ppi |
| | | INNER JOIN production_product_main ppm ON ppm.id = ppi.product_main_id |
| | | INNER JOIN product_process_route_item ppri ON ppri.id = ppm.product_process_route_item_id |
| | | INNER JOIN product_process_route ppr ON ppr.id = ppri.product_route_id |
| | | INNER JOIN product_model pm ON pm.id = ppi.product_model_id |
| | | INNER JOIN ( |
| | | SELECT |
| | | bom_id, |
| | | process_id, |
| | | product_model_id, |
| | | CAST(SUBSTRING_INDEX(GROUP_CONCAT(unit_quantity ORDER BY id ASC), ',', 1) AS DECIMAL(16, 4)) AS unit_quantity |
| | | FROM product_structure |
| | | GROUP BY bom_id, process_id, product_model_id |
| | | ) distinct_ps ON distinct_ps.bom_id = ppr.bom_id |
| | | AND distinct_ps.process_id = ppri.process_id |
| | | AND distinct_ps.product_model_id = ppi.product_model_id |
| | | <where> |
| | | <if test="startDate != null"> |
| | | AND ppi.create_time >= #{startDate} |
| | | </if> |
| | | <if test="endDate != null"> |
| | | AND ppi.create_time <= #{endDate} |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | | DATE_FORMAT(create_time, '%Y-%m-%d') |
| | | DATE_FORMAT(ppi.create_time, '%Y-%m-%d'), |
| | | pm.id, |
| | | pm.model |
| | | ORDER BY |
| | | date DESC, |
| | | pm.id ASC |
| | | </select> |
| | | </mapper> |
| | |
| | | pwo.status as workOrderStatus, |
| | | u.nick_name as nickName, |
| | | p.product_name as productName, |
| | | pp.name as process, |
| | | pm.model as productModelName, |
| | | ppo.quantity, |
| | | ppo.scrap_qty, |
| | |
| | | from |
| | | production_product_main ppm |
| | | left join product_work_order pwo on pwo.id = ppm.work_order_id |
| | | left join product_process_route_item ppri on ppri.id = pwo.product_process_route_item_id |
| | | left join product_process pp on pp.id = ppri.process_id |
| | | left join product_order po on po.id = pwo.product_order_id |
| | | left join production_product_output ppo on ppm.id = ppo.product_main_id |
| | | left join product_model pm on pm.id = ppo.product_model_id |
| | |
| | | <select id="selectDailyOutputStats" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT(create_time, '%Y-%m-%d') as date, |
| | | SUM(quantity) as quantity |
| | | SUM(quantity-scrap_qty) as quantity |
| | | FROM |
| | | production_product_output |
| | | WHERE |
| | |
| | | SET contract_amount = #{totalTaxInclusiveAmount} |
| | | WHERE id = #{id} |
| | | </update> |
| | | |
| | | <select id="selectPurchaseLedgerListPage" resultType="com.ruoyi.purchase.dto.PurchaseLedgerDto"> |
| | | select |
| | | SELECT |
| | | pl.id, |
| | | pl.purchase_contract_number , |
| | | pl.purchase_contract_number, |
| | | pl.sales_contract_no, |
| | | pl.supplier_id, |
| | | pl.supplier_name, |
| | | pl.project_name, |
| | | pl.contract_amount, |
| | | IFNULL(sum(tr.invoice_amount),0) as receipt_payment_amount, |
| | | pl.contract_amount-IFNULL(sum(tr.invoice_amount),0) AS unReceipt_payment_amount, |
| | | IFNULL(tr_sum.total_invoice_amount, 0) AS receipt_payment_amount, |
| | | pl.contract_amount - IFNULL(tr_sum.total_invoice_amount, 0) AS unReceipt_payment_amount, |
| | | pl.entry_date, |
| | | pl.execution_date, |
| | | pl.recorder_id, |
| | |
| | | pl.approval_status, |
| | | pl.payment_method, |
| | | pl.remarks |
| | | from purchase_ledger pl |
| | | left join sales_ledger_product slp on slp.sales_ledger_id = pl.id and slp.type=2 |
| | | left join product_record pr on pl.id = pr.purchase_ledger_id |
| | | left join ticket_registration tr on tr.id = pr.ticket_registration_id |
| | | left join supplier_manage sm on pl.supplier_id = sm.id |
| | | FROM purchase_ledger pl |
| | | LEFT JOIN ( |
| | | SELECT |
| | | purchase_ledger_id, |
| | | SUM(invoice_amount) AS total_invoice_amount |
| | | FROM ticket_registration |
| | | GROUP BY purchase_ledger_id |
| | | ) tr_sum ON pl.id = tr_sum.purchase_ledger_id |
| | | LEFT JOIN supplier_manage sm ON pl.supplier_id = sm.id |
| | | <where> |
| | | 1 = 1 |
| | | <if test="c.purchaseContractNumber != null and c.purchaseContractNumber != ''"> |
| | | and pl.purchase_contract_number like concat('%',#{c.purchaseContractNumber},'%') |
| | | AND pl.purchase_contract_number LIKE CONCAT('%', #{c.purchaseContractNumber}, '%') |
| | | </if> |
| | | <if test="c.approvalStatus != null and c.approvalStatus != ''"> |
| | | and pl.approval_status = #{c.approvalStatus} |
| | | AND pl.approval_status = #{c.approvalStatus} |
| | | </if> |
| | | <if test="c.supplierName != null and c.supplierName != ''"> |
| | | and pl.supplier_name like concat('%',#{c.supplierName},'%') |
| | | AND pl.supplier_name LIKE CONCAT('%', #{c.supplierName}, '%') |
| | | </if> |
| | | <if test="c.salesContractNo != null and c.salesContractNo != ''"> |
| | | and pl.sales_contract_no like concat('%',#{c.salesContractNo},'%') |
| | | AND pl.sales_contract_no LIKE CONCAT('%', #{c.salesContractNo}, '%') |
| | | </if> |
| | | <if test="c.projectName != null and c.projectName != ''"> |
| | | and pl.project_name like concat('%',#{c.projectName},'%') |
| | | AND pl.project_name LIKE CONCAT('%', #{c.projectName}, '%') |
| | | </if> |
| | | <if test="c.entryDateStart != null and c.entryDateStart != '' "> |
| | | AND pl.entry_date >= DATE_FORMAT(#{c.entryDateStart},'%Y-%m-%d') |
| | | <if test="c.entryDateStart != null and c.entryDateStart != ''"> |
| | | AND pl.entry_date >= #{c.entryDateStart} |
| | | </if> |
| | | <if test="c.entryDateEnd != null and c.entryDateEnd != '' "> |
| | | AND pl.entry_date <= DATE_FORMAT(#{c.entryDateEnd},'%Y-%m-%d') |
| | | <if test="c.entryDateEnd != null and c.entryDateEnd != ''"> |
| | | AND pl.entry_date <= #{c.entryDateEnd} |
| | | </if> |
| | | </where> |
| | | group by pl.id, pl.purchase_contract_number, pl.sales_contract_no, pl.supplier_name, |
| | | pl.project_name,pl.entry_date, |
| | | pl.recorder_name, |
| | | pl.contract_amount |
| | | order by pl.entry_date desc |
| | | |
| | | ORDER BY pl.entry_date DESC |
| | | </select> |
| | | |
| | | <select id="getPaymentRegistrationDtoById" resultType="com.ruoyi.purchase.dto.PaymentRegistrationDto"> |
| | | SELECT |
| | | T1.id, |
| | |
| | | <mapper namespace="com.ruoyi.quality.mapper.QualityUnqualifiedMapper"> |
| | | <select id="qualityUnqualifiedListPage" resultType="com.ruoyi.quality.pojo.QualityUnqualified"> |
| | | SELECT |
| | | * |
| | | FROM quality_unqualified |
| | | qu.id, |
| | | qu.inspect_type, |
| | | qu.inspect_state, |
| | | qu.check_time, |
| | | qu.check_name, |
| | | qu.product_id, |
| | | qu.product_name, |
| | | qu.unit, |
| | | qu.quantity, |
| | | qu.defective_phenomena, |
| | | qu.deal_result, |
| | | qu.deal_name, |
| | | qu.deal_time, |
| | | CASE |
| | | WHEN qu.model = pm.id THEN pm.model |
| | | ELSE qu.model |
| | | END AS model, |
| | | CASE |
| | | WHEN qu.model = pm.id THEN true |
| | | ELSE false |
| | | END AS method |
| | | FROM quality_unqualified qu |
| | | LEFT JOIN product_model pm ON qu.model = pm.id |
| | | where |
| | | 1=1 |
| | | <if test="qualityUnqualified.inspectType != null "> |
| | |
| | | AND product_name = #{qualityUnqualified.productName} |
| | | </if> |
| | | </select> |
| | | <select id="getUnqualified" resultType="com.ruoyi.quality.pojo.QualityUnqualified"> |
| | | SELECT |
| | | qu.id, |
| | | qu.inspect_type, |
| | | qu.inspect_state, |
| | | qu.check_time, |
| | | qu.check_name, |
| | | qu.product_id, |
| | | qu.product_name, |
| | | qu.unit, |
| | | qu.quantity, |
| | | qu.defective_phenomena, |
| | | qu.deal_result, |
| | | qu.deal_name, |
| | | qu.deal_time, |
| | | CASE |
| | | WHEN qu.model = pm.id THEN pm.model |
| | | ELSE qu.model |
| | | END AS model, |
| | | CASE |
| | | WHEN qu.model = pm.id THEN true |
| | | ELSE false |
| | | END AS method |
| | | FROM quality_unqualified qu |
| | | LEFT JOIN product_model pm ON qu.model = pm.id |
| | | where |
| | | 1=1 |
| | | and qu.id = #{id} |
| | | </select> |
| | | <select id="getModelId" resultType="java.lang.Long"> |
| | | select pm.id |
| | | from product_model pm |
| | | left join product p on pm.product_id=p.id |
| | | where pm.model=#{model} |
| | | and p.product_name=#{productName} |
| | | </select> |
| | | </mapper> |
| | |
| | | SELECT |
| | | T1.*, |
| | | CASE |
| | | WHEN t2.qualitity > T1.quantity THEN 1 |
| | | WHEN (IFNULL(t2.qualitity, 0) - IFNULL(t2.locked_quantity, 0)) >= IFNULL(T1.quantity, 0) THEN 1 |
| | | ELSE 0 |
| | | END as has_sufficient_stock |
| | | FROM |
| | | sales_ledger_product T1 |
| | | LEFT JOIN stock_inventory t2 ON T1.product_model_id = t2.product_model_id |
| | | <where> |
| | | 1=1 |
| | | <if test="salesLedgerProduct.salesLedgerId != null and salesLedgerProduct.salesLedgerId != '' "> |
| | | <if test="salesLedgerProduct.salesLedgerId != null"> |
| | | AND T1.sales_ledger_id = #{salesLedgerProduct.salesLedgerId} |
| | | </if> |
| | | <if test="salesLedgerProduct.type != null and salesLedgerProduct.type != '' "> |
| | | <if test="salesLedgerProduct.type != null"> |
| | | AND T1.type = #{salesLedgerProduct.type} |
| | | </if> |
| | | </where> |
| | | ORDER BY T1.register_date DESC |
| | | </select> |
| | | |
| | | <select id="selectSalesLedgerProductByMainId" resultType="com.ruoyi.sales.pojo.SalesLedgerProduct"> |
| | | select slp.* |
| | | from quality_inspect qi |
| | |
| | | </select> |
| | | |
| | | <select id="selectProductCountByTypeAndDate" resultType="int"> |
| | | SELECT COUNT(*) |
| | | SELECT IFNULL(COUNT(*), 0) |
| | | FROM sales_ledger_product |
| | | WHERE type = #{type} |
| | | AND register_date >= #{startDate} |
| | | AND register_date <= #{endDate} |
| | | <if test="startDate != null"> |
| | | AND register_date >= #{startDate} |
| | | </if> |
| | | <if test="endDate != null"> |
| | | AND register_date <= #{endDate} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectRawMaterialExpense" resultType="java.math.BigDecimal"> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.staff.mapper.PersonalAttendanceLocationConfigMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.staff.pojo.PersonalAttendanceLocationConfig"> |
| | | <id column="id" property="id" /> |
| | | <result column="sys_dept_id" property="sysDeptId" /> |
| | | <result column="location_name" property="locationName" /> |
| | | <result column="longitude" property="longitude" /> |
| | | <result column="latitude" property="latitude" /> |
| | | <result column="radius" property="radius" /> |
| | | <result column="start_at" property="startAt" /> |
| | | <result column="end_at" property="endAt" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.staff.mapper.PersonalAttendanceRecordsMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.staff.pojo.PersonalAttendanceRecords"> |
| | | <id column="id" property="id" /> |
| | | <result column="staff_on_job_id" property="staffOnJobId" /> |
| | | <result column="date" property="date" /> |
| | | <result column="work_start_at" property="workStartAt" /> |
| | | <result column="work_end_at" property="workEndAt" /> |
| | | <result column="work_hours" property="workHours" /> |
| | | <result column="status" property="status" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="tenant_id" property="tenantId" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | </resultMap> |
| | | |
| | | <select id="listPage" resultType="com.ruoyi.staff.dto.PersonalAttendanceRecordsDto"> |
| | | SELECT |
| | | personal_attendance_records.*, |
| | | soj.staff_name as staffName, |
| | | soj.staff_no as staffNo, |
| | | sd.dept_name as deptName |
| | | FROM personal_attendance_records |
| | | LEFT JOIN |
| | | staff_on_job soj ON soj.id = personal_attendance_records.staff_on_job_id |
| | | LEFT JOIN |
| | | sys_dept sd ON sd.dept_id = soj.sys_dept_id |
| | | where 1=1 |
| | | <if test="params.staffOnJobId != null and params.staffOnJobId > 0"> |
| | | AND personal_attendance_records.staff_on_job_id = #{params.staffOnJobId} |
| | | </if> |
| | | <if test="params.deptId != null and params.deptId > 0"> |
| | | AND sd.dept_id = #{params.deptId} |
| | | </if> |
| | | <if test="params.date != null"> |
| | | and personal_attendance_records.date >= #{params.date} |
| | | and personal_attendance_records.date < DATE_ADD(DATE(#{params.date}), INTERVAL 1 DAY) |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | | <!-- æ¥è¯¢æå®æ¥ææ²¡æèå¤è®°å½çå¨èåå·¥ï¼å¨æå®æ¶é´ä¹åå
¥èçï¼ --> |
| | | <select id="selectStaffWithoutAttendanceRecordBeforeTime" resultType="com.ruoyi.staff.pojo.StaffOnJob"> |
| | | SELECT soj.* |
| | | FROM staff_on_job soj |
| | | WHERE soj.staff_state = 1 |
| | | AND soj.create_time < #{entryDeadline} |
| | | AND EXISTS ( |
| | | SELECT 1 |
| | | FROM personal_attendance_location_config palc |
| | | WHERE palc.sys_dept_id = soj.sys_dept_id |
| | | ) |
| | | AND NOT EXISTS ( |
| | | SELECT 1 |
| | | FROM personal_attendance_records par |
| | | WHERE par.staff_on_job_id = soj.id |
| | | AND par.date = #{date} |
| | | ) |
| | | </select> |
| | | |
| | | <!-- æ£æ¥æå®å工卿宿¥ææ¯å¦å·²åå¨èå¤è®°å½ --> |
| | | <select id="existsAttendanceRecord" resultType="boolean"> |
| | | SELECT EXISTS ( |
| | | SELECT 1 |
| | | FROM personal_attendance_records |
| | | WHERE staff_on_job_id = #{staffOnJobId} |
| | | AND date = #{date} |
| | | ) |
| | | </select> |
| | | </mapper> |
| | |
| | | sys_dept sd ON sd.dept_id = staff_on_job.sys_dept_id |
| | | where 1=1 |
| | | <if test="staffOnJob.staffState != null"> |
| | | AND staff_state = #{staffOnJob.staffState} |
| | | AND staff_state = #{staffOnJob.staffState} |
| | | </if> |
| | | <if test="staffOnJob.staffName != null and staffOnJob.staffName != '' "> |
| | | AND staff_name LIKE CONCAT('%',#{staffOnJob.staffName},'%') |
| | |
| | | AND contract_expire_time >= DATE_FORMAT(#{staffOnJob.entryDateStart},'%Y-%m-%d') |
| | | </if> |
| | | <if test="staffOnJob.entryDateEnd != null and staffOnJob.entryDateEnd != '' "> |
| | | AND contract_expire_time <= DATE_FORMAT(#{staffOnJob.entryDateEnd},'%Y-%m-%d') |
| | | AND contract_expire_time <= DATE_FORMAT(#{staffOnJob.entryDateEnd},'%Y-%m-%d') |
| | | </if> |
| | | </select> |
| | | <select id="staffOnJobList" resultType="com.ruoyi.staff.dto.StaffOnJobDto"> |
| | |
| | | SELECT COUNT(*) |
| | | FROM staff_on_job |
| | | WHERE staff_state = 1 |
| | | AND DATE_FORMAT(create_time, '%Y-%m-%d') <= #{date} |
| | | AND DATE_FORMAT(create_time, '%Y-%m-%d') <= #{date} |
| | | </select> |
| | | |
| | | <!-- ç»è®¡æå®æä»½çæ°å
¥èåå·¥æ° --> |
| | |
| | | SELECT COUNT(*) |
| | | FROM staff_on_job |
| | | WHERE staff_state = 1 |
| | | AND DATE_FORMAT(create_time, '%Y-%m-%d') BETWEEN #{monthStart} AND #{monthEnd} |
| | | AND DATE_FORMAT(create_time, '%Y-%m-%d') BETWEEN #{monthStart} AND #{monthEnd} |
| | | </select> |
| | | |
| | | <select id="selectStaffByNickName" resultType="com.ruoyi.staff.pojo.StaffOnJob" parameterType="java.lang.String"> |
| | | SELECT |
| | | id |
| | | nick_name AS staffName |
| | | FROM staff_on_job |
| | | WHERE del_flag = '0' |
| | | <choose> |
| | | <when test="staffName != null and staffName != ''"> |
| | | AND nick_name = #{staffName} |
| | | </when> |
| | | <otherwise> |
| | | AND 1 = 0 |
| | | </otherwise> |
| | | </choose> |
| | | LIMIT 1 |
| | | </select> |
| | | </mapper> |
| | |
| | | </select> |
| | | |
| | | <select id="selectStorageProductCountByDate" resultType="int"> |
| | | SELECT COUNT(*) |
| | | FROM (SELECT create_time |
| | | SELECT SUM(total_count) |
| | | FROM (SELECT COUNT(*) as total_count |
| | | FROM stock_inventory |
| | | WHERE create_time >= #{startDate} |
| | | AND create_time <= #{endDate} |
| | | UNION ALL |
| | | SELECT create_time |
| | | FROM stock_uninventory) combined |
| | | WHERE create_time >= #{startDate} |
| | | AND create_time <= #{endDate} |
| | | SELECT COUNT(*) as total_count |
| | | FROM stock_uninventory |
| | | WHERE create_time >= #{startDate} |
| | | AND create_time <= #{endDate}) AS combined_counts |
| | | </select> |
| | | |
| | | <select id="selectDailyStockInCounts" resultType="java.util.Map"> |
| | |
| | | where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0 |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | | |
| | | <select id="selectMenuListByRoleId" resultType="Long"> |
| | | select m.menu_id |
| | | from sys_menu m |
| | |
| | | <include refid="selectMenuVo"/> |
| | | where menu_name=#{menuName} and parent_id = #{parentId} limit 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="selectMenuByPath" resultType="com.ruoyi.project.system.domain.SysMenu" parameterType="java.lang.String"> |
| | | SELECT menu_id, menu_name, parent_id, path, app_component, status |
| | | FROM sys_menu |
| | | WHERE path = #{path} |
| | | AND status = '0' LIMIT 1 |
| | | </select> |
| | | |
| | | <update id="updateMenu" parameterType="com.ruoyi.project.system.domain.SysMenu"> |
| | | update sys_menu |
| | | <set> |
| | |
| | | sender_id, |
| | | consignee_id, |
| | | jump_path, |
| | | app_jump_path, |
| | | tenant_id |
| | | from sys_notice |
| | | </sql> |
| | |
| | | <if test="senderId != null and senderId != ''">sender_id,</if> |
| | | <if test="consigneeId != null and consigneeId != ''">consignee_id,</if> |
| | | <if test="jumpPath != null and jumpPath != ''">jump_path,</if> |
| | | <if test="appJumpPath != null and appJumpPath != ''">app_jump_path,</if> |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | <if test="tenantId != null and tenantId != ''">tenant_id,</if> |
| | | create_time |
| | |
| | | <if test="senderId != null and senderId != ''">#{senderId},</if> |
| | | <if test="consigneeId != null and consigneeId != ''">#{consigneeId},</if> |
| | | <if test="jumpPath != null and jumpPath != ''">#{jumpPath},</if> |
| | | <if test="appJumpPath != null and appJumpPath != ''">#{appJumpPath},</if> |
| | | <if test="pathParms != null and pathParms != ''">#{queryParms},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | <if test="tenantId != null and tenantId != ''">#{tenantId},</if> |