Commit 1d5daa16 authored by Fuzy's avatar Fuzy

重构计算方法

parent 8d1bb1b4
......@@ -11,10 +11,13 @@ import com.ruoyi.system.service.IActSuppliesAccountService;
import com.ruoyi.system.utils.AccSubjectReqParamHandler;
import com.ruoyi.system.utils.AuxiliaryAccRuleHandler;
import com.ruoyi.system.yyinterface.VoucherUtils;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.stream.IntStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -23,48 +26,165 @@ import org.springframework.stereotype.Service;
@Service
public class ActSuppliesAccountServiceImpl implements IActSuppliesAccountService {
private static final JSONObject REQUEST_HTTP_BODY = new JSONObject();
private static final Map<String, Function<List<ActDispensing>, List<ActDispensing>>> MAP = new HashMap<>();
static {
REQUEST_HTTP_BODY.put("accsubjectchart", "1896891590924304390");
REQUEST_HTTP_BODY.put("pk_org", "1685820920723669151");
MAP.put("其他", ActSuppliesAccountServiceImpl::getActDispensings);
MAP.put("011706", ActSuppliesAccountServiceImpl::getActDispensing);
}
private Logger logger = LoggerFactory.getLogger(ActSuppliesAccountServiceImpl.class);
private static Logger logger = LoggerFactory.getLogger(ActSuppliesAccountServiceImpl.class);
@Autowired
private ActSuppliesAccountMapper actSuppliesAccountMapper;
public List<ActDispensing> options(List<ActDispensing> actDispensings) {
for (int i = 0; i < actDispensings.size(); i++) {
if (((ActDispensing)actDispensings.get(i)).getDepartment().equals("") || ((ActDispensing)actDispensings.get(i)).getDepartment() == null) {
ActDispensing actDispensing1 = this.actSuppliesAccountMapper.selectActSuppliesAccpuntByName(((ActDispensing)actDispensings.get(i)).getName());
if (((ActDispensing) actDispensings.get(i)).getDepartment().equals("") || ((ActDispensing) actDispensings.get(i)).getDepartment() == null) {
ActDispensing actDispensing1 = this.actSuppliesAccountMapper.selectActSuppliesAccpuntByName(((ActDispensing) actDispensings.get(i)).getName());
if (actDispensing1 != null) {
((ActDispensing)actDispensings.get(i)).setAccountingCode(actDispensing1.getAccountingCode());
((ActDispensing)actDispensings.get(i)).setAccountingNameA(actDispensing1.getAccountingNameA() + ',' + actDispensing1.getAccountingIdA());
((ActDispensing)actDispensings.get(i)).setAccountingNameB(actDispensing1.getAccountingNameB() + ',' + actDispensing1.getAccountingIdB());
((ActDispensing)actDispensings.get(i)).setAccountingNameC(actDispensing1.getAccountingNameC() + ',' + actDispensing1.getAccountingIdC());
((ActDispensing) actDispensings.get(i)).setAccountingCode(actDispensing1.getAccountingCode());
((ActDispensing) actDispensings.get(i)).setAccountingNameA(actDispensing1.getAccountingNameA() + ',' + actDispensing1.getAccountingIdA());
((ActDispensing) actDispensings.get(i)).setAccountingNameB(actDispensing1.getAccountingNameB() + ',' + actDispensing1.getAccountingIdB());
((ActDispensing) actDispensings.get(i)).setAccountingNameC(actDispensing1.getAccountingNameC() + ',' + actDispensing1.getAccountingIdC());
}
} else {
ActDispensing actDispensing1 = this.actSuppliesAccountMapper.selectActSuppliesAccpuntByName(((ActDispensing)actDispensings.get(i)).getName() + '-' + ((ActDispensing)actDispensings.get(i)).getDepartment() + '-' + ((ActDispensing)actDispensings.get(i)).getMaterial());
ActDispensing actDispensing1 = this.actSuppliesAccountMapper.selectActSuppliesAccpuntByName(((ActDispensing) actDispensings.get(i)).getName() + '-' + ((ActDispensing) actDispensings.get(i)).getDepartment() + '-' + ((ActDispensing) actDispensings.get(i)).getMaterial());
if (actDispensing1 != null) {
((ActDispensing)actDispensings.get(i)).setAccountingCode(actDispensing1.getAccountingCode());
((ActDispensing)actDispensings.get(i)).setAccountingNameA(actDispensing1.getAccountingNameA() + ',' + actDispensing1.getAccountingIdA());
((ActDispensing)actDispensings.get(i)).setAccountingNameB(actDispensing1.getAccountingNameB() + ',' + actDispensing1.getAccountingIdB());
((ActDispensing)actDispensings.get(i)).setAccountingNameC(actDispensing1.getAccountingNameC() + ',' + actDispensing1.getAccountingIdC());
((ActDispensing) actDispensings.get(i)).setAccountingCode(actDispensing1.getAccountingCode());
((ActDispensing) actDispensings.get(i)).setAccountingNameA(actDispensing1.getAccountingNameA() + ',' + actDispensing1.getAccountingIdA());
((ActDispensing) actDispensings.get(i)).setAccountingNameB(actDispensing1.getAccountingNameB() + ',' + actDispensing1.getAccountingIdB());
((ActDispensing) actDispensings.get(i)).setAccountingNameC(actDispensing1.getAccountingNameC() + ',' + actDispensing1.getAccountingIdC());
}
}
}
List<ActDispensing> actDispensing = this.actSuppliesAccountMapper.selectActSuppliesAccpuntByCode();
for (int j = 0; j < actDispensing.size(); j++) {
((ActDispensing)actDispensing.get(j)).setAccountingNameA(((ActDispensing)actDispensing.get(j)).getAccountingNameA() + ',' + ((ActDispensing)actDispensing.get(j)).getAccountingIdA());
((ActDispensing)actDispensing.get(j)).setAccountingNameB(((ActDispensing)actDispensing.get(j)).getAccountingNameB() + ',' + ((ActDispensing)actDispensing.get(j)).getAccountingIdB());
((ActDispensing)actDispensing.get(j)).setAccountingNameC(((ActDispensing)actDispensing.get(j)).getAccountingNameC() + ',' + ((ActDispensing)actDispensing.get(j)).getAccountingIdC());
((ActDispensing) actDispensing.get(j)).setAccountingNameA(((ActDispensing) actDispensing.get(j)).getAccountingNameA() + ',' + ((ActDispensing) actDispensing.get(j)).getAccountingIdA());
((ActDispensing) actDispensing.get(j)).setAccountingNameB(((ActDispensing) actDispensing.get(j)).getAccountingNameB() + ',' + ((ActDispensing) actDispensing.get(j)).getAccountingIdB());
((ActDispensing) actDispensing.get(j)).setAccountingNameC(((ActDispensing) actDispensing.get(j)).getAccountingNameC() + ',' + ((ActDispensing) actDispensing.get(j)).getAccountingIdC());
actDispensings.add(actDispensing.get(j));
}
return actDispensings;
}
public List<ActDispensing> getAccountFromYon(List<ActDispensing> actDispensings) {
Optional<List<ActDispensing>> optional = Optional.ofNullable(actDispensings);
if (!optional.isPresent()) {
return null;
}
String s = actDispensings.get(0).getMining().equals("011706") ? "011706" : "其他";
Function<List<ActDispensing>, List<ActDispensing>> function = MAP.get(s);
List<ActDispensing> apply = function.apply(actDispensings);
return apply;
}
/**
* 中润调用友接口拿数据方法
*
* @param actDispensings
* @return
*/
private static List<ActDispensing> getActDispensing(List<ActDispensing> actDispensings) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("accsubjectchart", "1896891590924304390");
jsonObject.put("pk_org", "1685820920723669151");
for (ActDispensing actDispensing : actDispensings) {
String[] names = actDispensing.getName().split("_");
int len = names.length;
jsonObject.put("names", names[len - 1]);
ReturnResult returnResult = VoucherUtils.callVoucherQuery(jsonObject, "/yonbip/fi/fipub/accsubject/querysubjectapi");
ArrayList data = returnResult.getData();
JSONObject object = (JSONObject) data.get(0);
JSONObject accsubjectchart = object.getJSONObject("accsubjectchart");
JSONObject accSubjects = (JSONObject) accsubjectchart.get("accSubjects");
accSubjects.forEach((a, b) -> {
JSONObject jsonObject1 = (JSONObject) b;
if (actDispensing.getName().equals(jsonObject1.getString("displayname"))) {
actDispensing.setAccountingCode(jsonObject1.getString("code"));
JSONArray bodies = jsonObject1.getJSONArray("bodies");
if (actDispensing.getAccountingNameA() != null && actDispensing.getAccountingNameA().split("-").length == 2) {
String[] split = actDispensing.getAccountingNameA().split("-");
boolean dimensionext_name = IntStream.range(0, bodies.size())
.mapToObj(bodies::getJSONObject)
.map(v -> v.getString("dimensionext_name"))
.anyMatch(v -> split[0].equals(v));
if (dimensionext_name) {
JSONObject object1 = new JSONObject();
object1.put("pageIndex", "1");
object1.put("pageSize", "1000");
object1.put("name", split[1]);
ReturnResult returnResult1 = VoucherUtils.callVoucherQuery(jsonObject, "/yonbip/digitalModel/customerdoc/list");
JSONObject o = (JSONObject) returnResult1.getData().get(0);
JSONArray recordList = o.getJSONArray("recordList");
Optional<String> first = IntStream.range(0, recordList.size())
.mapToObj(recordList::getJSONObject)
.filter(v -> v.getString("custdocdefid_name").equals(split[0]))
.map(v -> v.getString("code"))
.findFirst();
first.ifPresent(actDispensing::setAccountingIdA);
}
}
if (actDispensing.getAccountingNameB() != null && actDispensing.getAccountingNameB().split("-").length == 2) {
String[] split = actDispensing.getAccountingNameB().split("-");
boolean dimensionext_name = IntStream.range(0, bodies.size())
.mapToObj(bodies::getJSONObject)
.map(v -> v.getString("dimensionext_name"))
.anyMatch(v -> split[0].equals(v));
if (dimensionext_name) {
JSONObject object1 = new JSONObject();
object1.put("pageIndex", "1");
object1.put("pageSize", "1000");
object1.put("name", split[1]);
ReturnResult returnResult1 = VoucherUtils.callVoucherQuery(jsonObject, "/yonbip/digitalModel/customerdoc/list");
JSONObject o = (JSONObject) returnResult1.getData().get(0);
JSONArray recordList = o.getJSONArray("recordList");
Optional<String> first = IntStream.range(0, recordList.size())
.mapToObj(recordList::getJSONObject)
.filter(v -> v.getString("custdocdefid_name").equals(split[0]))
.map(v -> v.getString("code"))
.findFirst();
first.ifPresent(actDispensing::setAccountingIdB);
}
}
if (actDispensing.getAccountingNameC() != null && actDispensing.getAccountingNameC().split("-").length == 2) {
String[] split = actDispensing.getAccountingNameC().split("-");
boolean dimensionext_name = IntStream.range(0, bodies.size())
.mapToObj(bodies::getJSONObject)
.map(v -> v.getString("dimensionext_name"))
.anyMatch(v -> split[0].equals(v));
if (dimensionext_name) {
JSONObject object1 = new JSONObject();
object1.put("pageIndex", "1");
object1.put("pageSize", "1000");
object1.put("name", split[1]);
ReturnResult returnResult1 = VoucherUtils.callVoucherQuery(jsonObject, "/yonbip/digitalModel/customerdoc/list");
JSONObject o = (JSONObject) returnResult1.getData().get(0);
JSONArray recordList = o.getJSONArray("recordList");
Optional<String> first = IntStream.range(0, recordList.size())
.mapToObj(recordList::getJSONObject)
.filter(v -> v.getString("custdocdefid_name").equals(split[0]))
.map(v -> v.getString("code"))
.findFirst();
first.ifPresent(actDispensing::setAccountingIdC);
}
}
return;
}
});
}
return null;
}
/**
* 其他矿调用友接口拿数据方法(以前的)
*
* @param actDispensings
* @return
*/
private static List<ActDispensing> getActDispensings(List<ActDispensing> actDispensings) {
JSONObject accSubjects = getAccSubjects();
CustomDocRequestModel docRequest = new CustomDocRequestModel();
docRequest.setPageIndex(Long.valueOf(1L));
......@@ -82,7 +202,7 @@ public class ActSuppliesAccountServiceImpl implements IActSuppliesAccountService
dispensing.setAccountingNameC(null + "," + null);
Map<String, String> mapNameCode = new HashMap<>();
for (Object jsonObject : res) {
JSONObject accObject = (JSONObject)jsonObject;
JSONObject accObject = (JSONObject) jsonObject;
String dimensionextName = accObject.getString("dimensionext_name");
String dimensionextCode = accObject.getString("dimensionext_code");
String codeFromCustomDoc = null;
......@@ -106,17 +226,17 @@ public class ActSuppliesAccountServiceImpl implements IActSuppliesAccountService
Iterator<Map.Entry<String, String>> it = mapNameCode.entrySet().iterator();
if (it.hasNext()) {
Map.Entry<String, String> entry = it.next();
dispensing.setAccountingNameA((String)entry.getKey() + "," + (String)entry.getValue());
dispensing.setAccountingNameA((String) entry.getKey() + "," + (String) entry.getValue());
}
if (it.hasNext()) {
Map.Entry<String, String> entry = it.next();
dispensing.setAccountingNameB((String)entry.getKey() + "," + (String)entry.getValue());
dispensing.setAccountingNameB((String) entry.getKey() + "," + (String) entry.getValue());
}
if (it.hasNext()) {
Map.Entry<String, String> entry = it.next();
dispensing.setAccountingNameC((String)entry.getKey() + "," + (String)entry.getValue());
dispensing.setAccountingNameC((String) entry.getKey() + "," + (String) entry.getValue());
}
this.logger.error(dispensing.toString());
logger.error(dispensing.toString());
}
ActDispensing actDispensing = new ActDispensing();
actDispensing.setAccountingCode("2241005");
......@@ -126,36 +246,36 @@ public class ActSuppliesAccountServiceImpl implements IActSuppliesAccountService
actDispensings.add(actDispensing2);
return actDispensings;
}
public JSONArray getCustomDoc(CustomDocRequestModel customDocRequestModel) {
public static JSONArray getCustomDoc(CustomDocRequestModel customDocRequestModel) {
ReturnResult customDocument = VoucherUtils.callVoucherQuery(customDocRequestModel, "/yonbip/digitalModel/customerdoc/list");
JSONObject customDocumentJsonObj = (JSONObject)JSON.toJSON(customDocument.getData().get(0));
JSONObject customDocumentJsonObj = (JSONObject) JSON.toJSON(customDocument.getData().get(0));
return customDocumentJsonObj.getJSONArray("recordList");
}
public JSONObject getCellByName(String filterNameZHCN, JSONObject accSubjects) {
public static JSONObject getCellByName(String filterNameZHCN, JSONObject accSubjects) {
JSONObject cell = getAccSubject(accSubjects, filterNameZHCN);
if (filterNameZHCN == null || "".equals(filterNameZHCN) || cell == null || cell.size() == 0){
if (filterNameZHCN == null || "".equals(filterNameZHCN) || cell == null || cell.size() == 0) {
return null;
}
if ("专项储备_煤炭生产安全费_本年减少_费用性支出".equals(filterNameZHCN) || "研发支出_费用化支出_材料及低值易耗品".equals(filterNameZHCN) || "在建工程_内部投资工程".equals(filterNameZHCN))
return filterBodiesWithSpecified(cell);
return filterBodiesWithExtNameEnding(cell);
}
private JSONObject getAccSubject(JSONObject accSubjects, String filterNameZHCN) {
private static JSONObject getAccSubject(JSONObject accSubjects, String filterNameZHCN) {
for (String key : accSubjects.keySet()) {
JSONArray accSubject = accSubjects.getJSONArray(key);
for (Object o : accSubject) {
JSONObject cell = (JSONObject)o;
JSONObject cell = (JSONObject) o;
if (cell.getString("displayname").equals(filterNameZHCN))
return cell;
}
}
return null;
}
private JSONObject filterBodiesWithExtNameEnding(JSONObject cell) {
private static JSONObject filterBodiesWithExtNameEnding(JSONObject cell) {
JSONArray bodies = cell.getJSONArray("bodies");
JSONArray res = new JSONArray();
String code = cell.getString("code");
......@@ -176,8 +296,8 @@ public class ActSuppliesAccountServiceImpl implements IActSuppliesAccountService
result.put("res", res);
return result;
}
private JSONObject filterBodiesWithSpecified(JSONObject cell) {
private static JSONObject filterBodiesWithSpecified(JSONObject cell) {
JSONArray bodies = cell.getJSONArray("bodies");
JSONArray res = new JSONArray();
String code = cell.getString("code");
......@@ -195,11 +315,11 @@ public class ActSuppliesAccountServiceImpl implements IActSuppliesAccountService
result.put("res", res);
return result;
}
private String getCodeFromCustomDoc(JSONArray customDoc, String nameZhCn) {
private static String getCodeFromCustomDoc(JSONArray customDoc, String nameZhCn) {
String code = null;
for (Object o : customDoc) {
JSONObject object = (JSONObject)o;
JSONObject object = (JSONObject) o;
JSONObject nameObject = object.getJSONObject("name");
String zh_CN = nameObject.getString("zh_CN");
if (zh_CN.equals(nameZhCn)) {
......@@ -209,13 +329,13 @@ public class ActSuppliesAccountServiceImpl implements IActSuppliesAccountService
}
return code;
}
public JSONArray getAuxiliary() {
ReturnResult accounting = VoucherUtils.invokeByGet("", "", "/yonbip/fi/fipub/multidimension_ext/getapimultidimension");
return (JSONArray)JSON.toJSON(accounting.getData());
return (JSONArray) JSON.toJSON(accounting.getData());
}
public JSONObject getAccSubjects() {
public static JSONObject getAccSubjects() {
ReturnResult accSubject = VoucherUtils.callVoucherQuery(REQUEST_HTTP_BODY, "/yonbip/fi/fipub/accsubject/querysubjectapi");
JSONArray jsonArray = new JSONArray(accSubject.getData());
return jsonArray
......
package com.ruoyi.system.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.support.config.FastJsonConfig;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.model.wages.dao.WagesDetailsOriginalExcelDAO;
import com.ruoyi.system.model.wages.dao.WagesSalaryProof;
import com.ruoyi.system.model.wages.vo.WagesOverviewOriginalDataVO;
import com.ruoyi.system.service.WagesService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Map;
/**
* 2024/4/26
......@@ -42,7 +29,7 @@ public class WagesController {
}
/**
* excel解析
* 唐山矿excel解析
* @param file
* @return
*/
......@@ -88,5 +75,23 @@ public class WagesController {
return AjaxResult.success(of);
}
/**
* 林西矿工资Excel导入
* @return
*/
@RequestMapping("/lxWages")
public AjaxResult LinXiExcelAnalysisWages(@RequestParam("file") MultipartFile file, @RequestParam("date")String date){
String s = wagesService.linXiExcelAnalysisWages(file, date);
return new AjaxResult(200, s);
}
/**
* 林西矿工资Excel导入
* @return
*/
@RequestMapping("/lxIns")
public List<WagesDetailsOriginalExcelDAO> LinXiExcelAnalysisInsurance(){
// List<WagesDetailsOriginalExcelDAO> list = wagesService.linXiExcelAnalysisInsurance();
return null;
}
}
package com.ruoyi.system.model.wages.dao;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 2024/6/6
*/
// 林西财务工资表
@Data
public class LinXiFinanceWagesSurface {
@ExcelProperty(value = "部门名称",index = 0)
private String dept;
@ExcelProperty(value = "人数", index = 1)
private BigDecimal numberOfPeople;
@ExcelProperty(value = "工资合计", index = 2)
private BigDecimal totalSalary;
@ExcelProperty(value = "班中餐", index = 3)
private BigDecimal classLunch;
@ExcelProperty(value = "一孩保健", index = 4)
private BigDecimal childHealthCare;
@ExcelProperty(value = "保健费", index = 5)
private BigDecimal healthExpenses;
@ExcelProperty(value = "住宿补贴", index = 6)
private BigDecimal accommodationSubsidy;
@ExcelProperty(value = "荣誉金", index =7 )
private BigDecimal honoraryGold;
@ExcelProperty(value = "降温防暑费", index = 8)
private BigDecimal coolingAndHeatstrokePreventionFees;
@ExcelProperty(value = "生日补贴", index = 9)
private BigDecimal birthdaySubsidy;
@ExcelProperty(value = "月票", index = 10)
private BigDecimal monthlyTicket;
@ExcelProperty(value = "护理费", index = 11)
private BigDecimal nursingExpenses;
@ExcelProperty(value = "营养餐", index = 12)
private BigDecimal nutritionalMeals;
@ExcelProperty(value = "党组织工作经费", index = 13)
private BigDecimal partyOrganizationWorkFunds;
@ExcelProperty(value = "培训费", index = 14)
private BigDecimal trainingFees;
@ExcelProperty(value = "其它费用1", index = 15)
private BigDecimal otherExpenses1;
@ExcelProperty(value = "其它费用1.1", index = 16)
private BigDecimal otherExpenses1_1;
@ExcelProperty(value = "其它费用1.2", index = 17)
private BigDecimal otherExpenses1_2;
@ExcelProperty(value = "其它费用2", index = 18)
private BigDecimal otherExpenses2;
@ExcelProperty(value = "伙食补贴", index = 19)
private BigDecimal mealAllowance;
@ExcelProperty(value = "其它费用4", index = 20)
private BigDecimal otherExpenses4;
@ExcelProperty(value = "宣传费用", index = 21)
private BigDecimal promotionExpenses;
@ExcelProperty(value = "司机补贴", index = 22)
private BigDecimal driverSubsidies;
@ExcelProperty(value = "困难补助", index = 23)
private BigDecimal subsidyThoseFinancialDifficulties;
@ExcelProperty(value = "费用合计", index = 24)
private BigDecimal totalExpenses;
@ExcelProperty(value = "应付工资", index = 25)
private BigDecimal payableWages;
@ExcelProperty(value = "扣款合计", index = 26)
private BigDecimal totalDeduction;
@ExcelProperty(value = "实付工资", index = 27)
private BigDecimal paidWages;
@ExcelProperty(value = "矿付", index = 28)
private BigDecimal miningPayment;
}
package com.ruoyi.system.model.wages.dao;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 2024/6/6
*/
// 林西工资详情表
@Data
public class LinXiWagesDetailsOriginalExcelDao {
@ExcelProperty(value = "部门名称",index = 0)
private String dept;
@ExcelProperty(value = "人数", index = 1)
private BigDecimal numberOfPeople;
@ExcelProperty(value = "基本工资", index = 2)
private BigDecimal basicSalary;
@ExcelProperty(value = "风险补贴", index = 3)
private BigDecimal riskSubsidy;
@ExcelProperty(value = "节日资", index = 4)
private BigDecimal festivalResources;
@ExcelProperty(value = "井下贴", index = 5)
private BigDecimal undergroundSticker;
@ExcelProperty(value = "岗贴", index = 6)
private BigDecimal postStickers;
@ExcelProperty(value = "夜班费", index = 7)
private BigDecimal nightShiftFee;
@ExcelProperty(value = "班组贴", index = 8)
private BigDecimal teamStickers;
@ExcelProperty(value = "书报", index = 9)
private BigDecimal booksAndNewspapers;
@ExcelProperty(value = "调标补资", index = 10)
private BigDecimal adjustmentStandardsFunding;
@ExcelProperty(value = "调标补资1", index = 11)
private BigDecimal adjustmentStandardsFunding1;
@ExcelProperty(value = "女卫", index = 12)
private BigDecimal femaleGuard;
@ExcelProperty(value = "交通补贴", index = 13)
private BigDecimal transportationSubsidies;
@ExcelProperty(value = "房贴", index = 14)
private BigDecimal roomStickers;
@ExcelProperty(value = "技师", index = 15)
private BigDecimal technician;
@ExcelProperty(value = "岗位带头人", index = 16)
private BigDecimal jobLeader;
@ExcelProperty(value = "绩效工资", index = 17)
private BigDecimal performanceBasedSalary;
@ExcelProperty(value = "安全工资", index = 18)
private BigDecimal safeSalary;
@ExcelProperty(value = "保勤奖", index = 19)
private BigDecimal attendanceAward;
@ExcelProperty(value = "风险金返还", index = 20)
private BigDecimal riskFundReturn;
@ExcelProperty(value = "调精神文明奖", index = 21)
private BigDecimal spiritualCivilizationAward;
@ExcelProperty(value = "年终奖", index = 22)
private BigDecimal yearEndBonus;
@ExcelProperty(value = "调保勤奖", index = 23)
private BigDecimal adjustmentAndMaintenanceAttendanceAward;
@ExcelProperty(value = "调一季度开门红奖", index = 24)
private BigDecimal adjustFirstQuarterOpeningBonus;
@ExcelProperty(value = "单项奖", index = 25)
private BigDecimal individualAwards;
@ExcelProperty(value = "兑现奖", index = 26)
private BigDecimal redemptionAward;
@ExcelProperty(value = "配煤奖", index = 27)
private BigDecimal coalBlendingAward;
@ExcelProperty(value = "通防奖", index = 28)
private BigDecimal communicationAndDefenseAward;
@ExcelProperty(value = "其它奖", index = 29)
private BigDecimal otherAwards;
@ExcelProperty(value = "下井加奖", index = 30)
private BigDecimal lowerWellBonus;
@ExcelProperty(value = "加其它一", index = 31)
private BigDecimal addAnotherOne;
@ExcelProperty(value = "加其它二", index = 32)
private BigDecimal addAnotherTwo;
@ExcelProperty(value = "其它扣奖", index = 33)
private BigDecimal otherDeductions;
@ExcelProperty(value = "奖金合计", index = 34)
private BigDecimal totalBonus;
@ExcelProperty(value = "生育津贴", index = 35)
private BigDecimal maternityAllowance;
@ExcelProperty(value = "肉贴", index = 36)
private BigDecimal meatPaste;
@ExcelProperty(value = "年功", index = 37)
private BigDecimal meritEarnedDuringYearsOfService;
@ExcelProperty(value = "老年功", index = 38)
private BigDecimal elderlyMerit;
@ExcelProperty(value = "医药贴", index = 39)
private BigDecimal medicalPatches;
@ExcelProperty(value = "取暖费", index = 40)
private BigDecimal heatingExpenses;
@ExcelProperty(value = "话费", index = 41)
private BigDecimal phoneBill;
@ExcelProperty(value = "信访津贴", index = 42)
private BigDecimal petitionAllowance;
@ExcelProperty(value = "三违罚款", index = 43)
private BigDecimal finesForThreeViolations;
@ExcelProperty(value = "工资合计", index = 44)
private BigDecimal totalSalary;
@ExcelProperty(value = "班中餐", index = 45)
private BigDecimal classLunch;
@ExcelProperty(value = "一孩保健", index = 46)
private BigDecimal childHealthCare;
@ExcelProperty(value = "保健费", index = 47)
private BigDecimal healthExpenses;
@ExcelProperty(value = "住宿补贴", index = 48)
private BigDecimal accommodationSubsidy;
@ExcelProperty(value = "荣誉金", index = 49)
private BigDecimal honoraryGold;
@ExcelProperty(value = "降温防暑费", index = 50)
private BigDecimal coolingAndHeatstrokePreventionFees;
@ExcelProperty(value = "生日补贴", index = 51)
private BigDecimal birthdaySubsidy;
@ExcelProperty(value = "月票", index = 52)
private BigDecimal monthlyTicket;
@ExcelProperty(value = "护理费", index = 53)
private BigDecimal nursingExpenses;
@ExcelProperty(value = "营养餐", index = 54)
private BigDecimal nutritionalMeals;
@ExcelProperty(value = "党组织工作经费", index = 55)
private BigDecimal partyOrganizationWorkFunds;
@ExcelProperty(value = "培训费", index = 56)
private BigDecimal trainingFees;
@ExcelProperty(value = "其它费用1", index = 57)
private BigDecimal otherExpenses1;
@ExcelProperty(value = "其它费用1.1", index = 58)
private BigDecimal otherExpenses1_1;
@ExcelProperty(value = "其它费用1.2", index = 59)
private BigDecimal otherExpenses1_2;
@ExcelProperty(value = "其它费用2", index = 60)
private BigDecimal otherExpenses2;
@ExcelProperty(value = "伙食补贴", index = 61)
private BigDecimal mealAllowance;
@ExcelProperty(value = "其它费用4", index = 62)
private BigDecimal otherExpenses4;
@ExcelProperty(value = "宣传费用", index = 63)
private BigDecimal promotionExpenses;
@ExcelProperty(value = "司机补贴", index = 64)
private BigDecimal driverSubsidies;
@ExcelProperty(value = "困难补助", index = 65)
private BigDecimal subsidyThoseFinancialDifficulties;
@ExcelProperty(value = "费用合计", index = 66)
private BigDecimal totalExpenses;
@ExcelProperty(value = "应付工资", index = 67)
private BigDecimal payableWages;
@ExcelProperty(value = "扣款合计", index = 68)
private BigDecimal totalDeduction;
@ExcelProperty(value = "实付工资", index = 69)
private BigDecimal paidWages;
@ExcelProperty(value = "矿付", index = 70)
private BigDecimal miningPayment;
}
......@@ -2,12 +2,10 @@ package com.ruoyi.system.service;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.system.model.wages.dao.WagesDetailsOriginalExcelDAO;
import com.ruoyi.system.model.wages.dao.WagesSalaryProof;
import com.ruoyi.system.model.wages.vo.WagesOverviewOriginalDataVO;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Map;
/**
* 2024/4/27
......@@ -20,4 +18,6 @@ public interface WagesService {
List<WagesDetailsOriginalExcelDAO> details();
JSONObject selectWagesVoucherList(String s);
String linXiExcelAnalysisWages(MultipartFile file, String date);
}
......@@ -13,6 +13,8 @@ import com.ruoyi.system.model.wages.dao.*;
import com.ruoyi.system.model.wages.vo.WagesOverviewOriginalDataVO;
import com.ruoyi.system.service.WagesService;
import com.ruoyi.system.yyinterface.VoucherUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -23,6 +25,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
......@@ -200,6 +203,24 @@ public class WagesServiceImpl implements WagesService {
return object;
}
@Override
public String linXiExcelAnalysisWages(MultipartFile file, String date) {
try {
List<String> filterList = Arrays.asList("小计", "合计", "总计");
InputStream inputStream = file.getInputStream();
List<LinXiWagesDetailsOriginalExcelDao> wagesList = EasyExcelFactory.read(inputStream, LinXiWagesDetailsOriginalExcelDao.class, new ExcelListener<LinXiWagesDetailsOriginalExcelDao>()).sheet(0).doReadSync();
inputStream.close();
InputStream inputStream1 = file.getInputStream();
List<LinXiFinanceWagesSurface> financeWagesList = EasyExcelFactory.read(inputStream1, LinXiFinanceWagesSurface.class, new ExcelListener<LinXiFinanceWagesSurface>()).sheet(1).doReadSync();
inputStream1.close();
wagesList = wagesList.parallelStream().filter(v -> !filterList.contains(v.getDept())).collect(Collectors.toList());
financeWagesList = financeWagesList.parallelStream().filter(v -> !filterList.contains(v.getDept())).collect(Collectors.toList());
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public JSONArray getCustomDoc(CustomDocRequestModel customDocRequestModel) {
ReturnResult customDocument = VoucherUtils.callVoucherQuery(customDocRequestModel, "/yonbip/digitalModel/customerdoc/list");
if(customDocument!=null){
......
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