913db01c 张雷

Merge remote-tracking branch 'origin/master' into master

2 个父辈 beaa9e42 4a54521b
......@@ -15,6 +15,10 @@ import com.skua.core.context.SpringContextUtils;
* @version V0.1, 2021年2月26日 上午9:34:04
*/
public class ReportViewUtil {
public static String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";// 水 COD TP TN NH3H
public static String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";//能耗报表
public static String view4411 = "4411ed3d78634bcdcd700f6e33724025";//生产运营周报
/**
* <pre>
* 构造填报报表视图
......
......@@ -380,12 +380,21 @@ public class AjhMeetingSendController {
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
// Step.1 组装查询条件
QueryWrapper<AjhMeetingSend> queryWrapper = null;
refreshMeetStatus();//刷新会议状态
try {
String paramsStr = request.getParameter("paramsStr");
if (ConvertUtils.isNotEmpty(paramsStr)) {
String deString = URLDecoder.decode(paramsStr, "UTF-8");
AjhMeetingSend ajhMeetingSend = JSON.parseObject(deString, AjhMeetingSend.class);
queryWrapper = QueryGenerator.initQueryWrapper(ajhMeetingSend, request.getParameterMap());
queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetId()),"meet_id",ajhMeetingSend.getMeetId());
queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getDepartId()),"depart_id",ajhMeetingSend.getDepartId());
queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetStatus()),"meet_status",ajhMeetingSend.getMeetStatus());
queryWrapper.eq(ConvertUtils.isNotEmpty(ajhMeetingSend.getSendStatus()),"send_status",ajhMeetingSend.getSendStatus());
queryWrapper.like(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetTitle()),"meet_title",ajhMeetingSend.getMeetTitle());
queryWrapper.between(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetStartTime()),"meet_start_time",
ajhMeetingSend.getMeetStartTime()+" 00:00:00",ajhMeetingSend.getMeetEndTime()+" 23:59:59");
queryWrapper.orderByDesc("send_status");
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
......
......@@ -56,49 +56,24 @@ public class SysCommandCentreController {
@GetMapping(value = "/statisticsByWaterData")
public Result<List<FRportlCommandCenterVO>> statisticsByWaterData(ReportItemvParam reportItemvParam)throws Exception{
Result<List<FRportlCommandCenterVO> > result = new Result<>();
//将jsonObject转sysAlgorithmStatisticsLibraryVO对象
//SysAlgorithmStatisticsLibraryVO sysAlgorithmLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class);
//String reportId = "2119ecbf53a1d2d0708258ff67cfd9e1";//报表编号
//String reportItemCode = "CSL";//查询字段
//报表数据项值
String reitId = sysConfigService.queryValueByKey("REIT_ID_CSL");
//ReportItemvParam reportItemvParam = new ReportItemvParam(reportId,reportItemCode ,sysAlgorithmLibraryVO.getStartDate() ,sysAlgorithmLibraryVO.getEndDate());
reportItemvParam.initData(reitId ,reportItemvParam.getStartDate() ,reportItemvParam.getEndDate());
List<FRportlCommandCenterVO> fReportItemvList = new ArrayList<>();//返回集合对象
//月统计
FRportlCommandCenterVO reportMonthData = commandCentreService.getReportItemvMonthDataByReitId(reportItemvParam );
fReportItemvList.add( reportMonthData );
FRportlCommandCenterVO reportDayData = commandCentreService.getReportItemvDayDataByReitId(reportItemvParam );
fReportItemvList.add( reportDayData );
//换算单位
if(fReportItemvList != null && !fReportItemvList.isEmpty()){
String value = null ;
String valueHb = null;
String valueTb = null;
for( FRportlCommandCenterVO reportDayData3 : fReportItemvList){
value = DigitalUtils.division(reportDayData3.getValue(),"10000");
reportDayData3.setValue( value );
valueHb = DigitalUtils.division(reportDayData3.getValueHb(),"10000");
reportDayData3.setValueHb(valueHb );
valueTb = DigitalUtils.division(reportDayData3.getValueTb(),"10000");
reportDayData3.setValueTb( valueTb );
}
}
/* FReportItemv currenteportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode,startDate , endDate );
//上月数据
FReportItemv lastMonthReportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode,reportItemvParam.getLastMonthStartDate() , reportItemvParam.getLastMonthEndDate() );
//去年数据
FReportItemv lastYearReportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode, reportItemvParam.getLastYearStartDate() , reportItemvParam.getLastYearEndDate() );
DateVO dateVO = new DateVO(reportItemvParam.getStartDate());
//本月数据
String monthCSL = reportItemvService.getSumCSL(BaseContextHandler.getDeparts(), dateVO.getNowMonthStartDate(), dateVO.getNowMonthEndDate());
//环比 上月数据
String lastMonthCSL = reportItemvService.getSumCSL(BaseContextHandler.getDeparts(), dateVO.getNowMonthStartDate(), dateVO.getNowMonthEndDate());
//同比 去年数据
String lastYearCSL = reportItemvService.getSumCSL(BaseContextHandler.getDeparts(), dateVO.getLastYearMonthStartTime(), dateVO.getLastYearMonthEndTime());
//整理数据
List<FRportlCommandCenterVO> fReportItemvList = arrangeFRportlCommandCenterVO(currenteportItemv , lastMonthReportItemv,lastYearReportItemv);*/
long nowDifferDay = DateUtils.differenceDay(dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
long lastMonthDifferDay = DateUtils.differenceDay(dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
long lastYearDifferDay = DateUtils.differenceDay(dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime());
//月对象数据String value, String valueTb, String valueHb
FRportlCommandCenterVO monthDataVO = new FRportlCommandCenterVO("月汇总数据",JSUtils.format(monthCSL),JSUtils.format(lastMonthCSL),JSUtils.format(lastYearCSL));
//日处理对象
FRportlCommandCenterVO avgDayDataVO = new FRportlCommandCenterVO("日均处理水量",JSUtils.divide(monthCSL,nowDifferDay*10000),JSUtils.divide(lastMonthCSL,lastMonthDifferDay*10000),JSUtils.divide(lastYearCSL,lastYearDifferDay*10000));
fReportItemvList.add( monthDataVO) ;
fReportItemvList.add( avgDayDataVO ) ;
//年数据统计:
String total = factoryInfoService.querySumProScale();
......@@ -106,7 +81,6 @@ public class SysCommandCentreController {
// total = DigitalUtils.multiply(total,"10000");
fReportItemvList.add( new FRportlCommandCenterVO( total,"0","0"));
//todo 演示暂时注释
result.setSuccess(true);
result.setResult(fReportItemvList);
return result;
......@@ -119,6 +93,15 @@ public class SysCommandCentreController {
public Result<DepartLoadRateResultVO> statisticsByLoadRate(ReportItemvParam reportItemvParam) throws Exception {
DepartLoadRateResultVO loadRateResultVO = new DepartLoadRateResultVO();
//SysAlgorithmStatisticsLibraryVO sysAlgorithmLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class);
// 运行负荷率分析 = CSL/规模
String departId = BaseContextHandler.getDeparts();
String startTime = reportItemvParam.getStartDate();
String endTime = reportItemvParam.getEndDate();
String dataViewName2119 = ReportViewUtil.buildView(ReportViewUtil.view2119,"CSL", departId, startTime,endTime);// 部门、时间
//报表数据项值
String reitId = sysConfigService.queryValueByKey("REIT_ID_CSL");
......
......@@ -14,9 +14,7 @@ import org.springframework.stereotype.Service;
public class ReportItemvService {
String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";// 水 COD TP TN NH3H
String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";//能耗报表
String view4411 = "4411ed3d78634bcdcd700f6e33724025";//生产运营周报
private JdbcTemplate getJdbcTemplate(){
//主库数据源
......@@ -25,7 +23,7 @@ public class ReportItemvService {
}
public String getSumCSL(String departId ,String startTime ,String endTime){
String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departId, startTime,endTime);
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportViewUtil.view2119,"CSL", departId, startTime,endTime);
String sql = "select sum(aaa.CSL) from " + dataViewName2119+ "aaa";
String csl = getJdbcTemplate().queryForObject(sql,String.class);
return csl;
......@@ -35,7 +33,7 @@ public class ReportItemvService {
}*/
public String getSumDLHJ(String departId ,String startTime ,String endTime){
String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,"DLHJ", departId, startTime,endTime);
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportViewUtil.view3a24,"DLHJ", departId, startTime,endTime);
String sql = "select sum(aaa.DLHJ) from " + dataViewName3a24+ "aaa";
String dlhj = getJdbcTemplate().queryForObject(sql,String.class);
return dlhj;
......
......@@ -307,20 +307,14 @@ public class PurchasePlanController {
purchasePlanSearchVO.setSparepartType( sparepartTypeStr );
}
log.debug("查询物料子分类集合:{}",sparepartTypeStr);
//查询下一级部门集合
if (!"1".equals(BaseContextHandler.get("userType"))) {
Set<String> departsSet = new HashSet<String>();
String departIds = "";
if (StringUtils.isNotEmpty(purchasePlanSearchVO.getDepartId())) {
// 查询子集
departsSet = departService.getAllChildrenDepartIds( purchasePlanSearchVO.getDepartId() );
if(departsSet.size() > 0 ) departIds = String.join(",", departsSet);// 使用String.join()方法转换Set为字符串,以逗号分隔
purchasePlanSearchVO.setDepartIds( departIds );
log.debug("查询部门集合:{}",departIds);
}else{
purchasePlanSearchVO.setDepartIds( BaseUtil.quoteEach(BaseContextHandler.getDeparts(),",") );
log.debug("查询权限部门集合:{}", BaseUtil.quoteEach(BaseContextHandler.getDeparts(),","));
}
Set<String> departsSet = new HashSet<String>();
String departIds = null;
if (StringUtils.isNotEmpty(purchasePlanSearchVO.getDepartId())) {
// 查询子集
departsSet = departService.getAllChildrenDepartIds( purchasePlanSearchVO.getDepartId() );
if(departsSet.size() > 0 ) departIds = String.join(",", departsSet);// 使用String.join()方法转换Set为字符串,以逗号分隔
purchasePlanSearchVO.setDepartIds( departIds );
log.debug("查询部门集合:{}",departIds);
}
if(StringUtils.isNotEmpty(purchasePlanSearchVO.getSparepartAttribute() )){
purchasePlanSearchVO.setSparepartAttribute( BaseUtil.quoteEach(purchasePlanSearchVO.getSparepartAttribute(),",") ) ;
......
......@@ -15,13 +15,13 @@
and pi.sparepart_type in ( ${ev.sparepartType})
</if>
<if test="ev.sparepartCode != null and ev.sparepartCode != '' ">
AND pi.sparepart_code like '%'#{ev.sparepartCode}'%'
AND pi.sparepart_code like CONCAT('%', #{ev.sparepartCode},'%')
</if>
<if test="ev.sparepartName != null and ev.sparepartName != '' ">
AND pi.sparepart_name like '%'#{ev.sparepartName}'%'
AND pi.sparepart_name like CONCAT('%', #{ev.sparepartName},'%')
</if>
<if test="ev.purpose != null and ev.purpose != '' ">
AND pi.purpose like '%'#{ev.purpose}'%'
AND pi.purpose like CONCAT('%', #{ev.purpose},'%')
</if>
<if test="ev.applyYear != null and ev.applyYear != '' ">
and pp.apply_year = #{ev.applyYear}
......
......@@ -74,6 +74,8 @@ public class DistributContractServiceImpl extends ServiceImpl<DistributContractM
errMsg = "所属厂站["+departMapper.selectById(distributContractVO.getDepartId()).getDepartName()+"]下的货号["+material.getGoodCode()+"]已经分销过!";
break;
}
//校验数量:分销数量不能大于采购数据量
}
}
return errMsg;
......
......@@ -25,6 +25,7 @@ import com.skua.modules.guest.util.DateUtil;
import com.skua.modules.quartz.util.BaseUtil;
import com.skua.modules.supplies.entity.SuppliesWarehouse;
import com.skua.modules.supplies.service.ISuppliesWarehouseService;
import com.skua.tool.util.DateUtils;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.service.spi.ServiceException;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -148,10 +149,11 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia
equipmentOutDTO.setDepartId( equipmentIn.getDepartId() ) ;
equipmentOutDTO.setOutType("9");//
equipmentOutDTO.setRemark( materialINTemp.getRemark() );
equipmentOutDTO.setChooseTime(BaseUtil.getCurrentDate());//经办时间
equipmentOutDTO.setChooseTime(DateUtils.date2Str(new Date(),"yyyy-MM-dd HH:mm:ss"));//经办时间
equipmentOutDTO.setUseBy( BaseContextHandler.getUserId() );//使用人
equipmentOutDTO.setOutDate( BaseUtil.getCurrentDate() );
equipmentOutDTO.setInventoryUpdateTimeEnd( BaseUtil.getCurrentDate());
equipmentOutDTO.setOutDate( DateUtils.date2Str(new Date(),"yyyy-MM-dd HH:mm:ss") );
equipmentOutDTO.setInventoryUpdateTimeEnd( DateUtils.date2Str(new Date(),"yyyy-MM-dd HH:mm:ss") );
equipmentOutDTO.setInventoryUpdateTime(new Date());
equipmentOutDTO.setSuppliesWarehouseId( equipmentIn.getSuppliesWarehouseId() );// this.suppliesWarehouseId = suppliesWarehouseId;//所属仓库
//this.outOrder = outOrder;
......
......@@ -66,8 +66,6 @@ public class DateUtil {
Date date = formatter.parse(dateString);
// 再将 Date 对象格式化为字符串
formattedDate = formatter.format(date);
// 输出结果
System.out.println(formattedDate); // 输出: 2024-08-19
}
} catch (Exception e) {
e.printStackTrace();
......
......@@ -4,6 +4,7 @@ import com.skua.core.util.ConvertUtils;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -33,6 +34,12 @@ public class BaseUtil {
return d.toString();
}
public static Double formatDouble(Object obj ){
Double value = ConvertUtils.getDouble(obj,0d);
BigDecimal bd = BigDecimal.valueOf(value);
return bd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
}
/***
* 计算时间的前几个月的月份
* @param month
......
......@@ -133,7 +133,7 @@ public class DangerLevelManageController {
dangerLevelManageService.updateById( dangerLevelManage ) ;
//是否共享 添加到共享库
if("1".equals(dangerLevelManage.getIs_share())){
if("1".equals(dangerLevelManage.getShare())){
DangerLevelManageShare dangerLevelManageShare = new DangerLevelManageShare();
BeanUtils.copyProperties(dangerLevelManage , dangerLevelManageShare);
dangerLevelManageShareService.save( dangerLevelManageShare ) ;
......@@ -166,7 +166,7 @@ public class DangerLevelManageController {
boolean ok = dangerLevelManageService.updateById(dangerLevelManage);
//是否共享 添加到共享库
if("1".equals(dangerLevelManage.getIs_share())){
if("1".equals(dangerLevelManage.getShare())){
dangerLevelManageShareService.removeById( dangerLevelManage.getId()) ;
DangerLevelManageShare dangerLevelManageShare = new DangerLevelManageShare();
BeanUtils.copyProperties(dangerLevelManage , dangerLevelManageShare);
......
......@@ -16,6 +16,9 @@ import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import javax.persistence.Column;
/**
* 风险分级管控清单
*/
......@@ -95,7 +98,7 @@ public class DangerLevelManage{
@Excel(name = "是否共享", width = 15)
@ApiModelProperty(value = "是否共享")
private String is_share;
private String share;
//@Excel(name = "二维码", width = 15)
@ApiModelProperty(value = "二维码")
......
......@@ -8,6 +8,7 @@ import com.skua.modules.report.service.IOperationReportService;
import com.skua.modules.report.vo.*;
import com.skua.tool.util.DateUtils;
import com.skua.tool.util.DigitalUtils;
import com.skua.tool.util.JSUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
......@@ -59,15 +60,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
String deptartCount = getJdbcTemplate().queryForObject(sql,String.class);
productDataVO.setDeptartCount( deptartCount );
//生产指标完成情况--收费水量
//DLHJ 电量合计 ,ydh 用电量 ,yslwcbl 月水量完成比例,ysjsldyqntqyy 月实际水量低于去年同期原因,qntqsfsl 去年同期收费水量, ysfsl`,月收费水量 `bnsjdh`, 本年实际电耗 sldyyqyy`, 收费水量对比变化率 ,`dhgyqntqyy`, 电耗高于去年同期原因;`yyf`, 月药费 `yhgyqntqyy`, 药耗高于去年同期原因 `dhcmbzyy`, 电耗超目标值原因 `yhcyqyy` 药耗超预期原因
// 电量合计 , 用电量 , 月水量完成比例, 月实际水量低于去年同期原因, 去年同期收费水量, `,月收费水量 ``, 本年实际电耗 `, 收费水量对比变化率 ,``, 电耗高于去年同期原因;``, 月药费 ``, 药耗高于去年同期原因 ``, 电耗超目标值原因 `` 药耗超预期原因
//String fields = "DLHJ,ydh,yslwcbl,ysjsldyqntqyy,qntqsfsl,ysfsl,bnsjdh,sldyyqyy,dhgyqntqyy,yyf,yhgyqntqyy,dhcmbzyy,yhcyqyy";
// fields = "DLHJ,YDH,YSLWCBL,YSJSLDYQNTQYY,QNTQSFSL,YSFSL,BNSJDH,SLDYYQYY,DHGYQNTQYY,YYF,YHGYQNTQYY,DHCMBZYY,YHCYQYY";
// fields = fields.toUpperCase();
String departId = null;
// ysfsl:月收费水量 ; yyf:月药费 ; ysjsl:月实际水量
String dataViewName4411 = ReportViewUtil.buildViewLike(view4411,"ysfsl,ysjsl,yyf", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime());
sql = "select sum( aaa.ysfsl ) 'ysfsl' , sum( aaa.ysjsl ) 'ysjsl' , sum(tc.target_water ) 'target_water', sum(tc.target_drug ) 'target_drug' ,round((sum( aaa.ysfsl ) *100 / sum(tc.target_water )),2) as 'completeRatio' from "+dataViewName4411+" aaa";
......@@ -76,39 +69,42 @@ public class OperationReportServiceImpl implements IOperationReportService {
productDataVO.setDayNum( DateUtils.differenceDay(seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime()) );//相差天数
Double target_drug = null;//药吨水药耗
Double drugCost = 0d;//药剂实际费用
Double completeRatio = null;
Double ysjsl = null;//实际处理水量
if(mapList != null ){
for(Map<String,Object> map : mapList){
productDataVO.setChargeWaterVolume( ConvertUtils.getString( map.get("ysfsl")) ); //收费水量
productDataVO.setYsjslWaterVolume(ConvertUtils.getString( map.get("ysjsl")) );//实际处理水量
productDataVO.setCompleteRatio( ConvertUtils.getDouble( map.get("completeRatio"),0d) );//收费水量-完成率
productDataVO.setChargeWaterVolume( JSUtils.format( map.get("ysfsl")) ); //收费水量
productDataVO.setYsjslWaterVolume(JSUtils.format(map.get("ysjsl")) );//实际处理水量
productDataVO.setCompleteRatio( JSUtils.format( map.get("completeRatio")) );//收费水量-完成率
completeRatio = ConvertUtils.getDouble(map.get("completeRatio"),0d);
target_drug = ConvertUtils.getDouble( map.get("target_drug"),0d);
ysjsl = ConvertUtils.getDouble( map.get("ysjsl"),0d);
if(ysjsl.doubleValue() != 0 ){
drugCost = ConvertUtils.getDouble( map.get("yyf"),0d) / ysjsl;
drugCost = formatDouble(ConvertUtils.getDouble( map.get("yyf"),0d) / ysjsl);
}
}
}
productDataVO.setDrugCost( drugCost );
productDataVO.setTargetDrug( target_drug );
productDataVO.setSequentialProgress("基本满足时序进度");
if(productDataVO.getCompleteRatio().doubleValue() > 25){
if(completeRatio.doubleValue() > 25){
productDataVO.setSequentialProgress("超额完成时序进度");
}
// 去年水数据:月收费水量、月实际水量
// ysfsl:月收费水量 ; yyf:月药费 ; ysjsl:月实际水量
dataViewName4411 = ReportViewUtil.buildViewLike(view4411,"ysfsl,ysjsl", departId, lastSeasonTimeVO.getStartTime(),lastSeasonTimeVO.getEndTime());
sql = "select sum( aaa.ysfsl ) 'ysfsl' , sum( aaa.ysjsl ) 'ysjsl' from "+dataViewName4411+" aaa";
if(mapList != null ){
for(Map<String,Object> map : mapList){
Double qn_ysfsl = ConvertUtils.getDouble( map.get("ysfsl"),0d);// 去年:收费水量
Double qn_ysjsl = ConvertUtils.getDouble( map.get("ysjsl"),0d);// 去年:月实际水量
if(qn_ysfsl.doubleValue() != 0){//去年:收费水量
productDataVO.setChargeWaterRatio( (ConvertUtils.getDouble( productDataVO.getChargeWaterVolume() ,0d) - qn_ysfsl) / qn_ysfsl );
productDataVO.setChargeWaterRatio( formatDouble((ConvertUtils.getDouble( productDataVO.getChargeWaterVolume() ,0d) - qn_ysfsl)*100 / qn_ysfsl ));
}
if(qn_ysjsl.doubleValue() != 0){//去年:月实际水量
productDataVO.setYsjslWaterRatio( ( ConvertUtils.getDouble( productDataVO.getYsjslWaterVolume() ,0d) - qn_ysjsl ) / qn_ysjsl );
productDataVO.setYsjslWaterRatio( formatDouble(( ConvertUtils.getDouble( productDataVO.getYsjslWaterVolume() ,0d) - qn_ysjsl ) *100/ qn_ysjsl ) );
}
}
}
......@@ -126,19 +122,18 @@ public class OperationReportServiceImpl implements IOperationReportService {
//水电耗高于控制目标--水务公司列表
dataViewName4411 = ReportViewUtil.buildViewLike(view4411,"ydh,qntqdh,dhgyqntqyy", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime(),"max");
sql = "select aaa.dhgyqntqyy 'causeAnalysis' , aaa.qntqdh ,aaa.ydh 'realConsume' ,d.depart_name 'deptartName' , tc.target_power 'targetConsume' from " + dataViewName4411 + " aaa ";
sql = "select aaa.dhgyqntqyy 'causeAnalysis' , aaa.qntqdh ,aaa.ydh 'realConsume' ,d.depart_name 'deptartName' , IFNULL(tc.target_power,'-') 'targetConsume' from " + dataViewName4411 + " aaa ";
sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year ="+year+")";
sql += " left join sys_depart d on d.id = aaa.depart_id ";
sql += " where aaa.ydh > IFNULL(tc.target_power,0)";
List<FReportPowerMonthDataVO> powerMonthDataVOList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<FReportPowerMonthDataVO>(FReportPowerMonthDataVO.class));
productDataVO.setPowerDeptartList(powerMonthDataVOList);
/**
* ysjsl:月实际水量 ; 月药耗 yyh; 去年同期药耗 qntqyh; 月药费 yyf;药耗高于去年同期原因 yhgyqntqyy;药耗超预期原因 yhcyqyy; 本年实际药耗 bnsjyh; 本年药耗目标 bnyhmb*/
/** ysjsl:月实际水量 ; 月药耗 yyh; 去年同期药耗 qntqyh; 月药费 yyf;药耗高于去年同期原因 yhgyqntqyy;药耗超预期原因 yhcyqyy; 本年实际药耗 bnsjyh; 本年药耗目标 bnyhmb*/
//药剂成本高于控制目标--水务公司列表
dataViewName4411 = ReportViewUtil.buildViewLike(view4411,"ysjsl,yyh,qntqyh,qntqyh,yhgyqntqyy,bnsjyh,bnyhmb", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime(),"max");
// sql = "select (aaa.yyh/aaa.ysjsl) 'realConsume',aaa.ysjsl,aaa.qntqyh,aaa.qntqyh,aaa.yhgyqntqyy '',aaa.bnsjyh,aaa.bnyhmb,aaa.depart_id ,d.depart_name ,tc.target_drug 'targetConsume' from " + dataViewName4411 + " aaa ";
sql = "select (aaa.yyh/aaa.ysjsl) 'realConsume',aaa.yhgyqntqyy 'causeAnalysis',d.depart_name 'deptartName' ,tc.target_drug 'targetConsume' from " + dataViewName4411 + " aaa ";
// sql = "select round((aaa.yyh/aaa.ysjsl),2) 'realConsume',aaa.ysjsl,aaa.qntqyh,aaa.qntqyh,aaa.yhgyqntqyy '',aaa.bnsjyh,aaa.bnyhmb,aaa.depart_id ,d.depart_name ,IFNULL(tc.target_drug,'-') 'targetConsume' from " + dataViewName4411 + " aaa ";
sql = "select round((aaa.yyh/aaa.ysjsl),2) 'realConsume',aaa.yhgyqntqyy 'causeAnalysis',d.depart_name 'deptartName' ,IFNULL(tc.target_drug,'-') 'targetConsume' from " + dataViewName4411 + " aaa ";
sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year ="+year+")";
sql+= " left join sys_depart d on d.id = aaa.depart_id ";
sql += " where (aaa.ysjsl/aaa.ysjsl) > IFNULL(tc.target_drug,0)";
......@@ -146,17 +141,18 @@ public class OperationReportServiceImpl implements IOperationReportService {
productDataVO.setDrugDeptartList(drugDataList);
//隐患排查完成情况
sql = "select d.depart_name from ajh_rectification_info t ";
sql+=" left join sys_depart d on t.depart_id = d.id ";
sql += " group by t.depart_id ";
List<String> deptNameList = operationReportMapper.queryDepatNameList();
productDataVO.setDangerDeptCount( 0 );
if(deptNameList != null && !deptNameList.isEmpty()){
productDataVO.setDangerDeptCount( deptNameList.size());
productDataVO.setDangerDeptNames(String.join(",",deptNameList));
}
return productDataVO;
}
public Double formatDouble(Object obj ){
Double value = ConvertUtils.getDouble(obj,0d);
BigDecimal bd = BigDecimal.valueOf(value);
return bd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
}
}
......
......@@ -34,7 +34,7 @@ public class ProductDataVO {
@ApiModelProperty(value = "收费水量-同比增长")
private Double chargeWaterRatio;
@ApiModelProperty(value = "收费水量-完成率")
private Double completeRatio;
private String completeRatio;
@ApiModelProperty(value = "序时进度")
private String sequentialProgress;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!