Commit 69211052 authored by 位宇华's avatar 位宇华

--代码提交

parent 7cfe50db
......@@ -212,5 +212,16 @@ public class ActSuppliesHistorydataController extends BaseController
public TableDataInfo selectData(){
return getDataTable(actSuppliesHistorydataService.selectNewData());
}
@PreAuthorize("@ss.hasPermi('system.historydata.selectContent')")
@GetMapping("/selectbyid")
public AjaxResult selectContent(@RequestParam("id") Integer id){
return actSuppliesHistorydataService.selectContent(id);
}
@PreAuthorize("@ss.hasPermi('system.historydata.deleteById')")
@GetMapping("/deletebyid")
public AjaxResult deleteById(@RequestParam("id") Integer id){
actSuppliesHistorydataService.deleteById(id);
return toAjax(1);
}
}
......@@ -56,4 +56,8 @@ public interface ActSuppliesCleaningRuleMapper
void saveHistoryData(@Param("data") HistorySaveDataModel historySaveDataModel, @Param("jsonString") String jsonString);
List<HistoryResonseDataModel> selectNewData();
List<Object> selectContent(@Param("id") Integer id);
void deleteById(@Param("id") Integer id);
}
......@@ -4,13 +4,17 @@ import java.io.Serializable;
public class HistoryResonseDataModel implements Serializable {
private String historyName;
private Integer id;
private Object historyContent;
private String historyName;
private String mining;;
private String templateId;
private String templateName;
private String date;
private String createTime;
public String getHistoryName() {
return historyName;
......@@ -20,13 +24,6 @@ public class HistoryResonseDataModel implements Serializable {
this.historyName = historyName;
}
public Object getHistoryContent() {
return historyContent;
}
public void setHistoryContent(Object historyContent) {
this.historyContent = historyContent;
}
public String getMining() {
return mining;
......@@ -36,11 +33,35 @@ public class HistoryResonseDataModel implements Serializable {
this.mining = mining;
}
public String getTemplateId() {
return templateId;
public String getTemplateName() {
return templateName;
}
public void setTemplateName(String templateName) {
this.templateName = templateName;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public Integer getId() {
return id;
}
public void setTemplateId(String templateId) {
this.templateId = templateId;
public void setId(Integer id) {
this.id = id;
}
}
......@@ -15,6 +15,8 @@ public class HistorySaveDataModel implements Serializable {
private String templateId;
private String newDateTime;
public String getHistoryName() {
return historyName;
}
......@@ -46,4 +48,12 @@ public class HistorySaveDataModel implements Serializable {
public void setTemplateId(String templateId) {
this.templateId = templateId;
}
public String getNewDateTime() {
return newDateTime;
}
public void setNewDateTime(String newDateTime) {
this.newDateTime = newDateTime;
}
}
......@@ -99,4 +99,8 @@ public interface IActSuppliesHistorydataService
void saveHistoryData(HistorySaveDataModel historySaveDataModel);
List<?> selectNewData();
AjaxResult selectContent(Integer id);
void deleteById(Integer id);
}
......@@ -944,5 +944,15 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
return actSuppliesCleaningRuleMapper.selectNewData();
}
@Override
public AjaxResult selectContent(Integer id) {
return AjaxResult.success(actSuppliesCleaningRuleMapper.selectContent(id));
}
@Override
public void deleteById(Integer id) {
actSuppliesCleaningRuleMapper.deleteById(id);
}
}
......@@ -64,12 +64,20 @@
or two_level = ''
</select>
<select id="selectNewData" resultType="com.ruoyi.system.model.HistoryResonseDataModel">
select template_id as templateId, history_name as historyName, history_content as historyContent, mining
from new_history_data_sheet
select (select template_name
from act_supplies_template ast
where ast.id = a.template_id) as templateName,
id,
history_name as historyName,
mining,
new_datetime as `date`,
create_time as createTime
from new_history_data_sheet a
order by id desc
</select>
<insert id="insertActSuppliesImportCleaning" parameterType="ActSuppliesImportCleaning" useGeneratedKeys="true"
keyProperty="id">
insert into act_supplies_import_cleaning
......@@ -697,6 +705,7 @@
and hdate = #{dateColumn}
</delete>
<insert id="addInsertConvertAcc" parameterType="ActSuppliesImportTable" useGeneratedKeys="true" keyProperty="id">
insert into act_supplies_import_table_copy1
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -868,11 +877,15 @@
</foreach>
</insert>
<insert id="saveHistoryData">
Insert Into new_history_data_sheet (template_id, history_name, history_content, mining)
values (#{data.templateId}, #{data.historyName}, #{jsonString}, #{data.mining})
Insert Into new_history_data_sheet (template_id, history_name, history_content, mining, new_datetime)
values (#{data.templateId}, #{data.historyName}, #{jsonString}, #{data.mining}, #{data.newDateTime})
</insert>
<select id="selectContent" resultType="java.lang.Object">
select history_content from new_history_data_sheet where id=#{id}
</select>
<delete id="deleteById">
delete from new_history_data_sheet where id=#{id}
</delete>
</mapper>
......@@ -42,23 +42,23 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
redis.set("电力导入" + user, "电力导入大屏");
redis.expire("电力导入" + user, 5);
redis.close();
electricityIntoTheParameterDtoDtoList.stream().forEach(v -> v.setRow(v.getRow().split("-")[1]));
electricityIntoTheParameterDtoDtoList.stream().forEach(v -> v.setRow(v.getRow().replace(" ", "")));
electricityIntoTheParameterDtoDtoList.forEach(v -> v.setRow(v.getRow().split("-")[1]));
electricityIntoTheParameterDtoDtoList.forEach(v -> v.setRow(v.getRow().replace(" ", "")));
String mindId = electricityIntoTheParameterDtoDtoList.get(0).getMineid().replaceAll(" ", "");
List<PowerControlDao> controlList = powerDisplayMapper.selControl(mindId);
List<PowerDisplayDto> powerDisplayDtoList = new ArrayList<>();
Class<PowerDisplayDto> powerDisplayDtoClass = PowerDisplayDto.class;
AtomicBoolean b = new AtomicBoolean(false);
PowerDisplayDto xs011701 = null;
electricityIntoTheParameterDtoDtoList.stream().forEach(v -> {
if (!controlList.parallelStream().anyMatch(a -> a.getColumn().equals(v.getColoumn()))) return;
electricityIntoTheParameterDtoDtoList.forEach(v -> {
if (controlList.parallelStream().noneMatch(a -> a.getColumn().equals(v.getColoumn()))) return;
PowerDisplayDto displayDto;
if ("011704".equals(mindId) && v.getRow().equals("电价(含税)")) return;
if ("010105".equals(mindId) && (v.getRow().contains("(尖)") || v.getRow().contains("(峰)") || v.getRow().contains("(平)") || v.getRow().contains("(谷)") || v.getColoumn().equals("单价")))
return;
if ("011701".equals(mindId) && (v.getColoumn().equals("照明电价") || v.getColoumn().equals("动力电价") || v.getRow().contains("多经公司")))
return;
if (powerDisplayDtoList.size() > 0) {
if (!powerDisplayDtoList.isEmpty()) {
powerDisplayDtoList.removeAll(Collections.singleton(null));
b.set(powerDisplayDtoList.stream().anyMatch(a -> a.getClassificationName().equals(v.getRow())));
}
......@@ -85,7 +85,6 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
}
b.set(false);
});
if (xs011701 != null) powerDisplayDtoList.add(xs011701);
List<PowerClassificationQueryDao> dao = powerDisplayMapper.selectClassificationToMid(mindId);
SaveOnTheLargeScreenImpl saveOnTheLargeScreen = null;
List<String> linXi = Collections.singletonList("011704");
......@@ -99,8 +98,8 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
List<PowerDisplayDto> collect1 = powerDisplayDtoList.parallelStream().filter(v -> !field.contains(v.getClassificationName())).collect(Collectors.toList());
if (linXi.contains(mindId)) {
List<NewRuleRequestModel> collect = electricityIntoTheParameterDtoDtoList.parallelStream().filter(v -> v.getRow().equals("电价(含税)")).collect(Collectors.toList());
collect.stream().forEach(v -> v.setColoumn(v.getColoumn() + "-费"));
if (collect.size() != 0) {
collect.forEach(v -> v.setColoumn(v.getColoumn() + "-费"));
if (!collect.isEmpty()) {
collect.parallelStream().forEach(v -> {
Optional<PowerControlDao> first = controlList.parallelStream().filter(a -> a.getColumn().equals(v.getColoumn())).findFirst();
try {
......@@ -128,7 +127,7 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
.parallelStream()
.filter(v -> v.getRow().contains("(尖)") || v.getRow().contains("(峰)") || v.getRow().contains("(平)") || v.getRow().contains("(谷)"))
.collect(Collectors.toList());
if (collect.size() != 0) {
if (!collect.isEmpty()) {
PowerDisplayDto displayDto;
for (NewRuleRequestModel dto : collect) {
String[] split = dto.getRow().split("-");
......@@ -149,7 +148,7 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
saveOnTheLargeScreen = new SaveOnTheLargeScreenImpl(new QianJiaYing());
} else if (fanGeZhuang.contains(mindId)) {
List<NewRuleRequestModel> collect = electricityIntoTheParameterDtoDtoList.parallelStream().filter(v -> v.getRow().contains("多经公司")).collect(Collectors.toList());
if (collect.size() != 0) {
if (!collect.isEmpty()) {
PowerDisplayDto dto = new PowerDisplayDto();
String[] split = collect.get(0).getRow().split("-");
dto.setClassificationName(split[0]);
......@@ -181,8 +180,8 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
// 单另处理电费
if (mindId.equals("010105")) method(list, electricityIntoTheParameterDtoDtoList);
if (mindId.equals("011701")) methodFgz(list, electricityIntoTheParameterDtoDtoList);
list.stream().forEach(v -> {
if (v.getLevelOneClassification() == null || "".equals(v.getLevelOneClassification()))
list.forEach(v -> {
if (v.getLevelOneClassification() == null || v.getLevelOneClassification().isEmpty())
v.setLevelOneClassification("其他");
v.setMindId(mindId);
v.setDateColumn(electricityIntoTheParameterDtoDtoList.get(0).getWageMonth());
......@@ -216,10 +215,10 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
String electricityPricesForLighting = electricityIntoTheParameterDtoDtoList.parallelStream().filter(v -> v.getColoumn().equals("照明电价")).findFirst().get().getValue();
String powerTariff = electricityIntoTheParameterDtoDtoList.parallelStream().filter(v -> v.getColoumn().equals("动力电价")).findFirst().get().getValue();
list.parallelStream().forEach(v -> {
if ((v.getElectricityPriceFlat() != null && !v.getElectricityPriceFlat().equals("")) ||
(v.getElectricityPricePeak() != null && !v.getElectricityPricePeak().equals("")) ||
(v.getElectricityPriceTip() != null && !v.getElectricityPriceTip().equals("")) ||
(v.getElectricityPriceValley() != null && !v.getElectricityPriceValley().equals(""))) return;
if ((v.getElectricityPriceFlat() != null && !v.getElectricityPriceFlat().isEmpty()) ||
(v.getElectricityPricePeak() != null && !v.getElectricityPricePeak().isEmpty()) ||
(v.getElectricityPriceTip() != null && !v.getElectricityPriceTip().isEmpty()) ||
(v.getElectricityPriceValley() != null && !v.getElectricityPriceValley().isEmpty())) return;
if (v.getLevelThreeClassification().equals("动力用电")) {
v.setElectricityPriceValley(powerTariff);
v.setElectricityPriceFlat(powerTariff);
......@@ -243,8 +242,8 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
*/
private void method(List<PowerDisplayDto> list, List<NewRuleRequestModel> electricityIntoTheParameterDtoDtoList) {
for (PowerDisplayDto dto : list) {
if ((dto.getElectricityPriceFlat() == null || dto.getElectricityPriceFlat().equals("")) && (dto.getElectricityPricePeak() == null || dto.getElectricityPricePeak().equals("")) &&
(dto.getElectricityPriceTip() == null || dto.getElectricityPriceTip().equals("")) && (dto.getElectricityPriceValley() == null || dto.getElectricityPriceValley().equals(""))) {
if ((dto.getElectricityPriceFlat() == null || dto.getElectricityPriceFlat().isEmpty()) && (dto.getElectricityPricePeak() == null || dto.getElectricityPricePeak().isEmpty()) &&
(dto.getElectricityPriceTip() == null || dto.getElectricityPriceTip().isEmpty()) && (dto.getElectricityPriceValley() == null || dto.getElectricityPriceValley().isEmpty())) {
Optional<NewRuleRequestModel> first = electricityIntoTheParameterDtoDtoList.parallelStream().filter(v -> (v.getRow().equals(dto.getLevelOneClassification()) || v.getRow().equals(dto.getLevelTwoClassification())) && v.getColoumn().equals("单价")).findFirst();
if (first.isPresent()) {
NewRuleRequestModel model = first.get();
......
......@@ -125,12 +125,12 @@ public class CurrentRuleSalarySupport {
* @return
*/
private static List<SalaryExcelModel> getLxMineSalaryData(List<NewRuleRequestModel> newRuleSalaryRequestModelList) {
newRuleSalaryRequestModelList=newRuleSalaryRequestModelList.stream().map(v -> {
v.setColoumn(v.getColoumn().replaceAll(" ", StringUtils.EMPTY));
v.setRow(v.getRow().replaceAll(" ", StringUtils.EMPTY));
v.setMineid(v.getMineid().replaceAll(" ", StringUtils.EMPTY));
v.setValue(v.getValue().replaceAll(" ", StringUtils.EMPTY));
v.setWageMonth(v.getWageMonth().replaceAll(" ", StringUtils.EMPTY));
newRuleSalaryRequestModelList = newRuleSalaryRequestModelList.stream().map(v -> {
v.setColoumn(v.getColoumn().replaceAll(StringUtils.SPACE, StringUtils.EMPTY));
v.setRow(v.getRow().replaceAll(StringUtils.SPACE, StringUtils.EMPTY));
v.setMineid(v.getMineid().replaceAll(StringUtils.SPACE, StringUtils.EMPTY));
v.setValue(v.getValue().replaceAll(StringUtils.SPACE, StringUtils.EMPTY));
v.setWageMonth(v.getWageMonth().replaceAll(StringUtils.SPACE, StringUtils.EMPTY));
return v;
}).collect(Collectors.toList());
List<SalaryExcelModel> salaryExcelModelList = getSalaryMapping(newRuleSalaryRequestModelList);
......
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