1.台账编号添加160前缀
This commit is contained in:
@@ -103,4 +103,14 @@ public class DisPhotovoltaicController {
|
||||
System.out.println();
|
||||
|
||||
}
|
||||
|
||||
// @ApiOperation(value = "将用户数据导入到配网表中")
|
||||
// @PostMapping("/insertDistributionMonitor")
|
||||
// public String import380KV() throws Exception {
|
||||
// Boolean aBoolean = disPhotovoltaicService.savePmsDistributionMonitor();
|
||||
// if(aBoolean){
|
||||
// return "数据导入成功";
|
||||
// }
|
||||
// return "数据导入失败";
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -20,5 +20,7 @@ public interface DictDataMapper extends BaseMapper<DictData> {
|
||||
List<DictData> selectList(@Param("code") String code);
|
||||
DictData selectByCode(@Param("dataCode") String dataCode,@Param("typeCode") String typeCode);
|
||||
List<Dept> selectUserList();
|
||||
Boolean deletePmsDistributionMonitor(@Param("date") String date);
|
||||
Boolean insertPmsDistributionMonitor();
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,42 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.jbsyncdata.mapper.DictDataMapper">
|
||||
|
||||
<insert id="insertPmsDistributionMonitor">
|
||||
INSERT INTO pms_distribution_monitor (
|
||||
Monitor_Sort,
|
||||
Monitor_Id,
|
||||
Org_Id,
|
||||
Voltage_Level,
|
||||
If_Power_User,
|
||||
Monitor_State,
|
||||
Created_Date,
|
||||
Status,
|
||||
Create_Time,
|
||||
Update_Time
|
||||
)
|
||||
select
|
||||
(select id from sys_dict_data where code="Three_Line") as Monitor_Sort,
|
||||
id as Monitor_Id,
|
||||
Org_Id as Org_Id ,
|
||||
Voltage_Level as Voltage_Level,
|
||||
1 as If_Power_User,
|
||||
(select sd.id from sys_dict_data sd INNER JOIN sys_dict_type st on st.id=sd.Type_Id where sd.`Code`="Run" and st.`Code`="Line_State") as Monitor_State,
|
||||
now() as Created_Date,
|
||||
1 as Status,
|
||||
now() as Create_Time,
|
||||
now() as Update_Time
|
||||
from
|
||||
pms_power_generation_user
|
||||
where Status=1
|
||||
</insert>
|
||||
<delete id="deletePmsDistributionMonitor">
|
||||
delete FROM pms_distribution_monitor
|
||||
<where>
|
||||
<if test="date != null and date !=''">
|
||||
DATE_FORMAT(Create_Time, '%Y-%m-%d') = DATE_FORMAT(#{date}, '%Y-%m-%d')
|
||||
</if>
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
<select id="selectList" resultType="com.njcn.jbsyncdata.pojo.DictData">
|
||||
SELECT sys_dict_data.*
|
||||
|
||||
@@ -31,4 +31,12 @@ public interface DisPhotovoltaicService {
|
||||
*/
|
||||
void SavaPmsPowerGenerationUser380KV(List<DisPhotovoltaic380Excel> list, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* @Description: 配网表数据新增
|
||||
* @param
|
||||
* @return: java.lang.Boolean
|
||||
* @Author: wr
|
||||
* @Date: 2023/10/11 14:31
|
||||
*/
|
||||
Boolean savePmsDistributionMonitor();
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public class DisPhotovoltaicServiceImpl implements DisPhotovoltaicService {
|
||||
}
|
||||
|
||||
user = new PmsPowerGenerationUser();
|
||||
user.setId(excel.getGenerationUserID());
|
||||
user.setId("160"+excel.getGenerationUserID());
|
||||
user.setName(excel.getGenerationUserName());
|
||||
//todo 部门信息
|
||||
user.setOrgName("国网" + excel.getOrgName());
|
||||
@@ -188,7 +188,7 @@ public class DisPhotovoltaicServiceImpl implements DisPhotovoltaicService {
|
||||
}
|
||||
|
||||
user = new PmsPowerGenerationUser();
|
||||
user.setId(excel.getGenerationUserID());
|
||||
user.setId("160"+excel.getGenerationUserID());
|
||||
user.setName(excel.getGenerationUserName());
|
||||
//todo 部门信息
|
||||
user.setOrgName(replace);
|
||||
@@ -239,6 +239,15 @@ public class DisPhotovoltaicServiceImpl implements DisPhotovoltaicService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean savePmsDistributionMonitor() {
|
||||
Boolean aBoolean = dictDataMapper.deletePmsDistributionMonitor(null);
|
||||
if(aBoolean){
|
||||
return dictDataMapper.insertPmsDistributionMonitor();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getAlgoDescribe(String name, List<DictData> dictData) {
|
||||
List<DictData> dictDataList = dictData.stream().filter(x -> x.getName().indexOf(name) != -1).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(dictDataList)) {
|
||||
|
||||
Reference in New Issue
Block a user