Commit a7d70ed9 authored by 刘_震's avatar 刘_震

工资-后端接口代码的实现

parent bd6b582b
package com.ruoyi.system.controller;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.model.wages.dto.WagesConversionDataDto;
import com.ruoyi.system.model.wages.dto.WagesFormulaDto;
import com.ruoyi.system.model.wages.dto.WagesFormulaListDto;
import com.ruoyi.system.model.wages.vo.WagesFormulaVo;
import com.ruoyi.system.model.wages.vo.WagesOverviewOriginalDataVO;
import com.ruoyi.system.service.WagesCalculateConversionService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 2024/5/21
*/
@RestController
@Api(tags = "工资转化模版")
@RequestMapping("/wages/calculate")
@RequiredArgsConstructor
public class WagesCalculateConversionController {
private WagesCalculateConversionService wagesCalculateConversionService;
private WagesCalculateConversionController(WagesCalculateConversionService wagesCalculateConversionService){
this.wagesCalculateConversionService = wagesCalculateConversionService;
}
private final WagesCalculateConversionService wagesCalculateConversionService;
/**
* 唐山矿转换表
*/
@RequestMapping("/surface")
public AjaxResult conversionSurface( @RequestBody WagesFormulaListDto wagesFormulaListDto) {
return new AjaxResult(200, "成功", wagesCalculateConversionService.conversionSurface(wagesFormulaListDto));
@PostMapping(value = "/surface")
@ApiOperation(value = "唐山矿转换表")
public AjaxResult conversionSurface( @RequestBody WagesFormulaListDto wagesFormulaListDto) throws NoSuchFieldException, IllegalAccessException {
List<WagesFormulaVo> data = wagesCalculateConversionService.conversionSurface(wagesFormulaListDto);
return new AjaxResult(200, "成功", data);
}
}
package com.ruoyi.system.mapper;
import java.util.List;
/**
* @author haiwe
* @date 2024/5/22
*/
public interface WagesCalculateConversionMapper {
List<Object> select(String year);
}
package com.ruoyi.system.mapper;
import com.ruoyi.system.model.wages.dao.WagesDetailsOriginalExcelDAO;
import java.util.List;
public interface WagesDetailsOriginalDataMapper {
List<WagesDetailsOriginalExcelDAO> selectAll();
}
\ No newline at end of file
package com.ruoyi.system.mapper;
import com.ruoyi.system.model.wages.dao.WagesOverviewOriginalExcelDAO;
import java.util.List;
public interface WagesOverviewOriginalDateMapper {
List<WagesOverviewOriginalExcelDAO> selectAll();
}
\ No newline at end of file
......@@ -20,25 +20,25 @@ public class WagesOverviewOriginalExcelDAO {
private String unitCode;
// 单位名称
@ExcelProperty(index = 3)
private String UnitName;
private String unitName;
// 工人人数
@ExcelProperty(index = 4)
private Integer WorkerCount;
private Integer workerCount;
// 工人应付工资
@ExcelProperty(index = 5)
private BigDecimal WorkerWagesPayable;
private BigDecimal workerWagesPayable;
// 干部人数
@ExcelProperty(index = 6)
private Integer CadreCount;
private Integer cadreCount;
// 干部应付工资
@ExcelProperty(index = 7)
private BigDecimal CadreWagesPayable;
private BigDecimal cadreWagesPayable;
// 人数合计
@ExcelProperty(index = 8)
private Integer TotalCount;
private Integer totalCount;
// 应付工资合计
@ExcelProperty(index = 9)
private BigDecimal TotalWagesPayable;
private BigDecimal totalWagesPayable;
public String getYear() {
return year;
......@@ -65,58 +65,58 @@ public class WagesOverviewOriginalExcelDAO {
}
public String getUnitName() {
return UnitName;
return unitName;
}
public void setUnitName(String unitName) {
UnitName = unitName;
this.unitName = unitName;
}
public Integer getWorkerCount() {
return WorkerCount;
return workerCount;
}
public void setWorkerCount(Integer workerCount) {
WorkerCount = workerCount;
this.workerCount = workerCount;
}
public BigDecimal getWorkerWagesPayable() {
return WorkerWagesPayable;
return workerWagesPayable;
}
public void setWorkerWagesPayable(BigDecimal workerWagesPayable) {
WorkerWagesPayable = workerWagesPayable;
this.workerWagesPayable = workerWagesPayable;
}
public Integer getCadreCount() {
return CadreCount;
return cadreCount;
}
public void setCadreCount(Integer cadreCount) {
CadreCount = cadreCount;
this.cadreCount = cadreCount;
}
public BigDecimal getCadreWagesPayable() {
return CadreWagesPayable;
return cadreWagesPayable;
}
public void setCadreWagesPayable(BigDecimal cadreWagesPayable) {
CadreWagesPayable = cadreWagesPayable;
this.cadreWagesPayable = cadreWagesPayable;
}
public Integer getTotalCount() {
return TotalCount;
return totalCount;
}
public void setTotalCount(Integer totalCount) {
TotalCount = totalCount;
this.totalCount = totalCount;
}
public BigDecimal getTotalWagesPayable() {
return TotalWagesPayable;
return totalWagesPayable;
}
public void setTotalWagesPayable(BigDecimal totalWagesPayable) {
TotalWagesPayable = totalWagesPayable;
this.totalWagesPayable = totalWagesPayable;
}
}
\ No newline at end of file
......@@ -9,7 +9,7 @@ import java.util.List;
public class WagesFormulaListDto {
// 日期
private String date;
private List<WagesFormulaDto> wagesFormulaDtoList;
private List<WagesFormulaDto> data;
public String getDate() {
return date;
......@@ -19,11 +19,11 @@ public class WagesFormulaListDto {
this.date = date;
}
public List<WagesFormulaDto> getWagesFormulaDtoList() {
return wagesFormulaDtoList;
public List<WagesFormulaDto> getData() {
return data;
}
public void setWagesFormulaDtoList(List<WagesFormulaDto> wagesFormulaDtoList) {
this.wagesFormulaDtoList = wagesFormulaDtoList;
public void setData(List<WagesFormulaDto> data) {
this.data = data;
}
}
package com.ruoyi.system.model.wages.vo;
import java.util.List;
/**
* 2024/5/22
*/
public class WagesFormulaListVo {
// 部门
private String dep;
private List<WagesFormulaVo> list;
public String getDep() {
return dep;
}
public void setDep(String dep) {
this.dep = dep;
}
public List<WagesFormulaVo> getList() {
return list;
}
public void setList(List<WagesFormulaVo> list) {
this.list = list;
}
}
//package com.ruoyi.system.model.wages.vo;
//
//import java.util.List;
//
///**
// * 2024/5/22
// */
//public class WagesFormulaListVo {
// // 部门
// private String dep;
// private List<WagesFormulaVo> list;
//
// public String getDep() {
// return dep;
// }
//
// public void setDep(String dep) {
// this.dep = dep;
// }
//
// public List<WagesFormulaVo> getList() {
// return list;
// }
//
// public void setList(List<WagesFormulaVo> list) {
// this.list = list;
// }
//}
\ No newline at end of file
......@@ -4,12 +4,18 @@ package com.ruoyi.system.model.wages.vo;
* 2024/5/22
*/
public class WagesFormulaVo {
//部门名
private String dep;
// 页面展示字段
private String label;
// 列数
private String c;
// 值
private String value;
//工人
private String worker;
//干部
private String cadre;
public String getLabel() {
return label;
......@@ -34,4 +40,28 @@ public class WagesFormulaVo {
public void setValue(String value) {
this.value = value;
}
public String getWorker() {
return worker;
}
public void setWorker(String worker) {
this.worker = worker;
}
public String getCadre() {
return cadre;
}
public void setCadre(String cadre) {
this.cadre = cadre;
}
public String getDep() {
return dep;
}
public void setDep(String dep) {
this.dep = dep;
}
}
package com.ruoyi.system.service;
import com.ruoyi.system.model.wages.dto.WagesFormulaListDto;
import com.ruoyi.system.model.wages.vo.WagesFormulaVo;
import com.ruoyi.system.model.wages.vo.WagesOverviewOriginalDataVO;
import java.util.List;
/**
* 2024/5/21
*/
public interface WagesCalculateConversionService {
Object conversionSurface(WagesFormulaListDto wagesFormulaListDto);
/**
*
* @param wagesFormulaListDto
* @return
*/
List<WagesFormulaVo> conversionSurface(WagesFormulaListDto wagesFormulaListDto) throws NoSuchFieldException, IllegalAccessException;
}
<?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.WagesCalculateConversionMapper">
<select id="select" resultType="java.lang.Object" parameterType="java.lang.String">
select * from wages_details_original_data where year = #{year}
</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.WagesDetailsOriginalDataMapper">
<resultMap type="com.ruoyi.system.model.wages.dao.WagesDetailsOriginalExcelDAO" id="WagesDetailsOriginalDataResult">
<result property="id" column="id" />
<result property="year" column="year" />
<result property="month" column="month" />
<result property="unitName" column="unit_name" />
<result property="peopleCount" column="people_count" />
<result property="totalWithholding" column="total_withholding" />
<result property="netSalary" column="net_salary" />
<result property="oneChildFee" column="one_child_fee" />
<result property="medicalSubsidy" column="medical_subsidy" />
<result property="healthCareFee" column="health_care_fee" />
<result property="classMealFee" column="class_meal_fee" />
<result property="soapFee" column="soap_fee" />
<result property="nursingFee" column="nursing_fee" />
<result property="heatstrokePreventionSubsidy" column="heatstroke_prevention_subsidy" />
<result property="heatingSubsidy" column="heating_subsidy" />
<result property="manuscriptFee" column="manuscript_fee" />
<result property="driverAllowance" column="driver_allowance" />
<result property="graduateSettlementFee" column="graduate_settlement_fee" />
<result property="oneTimeDisabilitySubsidy" column="one_time_disability_subsidy" />
<result property="lectureAndExamFee" column="lecture_and_exam_fee" />
<result property="otherSubsidies" column="other_subsidies" />
<result property="houseRent" column="house_rent" />
<result property="wagesPayable" column="Wages_payable" />
<result property="accommodation" column="accommodation" />
<result property="heatingFee" column="heating_fee" />
<result property="tradeUnionDues" column="trade_union_dues" />
<result property="compensationDeduction" column="compensation_deduction" />
<result property="otherDeductions" column="other_deductions" />
<result property="mutualMedicalAid" column="mutual_medical_aid" />
<result property="communicationFee" column="communication_fee" />
<result property="tax1" column="tax1" />
<result property="tax2" column="tax2" />
<result property="pensionInsurance" column="pension_insurance" />
<result property="unemploymentInsurance" column="unemployment_insurance" />
<result property="medicalInsurance" column="medical_insurance" />
<result property="annuity" column="annuity" />
<result property="housingProvidentFund" column="housing_provident_fund" />
<result property="enterpriseFund" column="enterprise_fund" />
<result property="annuityIncomeTax" column="annuity_income_tax" />
<result property="totalPayment" column="total_payment" />
<result property="totalSalaryDisbursement" column="total_salary_disbursement" />
</resultMap>
<sql id="selectWagesDetailsOriginalDataVo">
select id, ssk_id, 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 from wages_details_original_data
</sql>
<select id="selectAll" parameterType="com.ruoyi.system.model.wages.dao.WagesDetailsOriginalExcelDAO" resultMap="WagesDetailsOriginalDataResult">
<include refid="selectWagesDetailsOriginalDataVo"/>
<where>
<if test="sskId != null and sskId != ''"> and ssk_id = #{sskId}</if>
<if test="year != null and year != ''"> and year = #{year}</if>
<if test="month != null and month != ''"> and month = #{month}</if>
<if test="unitName != null and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
<if test="peopleCount != null "> and people_count = #{peopleCount}</if>
<if test="totalWithholding != null "> and total_withholding = #{totalWithholding}</if>
<if test="netSalary != null "> and net_salary = #{netSalary}</if>
<if test="oneChildFee != null "> and one_child_fee = #{oneChildFee}</if>
<if test="medicalSubsidy != null "> and medical_subsidy = #{medicalSubsidy}</if>
<if test="healthCareFee != null "> and health_care_fee = #{healthCareFee}</if>
<if test="classMealFee != null "> and class_meal_fee = #{classMealFee}</if>
<if test="soapFee != null "> and soap_fee = #{soapFee}</if>
<if test="nursingFee != null "> and nursing_fee = #{nursingFee}</if>
<if test="heatstrokePreventionSubsidy != null "> and heatstroke_prevention_subsidy = #{heatstrokePreventionSubsidy}</if>
<if test="heatingSubsidy != null "> and heating_subsidy = #{heatingSubsidy}</if>
<if test="manuscriptFee != null "> and manuscript_fee = #{manuscriptFee}</if>
<if test="driverAllowance != null "> and driver_allowance = #{driverAllowance}</if>
<if test="graduateSettlementFee != null "> and graduate_settlement_fee = #{graduateSettlementFee}</if>
<if test="oneTimeDisabilitySubsidy != null "> and one_time_disability_subsidy = #{oneTimeDisabilitySubsidy}</if>
<if test="lectureAndExamFee != null "> and lecture_and_exam_fee = #{lectureAndExamFee}</if>
<if test="otherSubsidies != null "> and other_subsidies = #{otherSubsidies}</if>
<if test="houseRent != null "> and house_rent = #{houseRent}</if>
<if test="wagesPayable != null "> and Wages_payable = #{wagesPayable}</if>
<if test="accommodation != null "> and accommodation = #{accommodation}</if>
<if test="heatingFee != null "> and heating_fee = #{heatingFee}</if>
<if test="tradeUnionDues != null "> and trade_union_dues = #{tradeUnionDues}</if>
<if test="compensationDeduction != null "> and compensation_deduction = #{compensationDeduction}</if>
<if test="otherDeductions != null "> and other_deductions = #{otherDeductions}</if>
<if test="mutualMedicalAid != null "> and mutual_medical_aid = #{mutualMedicalAid}</if>
<if test="communicationFee != null "> and communication_fee = #{communicationFee}</if>
<if test="tax1 != null "> and tax1 = #{tax1}</if>
<if test="tax2 != null "> and tax2 = #{tax2}</if>
<if test="pensionInsurance != null "> and pension_insurance = #{pensionInsurance}</if>
<if test="unemploymentInsurance != null "> and unemployment_insurance = #{unemploymentInsurance}</if>
<if test="medicalInsurance != null "> and medical_insurance = #{medicalInsurance}</if>
<if test="annuity != null "> and annuity = #{annuity}</if>
<if test="housingProvidentFund != null "> and housing_provident_fund = #{housingProvidentFund}</if>
<if test="enterpriseFund != null "> and enterprise_fund = #{enterpriseFund}</if>
<if test="annuityIncomeTax != null "> and annuity_income_tax = #{annuityIncomeTax}</if>
<if test="totalPayment != null "> and total_payment = #{totalPayment}</if>
<if test="totalSalaryDisbursement != null "> and total_salary_disbursement = #{totalSalaryDisbursement}</if>
</where>
</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.WagesOverviewOriginalDateMapper">
<resultMap type="com.ruoyi.system.model.wages.dao.WagesOverviewOriginalExcelDAO" id="WagesOverviewOriginalDataResult">
<result property="year" column="year" />
<result property="month" column="month" />
<result property="unitCode" column="unit_code" />
<result property="unitName" column="unit_name" />
<result property="workerCount" column="worker_count" />
<result property="workerWagesPayable" column="worker_wages_payable" />
<result property="cadreCount" column="cadre_count" />
<result property="cadreWagesPayable" column="cadre_wages_payable" />
<result property="totalCount" column="total_count" />
<result property="totalWagesPayable" column="total_wages_payable" />
</resultMap>
<sql id="selectWagesOverviewOriginalDataVo">
select id, year, month, unit_code, unit_name, worker_count, worker_wages_payable, cadre_count, cadre_wages_payable, total_count, total_wages_payable from wages_overview_original_data
</sql>
<select id="selectAll" parameterType="com.ruoyi.system.model.wages.dao.WagesOverviewOriginalExcelDAO" resultMap="WagesOverviewOriginalDataResult">
<include refid="selectWagesOverviewOriginalDataVo"/>
<where>
<if test="year != null and year != ''"> and year = #{year}</if>
<if test="month != null and month != ''"> and month = #{month}</if>
<if test="unitCode != null and unitCode != ''"> and unit_code = #{unitCode}</if>
<if test="unitName != null and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
<if test="workerCount != null "> and worker_count = #{workerCount}</if>
<if test="workerWagesPayable != null "> and worker_wages_payable = #{workerWagesPayable}</if>
<if test="cadreCount != null "> and cadre_count = #{cadreCount}</if>
<if test="cadreWagesPayable != null "> and cadre_wages_payable = #{cadreWagesPayable}</if>
<if test="totalCount != null "> and total_count = #{totalCount}</if>
<if test="totalWagesPayable != null "> and total_wages_payable = #{totalWagesPayable}</if>
</where>
</select>
</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