4cb9519b 张雷

安环及报表问题修改

1 个父辈 1cf23567
......@@ -8,6 +8,7 @@ import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.query.QueryGenerator;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.ajh.dto.AjhRectificationInfoAnalyseQueryDto;
import com.skua.modules.ajh.dto.AjhRectificationInfoMendDto;
import com.skua.modules.ajh.entity.AjhRectificationInfo;
......@@ -72,6 +73,7 @@ public class AjhRectificationInfoController {
ajhRectificationInfo.setDepartId(BaseContextHandler.getDeparts());
}
QueryWrapper<AjhRectificationInfo> queryWrapper = QueryGenerator.initQueryWrapper(ajhRectificationInfo, req.getParameterMap());
queryWrapper.eq(ConvertUtils.isNotEmpty(ajhRectificationInfo.getDangerId()),"danger_id",ajhRectificationInfo.getDangerId());
queryWrapper.orderByDesc("rec_ord_level");//重大风险排前面
Page<AjhRectificationInfo> page = new Page<AjhRectificationInfo>(pageNo, pageSize);
IPage<AjhRectificationInfo> pageList = ajhRectificationInfoService.page(page, queryWrapper);
......
......@@ -55,6 +55,7 @@ public class AjhRectificationInfo extends FlowEntity {
/**风险库关联ID*/
@Excel(name = "风险库关联ID", width = 15)
@ApiModelProperty(value = "风险库关联ID")
@Dict(dicCode = "id",dictTable="danger_level_manage",dicText="danger_name")
private String dangerId;
/**验收人*/
@Excel(name = "验收人", width = 15)
......
......@@ -91,7 +91,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, dataTime);
String dataViewName3a24tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, tbYear);
String field4411 = "yslwcbl,ysjsldyqntqyy,qntqsfsl,ysfsl,sfsldbbhl,sldyyqyy,dhgyqntqyy,yyf,yhgyqntqyy,dhcmbzyy,yhcyqyy";
String field4411 = "yslwcbl,ysjsldyqntqyy,qntqsfsl,ysfsl,sfsldbbhl,sldyyqyy,dhgyqntqyy,yyf,yhgyqntqyy,dhcmbzyy,yhcyqyy,df,sbwhf";
String dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,field4411, departId, dataTime);
String dataViewName4411tb = ReportViewUtil.buildViewLike(ReportConstant.view4411,"qntqsfsl", departId, tbYear);
//主库数据源
......@@ -118,7 +118,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
" v6.yhgyqntqyy, " +
" rtc.target_power as bndhmb, " +
" round(y.dlhj_year/sum(v1.CSL),2) as bnsjdh, " +
" v6.dhcmbzyy, " +
" v6.dhcmbzyy,v6.df,v6.sbwhf, " +
" rtc.target_drug as bnyhmb, " +
" round(y.yjhl_year/sum(v1.CSL),2) as bnsjyh, " +
" v6.yhcyqyy " +
......@@ -153,7 +153,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
" ) v5 on v5.month_tb = right(left(v1.time,7),2) " +
" left join ( " +
" select v4411.time,v4411.yslwcbl,v4411.ysjsldyqntqyy,v4411.qntqsfsl,v4411.ysfsl,v4411.sfsldbbhl,v4411.sldyyqyy," +
" v4411.dhgyqntqyy,v4411.yyf,v4411.yhgyqntqyy,v4411.dhcmbzyy,v4411.yhcyqyy " +
" v4411.dhgyqntqyy,v4411.yyf,v4411.yhgyqntqyy,v4411.dhcmbzyy,v4411.yhcyqyy,v4411.df,v4411.sbwhf " +
" from "+dataViewName4411+" v4411 " +
" where v4411.depart_id = '"+departId+"' and v4411.time like CONCAT('"+dataTime+"','%')) v6 on right(left(v6.time,7),2)=right(left(v1.time,7),2) " +
" left join ( " +
......
......@@ -59,7 +59,7 @@ public class ReportDataController {
}
//同步修改生产运营月报
if(dataList.size() > 0){
reportDataService.syncUpdateScybData(dataList.get(0).get("departId"),dataList.get(0).get("time"));
reportDataService.syncUpdateScybData(dataList.get(0).get("departId"),dataList.get(0).get("time"),ReportConstant.view4411);
}
return Result.ok("报表批量添加成功");
}
......
......@@ -11,5 +11,5 @@ public interface IReportDataService {
void insertOrUpdateReportData(String departId, String time, Map<String, String> data, String reportId);
@Async
void syncUpdateScybData(String departId,String time);
void syncUpdateScybData(String departId,String time,String reportId);
}
......
......@@ -94,7 +94,7 @@ public class ReportDataServiceImpl implements IReportDataService {
}
@Override
public void syncUpdateScybData(String departId,String dataTime) {
public void syncUpdateScybData(String departId,String dataTime,String reportId) {
String year = dataTime.split("-")[0];
List<Map<String, Object>> valueList = fCustomReportDatasetService.getDataFromHY(year, departId);
List<Map<String, String>> list = new ArrayList<>();
......@@ -109,7 +109,6 @@ public class ReportDataServiceImpl implements IReportDataService {
list.add(newMap);
}
for (Map<String, String> data : list) {
String reportId = ConvertUtils.getString(data.get("reportId"));
String time = ConvertUtils.getString(data.get("time"));
insertOrUpdateReportData(departId, time, data, reportId);
}
......
......@@ -13,6 +13,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONObject;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.common.service.ICommonSqlService;
import com.skua.modules.system.service.ISysAreaService;
import com.skua.modules.system.service.ISysDictService;
......@@ -481,6 +482,19 @@ public class SysFactoryInfoController {
@GetMapping(value = "/queryByDepartId")
public Result queryByDepartId(@RequestParam(name = "departId", required = true) String departId) {
Result result = new Result();
SysFactoryInfoVO sysFactoryInfo = sysFactoryInfoService.getByDepartId(departId);
JSONObject jsonObject = sysDictService.translateTDictValue(sysFactoryInfo);
if (sysFactoryInfo == null) {
departId = getDepart(BaseContextHandler.getRealDepartId());
sysFactoryInfo = sysFactoryInfoService.getByDepartId(departId);
jsonObject = sysDictService.translateTDictValue(sysFactoryInfo);
}
result.setResult(jsonObject);
result.setSuccess(true);
return result;
}
private String getDepart(String departId) {
String departs = iCommonSqlService.getChildFactorys(departId);
if(StringUtils.isNotEmpty(departs)){
String[] departArray = departs.split(",");
......@@ -488,17 +502,10 @@ public class SysFactoryInfoController {
departId = departs.split(",")[0];
}
}
SysFactoryInfoVO sysFactoryInfo = sysFactoryInfoService.getByDepartId(departId);
JSONObject jsonObject = sysDictService.translateTDictValue(sysFactoryInfo);
if (sysFactoryInfo == null) {
result.error500("未找到对应实体");
} else {
result.setResult(jsonObject);
result.setSuccess(true);
}
return result;
return departId;
}
@AutoLog(value = "查询污水厂设计规模")
@ApiOperation(value = "查询污水厂设计规模", notes = "查询污水厂设计规模")
@GetMapping(value = "/queryFactoryDesignScale")
......
......@@ -255,6 +255,9 @@
'${item}'
</foreach>
)
ORDER BY
depart_type,
depart_order
</select>
<select id="queryDeptAndUserTreeList" parameterType="java.lang.String" resultType="com.skua.modules.system.vo.SysDeptUserVO">
SELECT
......@@ -356,6 +359,9 @@
'${item}'
</foreach>
))
ORDER BY
depart_type,
depart_order
</select>
<select id="queryDepartsByIds" resultType="com.skua.modules.system.entity.SysDepart">
......@@ -368,5 +374,8 @@
<foreach item="item" index="index" collection="ids.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
ORDER BY
depart_type,
depart_order
</select>
</mapper>
......
......@@ -73,13 +73,13 @@ public class SysFactoryInfoServiceImpl extends ServiceImpl<SysFactoryInfoMapper,
@Override
public SysFactoryInfoVO getByDepartId(String departId) {
SysFactoryInfoVO sysFactoryInfo = new SysFactoryInfoVO();
String departs = commonSqlMapper.getChildFactorys(departId);
if(StringUtils.isNotEmpty(departs)){
String[] departArray = departs.split(",");
if(departArray.length>1){
departId = departs.split(",")[0];
}
}
// String departs = commonSqlMapper.getChildFactorys(departId);
// if(StringUtils.isNotEmpty(departs)){
// String[] departArray = departs.split(",");
// if(departArray.length>1){
// departId = departs.split(",")[0];
// }
// }
//获取厂站基本信息
sysFactoryInfo = sysFactoryInfoMapper.getByDepartId(departId);
SysDepart sysDepart = sysDepartService.getById(departId);
......@@ -87,8 +87,6 @@ public class SysFactoryInfoServiceImpl extends ServiceImpl<SysFactoryInfoMapper,
List<SysDepart> departList = sysDepartService.list(new QueryWrapper<SysDepart>().eq("depart_type", 1).eq("del_flag", 1));
QueryWrapper<SysDepart> sysDepartQueryWrapper = new QueryWrapper<>();
sysDepartQueryWrapper.eq("depart_type", 1).eq("del_flag", 1);
//List<Map<String, Object>> departList = sysDepartService.queryFactoryDevice(sysDepartQueryWrapper);
//List<String> departIds = departList.stream().filter(depart-> ObjectUtil.isNotEmpty(depart.get("deviceId"))).map(depart -> String.valueOf(depart.get("departId"))).collect(Collectors.toList());
List<String> departIds = departList.stream().map(depart -> depart.getId()).collect(Collectors.toList());
List<SysFactoryInfo> sysFactoryInfos = this.list(new QueryWrapper<SysFactoryInfo>().in("depart_id", departIds));
double ProScaleSum = sysFactoryInfos.stream().filter(info -> StringUtils.isNotBlank(info.getProScale())).mapToDouble(info ->
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!