Commit 358dd0f7 authored by 位宇华's avatar 位宇华

代码提交

parent 40521895
...@@ -20,4 +20,8 @@ public class CoalConstant { ...@@ -20,4 +20,8 @@ public class CoalConstant {
*/ */
public final static String LJT_MINE = "011702"; public final static String LJT_MINE = "011702";
public final static String ONE="1";
public final static String ZERO="0";
} }
package com.ruoyi.system.controller; package com.ruoyi.system.controller;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.model.newrulesalary.NewRuleSalaryRequestModel; import com.ruoyi.system.model.newrule.NewRuleSalaryModel;
import com.ruoyi.system.service.SalaryCurrentRuleService; import com.ruoyi.system.service.SalaryCurrentRuleService;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -19,7 +19,7 @@ public class SalaryCurrentRuleController { ...@@ -19,7 +19,7 @@ public class SalaryCurrentRuleController {
} }
@PostMapping("/current/rule/salary") @PostMapping("/current/rule/salary")
public AjaxResult getCurrentRuleSalary(@RequestBody List<NewRuleSalaryRequestModel> newRuleSalaryRequestModelList){ public AjaxResult getCurrentRuleSalary(@RequestBody List<NewRuleSalaryModel> newRuleSalaryRequestModelList){
return salaryCurrentRuleService.getCurrentRuleSalary(newRuleSalaryRequestModelList); return salaryCurrentRuleService.getCurrentRuleSalary(newRuleSalaryRequestModelList);
} }
} }
package com.ruoyi.system.controller;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.model.SalaryPowerUnifyExposeRequestModel;
import com.ruoyi.system.service.SalaryPowerUnifyExposeService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class SalaryPowerUnifyExposeController {
private final SalaryPowerUnifyExposeService salaryPowerUnifyExposeService;
public SalaryPowerUnifyExposeController(SalaryPowerUnifyExposeService salaryPowerUnifyExposeService) {
this.salaryPowerUnifyExposeService = salaryPowerUnifyExposeService;
}
/**
* 工资电力统一接口
*
* @return
*/
@PostMapping("/unify/expose")
public AjaxResult expose(@RequestBody SalaryPowerUnifyExposeRequestModel salaryPowerUnifyExposeRequestModel ) {
return salaryPowerUnifyExposeService.unify(salaryPowerUnifyExposeRequestModel);
}
}
package com.ruoyi.system.model;
import com.ruoyi.system.model.newrule.NewRuleSalaryModel;
import java.io.Serializable;
import java.util.List;
public class SalaryPowerUnifyExposeRequestModel implements Serializable {
private List<NewRuleSalaryModel> newRuleSalaryModelList;
/**
* 类型 0--工资 1--电力
*/
private String type;
public List<NewRuleSalaryModel> getNewRuleSalaryModelList() {
return newRuleSalaryModelList;
}
public void setNewRuleSalaryModelList(List<NewRuleSalaryModel> newRuleSalaryModelList) {
this.newRuleSalaryModelList = newRuleSalaryModelList;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
package com.ruoyi.system.model.newrulesalary; package com.ruoyi.system.model.newrule;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
public class NewRuleSalaryRequestModel implements Serializable { public class NewRuleSalaryModel implements Serializable {
private String row; private String row;
......
package com.ruoyi.system.service; package com.ruoyi.system.service;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.model.newrulesalary.NewRuleSalaryRequestModel; import com.ruoyi.system.model.newrule.NewRuleSalaryModel;
import java.util.List; import java.util.List;
public interface SalaryCurrentRuleService { public interface SalaryCurrentRuleService {
AjaxResult getCurrentRuleSalary(List<NewRuleSalaryRequestModel> newRuleSalaryRequestModelList); AjaxResult getCurrentRuleSalary(List<NewRuleSalaryModel> newRuleSalaryRequestModelList);
} }
package com.ruoyi.system.service;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.model.SalaryPowerUnifyExposeRequestModel;
public interface SalaryPowerUnifyExposeService {
AjaxResult unify(SalaryPowerUnifyExposeRequestModel salaryPowerUnifyExposeRequestModel);
}
...@@ -5,7 +5,7 @@ import com.ruoyi.common.core.domain.AjaxResult; ...@@ -5,7 +5,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.mapper.SalaryMapper; import com.ruoyi.system.mapper.SalaryMapper;
import com.ruoyi.system.model.newrulesalary.NewRuleSalaryRequestModel; import com.ruoyi.system.model.newrule.NewRuleSalaryModel;
import com.ruoyi.system.model.salary.SalaryExcelModel; import com.ruoyi.system.model.salary.SalaryExcelModel;
import com.ruoyi.system.model.salary.SalaryExpenseSourceModel; import com.ruoyi.system.model.salary.SalaryExpenseSourceModel;
import com.ruoyi.system.service.SalaryCurrentRuleService; import com.ruoyi.system.service.SalaryCurrentRuleService;
...@@ -27,12 +27,12 @@ public class SalaryCurrentRuleServiceImpl implements SalaryCurrentRuleService { ...@@ -27,12 +27,12 @@ public class SalaryCurrentRuleServiceImpl implements SalaryCurrentRuleService {
} }
@Override @Override
public AjaxResult getCurrentRuleSalary(List<NewRuleSalaryRequestModel> newRuleSalaryRequestModelList) { public AjaxResult getCurrentRuleSalary(List<NewRuleSalaryModel> newRuleSalaryRequestModelList) {
Optional<List<NewRuleSalaryRequestModel>> optional = Optional.ofNullable(newRuleSalaryRequestModelList); Optional<List<NewRuleSalaryModel>> optional = Optional.ofNullable(newRuleSalaryRequestModelList);
optional.ifPresent(v -> { optional.ifPresent(v -> {
String mineCode = newRuleSalaryRequestModelList.get(0).getMineid(); String mineCode = newRuleSalaryRequestModelList.get(0).getMineid();
String salaryDate = newRuleSalaryRequestModelList.get(0).getWageMonth(); String salaryDate = newRuleSalaryRequestModelList.get(0).getWageMonth();
Function<List<NewRuleSalaryRequestModel>, List<SalaryExcelModel>> stringListFunction = CurrentRuleSalarySupport.MINE_MAP.get(mineCode); Function<List<NewRuleSalaryModel>, List<SalaryExcelModel>> stringListFunction = CurrentRuleSalarySupport.MINE_MAP.get(mineCode);
List<SalaryExcelModel> salaryExcelModels = stringListFunction.apply(newRuleSalaryRequestModelList); List<SalaryExcelModel> salaryExcelModels = stringListFunction.apply(newRuleSalaryRequestModelList);
List<SalaryExpenseSourceModel> sourceModels = salaryMapper.getSources(mineCode); List<SalaryExpenseSourceModel> sourceModels = salaryMapper.getSources(mineCode);
salaryExcelModels.forEach(salary -> sourceModels.forEach(source -> { salaryExcelModels.forEach(salary -> sourceModels.forEach(source -> {
......
package com.ruoyi.system.service.impl;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.constant.CoalConstant;
import com.ruoyi.system.model.SalaryPowerUnifyExposeRequestModel;
import com.ruoyi.system.service.SalaryPowerUnifyExposeService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@Service
public class SalaryPowerUnifyExposeServiceImpl implements SalaryPowerUnifyExposeService {
@Override
public AjaxResult unify(SalaryPowerUnifyExposeRequestModel salaryPowerUnifyExposeRequestModel) {
if (StringUtils.equals(CoalConstant.ZERO,salaryPowerUnifyExposeRequestModel.getType())){
}
if (StringUtils.equals(CoalConstant.ONE,salaryPowerUnifyExposeRequestModel.getType())){
}
return null;
}
}
...@@ -3,7 +3,7 @@ package com.ruoyi.system.support; ...@@ -3,7 +3,7 @@ package com.ruoyi.system.support;
import com.ruoyi.system.constant.CoalConstant; import com.ruoyi.system.constant.CoalConstant;
import com.ruoyi.system.constant.SalaryConstant; import com.ruoyi.system.constant.SalaryConstant;
import com.ruoyi.system.model.newrulesalary.NewRuleSalaryRequestModel; import com.ruoyi.system.model.newrule.NewRuleSalaryModel;
import com.ruoyi.system.model.salary.SalaryExcelModel; import com.ruoyi.system.model.salary.SalaryExcelModel;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -15,7 +15,7 @@ import java.util.stream.Collectors; ...@@ -15,7 +15,7 @@ import java.util.stream.Collectors;
public class CurrentRuleSalarySupport { public class CurrentRuleSalarySupport {
public final static Map<String, Function<List<NewRuleSalaryRequestModel>, List<SalaryExcelModel>>> MINE_MAP = new HashMap<>(); public final static Map<String, Function<List<NewRuleSalaryModel>, List<SalaryExcelModel>>> MINE_MAP = new HashMap<>();
static { static {
MINE_MAP.put(CoalConstant.TS_MINE, CurrentRuleSalarySupport::getTsMineSalaryData); MINE_MAP.put(CoalConstant.TS_MINE, CurrentRuleSalarySupport::getTsMineSalaryData);
...@@ -31,7 +31,7 @@ public class CurrentRuleSalarySupport { ...@@ -31,7 +31,7 @@ public class CurrentRuleSalarySupport {
* @param newRuleSalaryRequestModelList * @param newRuleSalaryRequestModelList
* @return * @return
*/ */
private static List<SalaryExcelModel> getTsMineSalaryData(List<NewRuleSalaryRequestModel> newRuleSalaryRequestModelList) { private static List<SalaryExcelModel> getTsMineSalaryData(List<NewRuleSalaryModel> newRuleSalaryRequestModelList) {
List<SalaryExcelModel> salaryExcelModelList = new ArrayList<>(); List<SalaryExcelModel> salaryExcelModelList = new ArrayList<>();
return salaryExcelModelList; return salaryExcelModelList;
...@@ -44,7 +44,7 @@ public class CurrentRuleSalarySupport { ...@@ -44,7 +44,7 @@ public class CurrentRuleSalarySupport {
* @return * @return
*/ */
private static List<SalaryExcelModel> getLjtMineSalaryData(List<NewRuleSalaryRequestModel> newRuleSalaryRequestModelList) { private static List<SalaryExcelModel> getLjtMineSalaryData(List<NewRuleSalaryModel> newRuleSalaryRequestModelList) {
return getSalaryMapping(newRuleSalaryRequestModelList); return getSalaryMapping(newRuleSalaryRequestModelList);
} }
...@@ -54,7 +54,7 @@ public class CurrentRuleSalarySupport { ...@@ -54,7 +54,7 @@ public class CurrentRuleSalarySupport {
* @param newRuleSalaryRequestModelList * @param newRuleSalaryRequestModelList
* @return * @return
*/ */
private static List<SalaryExcelModel> getLxMineSalaryData(List<NewRuleSalaryRequestModel> newRuleSalaryRequestModelList) { private static List<SalaryExcelModel> getLxMineSalaryData(List<NewRuleSalaryModel> newRuleSalaryRequestModelList) {
List<SalaryExcelModel> salaryExcelModelList = new ArrayList<>(); List<SalaryExcelModel> salaryExcelModelList = new ArrayList<>();
return salaryExcelModelList; return salaryExcelModelList;
} }
...@@ -65,14 +65,14 @@ public class CurrentRuleSalarySupport { ...@@ -65,14 +65,14 @@ public class CurrentRuleSalarySupport {
* @param newRuleSalaryRequestModelList * @param newRuleSalaryRequestModelList
* @return * @return
*/ */
private static List<SalaryExcelModel> getDhtMineSalaryData(List<NewRuleSalaryRequestModel> newRuleSalaryRequestModelList) { private static List<SalaryExcelModel> getDhtMineSalaryData(List<NewRuleSalaryModel> newRuleSalaryRequestModelList) {
List<SalaryExcelModel> salaryExcelModelList = new ArrayList<>(); List<SalaryExcelModel> salaryExcelModelList = new ArrayList<>();
return salaryExcelModelList; return salaryExcelModelList;
} }
public static List<SalaryExcelModel> getSalaryMapping(List<NewRuleSalaryRequestModel> newRuleSalaryRequestModelList) { public static List<SalaryExcelModel> getSalaryMapping(List<NewRuleSalaryModel> newRuleSalaryRequestModelList) {
List<SalaryExcelModel> salaryExcelModelList = new ArrayList<>(); List<SalaryExcelModel> salaryExcelModelList = new ArrayList<>();
for (NewRuleSalaryRequestModel newRuleSalaryRequestModel : newRuleSalaryRequestModelList) { for (NewRuleSalaryModel newRuleSalaryRequestModel : newRuleSalaryRequestModelList) {
SalaryExcelModel salaryExcelModel = new SalaryExcelModel(); SalaryExcelModel salaryExcelModel = new SalaryExcelModel();
String col = newRuleSalaryRequestModel.getColoumn(); String col = newRuleSalaryRequestModel.getColoumn();
if (SalaryConstant.ORG_SET.contains(col)) { if (SalaryConstant.ORG_SET.contains(col)) {
......
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