37d54c8f 张雷

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

2 个父辈 b7a4b7e6 fda2696d
正在显示 15 个修改的文件 包含 93 行增加23 行删除
......@@ -8,12 +8,14 @@
d.depart_name AS depart_name,
ifnull( dl.fxk_count, 0 ) AS fxk_count,
ifnull( di.yhpc_count, 0 ) AS yhpc_count,
ifnull( aq.aqyh_count, 0 ) AS aqyh_count
ifnull( aq.aqyh_count, 0 ) AS aqyh_count,
ifnull( ir.xj_count, 0 ) AS xj_count
FROM
sys_depart d
LEFT JOIN ( SELECT depart_id, count( id ) fxk_count FROM danger_level_manage WHERE create_time LIKE CONCAT(#{year},'%') GROUP BY depart_id ) dl ON dl.depart_id = d.id
LEFT JOIN ( SELECT depart_id, count( id ) yhpc_count FROM danger_inspection_record WHERE create_time LIKE CONCAT(#{year},'%') GROUP BY depart_id ) di ON di.depart_id = d.id
LEFT JOIN ( SELECT depart_id, count( id ) aqyh_count FROM ajh_rectification_info WHERE create_time LIKE CONCAT(#{year},'%') GROUP BY depart_id ) aq ON aq.depart_id = d.id
LEFT JOIN ( SELECT depart_id, count( id ) xj_count FROM danger_inspection_record WHERE create_time LIKE CONCAT(#{year},'%') GROUP BY depart_id ) ir ON ir.depart_id = d.id
WHERE
d.depart_type = 1
ORDER BY
......
......@@ -26,4 +26,6 @@ public class RiskDatabaseResult {
@ApiModelProperty(value = "隐患排查事件数量")
private Integer aqyhCount;
@ApiModelProperty(value = "巡检数量")
private Integer xjCount;
}
......
......@@ -142,7 +142,6 @@ public class PurchaseContractController {
result.success("修改成功!");
}
}
return result;
}
......
......@@ -118,7 +118,6 @@ public class TestMetricInfoController {
//月数据
if (timeType.equals("3")) dataMap.put( metricInfoVO.getEquipmentCode()+"_ZT" ,JSUtils.subtract( 30*24*60, paramMap.get(metricInfoVO.getYxExpress()),paramMap.get(metricInfoVO.getGzExpress()) ) );//暂停
}
dataList.add( dataMap );
}
}
......
......@@ -67,7 +67,7 @@
</select>
<!-- 根据id或code校验合同编号是否唯一-->
<select id="checkContractCode" resultType="java.lang.Integer">
select count(1) from erp_purchase_contract where contract_code = #{contractCode}
select count(1) from erp_purchase_contract where use_flag =1 and start_time gt; now() and ent_time lt; now() and contract_code = #{contractCode}
</select>
</mapper>
......
......@@ -34,6 +34,7 @@ public class DrugConsumptionAnalysisController {
result.setResult(data);
return result;
}
// 2411112:总药耗趋势 --->吨水药费
@AutoLog(value = "总药耗趋势")
@ApiOperation(value = "总药耗趋势", notes = "总药耗趋势")
@GetMapping("/data/drugConsumptionTrend")
......
......@@ -242,13 +242,10 @@ public class EquipmentSparepartController {
}
}
}
//部门子集
//后续补充
Page<EquipmentSparepartVO> page = new Page<EquipmentSparepartVO>(pageNo, pageSize);
//权限部门
if(StringUtils.isNotEmpty(sparepartSearchVO.getDepartId())){
String departIds = iCommonSqlService.getChildDepartId(sparepartSearchVO.getDepartId() ) ;
String departIds = iCommonSqlService.getChildDepartId(sparepartSearchVO.getDepartId() ) ;//部门子集
sparepartSearchVO.setDepartIds(departIds ) ;
}else{
sparepartSearchVO.setDepartIds( JSUtils.quoteEach(BaseContextHandler.getDeparts() ,",")) ;//非管理员,获取权限部门集合
......@@ -322,6 +319,23 @@ public class EquipmentSparepartController {
*/
}
//equipmentRelation
@AutoLog(value = "备品备件表-分页列表查询:关联的备品备件")
@ApiOperation(value = "备品备件表-分页列表查询:关联的备品备件", notes = "备品备件表-分页列表查询:关联的备品备件")
@GetMapping(value = "/equipmentRelationList")
public Result<IPage<EquipmentSparepartVO>> queryPageRelationList(EquipmentSparepartSearchVO sparepartSearchVO,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) throws Exception {
Result<IPage<EquipmentSparepartVO>> result = new Result<>();
Page<EquipmentSparepartVO> page = new Page<EquipmentSparepartVO>(pageNo, pageSize);
IPage<EquipmentSparepartVO> pageList = equipmentSparepartService.queryPageRelationList(page,sparepartSearchVO);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
/**
* 添加
......
......@@ -224,6 +224,7 @@ public class EquipmentSparepart {
*/
@Excel(name = "仓库id", width = 15)
@ApiModelProperty(value = "仓库id")
@Dict(dictTable = "supplies_warehouse",dicCode = "id",dicText = "warehouse_name")
private String suppliesWarehouseId;
/**
......@@ -231,6 +232,7 @@ public class EquipmentSparepart {
*/
@Excel(name = "所属厂站", width = 15)
@ApiModelProperty(value = "所属厂站")
@Dict(dictTable = "sys_depart",dicCode = "id",dicText = "depart_name")
private String departId;
/** 物料属性 */
......
......@@ -19,4 +19,12 @@ public interface EquipmentSparepartMapper extends BaseMapper<EquipmentSparepart>
//分页检索
IPage<EquipmentSparepartVO> queryByPage(@Param("page")Page<EquipmentSparepartVO> page, @Param("param") EquipmentSparepartSearchVO sparepartSearchVO);
/***
* 分页查询:设备关联的备品备件集合
* @param page
* @param sparepartSearchVO
* @return
*/
IPage<EquipmentSparepartVO> queryPageRelationList(@Param("page")Page<EquipmentSparepartVO> page, @Param("param") EquipmentSparepartSearchVO sparepartSearchVO);
}
......
......@@ -19,7 +19,14 @@
order by es.inventory_update_time desc
</select>
<!-- </if>
suppliesWarehouseId-->
<!-- 分页查询:设备关联的备品备件集合-->
<select id="queryPageRelationList" resultType="com.skua.modules.equipment.vo.EquipmentSparepartVO" >
select es.* from equipment_relation er , equipment_sparepart es
where er.sparepart_id = es.id and er.info_id = #{param.infoId}
<if test="param.sparepartCode != null and param.sparepartCode !=''">and es.sparepart_code like '%' #{param.sparepartCode}'%'</if>
<if test="param.sparepartName != null and param.sparepartName !=''">and es.sparepart_name like '%' #{param.sparepartName}'%'</if>
<if test="param.specification != null and param.specification !=''">and es.specification like '%' #{param.specification}'%'</if>
order by es.inventory_update_time desc
</select>
</mapper>
......
......@@ -13,7 +13,7 @@ public interface IDrugConsumptionAnalysisService {
//数据展示
DrugConsumptionDisplayVO dataDisplay(String time, String departId);
//总药耗趋势
//总药耗趋势--->改为吨水药费用
List<DrugConsumptionTrendChartVO> drugConsumptionTrend(String time, String departId);
//吨水药耗趋势
List<DrugConsumptionTrendChartVO> consumptionTonOfWaterTrend(String time,String departId);
......
......@@ -18,4 +18,11 @@ public interface IEquipmentSparepartService extends IService<EquipmentSparepart>
IPage<EquipmentSparepartVO> queryByPage(Page<EquipmentSparepartVO> page, EquipmentSparepartSearchVO sparepartSearchVO);
/***
* 分页查询:设备关联的备品备件
* @param page
* @param sparepartSearchVO
* @return
*/
IPage<EquipmentSparepartVO> queryPageRelationList(Page<EquipmentSparepartVO> page, EquipmentSparepartSearchVO sparepartSearchVO);
}
......
package com.skua.modules.equipment.service.impl;
import com.google.common.collect.Maps;
import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.context.SpringContextUtils;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.common.vo.DateVO;
import com.skua.modules.equipment.dto.*;
import com.skua.modules.equipment.mapper.ComprehensiveSupervisionMapper;
import com.skua.modules.equipment.service.IDrugConsumptionAnalysisService;
import com.skua.modules.equipment.vo.CorrelationAnalysisVO;
import com.skua.modules.equipment.vo.DrugConsumptionDisplayVO;
import com.skua.modules.equipment.vo.DrugConsumptionTrendChartVO;
import com.skua.modules.equipment.vo.MetricVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.dao.DataAccessException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
......@@ -24,7 +18,6 @@ import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Service
......@@ -81,14 +74,37 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
return displayVO;
}
//总药耗趋势
//总药耗趋势--->吨水药费
public List<DrugConsumptionTrendChartVO> drugConsumptionTrend(String time, String departId){
List<DrugConsumptionTrendChartVO> chartVOList = new ArrayList<>();
//查询当前时间往前推12个月的数据
String startTime=this.getMonthBytime(-25,time)+"-01";
String endTime=this.getMonthBytime(-1,time)+"-31";
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, startTime,endTime);
System.out.println("dataViewName3a24 ="+dataViewName3a24);
String dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"YYH", departId, startTime,endTime);
String sql = "select sum(aaa.yyh) yyh,aaa.time from ( "+ dataViewName4411+") aaa group by aaa.time";
List<Map<String, Object> > dataList = getJdbcTemplate().queryForList(sql);
Map<String, String> dataMap = new HashMap<>();
if(dataList != null ){
for (Map<String,Object> map : dataList){
dataMap.put(map.get("time")+"", ConvertUtils.getString(map.get("yyh"),"0"));
}
}
//查询当前时间往前推12个月的数据
DrugConsumptionTrendChartVO chartVO = null;
List<String> months=this.getTwelve(time);
for (String month : months) {
String yesmonth=this.getMonthBytime(-12,month);//同比
chartVO = new DrugConsumptionTrendChartVO();
chartVO.setTime( month );
chartVO.setZyh( ConvertUtils.getDouble(dataMap.get(month),0d) );
chartVO.setTbzyh( ConvertUtils.getDouble(dataMap.get(yesmonth),0d) );
chartVOList.add( chartVO ) ;
}
return chartVOList;
/* String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, startTime,endTime);
StringBuffer sql2 = new StringBuffer("select DATE_FORMAT(aaa.time,'%Y-%m') 'time', ");
sql2.append(" round((aaa.PAMZ + aaa.PAMF+ aaa.PAMRJ+ aaa.SCLPAMZ+ aaa.SCLPAMF+ aaa.NACLO+ aaa.PACGT+ aaa.PACYT+ aaa.FESO4G+ aaa.FESO4Y+ aaa.H2O2+ aaa.CH3COOH+ aaa.SH+ aaa.FECL3+ aaa.HXT+ aaa.PFS+ aaa.CH3COONA+ aaa.GXCLJ+ aaa.YWL+ aaa.RYXNJ+ aaa.FHTY),2) 'zyh' from ");
sql2.append( " "+dataViewName3a24+" aaa group by DATE_FORMAT(aaa.time,'%Y-%m')");
......@@ -120,7 +136,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
}
chartVOList1.add( chartVOTemp) ;
}
return chartVOList1;
return chartVOList1;*/
}
//吨水药耗趋势
......
......@@ -26,10 +26,19 @@ public class EquipmentSparepartServiceImpl extends ServiceImpl<EquipmentSparepar
/***
* 分页查询
* @param page
* @param equipmentSparepartDTO
* @param sparepartSearchVO
* @return
*/
public IPage<EquipmentSparepartVO> queryByPage(Page<EquipmentSparepartVO> page, EquipmentSparepartSearchVO sparepartSearchVO){
return baseMapper.queryByPage(page,sparepartSearchVO);
}
/***
* 分页查询:设备关联的备品备件
* @param page
* @param sparepartSearchVO
* @return
*/
public IPage<EquipmentSparepartVO> queryPageRelationList(Page<EquipmentSparepartVO> page, EquipmentSparepartSearchVO sparepartSearchVO){
return baseMapper.queryPageRelationList(page,sparepartSearchVO);
}
}
......
......@@ -15,6 +15,10 @@ public class EquipmentSparepartSearchVO {
@ApiModelProperty(value = "厂站")
private String departId;
@ApiModelProperty(value = "设备编号")
private String infoId;
@ApiModelProperty(value = "物料类别编号")
private String sparepartType;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!