Commit 2f269595 authored by 位宇华's avatar 位宇华

钱家营电--代码提交

parent 1ad81a23
package com.ruoyi.system.controller; package com.ruoyi.system.controller;
import com.ruoyi.system.mapper.SalaryMapper; import com.ruoyi.system.mapper.SalaryMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -80,4 +81,40 @@ public class ConfigSaveController { ...@@ -80,4 +81,40 @@ public class ConfigSaveController {
map.forEach((k,v)-> salaryMapper.insertSourceMap(k,v)); map.forEach((k,v)-> salaryMapper.insertSourceMap(k,v));
} }
@PostMapping("/save/filter/str")
public void saveFilterStr() {
Map<String,Object> map = new HashMap<>();
map.put("洗煤厂","");
map.put("物资管理中心","");
map.put("煤管科","货车队");
map.put("机采科","");
map.put("工会","");
map.put("工业电光","办公大楼");
map.put("档案楼","");
map.put("井运区","");
map.put("准备队","");
map.put("救护队","");
map.put("地测科","");
map.put("信息科","");
map.put("教培科","");
map.put("后勤服务中心","职工食堂,车队");
map.put("通风区","");
map.put("文体中心","");
map.put("机电科井上部位","");
map.put("瓦斯区","");
map.put("皮带区井上部位","");
map.put("生产压风","");
map.put("开拓延伸","");
map.put("保卫部","");
map.put("采掘小库","");
map.put("煤质科","");
map.put("综合办","宾馆");
map.put("设备科","");
map.put("唐钱社区电量","");
map.put("经贸公司","");
map.put("开大集团","");
map.forEach((k,v)-> salaryMapper.saveDept(k,v));
}
} }
package com.ruoyi.system.mapper; package com.ruoyi.system.mapper;
import com.ruoyi.system.model.power.FilterModel;
import com.ruoyi.system.model.power.PowerConvertSourceModel; import com.ruoyi.system.model.power.PowerConvertSourceModel;
import com.ruoyi.system.model.power.PowerSourceModel; import com.ruoyi.system.model.power.PowerSourceModel;
import com.ruoyi.system.model.power.dao.PowerClassificationQueryDao; import com.ruoyi.system.model.power.dao.PowerClassificationQueryDao;
...@@ -35,4 +36,6 @@ public interface PowerDisplayMapper { ...@@ -35,4 +36,6 @@ public interface PowerDisplayMapper {
void deleteRepeat(@Param("month") String month,@Param("minId") String minId); void deleteRepeat(@Param("month") String month,@Param("minId") String minId);
List<PowerConvertSourceModel> selectConvertSource(@Param("number") String number); List<PowerConvertSourceModel> selectConvertSource(@Param("number") String number);
List<FilterModel> selectExist(@Param("minId") String minId);
} }
...@@ -40,4 +40,6 @@ public interface SalaryMapper { ...@@ -40,4 +40,6 @@ public interface SalaryMapper {
List<ConfigModel> getConfig(); List<ConfigModel> getConfig();
void insertSourceMap(@Param("k") String k, @Param("v") Object v); void insertSourceMap(@Param("k") String k, @Param("v") Object v);
void saveDept(@Param("k") String k, @Param("v") Object v);
} }
package com.ruoyi.system.model.power;
import java.io.Serializable;
public class FilterModel implements Serializable {
private String dept;
private String secondDept;
public String getDept() {
return dept;
}
public void setDept(String dept) {
this.dept = dept;
}
public String getSecondDept() {
return secondDept;
}
public void setSecondDept(String secondDept) {
this.secondDept = secondDept;
}
}
package com.ruoyi.system.model.power;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
public class PowerCalModel implements Serializable {
private String keyName;
private List<BigDecimal> bigDecimalList;
public String getKeyName() {
return keyName;
}
public void setKeyName(String keyName) {
this.keyName = keyName;
}
public List<BigDecimal> getBigDecimalList() {
return bigDecimalList;
}
public void setBigDecimalList(List<BigDecimal> bigDecimalList) {
this.bigDecimalList = bigDecimalList;
}
}
...@@ -36,12 +36,11 @@ public class ImportExpenseSourceServiceImpl implements ImportExpenseSourceServic ...@@ -36,12 +36,11 @@ public class ImportExpenseSourceServiceImpl implements ImportExpenseSourceServic
@Override @Override
@SneakyThrows @SneakyThrows
public AjaxResult save(MultipartFile multipartFile) { public AjaxResult save(MultipartFile multipartFile) {
List<PowerImportSourceModel> powerImportSourceModelList = EasyExcelFactory.read(multipartFile.getInputStream(), PowerImportSourceModel.class, new ExcelListener<>()).sheet("Sheet3").headRowNumber(1).doReadSync(); List<PowerImportSourceModel> powerImportSourceModelList = EasyExcelFactory.read(multipartFile.getInputStream(), PowerImportSourceModel.class, new ExcelListener<>()).sheet("Sheet4").headRowNumber(1).doReadSync();
powerImportSourceModelList.forEach(v->{ powerImportSourceModelList.forEach(v->{
v.setClassificationName(v.getClassificationName().replaceAll(StringUtils.SPACE,StringUtils.EMPTY)); v.setClassificationName(v.getClassificationName().replaceAll(StringUtils.SPACE,StringUtils.EMPTY));
v.setLevelOneClassification(v.getLevelOneClassification().replaceAll(StringUtils.SPACE,StringUtils.EMPTY)); v.setLevelOneClassification(v.getLevelOneClassification().replaceAll(StringUtils.SPACE,StringUtils.EMPTY));
}); });
System.err.println(JSON.toJSONString(powerImportSourceModelList));
importExpenseSourceMapper.saveSource(powerImportSourceModelList); importExpenseSourceMapper.saveSource(powerImportSourceModelList);
return AjaxResult.success(); return AjaxResult.success();
} }
......
...@@ -124,5 +124,10 @@ ...@@ -124,5 +124,10 @@
from power_source_convert from power_source_convert
where org_code = #{number} where org_code = #{number}
</select> </select>
<select id="selectExist" resultType="com.ruoyi.system.model.power.FilterModel">
select dept as dept,second_dept as secondDept
from power_filter_table
where org_code = #{minId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -207,9 +207,14 @@ ...@@ -207,9 +207,14 @@
INSERT INTO power_source_convert (need_convert_source, convert_source,org_code) INSERT INTO power_source_convert (need_convert_source, convert_source,org_code)
values (#{k}, #{v},'011701') values (#{k}, #{v},'011701')
</insert> </insert>
<select id="getConfig" resultType="com.ruoyi.system.model.salary.ConfigModel"> <select id="getConfig" resultType="com.ruoyi.system.model.salary.ConfigModel">
select key_name as keyName, select key_name as keyName,
col_name as colName col_name as colName
from salary_col_config from salary_col_config
</select> </select>
<insert id="saveDept">
INSERT INTO power_filter_table (dept, second_dept,org_code)
values (#{k}, #{v},'010105')
</insert>
</mapper> </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