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

--代码提交

parent 7e9a63fe
......@@ -18,7 +18,7 @@ public class ConfigSaveController {
@PostMapping("/test/save")
public void save() {
Map<String,Object> map = new HashMap<>();
map.put("org","项目,部门名称");
/*map.put("org","项目,部门名称");
map.put("personCount","人数");
map.put("salary","应付工资");
map.put("medicalSubsidy","应付工资2(医疗补贴)");
......@@ -40,7 +40,27 @@ public class ConfigSaveController {
map.put("longAccountInsurance","长户险");
map.put("honorMoney","荣誉金");
map.put("warmSubsidy","取暖补贴");
map.put("heatPreventSubsidy","防暑降温,降温防暑费");
map.put("heatPreventSubsidy","防暑降温,降温防暑费");*/
map.put("classificationName","用电单位");
map.put("powerTotal","电量(kwh)");
map.put("powerTip","");
map.put("powerPeak","");
map.put("powerFlat","");
map.put("powerValley","");
map.put("electricityTotal","含税电费总额(元)");
map.put("electricityTip","");
map.put("electricityPeak","");
map.put("electricityFlat","");
map.put("electricityValley","");
map.put("electricityPriceTip","");
map.put("electricityPricePeak","");
map.put("electricityPriceFlat","");
map.put("electricityPriceValley","");
map.put("levelOneClassification","");
map.put("levelTwoClassification","");
map.put("levelThreeClassification","");
map.put("basicElectricityTariff","");
map.forEach((k,v)-> salaryMapper.insertMap(k,v));
}
......
......@@ -32,4 +32,10 @@ public class PowerDisplayController {
powerDisplayService.peek(powerDisplayDtoList);
return new AjaxResult(200, "成功");
}
@PostMapping("/save")
public AjaxResult save(@RequestBody List<NewRuleRequestModel> powerDisplayDtoList) {
return powerDisplayService.save(powerDisplayDtoList);
}
}
package com.ruoyi.system.mapper;
import com.ruoyi.system.model.power.PowerSourceModel;
import com.ruoyi.system.model.power.dao.PowerClassificationQueryDao;
import com.ruoyi.system.model.power.dao.PowerControlDao;
import com.ruoyi.system.model.power.dto.PowerDisplayDto;
import com.ruoyi.system.model.salary.ConfigModel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -24,4 +26,8 @@ public interface PowerDisplayMapper {
List<PowerDisplayDto> selOfMid(@Param("id") String mindId, @Param("date") String date);
void update(List<PowerDisplayDto> collect);
List<ConfigModel> seletPowerConfig();
List<PowerSourceModel> selectSource(@Param("number") String number);
}
package com.ruoyi.system.model.power;
import java.io.Serializable;
public class PowerSourceModel implements Serializable {
private String levelOneClassification;
private String classificationName;
private String mindId;
public String getLevelOneClassification() {
return levelOneClassification;
}
public void setLevelOneClassification(String levelOneClassification) {
this.levelOneClassification = levelOneClassification;
}
public String getClassificationName() {
return classificationName;
}
public void setClassificationName(String classificationName) {
this.classificationName = classificationName;
}
public String getMindId() {
return mindId;
}
public void setMindId(String mindId) {
this.mindId = mindId;
}
}
package com.ruoyi.system.model.power.dto;
import lombok.Data;
/**
* 2024/7/30
* 电力展示保存
*/
@Data
public class PowerDisplayDto {
// 年月
private String dateColumn;
......@@ -50,4 +49,172 @@ public class PowerDisplayDto {
private String levelThreeClassification;
// 基本电费
private String basicElectricityTariff;
public String getDateColumn() {
return dateColumn;
}
public void setDateColumn(String dateColumn) {
this.dateColumn = dateColumn;
}
public String getMindId() {
return mindId;
}
public void setMindId(String mindId) {
this.mindId = mindId;
}
public String getClassificationName() {
return classificationName;
}
public void setClassificationName(String classificationName) {
this.classificationName = classificationName;
}
public String getPowerTotal() {
return powerTotal;
}
public void setPowerTotal(String powerTotal) {
this.powerTotal = powerTotal;
}
public String getPowerTip() {
return powerTip;
}
public void setPowerTip(String powerTip) {
this.powerTip = powerTip;
}
public String getPowerPeak() {
return powerPeak;
}
public void setPowerPeak(String powerPeak) {
this.powerPeak = powerPeak;
}
public String getPowerFlat() {
return powerFlat;
}
public void setPowerFlat(String powerFlat) {
this.powerFlat = powerFlat;
}
public String getPowerValley() {
return powerValley;
}
public void setPowerValley(String powerValley) {
this.powerValley = powerValley;
}
public String getElectricityTotal() {
return electricityTotal;
}
public void setElectricityTotal(String electricityTotal) {
this.electricityTotal = electricityTotal;
}
public String getElectricityTip() {
return electricityTip;
}
public void setElectricityTip(String electricityTip) {
this.electricityTip = electricityTip;
}
public String getElectricityPeak() {
return electricityPeak;
}
public void setElectricityPeak(String electricityPeak) {
this.electricityPeak = electricityPeak;
}
public String getElectricityFlat() {
return electricityFlat;
}
public void setElectricityFlat(String electricityFlat) {
this.electricityFlat = electricityFlat;
}
public String getElectricityValley() {
return electricityValley;
}
public void setElectricityValley(String electricityValley) {
this.electricityValley = electricityValley;
}
public String getElectricityPriceTip() {
return electricityPriceTip;
}
public void setElectricityPriceTip(String electricityPriceTip) {
this.electricityPriceTip = electricityPriceTip;
}
public String getElectricityPricePeak() {
return electricityPricePeak;
}
public void setElectricityPricePeak(String electricityPricePeak) {
this.electricityPricePeak = electricityPricePeak;
}
public String getElectricityPriceFlat() {
return electricityPriceFlat;
}
public void setElectricityPriceFlat(String electricityPriceFlat) {
this.electricityPriceFlat = electricityPriceFlat;
}
public String getElectricityPriceValley() {
return electricityPriceValley;
}
public void setElectricityPriceValley(String electricityPriceValley) {
this.electricityPriceValley = electricityPriceValley;
}
public String getLevelOneClassification() {
return levelOneClassification;
}
public void setLevelOneClassification(String levelOneClassification) {
this.levelOneClassification = levelOneClassification;
}
public String getLevelTwoClassification() {
return levelTwoClassification;
}
public void setLevelTwoClassification(String levelTwoClassification) {
this.levelTwoClassification = levelTwoClassification;
}
public String getLevelThreeClassification() {
return levelThreeClassification;
}
public void setLevelThreeClassification(String levelThreeClassification) {
this.levelThreeClassification = levelThreeClassification;
}
public String getBasicElectricityTariff() {
return basicElectricityTariff;
}
public void setBasicElectricityTariff(String basicElectricityTariff) {
this.basicElectricityTariff = basicElectricityTariff;
}
}
package com.ruoyi.system.service;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.model.newrule.NewRuleRequestModel;
import java.util.List;
......@@ -9,4 +10,6 @@ import java.util.List;
*/
public interface PowerDisplayService {
void peek(List<NewRuleRequestModel> powerDisplayDtoList);
AjaxResult save(List<NewRuleRequestModel> powerDisplayDtoList);
}
......@@ -8,6 +8,7 @@ import com.ruoyi.system.model.power.PowerImportSourceModel;
import com.ruoyi.system.model.salary.SalaryExpenseSourceModel;
import com.ruoyi.system.service.ImportExpenseSourceService;
import lombok.SneakyThrows;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
......@@ -34,7 +35,11 @@ public class ImportExpenseSourceServiceImpl implements ImportExpenseSourceServic
@Override
@SneakyThrows
public AjaxResult save(MultipartFile multipartFile) {
List<PowerImportSourceModel> powerImportSourceModelList = EasyExcelFactory.read(multipartFile.getInputStream(), PowerImportSourceModel.class, new ExcelListener<>()).sheet("Sheet1").headRowNumber(1).doReadSync();
List<PowerImportSourceModel> powerImportSourceModelList = EasyExcelFactory.read(multipartFile.getInputStream(), PowerImportSourceModel.class, new ExcelListener<>()).sheet("Sheet2").headRowNumber(1).doReadSync();
powerImportSourceModelList.forEach(v->{
v.setClassificationName(v.getClassificationName().replaceAll(StringUtils.SPACE,StringUtils.EMPTY));
v.setLevelOneClassification(v.getLevelOneClassification().replaceAll(StringUtils.SPACE,StringUtils.EMPTY));
});
importExpenseSourceMapper.saveSource(powerImportSourceModelList);
return AjaxResult.success();
}
......
......@@ -95,9 +95,20 @@
where mind_id = #{id}
</select>
<select id="selOfMid" resultType="com.ruoyi.system.model.power.dto.PowerDisplayDto">
select a.level_one_classification levelOneClassification, a.classification_name classificationName
select a.level_one_classification levelOneClassification, a.classification_name classificationName
from power_large_screen_display a
where mind_id = #{id}
and date_column = #{date}
</select>
<select id="seletPowerConfig" resultType="com.ruoyi.system.model.salary.ConfigModel">
select key_name as keyName, col_name as colName
from power_col_config
where col_name !=''
</select>
<select id="selectSource" resultType="com.ruoyi.system.model.power.PowerSourceModel">
select level_one_classification as levelOneClassification,
classification_name as classificationName
from power_classification_query
where mind_id = #{number}
</select>
</mapper>
\ No newline at end of file
......@@ -200,7 +200,7 @@
and salary_date = #{salaryDate}
</update>
<insert id="insertMap">
INSERT INTO salary_col_config (key_name, col_name)
INSERT INTO power_col_config (key_name, col_name)
values (#{k}, #{v})
</insert>
<select id="getConfig" resultType="com.ruoyi.system.model.salary.ConfigModel">
......
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