Commit 60161a62 authored by Fuzy's avatar Fuzy

修改实体类

parent 555a5d97
......@@ -75,5 +75,11 @@
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.3.1</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -27,4 +27,20 @@ public class ActReadDataController {
}
return actReadDataService.read(actMaterialModel.getMineId());
}
@PostMapping("/readOfMId")
public AjaxResult readOfMId(@RequestBody @Validated ActMaterialModel actMaterialModel, BindingResult bindingResult){
if (bindingResult.hasErrors()){
return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage());
}
return actReadDataService.readOfMId(actMaterialModel.getMineId(), actMaterialModel.getDateNY());
}
@PostMapping("/delectOfMId")
public AjaxResult delectOfMId(@RequestBody @Validated ActMaterialModel actMaterialModel, BindingResult bindingResult){
if (bindingResult.hasErrors()){
return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage());
}
return actReadDataService.delectOfMId(actMaterialModel.getMineId(), actMaterialModel.getDateNY());
}
}
package com.ruoyi.system.controller;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.WagesService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
/**
* 2024/4/26
*/
@RestController
@RequestMapping("/wages")
public class WagesController {
private WagesService wagesService;
public WagesController(WagesService wagesService) {
this.wagesService = wagesService;
}
@PostMapping("/excel")
public AjaxResult excelAnalysis(@RequestParam("file") MultipartFile file) {
String s = wagesService.readOriginalData(file);
new AjaxResult();
return new AjaxResult(200, s);
}
}
......@@ -14,6 +14,16 @@ public class ActMaterialModel implements Serializable {
@NotBlank(message = "矿id不能为空!")
private String mineId;
private String dateNY;
public String getDateNY() {
return dateNY;
}
public void setDateNY(String dateNY) {
this.dateNY = dateNY;
}
public String getMineId() {
return mineId;
}
......
package com.ruoyi.system.listener;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
/**
* 2024/4/13
*/
public class ExcelListener<T> extends AnalysisEventListener<T> {
@Override
public void invoke(T t, AnalysisContext analysisContext) {
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
}
......@@ -24,4 +24,14 @@ public interface ActReadDataMapper {
void updateState(@Param("id") String yyUuid);
int selectCleanToOne(@Param("id") String mineId);
int readOfMId(@Param("id") String mineId, @Param("fDate") String format);
String selectOfMIdToHis(@Param("id") String mineId, @Param("fDate") String format);
void deleteOfMIdToHis(@Param("id")String mineId, @Param("ny") String dateNY);
void deleteOfMIdToClear(@Param("id")String mineId, @Param("ny") String dateNY);
void deleteToContent(@Param("uuid")String s);
}
package com.ruoyi.system.mapper;
import com.ruoyi.system.model.wages.dao.WagesDetailsOriginalExcelDAO;
import com.ruoyi.system.model.wages.dao.WagesOverviewOriginalExcelDAO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 2024/4/28
*/
@Repository
public interface WagesMapper {
void insertDetailsOriginal(@Param("accList") List<WagesDetailsOriginalExcelDAO> wagesDetList);
void insertWagesOverviewOriginal(@Param("accList") List<WagesOverviewOriginalExcelDAO> wagesOveList);
}
package com.ruoyi.system.model.wages.dao;
import java.math.BigDecimal;
/**
* 2024/4/27
*/
// 工资原始详情表 转换excel sheet2
public class WagesDetailsOriginalExcelDAO {
private String id;
// 年
private String year;
// 月
private String month;
// 单位名称
private String unitName;
// 人数
private Integer peopleCount;
// 应付工资
private BigDecimal wagesPayable;
// 房租
private BigDecimal houseRent;
// 住宿
private BigDecimal accommodation;
// 暖气费
private BigDecimal heatingFee;
// 工会会费
private BigDecimal tradeUnionDues;
// 赔偿扣款
private BigDecimal compensationDeduction;
// 其他扣款
private BigDecimal otherDeductions;
// 互助医疗
private BigDecimal mutualMedicalAid;
// 通讯费
private BigDecimal communicationFee;
// 税金1
private BigDecimal tax1;
// 税金2
private BigDecimal tax2;
// 养老保险
private BigDecimal pensionInsurance;
// 失业保险
private BigDecimal unemploymentInsurance;
// 医疗保险
private BigDecimal medicalInsurance;
// 年金
private BigDecimal annuity;
// 住房公积金
private BigDecimal housingProvidentFund;
// 企业公积金
private BigDecimal enterpriseFund;
// 年金个税
private BigDecimal annuityIncomeTax;
// 代扣合计
private BigDecimal totalWithholding;
// 净支工资
private BigDecimal netSalary;
// 一孩费
private BigDecimal oneChildFee;
// 医疗补贴
private BigDecimal medicalSubsidy;
// 保健费
private BigDecimal healthCareFee;
// 班中餐
private BigDecimal classMealFee;
// 肥皂费
private BigDecimal soapFee;
// 护理费
private BigDecimal nursingFee;
// 防暑补贴
private BigDecimal heatstrokePreventionSubsidy;
// 取暖补贴
private BigDecimal heatingSubsidy;
// 稿费
private BigDecimal manuscriptFee;
// 司机出车补贴
private BigDecimal driverAllowance;
// 毕业生安家费
private BigDecimal graduateSettlementFee;
// 一次性伤残补助
private BigDecimal oneTimeDisabilitySubsidy;
// 讲课考务费
private BigDecimal lectureAndExamFee;
// 其他补贴
private BigDecimal otherSubsidies;
// 代付合计
private BigDecimal totalPayment;
// 工资总支款
private BigDecimal totalSalaryDisbursement;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public WagesDetailsOriginalExcelDAO(String year, String month, String unitName, Integer peopleCount, BigDecimal wagesPayable, BigDecimal houseRent, BigDecimal accommodation, BigDecimal heatingFee, BigDecimal tradeUnionDues, BigDecimal compensationDeduction, BigDecimal otherDeductions, BigDecimal mutualMedicalAid, BigDecimal communicationFee, BigDecimal tax1, BigDecimal tax2, BigDecimal pensionInsurance, BigDecimal unemploymentInsurance, BigDecimal medicalInsurance, BigDecimal annuity, BigDecimal housingProvidentFund, BigDecimal enterpriseFund, BigDecimal annuityIncomeTax, BigDecimal totalWithholding, BigDecimal netSalary, BigDecimal oneChildFee, BigDecimal medicalSubsidy, BigDecimal healthCareFee, BigDecimal classMealFee, BigDecimal soapFee, BigDecimal nursingFee, BigDecimal heatstrokePreventionSubsidy, BigDecimal heatingSubsidy, BigDecimal manuscriptFee, BigDecimal driverAllowance, BigDecimal graduateSettlementFee, BigDecimal oneTimeDisabilitySubsidy, BigDecimal lectureAndExamFee, BigDecimal otherSubsidies, BigDecimal totalPayment, BigDecimal totalSalaryDisbursement) {
this.year = year;
this.month = month;
this.unitName = unitName;
this.peopleCount = peopleCount;
this.wagesPayable = wagesPayable;
this.houseRent = houseRent;
this.accommodation = accommodation;
this.heatingFee = heatingFee;
this.tradeUnionDues = tradeUnionDues;
this.compensationDeduction = compensationDeduction;
this.otherDeductions = otherDeductions;
this.mutualMedicalAid = mutualMedicalAid;
this.communicationFee = communicationFee;
this.tax1 = tax1;
this.tax2 = tax2;
this.pensionInsurance = pensionInsurance;
this.unemploymentInsurance = unemploymentInsurance;
this.medicalInsurance = medicalInsurance;
this.annuity = annuity;
this.housingProvidentFund = housingProvidentFund;
this.enterpriseFund = enterpriseFund;
this.annuityIncomeTax = annuityIncomeTax;
this.totalWithholding = totalWithholding;
this.netSalary = netSalary;
this.oneChildFee = oneChildFee;
this.medicalSubsidy = medicalSubsidy;
this.healthCareFee = healthCareFee;
this.classMealFee = classMealFee;
this.soapFee = soapFee;
this.nursingFee = nursingFee;
this.heatstrokePreventionSubsidy = heatstrokePreventionSubsidy;
this.heatingSubsidy = heatingSubsidy;
this.manuscriptFee = manuscriptFee;
this.driverAllowance = driverAllowance;
this.graduateSettlementFee = graduateSettlementFee;
this.oneTimeDisabilitySubsidy = oneTimeDisabilitySubsidy;
this.lectureAndExamFee = lectureAndExamFee;
this.otherSubsidies = otherSubsidies;
this.totalPayment = totalPayment;
this.totalSalaryDisbursement = totalSalaryDisbursement;
}
}
package com.ruoyi.system.model.wages.dao;
import com.alibaba.excel.annotation.ExcelProperty;
import java.math.BigDecimal;
/**
* 2024/4/27
*/
// 工资原始详情表 转换excel sheet1
public class WagesDetailsOriginalExcelSheet1DAO {
// 年
@ExcelProperty(index = 0)
private String year;
// 月
@ExcelProperty(index = 1)
private String month;
// 单位名称
@ExcelProperty(index = 2)
private String unitName;
// 人数
@ExcelProperty(index = 3)
private Integer peopleCount;
// 应付工资
@ExcelProperty(index = 4)
private BigDecimal wagesPayable;
// 房租
@ExcelProperty(index = 5)
private BigDecimal houseRent;
// 住宿
@ExcelProperty(index = 6)
private BigDecimal accommodation;
// 暖气费
@ExcelProperty(index = 7)
private BigDecimal heatingFee;
// 工会会费
@ExcelProperty(index = 8)
private BigDecimal tradeUnionDues;
// 赔偿扣款
@ExcelProperty(index = 9)
private BigDecimal compensationDeduction;
// 其他扣款
@ExcelProperty(index = 10)
private BigDecimal otherDeductions;
// 互助医疗
@ExcelProperty(index = 11)
private BigDecimal mutualMedicalAid;
// 通讯费
@ExcelProperty(index = 12)
private BigDecimal communicationFee;
// 税金1
@ExcelProperty(index = 13)
private BigDecimal tax1;
// 税金2
@ExcelProperty(index = 14)
private BigDecimal tax2;
// 养老保险
@ExcelProperty(index = 15)
private BigDecimal pensionInsurance;
// 失业保险
@ExcelProperty(index = 16)
private BigDecimal unemploymentInsurance;
// 医疗保险
@ExcelProperty(index = 17)
private BigDecimal medicalInsurance;
// 年金
@ExcelProperty(index = 18)
private BigDecimal annuity;
// 住房公积金
@ExcelProperty(index = 19)
private BigDecimal housingProvidentFund;
// 企业公积金
@ExcelProperty(index = 20)
private BigDecimal enterpriseFund;
// 年金个税
@ExcelProperty(index = 21)
private BigDecimal annuityIncomeTax;
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
public String getMonth() {
return month;
}
public void setMonth(String month) {
this.month = month;
}
public String getUnitName() {
return unitName;
}
public void setUnitName(String unitName) {
this.unitName = unitName;
}
public Integer getPeopleCount() {
return peopleCount;
}
public void setPeopleCount(Integer peopleCount) {
this.peopleCount = peopleCount;
}
public BigDecimal getWagesPayable() {
return wagesPayable;
}
public void setWagesPayable(BigDecimal wagesPayable) {
this.wagesPayable = wagesPayable;
}
public BigDecimal getHouseRent() {
return houseRent;
}
public void setHouseRent(BigDecimal houseRent) {
this.houseRent = houseRent;
}
public BigDecimal getAccommodation() {
return accommodation;
}
public void setAccommodation(BigDecimal accommodation) {
this.accommodation = accommodation;
}
public BigDecimal getHeatingFee() {
return heatingFee;
}
public void setHeatingFee(BigDecimal heatingFee) {
this.heatingFee = heatingFee;
}
public BigDecimal getTradeUnionDues() {
return tradeUnionDues;
}
public void setTradeUnionDues(BigDecimal tradeUnionDues) {
this.tradeUnionDues = tradeUnionDues;
}
public BigDecimal getCompensationDeduction() {
return compensationDeduction;
}
public void setCompensationDeduction(BigDecimal compensationDeduction) {
this.compensationDeduction = compensationDeduction;
}
public BigDecimal getOtherDeductions() {
return otherDeductions;
}
public void setOtherDeductions(BigDecimal otherDeductions) {
this.otherDeductions = otherDeductions;
}
public BigDecimal getMutualMedicalAid() {
return mutualMedicalAid;
}
public void setMutualMedicalAid(BigDecimal mutualMedicalAid) {
this.mutualMedicalAid = mutualMedicalAid;
}
public BigDecimal getCommunicationFee() {
return communicationFee;
}
public void setCommunicationFee(BigDecimal communicationFee) {
this.communicationFee = communicationFee;
}
public BigDecimal getTax1() {
return tax1;
}
public void setTax1(BigDecimal tax1) {
this.tax1 = tax1;
}
public BigDecimal getTax2() {
return tax2;
}
public void setTax2(BigDecimal tax2) {
this.tax2 = tax2;
}
public BigDecimal getPensionInsurance() {
return pensionInsurance;
}
public void setPensionInsurance(BigDecimal pensionInsurance) {
this.pensionInsurance = pensionInsurance;
}
public BigDecimal getUnemploymentInsurance() {
return unemploymentInsurance;
}
public void setUnemploymentInsurance(BigDecimal unemploymentInsurance) {
this.unemploymentInsurance = unemploymentInsurance;
}
public BigDecimal getMedicalInsurance() {
return medicalInsurance;
}
public void setMedicalInsurance(BigDecimal medicalInsurance) {
this.medicalInsurance = medicalInsurance;
}
public BigDecimal getAnnuity() {
return annuity;
}
public void setAnnuity(BigDecimal annuity) {
this.annuity = annuity;
}
public BigDecimal getHousingProvidentFund() {
return housingProvidentFund;
}
public void setHousingProvidentFund(BigDecimal housingProvidentFund) {
this.housingProvidentFund = housingProvidentFund;
}
public BigDecimal getEnterpriseFund() {
return enterpriseFund;
}
public void setEnterpriseFund(BigDecimal enterpriseFund) {
this.enterpriseFund = enterpriseFund;
}
public BigDecimal getAnnuityIncomeTax() {
return annuityIncomeTax;
}
public void setAnnuityIncomeTax(BigDecimal annuityIncomeTax) {
this.annuityIncomeTax = annuityIncomeTax;
}
}
package com.ruoyi.system.model.wages.dao;
import com.alibaba.excel.annotation.ExcelProperty;
import java.math.BigDecimal;
/**
* 2024/4/27
*/
// 工资原始详情表 转换excel sheet2
public class WagesDetailsOriginalExcelSheet2DAO {
// 单位名称
@ExcelProperty(index = 2)
private String unitName;
// 代扣合计
@ExcelProperty(index = 4)
private BigDecimal totalWithholding;
// 净支工资
@ExcelProperty(index = 5)
private BigDecimal netSalary;
// 一孩费
@ExcelProperty(index = 6)
private BigDecimal oneChildFee;
// 医疗补贴
@ExcelProperty(index = 7)
private BigDecimal medicalSubsidy;
// 保健费
@ExcelProperty(index = 8)
private BigDecimal healthCareFee;
// 班中餐
@ExcelProperty(index = 9)
private BigDecimal classMealFee;
// 肥皂费
@ExcelProperty(index = 10)
private BigDecimal soapFee;
// 护理费
@ExcelProperty(index = 11)
private BigDecimal nursingFee;
// 防暑补贴
@ExcelProperty(index = 12)
private BigDecimal heatstrokePreventionSubsidy;
// 取暖补贴
@ExcelProperty(index = 13)
private BigDecimal heatingSubsidy;
// 稿费
@ExcelProperty(index = 14)
private BigDecimal manuscriptFee;
// 司机出车补贴
@ExcelProperty(index = 15)
private BigDecimal driverAllowance;
// 毕业生安家费
@ExcelProperty(index = 16)
private BigDecimal graduateSettlementFee;
// 一次性伤残补助
@ExcelProperty(index = 17)
private BigDecimal oneTimeDisabilitySubsidy;
// 讲课考务费
@ExcelProperty(index = 18)
private BigDecimal lectureAndExamFee;
// 其他补贴
@ExcelProperty(index = 19)
private BigDecimal otherSubsidies;
// 代付合计
@ExcelProperty(index = 20)
private BigDecimal totalPayment;
// 工资总支款
@ExcelProperty(index = 21)
private BigDecimal totalSalaryDisbursement;
public String getUnitName() {
return unitName;
}
public void setUnitName(String unitName) {
this.unitName = unitName;
}
public BigDecimal getTotalWithholding() {
return totalWithholding;
}
public void setTotalWithholding(BigDecimal totalWithholding) {
this.totalWithholding = totalWithholding;
}
public BigDecimal getNetSalary() {
return netSalary;
}
public void setNetSalary(BigDecimal netSalary) {
this.netSalary = netSalary;
}
public BigDecimal getOneChildFee() {
return oneChildFee;
}
public void setOneChildFee(BigDecimal oneChildFee) {
this.oneChildFee = oneChildFee;
}
public BigDecimal getMedicalSubsidy() {
return medicalSubsidy;
}
public void setMedicalSubsidy(BigDecimal medicalSubsidy) {
this.medicalSubsidy = medicalSubsidy;
}
public BigDecimal getHealthCareFee() {
return healthCareFee;
}
public void setHealthCareFee(BigDecimal healthCareFee) {
this.healthCareFee = healthCareFee;
}
public BigDecimal getClassMealFee() {
return classMealFee;
}
public void setClassMealFee(BigDecimal classMealFee) {
this.classMealFee = classMealFee;
}
public BigDecimal getSoapFee() {
return soapFee;
}
public void setSoapFee(BigDecimal soapFee) {
this.soapFee = soapFee;
}
public BigDecimal getNursingFee() {
return nursingFee;
}
public void setNursingFee(BigDecimal nursingFee) {
this.nursingFee = nursingFee;
}
public BigDecimal getHeatstrokePreventionSubsidy() {
return heatstrokePreventionSubsidy;
}
public void setHeatstrokePreventionSubsidy(BigDecimal heatstrokePreventionSubsidy) {
this.heatstrokePreventionSubsidy = heatstrokePreventionSubsidy;
}
public BigDecimal getHeatingSubsidy() {
return heatingSubsidy;
}
public void setHeatingSubsidy(BigDecimal heatingSubsidy) {
this.heatingSubsidy = heatingSubsidy;
}
public BigDecimal getManuscriptFee() {
return manuscriptFee;
}
public void setManuscriptFee(BigDecimal manuscriptFee) {
this.manuscriptFee = manuscriptFee;
}
public BigDecimal getDriverAllowance() {
return driverAllowance;
}
public void setDriverAllowance(BigDecimal driverAllowance) {
this.driverAllowance = driverAllowance;
}
public BigDecimal getGraduateSettlementFee() {
return graduateSettlementFee;
}
public void setGraduateSettlementFee(BigDecimal graduateSettlementFee) {
this.graduateSettlementFee = graduateSettlementFee;
}
public BigDecimal getOneTimeDisabilitySubsidy() {
return oneTimeDisabilitySubsidy;
}
public void setOneTimeDisabilitySubsidy(BigDecimal oneTimeDisabilitySubsidy) {
this.oneTimeDisabilitySubsidy = oneTimeDisabilitySubsidy;
}
public BigDecimal getLectureAndExamFee() {
return lectureAndExamFee;
}
public void setLectureAndExamFee(BigDecimal lectureAndExamFee) {
this.lectureAndExamFee = lectureAndExamFee;
}
public BigDecimal getOtherSubsidies() {
return otherSubsidies;
}
public void setOtherSubsidies(BigDecimal otherSubsidies) {
this.otherSubsidies = otherSubsidies;
}
public BigDecimal getTotalPayment() {
return totalPayment;
}
public void setTotalPayment(BigDecimal totalPayment) {
this.totalPayment = totalPayment;
}
public BigDecimal getTotalSalaryDisbursement() {
return totalSalaryDisbursement;
}
public void setTotalSalaryDisbursement(BigDecimal totalSalaryDisbursement) {
this.totalSalaryDisbursement = totalSalaryDisbursement;
}
}
package com.ruoyi.system.model.wages.dao;
import com.alibaba.excel.annotation.ExcelProperty;
import java.math.BigDecimal;
/**
* 2024/4/27
*/
// 工资大略原始表 转换excel
public class WagesOverviewOriginalExcelDAO {
// 年
@ExcelProperty(index = 0)
private String year;
// 月
@ExcelProperty(index = 1)
private String month;
// 单位编码
@ExcelProperty(index = 2)
private String unitCode;
// 单位名称
@ExcelProperty(index = 3)
private String UnitName;
// 工人人数
@ExcelProperty(index = 4)
private Integer WorkerCount;
// 工人应付工资
@ExcelProperty(index = 5)
private BigDecimal WorkerWagesPayable;
// 干部人数
@ExcelProperty(index = 6)
private Integer CadreCount;
// 干部应付工资
@ExcelProperty(index = 7)
private BigDecimal CadreWagesPayable;
// 人数合计
@ExcelProperty(index = 8)
private Integer TotalCount;
// 应付工资合计
@ExcelProperty(index = 9)
private BigDecimal TotalWagesPayable;
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
public String getMonth() {
return month;
}
public void setMonth(String month) {
this.month = month;
}
public String getUnitCode() {
return unitCode;
}
public void setUnitCode(String unitCode) {
this.unitCode = unitCode;
}
public String getUnitName() {
return UnitName;
}
public void setUnitName(String unitName) {
UnitName = unitName;
}
public Integer getWorkerCount() {
return WorkerCount;
}
public void setWorkerCount(Integer workerCount) {
WorkerCount = workerCount;
}
public BigDecimal getWorkerWagesPayable() {
return WorkerWagesPayable;
}
public void setWorkerWagesPayable(BigDecimal workerWagesPayable) {
WorkerWagesPayable = workerWagesPayable;
}
public Integer getCadreCount() {
return CadreCount;
}
public void setCadreCount(Integer cadreCount) {
CadreCount = cadreCount;
}
public BigDecimal getCadreWagesPayable() {
return CadreWagesPayable;
}
public void setCadreWagesPayable(BigDecimal cadreWagesPayable) {
CadreWagesPayable = cadreWagesPayable;
}
public Integer getTotalCount() {
return TotalCount;
}
public void setTotalCount(Integer totalCount) {
TotalCount = totalCount;
}
public BigDecimal getTotalWagesPayable() {
return TotalWagesPayable;
}
public void setTotalWagesPayable(BigDecimal totalWagesPayable) {
TotalWagesPayable = totalWagesPayable;
}
}
package com.ruoyi.system.model.wages.dto;
import org.springframework.web.multipart.MultipartFile;
/**
* 2024/4/27
*/
public class WagesFileDto {
private MultipartFile file;
public MultipartFile getFile() {
return file;
}
public void setFile(MultipartFile file) {
this.file = file;
}
}
......@@ -8,4 +8,8 @@ import com.ruoyi.common.core.domain.AjaxResult;
public interface ActReadDataService {
AjaxResult read(String mineId);
AjaxResult readOfMId(String mineId, String dateNY);
AjaxResult delectOfMId(String mineId, String dateNY);
}
package com.ruoyi.system.service;
import org.springframework.web.multipart.MultipartFile;
/**
* 2024/4/27
*/
public interface WagesService {
String readOriginalData(MultipartFile file);
}
......@@ -7,6 +7,8 @@ import com.ruoyi.system.service.impl.Conversion.MineConver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.Future;
import java.util.regex.Pattern;
......@@ -54,6 +56,22 @@ public class ActReadDataServiceImpl implements ActReadDataService {
}
return new AjaxResult(200, "清洗成功");
}
@Override
public AjaxResult readOfMId(String mineId, String format) {
int count = actReadDataMapper.readOfMId(mineId, format);
return new AjaxResult(200, count + "");
}
@Override
public AjaxResult delectOfMId(String mineId, String dateNY) {
String s = actReadDataMapper.selectOfMIdToHis(mineId, dateNY);
actReadDataMapper.deleteOfMIdToHis(mineId, dateNY);
actReadDataMapper.deleteOfMIdToClear(mineId, dateNY);
actReadDataMapper.deleteToContent(s);
return new AjaxResult(200, "删除成功");
}
/*
@Override
public AjaxResult read(String mineId) {
......
package com.ruoyi.system.service.impl;
import cn.hutool.core.lang.Snowflake;
import com.alibaba.excel.EasyExcelFactory;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.system.listener.ExcelListener;
import com.ruoyi.system.mapper.WagesMapper;
import com.ruoyi.system.model.AccbookModel;
import com.ruoyi.system.model.wages.dao.*;
import com.ruoyi.system.service.WagesService;
import com.ruoyi.system.test.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 2024/4/27
*/
@Service
public class WagesServiceImpl implements WagesService {
@Autowired
WagesMapper wagesMapper;
@Transactional
@Override
public String readOriginalData(MultipartFile file) {
try {
// if (Test.put("工资导入", "1")){
// return "不可重复点击";
// }
InputStream inputStream1 = file.getInputStream();
List<WagesDetailsOriginalExcelSheet1DAO> wagesDetSheet1List = EasyExcelFactory.read(inputStream1, WagesDetailsOriginalExcelSheet1DAO.class, new ExcelListener<WagesDetailsOriginalExcelSheet1DAO>()).sheet(0).headRowNumber(1).doReadSync();
inputStream1.close();
InputStream inputStream2 = file.getInputStream();
List<WagesDetailsOriginalExcelSheet2DAO> wagesDetSheet2List = EasyExcelFactory.read(inputStream2, WagesDetailsOriginalExcelSheet2DAO.class, new ExcelListener<WagesDetailsOriginalExcelSheet2DAO>()).sheet(1).headRowNumber(1).doReadSync();
inputStream2.close();
InputStream inputStream = file.getInputStream();
List<WagesOverviewOriginalExcelDAO> wagesOveList = EasyExcelFactory.read(inputStream, WagesOverviewOriginalExcelDAO.class, new ExcelListener<WagesOverviewOriginalExcelDAO>()).sheet(2).headRowNumber(1).doReadSync();
inputStream.close();
List<WagesDetailsOriginalExcelDAO> wagesDetList = new ArrayList<>();
int size = wagesDetSheet1List.size();
for (int i = 0; i < size; i++) {
WagesDetailsOriginalExcelSheet1DAO wagesSheet1 = wagesDetSheet1List.get(i);
WagesDetailsOriginalExcelSheet2DAO wagesSheet2 = wagesDetSheet2List.stream().filter(v -> v.getUnitName().equals(wagesSheet1.getUnitName()))
.collect(Collectors.toList()).get(0);
WagesDetailsOriginalExcelDAO wages = new WagesDetailsOriginalExcelDAO(wagesSheet1.getYear(), wagesSheet1.getMonth(), wagesSheet1.getUnitName(), wagesSheet1.getPeopleCount(), wagesSheet1.getWagesPayable(), wagesSheet1.getHouseRent(), wagesSheet1.getAccommodation(), wagesSheet1.getHeatingFee(), wagesSheet1.getTradeUnionDues(), wagesSheet1.getCompensationDeduction(),
wagesSheet1.getOtherDeductions(), wagesSheet1.getMutualMedicalAid(),
wagesSheet1.getCommunicationFee(), wagesSheet1.getTax1(), wagesSheet1.getTax2(), wagesSheet1.getPensionInsurance(), wagesSheet1.getUnemploymentInsurance(), wagesSheet1.getMedicalInsurance(), wagesSheet1.getAnnuity(), wagesSheet1.getHousingProvidentFund(),
wagesSheet1.getEnterpriseFund(), wagesSheet1.getAnnuityIncomeTax(),
wagesSheet2.getTotalWithholding(), wagesSheet2.getNetSalary(),
wagesSheet2.getOneChildFee(), wagesSheet2.getMedicalSubsidy(), wagesSheet2.getHealthCareFee(), wagesSheet2.getClassMealFee(), wagesSheet2.getSoapFee(), wagesSheet2.getNursingFee(), wagesSheet2.getHeatstrokePreventionSubsidy(), wagesSheet2.getHeatingSubsidy(), wagesSheet2.getManuscriptFee(), wagesSheet2.getDriverAllowance(), wagesSheet2.getGraduateSettlementFee(), wagesSheet2.getOneTimeDisabilitySubsidy(), wagesSheet2.getLectureAndExamFee(), wagesSheet2.getOtherSubsidies(), wagesSheet2.getTotalPayment(), wagesSheet2.getTotalSalaryDisbursement());
wagesDetList.add(wages);
}
wagesMapper.insertDetailsOriginal(wagesDetList);
wagesMapper.insertWagesOverviewOriginal(wagesOveList);
return "导入成功!";
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}
package com.ruoyi.system.test;
import java.util.concurrent.*;
class Person {
private String name;
private int age;
public Person(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
@Override
public String toString() {
return "Person{" +
"name='" + name + '\'' +
", age=" + age +
'}';
}
}
public class AsyncQueueConsumer {
private static final int MAX_THREADS = 10;
private static final int QUEUE_CAPACITY = 100;
public static void main(String[] args) {
BlockingQueue<Person> queue = new LinkedBlockingQueue<>(QUEUE_CAPACITY);
ExecutorService executorService = Executors.newFixedThreadPool(MAX_THREADS);
// 生产者线程
new Thread(() -> {
for (int i = 0; i < 1000; i++) {
try {
Person person = new Person("Person" + i, i);
queue.put(person);
System.out.println("Produced: " + person);
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
// 消费者线程
for (int i = 0; i < MAX_THREADS; i++) {
executorService.submit(() -> {
try {
Thread.sleep(3000);
System.out.println(queue.poll(3, TimeUnit.SECONDS));
} catch (InterruptedException e) {
e.printStackTrace();
}
});
}
}
}
\ No newline at end of file
package com.ruoyi.system.test;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.stream.IntStream;
/**
* 2024/4/23
*/
@Component
public class Test {
public static Map<String, Map<String, Long>> map = new HashMap<>();
private static final long BIG_TIME = 1000L;
public static boolean put(String function, String user){
synchronized (Test.class) {
long state = System.currentTimeMillis();
if (map.containsKey(function)){
Map<String, Long> stringMap = map.get(function);
if (stringMap.containsKey(user)){
Long aLong = stringMap.get(user);
if (state - aLong > BIG_TIME){
stringMap.put(user, state);
}else {
stringMap.put(user, state);
return false;
}
}else {
stringMap.put(user, state);
}
}else {
Map<String, Long> stringMap = new HashMap<>();
stringMap.put(user, state);
map.put(function, stringMap);
}
return true;
}
}
@Scheduled(fixedRate = 30000)
public static void expireTime(){
synchronized (Test.class) {
long state = System.currentTimeMillis();
for(Map.Entry<String, Map<String, Long>> m : map.entrySet()){
Map<String, Long> value = m.getValue();
if (value == null && value.size() == 0) {
map.remove(m.getKey());
}
for(Map.Entry<String, Long> mapValue : value.entrySet()){
Long v = mapValue.getValue();
if (state - v > BIG_TIME){
value.remove(mapValue.getKey());
}
}
}
}
}
}
......@@ -19,6 +19,23 @@
set clean_status = 1
where import_uuid = #{id}
</update>
<delete id="deleteOfMIdToHis">
delete
from act_supplies_historydata_copy1
where ssk_id = #{id}
and date = #{ny}
</delete>
<delete id="deleteOfMIdToClear">
delete
from act_supplies_import_cleaning_copy1
where ssk_id = #{id}
and hdate = #{ny}
</delete>
<delete id="deleteToContent">
delete
from act_supplies_historycontent_copy1
where hid = #{uuid}
</delete>
<select id="readDateToHistory" resultType="com.ruoyi.system.domain.ActReadHistoryModel">
select ashc.conven_role rule,
ashc2.history_content data,
......@@ -48,4 +65,16 @@
and identifying_code = 0
and clean_status = 0
</select>
<select id="readOfMId" resultType="java.lang.Integer">
select count(*)
from act_supplies_historydata_copy1
where ssk_id = #{id}
and date = #{fDate}
</select>
<select id="selectOfMIdToHis" resultType="java.lang.String">
select import_uuid
from act_supplies_historydata_copy1
where ssk_id = #{id}
and date = #{fDate}
</select>
</mapper>
\ No newline at end of file
<?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.system.mapper.WagesMapper">
<insert id="insertDetailsOriginal">
insert into wages_details_original_data (year, month, unit_name, people_count, total_withholding,
net_salary, one_child_fee, medical_subsidy, health_care_fee, class_meal_fee, soap_fee, nursing_fee,
heatstroke_prevention_subsidy, heating_subsidy, manuscript_fee, driver_allowance,graduate_settlement_fee,
one_time_disability_subsidy,lecture_and_exam_fee,other_subsidies,house_rent,Wages_payable,accommodation,
heating_fee,trade_union_dues,compensation_deduction,other_deductions,mutual_medical_aid,communication_fee,tax1,tax2,pension_insurance,
unemployment_insurance,medical_insurance,annuity,housing_provident_fund,enterprise_fund,annuity_income_tax,total_payment,total_salary_disbursement)
values
<foreach collection="accList" item="list" separator=",">
(#{list.year}, #{list.month}, #{list.unitName}, #{list.peopleCount},
#{list.totalWithholding},
#{list.netSalary}, #{list.oneChildFee}, #{list.medicalSubsidy}, #{list.healthCareFee},
#{list.classMealFee}, #{list.soapFee}, #{list.nursingFee}, #{list.heatstrokePreventionSubsidy},
#{list.heatingSubsidy},
#{list.manuscriptFee}, #{list.driverAllowance}, #{list.graduateSettlementFee},
#{list.oneTimeDisabilitySubsidy}, #{list.lectureAndExamFee}, #{list.otherSubsidies},
#{list.houseRent}, #{list.wagesPayable}, #{list.accommodation}, #{list.heatingFee}, #{list.tradeUnionDues},
#{list.compensationDeduction}, #{list.otherDeductions}
, #{list.mutualMedicalAid}, #{list.communicationFee}, #{list.tax1}, #{list.tax2}, #{list.pensionInsurance}
, #{list.unemploymentInsurance}, #{list.medicalInsurance}, #{list.annuity}, #{list.housingProvidentFund},
#{list.enterpriseFund}
, #{list.annuityIncomeTax}, #{list.totalPayment}, #{list.totalSalaryDisbursement})
</foreach>
</insert>
<insert id="insertWagesOverviewOriginal">
insert into wages_overview_original_data(year,month,unit_code,unit_name,worker_count,worker_wages_payable,
cadre_count,cadre_wages_payable,total_count,total_wages_payable)
values
<foreach collection="accList" item="list" separator=",">
(#{list.year}, #{list.month}, #{list.unitCode}, #{list.unitName},
#{list.workerCount},
#{list.workerWagesPayable}, #{list.cadreCount}, #{list.cadreWagesPayable}, #{list.totalCount},
#{list.totalWagesPayable})
</foreach>
</insert>
</mapper>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment