3aa0e6bb 康伟

kangwei: 安环两个大屏样式、需求改版-后端

1 个父辈 b3ec3071
正在显示 22 个修改的文件 包含 187 行增加78 行删除
......@@ -175,12 +175,6 @@ public class AjhRectificationInfoController {
queryWrapper.select("count(id) count,handle_result handleResult");
queryWrapper.groupBy("handle_result");
/* if(StringUtils.isEmpty(ajhRectificationInfo.getDepartId())){
ajhRectificationInfo.setDepartId(BaseContextHandler.getDeparts());
}*/
if (!"1".equals(BaseContextHandler.get("userType"))) {
queryWrapper.in("depart_id",BaseContextHandler.getDeparts());
}
List<Map<String,Object>> list = ajhRectificationInfoService.listMaps(queryWrapper);
result.setSuccess(true);
......@@ -352,4 +346,12 @@ public class AjhRectificationInfoController {
Map<String, Object> result = ajhRectificationInfoService.searchSafeCensus(now, paramType);
return result;
}
@ApiOperation(value="安全态势总览数据统计:统计教育+题库", notes="安全态势总览数据统计:统计教育+题库")
@RequestMapping(value = "/jyCensus", method = RequestMethod.GET)
public Map<String,Object> jyCensus(@RequestParam(name="now",required=true) String now) {
Map<String, Object> result = ajhRectificationInfoService.jyCensus(now);
return result;
}
}
......
......@@ -109,4 +109,6 @@ public interface IAjhRectificationInfoService extends IService<AjhRectificationI
Map<String,Object> getStructNoHandleDetail(String startTime,String endTime);
boolean pass(AjhRectificationInfo dto);
//安全态势总览数据统计:统计教育+题库
Map<String, Object> jyCensus(String now);
}
......
......@@ -17,6 +17,8 @@ import com.skua.modules.ajh.entity.AjhRectificationInfo;
import com.skua.modules.ajh.mapper.AjhRectificationInfoMapper;
import com.skua.modules.ajh.service.IAjhRectificationInfoService;
import com.skua.modules.ajh.vo.RectificationInfoAnalyseVO;
import com.skua.modules.common.service.ICommonSqlService;
import com.skua.modules.common.vo.DateVO;
import com.skua.modules.emergency.enums.DicRectificationInfoHandleResultEnums;
import com.skua.modules.flow.business.service.FlowBusinessService;
import com.skua.modules.flow.business.service.IFlowService;
......@@ -31,6 +33,7 @@ import com.skua.modules.system.entity.SysUser;
import com.skua.modules.system.service.ISysDepartService;
import com.skua.modules.system.service.ISysDictService;
import com.skua.modules.system.service.ISysUserService;
import com.skua.tool.util.JSUtils;
import com.skua.tool.util.UniqIdUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
......@@ -64,6 +67,9 @@ public class AjhRectificationInfoServiceImpl extends ServiceImpl<AjhRectificatio
@Autowired
private ISysDepartService departService;
@Autowired
private ICommonSqlService commonSqlService;
@Override
public Map<String, Object> searchSafeCensus(String now, String paramType) {
String nowMonth = now;//本月
......@@ -139,6 +145,51 @@ public class AjhRectificationInfoServiceImpl extends ServiceImpl<AjhRectificatio
return result;
}
//安全态势总览数据统计:统计教育+题库
public Map<String,Object> jyCensus(String now) {
Map<String, Object> dataMap = new HashMap<>();
DateVO dateVO = new DateVO(now+"-01");
//教培数量
String jpNum = getJPCount( dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate() );
dataMap.put("jpNum",jpNum);//本月教培数量
String jpTBNum = getJPCount( dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime() );
dataMap.put("jpTBNum",jpTBNum);//同比月教培数量
String jpYearNum = getJPCount( dateVO.getNowYearStartDate(),dateVO.getNowYearEndDate() );
dataMap.put("jpYearNum",jpYearNum);//本年教培数量
String dbSql = "select count(1) from edu_question_db where create_time >='"+dateVO.getNowMonthStartDate()+" 00:00:00' and create_time <= '"+dateVO.getNowMonthEndDate()+" 23:59:59' ";
String dbNum = commonSqlService.queryForString(dbSql);
dataMap.put("dbNum",dbNum);//题库数量
// 教培人数
String sql = " select count(1) from ajh_meeting m ,ajh_meeting_send ms ,ajh_meeting_receipt t ";
sql += " where m.id = ms.meet_id and t.meets_id = ms.id and t.status = '1' and ms.meet_status > '0' and m.send_status = '1' and m.meet_category ='1' and ms.depart_id in("+JSUtils.quoteEach(BaseContextHandler.getDeparts(),",")+")+";
sql += " and ms.meet_end_time >='"+dateVO.getNowYearStartDate()+" 00:00:00' and ms.meet_end_time <= '"+dateVO.getNowYearEndDate()+" 23:59:59' ";
String pxUserNum = commonSqlService.queryForString(dbSql);
//考试人数
sql = " select count(1) from ( select up.user_id,up.paper_id from edu_user_paper up where up.end_time >='"+dateVO.getNowYearStartDate()+" 00:00:00' and up.end_time <= '"+dateVO.getNowYearEndDate()+" 23:59:59' group by up.user_id,up.paper_id)aaa";
String examUserNum = commonSqlService.queryForString(dbSql);
dataMap.put("jpUserNum",JSUtils.add(pxUserNum,examUserNum));//教培总人数
return dataMap;
}
// 获取教培数量
private String getJPCount(String startDate,String endDate){
//培训会议数量
String sql = "select count(1) from ajh_meeting m ,ajh_meeting_send ms ";
sql += " where m.id = ms.meet_id and ms.meet_status > '0' and m.send_status = '1' and m.meet_category ='1' and ms.depart_id in("+JSUtils.quoteEach(BaseContextHandler.getDeparts(),",")+") ";
sql += " and ms.meet_end_time >='"+startDate+" 00:00:00' and ms.meet_end_time <= '"+endDate+" 23:59:59' ";
String pxNum = commonSqlService.queryForString(sql);
//试卷数量
sql = " select count(p.id) from edu_paper p where p.send_status = '1' and p.depart_id in("+JSUtils.quoteEach(BaseContextHandler.getDeparts(),",")+") ";
sql += " and p.send_time >='"+startDate+" 00:00:00' and p.send_time <= '"+endDate+" 23:59:59' ";
String paperNum = commonSqlService.queryForString(sql);
String jpNum = JSUtils.add(pxNum,paperNum);
return jpNum;
}
@Override
@Transactional(rollbackFor = Exception.class)
......
......@@ -232,7 +232,6 @@ public class ReportItemvService {
private Map<String,String> commonQueryCsl(String departIds ,String startTime ,String endTime){
Map<String,String> cslMap = new HashMap<>();
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, startTime,endTime);
// System.out.println("dataViewName2119 ="+dataViewName2119 );
List<Map<String, Object>> dataMapList = getJdbcTemplate().queryForList(dataViewName2119);
if(dataMapList != null){
for(Map<String, Object> dataMap : dataMapList){
......
......@@ -160,7 +160,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
public Map<String,String> commonQueryCsl(String departIds ,String startTime ,String endTime){
Map<String,String> cslMap = new HashMap<>();
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, startTime,endTime);
// System.out.println("dataViewName2119 ="+dataViewName2119 );
List<Map<String, Object>> dataMapList = getJdbcTemplate().queryForList(dataViewName2119);
if(dataMapList != null){
for(Map<String, Object> dataMap : dataMapList){
......
package com.skua.modules.edu.job;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.util.DateUtils;
import com.skua.core.util.push.IPushService;
import com.skua.core.util.push.MessageEntity;
import com.skua.core.util.push.PushMessageFactory;
import com.skua.modules.edu.entity.Paper;
import com.skua.modules.edu.service.IPaperService;
import com.skua.modules.edu.service.IUserPaperService;
import com.skua.modules.system.entity.SysUser;
import com.skua.modules.system.service.ISysUserService;
import com.skua.modules.system.service.SmsService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
......@@ -31,12 +27,15 @@ import java.util.stream.Collectors;
* (3)、考试结束时间前1天推送一次(如果还未完成的话)
*/
@Slf4j
@Component
public class EduSendMsgJob implements Job {
@Autowired
private ISysUserService userService;
@Autowired
private IPaperService paperService;
@Autowired
private SmsService smsService;
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
log.info(String.format(" Jeecg-Boot 发送消息任务 SendMsgJob ! 时间:" + DateUtils.getTimestamp()));
......@@ -57,6 +56,7 @@ public class EduSendMsgJob implements Job {
String messageBody = null;
String userIds = null;
String msgCategory = "12";
List<Paper> paperList = paperService.queryExamUserIds(yesterDate,null);
if(paperList != null && !paperList.isEmpty()){
for(Paper paper : paperList){
......@@ -65,7 +65,8 @@ public class EduSendMsgJob implements Job {
messageBody = "考试任务:<"+paper.getPaperTitle() +">明天开始,考试时间:"+paper.getStartTime() +"至"+paper.getEndTime()+",请准时参加考试";
userIds = getNoExamUserIds(paper.getExamUserIds(),paper.getUserIds());
if(StringUtils.isNotEmpty(userIds)){
pushMsgNoProcess(messageTitle,messageBody,userIds);
//pushMsgNoProcess(messageTitle,messageBody,userIds);
smsService.pushMsgNoProcess( messageTitle , messageBody , userIds, "Paper", msgCategory);
}
}
......@@ -78,34 +79,10 @@ public class EduSendMsgJob implements Job {
messageBody = "考试任务:<"+paper.getPaperTitle() +">明天结束,考试时间:"+paper.getStartTime() +"至"+paper.getEndTime()+",请准时参加考试";
userIds = getNoExamUserIds(paper.getExamUserIds(),paper.getUserIds());
if(StringUtils.isNotEmpty(userIds)){
pushMsgNoProcess(messageTitle,messageBody,userIds);
}
}
//pushMsgNoProcess(messageTitle,messageBody,userIds);
smsService.pushMsgNoProcess( messageTitle , messageBody , userIds, "Paper", msgCategory);
}
}
private void pushMsgNoProcess(String messageTitle ,String messageBody ,String userIds) {
if(StringUtils.isNotEmpty(userIds)){
List<SysUser> sysUserList = userService.getUserByUserIds(userIds);
List<String> userCidList = sysUserList.stream().map(SysUser::getCid).filter(v -> StringUtils.isNotBlank(v)).collect(Collectors.toList());
List<String> userIdList = sysUserList.stream().map(SysUser::getId).collect(Collectors.toList());
MessageEntity messageEntity = new MessageEntity();
//messageEntity.setMessageTitle("考试马上开始");
//messageEntity.setMessageBody("**考试于*****开始考试,请尽快准备!");
messageEntity.setMessageTitle(messageTitle);
messageEntity.setMessageBody(messageBody);
messageEntity.setReceiveUser(userIdList);
messageEntity.setReceiveUserCid(userCidList);
messageEntity.setSendUser(BaseContextHandler.getUserName());
messageEntity.setForwardTag("historyRecordRemind");//消息提醒类型 保持唯一
IPushService appPushService = PushMessageFactory.getPushService("MOB");
IPushService webPushService = PushMessageFactory.getPushService("WEB");
appPushService.pushMessage(messageEntity);
webPushService.pushMessage(messageEntity);
}
}
......
......@@ -3,6 +3,7 @@ package com.skua.modules.erp.mapper;
import java.util.List;
import com.skua.modules.erp.entity.MaterialIN;
import com.skua.tool.annotation.Anonymous;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.erp.entity.MaterialAcceptanceForm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -25,4 +26,6 @@ public interface MaterialAcceptanceFormMapper extends BaseMapper<MaterialAccepta
* @param confirmStatus
*/
void updateMaterialINConfirmStatus(@Param("materialInId") String materialInId, @Param("confirmStatus")String confirmStatus);
@Anonymous
public MaterialAcceptanceForm queryById(@Param("id") String id);
}
......
......@@ -2,6 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.erp.mapper.MaterialAcceptanceFormMapper">
<select id="queryById" resultType="com.skua.modules.erp.entity.MaterialAcceptanceForm">
select * from erp_material_acceptance_form where id = #{id}
</select>
<select id="queryArrivalRecordByList" resultType="com.skua.modules.erp.entity.MaterialAcceptanceForm">
select mi.arrive_time , maf.* from erp_material_in mi ,erp_material_acceptance_form maf
where mi.id = maf.id
......
......@@ -60,10 +60,12 @@
group by sparepart_id,purchase_contract_id,depart_id,supplier_id
</select>
<select id="queryById" resultType="com.skua.modules.erp.vo.MaterialINVO">
select d.depart_name 'departName', ss.sparepart_code,ss.sparepart_name, st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name',ss.sparepart_name, ss.specification,ss.measuring_unit,
select d.depart_name 'departName', ss.sparepart_code, st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name',ss.sparepart_name, ss.specification,ss.measuring_unit,
round(pm.unit_price * t.material_num,2) 'purchaseTotalPrice', round(dm.distribut_price * t.material_num,2) 'distributTotalPrice' ,round(dm.distribut_price * t.material_num ,2)'total_price',
dm.tax_amount,dm.distribut_price,t.distribut_material_id,t.sparepart_type,
dm.tax_amount,dm.distribut_price,t.distribut_material_id,t.sparepart_type,t.in_warehouse_id,
t.id,t.depart_id,t.project_name,t.in_order,t.purchase_contract_id,t.purchase_contract_code,t.distribut_contract_id,t.distribut_contract_code,t.arrive_time,t.receiver,t.sparepart_id,t.material_num,t.supplier_id,t.good_code,t.share_url,t.confirm_status,t.audit_status,t.approve_message,t.in_type
from erp_material_in t
left join sys_depart d on t.depart_id = d.id
......@@ -77,9 +79,9 @@
<select id="arrivalRecordList" resultType="com.skua.modules.erp.vo.MaterialINVO">
select d.depart_name 'departName', ss.sparepart_code,ss.sparepart_name, st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name',ss.sparepart_name, ss.specification,ss.measuring_unit,
select d.depart_name 'departName', ss.sparepart_code, st.item_text as 'sparepart_type_name',sm.supp_name as 'supplier_name',ss.sparepart_name, ss.specification,ss.measuring_unit,
round(pm.unit_price * t.material_num,2) 'purchaseTotalPrice', round(dm.distribut_price * t.material_num,2) 'distributTotalPrice' ,round(dm.distribut_price * t.material_num ,2)'total_price',
dm.tax_amount,dm.distribut_price,t.distribut_material_id,t.sparepart_type,
dm.tax_amount,dm.distribut_price,t.distribut_material_id,t.sparepart_type,t.in_warehouse_id,
t.id,t.depart_id,t.project_name,t.in_order,t.purchase_contract_id,t.purchase_contract_code,t.distribut_contract_id,t.distribut_contract_code,t.arrive_time,t.receiver,t.sparepart_id,t.material_num,t.supplier_id,t.good_code,t.share_url,t.confirm_status,t.audit_status,t.approve_message,t.in_type
from erp_material_in t
left join sys_depart d on t.depart_id = d.id
......
......@@ -145,7 +145,7 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
if("1".equals( purchaseContractVO.getStatus() )){
//发送信息
String roleId = configService.queryValueByKey("TGHT_SP_ROLE_ID");
smsService.pushMsgNoProcessByRoleId("统购合同审批","有统购合同["+purchaseContractVO.getContractName()+"]需要审批审批",roleId,"PurchaseContract");
smsService.pushMsgNoProcessByRoleId("统购合同审批","有统购合同["+purchaseContractVO.getContractName()+"]需要审批审批",roleId,"PurchaseContract","13");
}
}
......@@ -180,7 +180,7 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
if("1".equals( purchaseContractVO.getStatus() )){
//发送信息
String roleId = configService.queryValueByKey("TGHT_SP_ROLE_ID");
smsService.pushMsgNoProcessByRoleId("统购合同审批","有统购合同["+purchaseContractVO.getContractName()+"]需要审批审批",roleId,"PurchaseContract");
smsService.pushMsgNoProcessByRoleId("统购合同审批","有统购合同["+purchaseContractVO.getContractName()+"]需要审批审批",roleId,"PurchaseContract","13");
}
return count > 0 ? true :false;
}
......@@ -323,7 +323,7 @@ public class ERPPurchaseContractServiceImpl extends ServiceImpl<ERPPurchaseContr
this.baseMapper.updateById(purchaseContract);
//发送信息
String roleId = configService.queryValueByKey("TGHT_SP_ROLE_ID");
smsService.pushMsgNoProcessByRoleId("统购合同审批","有统购合同["+purchaseContract.getContractName()+"]需要审批审批",roleId,"PurchaseContract");
smsService.pushMsgNoProcessByRoleId("统购合同审批","有统购合同["+purchaseContract.getContractName()+"]需要审批审批",roleId,"PurchaseContract","13");
}
/***
......
......@@ -69,16 +69,19 @@ public class ErpSettlementServiceImpl extends ServiceImpl<ErpSettlementMapper, E
updateMaterialInSettlementFlag( erpSettlementVO,"1");
//发送消息
// settlementType;结算类型:0 供应商结算,1 水厂结算
String msgCategory = "9";
String msgTitle = "药剂结算验收审批";
if("0".equals( erpSettlementVO.getSettlementType() )){
msgCategory = "10";
msgTitle = "供应商结算验收审批";
}
if("1".equals( erpSettlementVO.getSettlementType() )){
msgCategory = "9";
msgTitle = "水厂结算验收审批";
}
//发送信息
String roleId = configService.queryValueByKey("YJJS_YS_ROLE_ID");
smsService.pushMsgNoProcessByRoleId(msgTitle,msgTitle,roleId,"ErpSettlement");
smsService.pushMsgNoProcessByRoleId(msgTitle,msgTitle,roleId,"ErpSettlement",msgCategory);
}
/**
......@@ -177,6 +180,7 @@ public class ErpSettlementServiceImpl extends ServiceImpl<ErpSettlementMapper, E
String roleId = configService.queryValueByKey("YJJS_JLSP_ROLE_ID");
//发送消息
// settlementType;结算类型:0 供应商结算,1 水厂结算
String msgCategory = "11";
String msgTitle = "药剂结算经理审批";
if("0".equals( erpSettlementEntity.getSettlementType() )){
msgTitle = "供应商结算经理审批";
......@@ -185,7 +189,7 @@ public class ErpSettlementServiceImpl extends ServiceImpl<ErpSettlementMapper, E
msgTitle = "水厂结算经理审批";
}
//发送信息
smsService.pushMsgNoProcessByRoleId(msgTitle,msgTitle,roleId,"ErpSettlement");
smsService.pushMsgNoProcessByRoleId(msgTitle,msgTitle,roleId,"ErpSettlement",msgCategory);
return true;
}
......
......@@ -41,6 +41,6 @@ public class MaterialAcceptanceFormServiceImpl extends ServiceImpl<MaterialAccep
}
public MaterialAcceptanceForm queryById(String id){
return baseMapper.selectById(id);
return baseMapper.queryById(id);
}
}
......
......@@ -98,10 +98,10 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia
*/
@Transactional
public int batchSendAudit(String ids,String auditStatus){
//发送信息
String roleId = configService.queryValueByKey("YJRK_SP_ROLE_ID");
smsService.pushMsgNoProcessByRoleId("药剂入库审批","有多个药剂入库需要审批审批",roleId,"MaterialIN");
String msgCategory = "6";
smsService.pushMsgNoProcessByRoleId("药剂入库审批","有多个药剂入库需要审批审批",roleId,"MaterialIN",msgCategory);
return this.baseMapper.batchSendAudit(ids,auditStatus);
}
/**
......@@ -113,7 +113,8 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia
this.baseMapper.updateById(materialIN);
//发送信息
String roleId = configService.queryValueByKey("YJRK_SP_ROLE_ID");
smsService.pushMsgNoProcessByRoleId("药剂入库审批","有药剂入库单["+materialIN.getProjectName()+"]需要审批审批",roleId,"MaterialIN");
String msgCategory = "6";
smsService.pushMsgNoProcessByRoleId("药剂入库审批","有药剂入库单["+materialIN.getProjectName()+"]需要审批审批",roleId,"MaterialIN",msgCategory);
}
/***
* 审核药剂入库单
......@@ -131,12 +132,12 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia
String errMsg = null;
boolean inAndOutStock = false;
//保存
MaterialIN materialINTemp = this.baseMapper.selectById(id);
MaterialIN materialINTemp = this.baseMapper.queryById(id);
if(!"3".equals(materialINTemp.getAuditStatus())){
/* QueryWrapper<SuppliesWarehouse> queryWrapper = new QueryWrapper<SuppliesWarehouse>();
queryWrapper.eq("depart_id",materialINVO.getDepartId());*/
String inWarehouseId = materialINTemp.getInWarehouseId();
if(StringUtils.isEmpty(inWarehouseId)){
/* if(StringUtils.isEmpty(inWarehouseId)){
//主库数据源
JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
if(materialINTemp != null && StringUtils.isNotEmpty(materialINTemp.getDepartId())){
......@@ -148,7 +149,7 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia
String departName = masterDB.queryForObject( departSql,String.class );
return "所属厂站["+ ConvertUtils.getString(departName) +"]下没有找到仓库信息!";
}
}
}*/
//purchasePlan.getApproveState() 审批状态 1通过2不通过
if("1".equals( approveState )){
materialINTemp.setAuditStatus( "3" );
......
......@@ -11,6 +11,7 @@ import com.skua.modules.system.service.ISysDepartService;
import com.skua.tool.util.DateUtils;
import com.skua.tool.util.JSUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -185,6 +186,17 @@ public class OperationDailyController {
dataMap = commonSqlService.queryForMap(sql);
operationDailyVO.setYhDepartName( ConvertUtils.getString(dataMap.get("depart_name"),"无") );
if("1818215543140909056".equals(departId)){
String dataViewName6643 = ReportViewUtil.buildView(ReportConstant.view6643,"GSL", departIds, dateTIme,dateTIme);
String dataViewName6643HB = ReportViewUtil.buildView(ReportConstant.view6643,"GSL", departIds, previousDay,previousDay);
sql = "select round(sum(ifnull(aaa.GSL,0))/10000,2) GSL from "+dataViewName6643+"aaa ";
dataMap = commonSqlService.queryForMap(sql);
operationDailyVO.setScgsl( ConvertUtils.getString(dataMap.get("GSL"),"0") );//日报生产供水量
sql = "select round(sum(ifnull(aaa.GSL,0))/10000,2) GSL from "+dataViewName6643HB+"aaa ";
dataMap = commonSqlService.queryForMap(sql);
operationDailyVO.setIncreaseScgsl( ConvertUtils.getString(dataMap.get("GSL"),"0") );//供水量较昨日增加
}
return operationDailyVO;
}
......
package com.skua.modules.report.job;
import com.skua.core.util.DateUtils;
import com.skua.modules.edu.entity.Paper;
import com.skua.modules.edu.service.IPaperService;
import com.skua.modules.system.service.ISysConfigService;
import com.skua.modules.system.service.ISysUserService;
import com.skua.modules.system.service.SmsService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
2、每日下午14点给该角色发送消息推送(移动端及web端),提示该角色查看运营日报,点击后即可查看昨日运营日报.
*/
@Slf4j
@Component
public class OperationDailyJob implements Job {
@Autowired
private ISysConfigService configService;
@Autowired
private SmsService smsService;
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
log.info(String.format(" Jeecg-Boot 发送消息任务 SendMsgJob ! 时间:" + DateUtils.getTimestamp()));
String messageTitle = null;
String messageBody = null;
String msgCategory = "8";
messageTitle = "请查看运营日报.";
messageBody = "请查看运营日报.";
String roleId = configService.queryValueByKey("YJJS_JLSP_ROLE_ID");
//发送信息
smsService.pushMsgNoProcessByRoleId(messageTitle,messageBody,roleId,"OperationDaily",msgCategory);
}
}
......@@ -45,4 +45,14 @@ public class OperationDailyVO {
@ApiModelProperty(value = "药耗超标公司")
private String yhDepartName;
@ApiModelProperty(value = "日报生产供水量")
private String scgsl;
@ApiModelProperty(value = "供水量较昨日增加")
private String increaseScgsl;
}
......
......@@ -111,7 +111,6 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
//DateVO dateVO = new DateVO(DateUtil.dateformat("2024-07-01","yyyy-MM-dd"));
//月产水量
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", null, startTime,endTime,"sum");
//System.out.println("dataViewName2119 = "+dataViewName2119);
String ycslSql = "select round(sum(aaa.CSL),2) 'CSL' from "+ dataViewName2119+" aaa";
String ycsl = getJdbcTemplate().queryForObject(ycslSql, String.class);
projectOperationInfoVO.setYcsl( ycsl );
......@@ -161,7 +160,6 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
String endTime=BaseUtil.getMonthBytime(-1,time)+"-31";
//月产水量
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL,JSL", null, startTime,endTime);
//System.out.println("dataViewName2119 ="+dataViewName2119);
StringBuffer sql = new StringBuffer("select date_format(bbb.time,'%Y-%m') 'time' ,round(sum(bbb.JSL),2) 'jsl',round(sum(bbb.CSL),2) 'csl' from ");
sql.append( dataViewName2119 );
sql.append( " bbb group by date_format(bbb.time,'%Y-%m') ORDER BY bbb.time");
......@@ -209,7 +207,6 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
String endTime=BaseUtil.getMonthBytime(-1,time)+"-31";
//CSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN,JSAD,CSAD
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"JSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN,JSAD,CSAD", departId, startTime,endTime);
System.out.println("dataViewName2119 ="+dataViewName2119);
StringBuffer sql = new StringBuffer("select date_format(aaa.time, '%Y-%m') 'time' , round(sum(aaa.JSL),2) 'jsl',round(sum( aaa.JSCOD -aaa.CSCOD ),2) 'cod', ");
sql.append(" round(sum( aaa.JSZL -aaa.CSZL ),2) 'tp', round(sum( aaa.JSZD -aaa.CSTN ),2) 'tn',round(sum( aaa.JSAD -aaa.CSAD ),2) 'nh3n' from ");
sql.append(" "+dataViewName2119 +" aaa ");
......@@ -241,20 +238,19 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
// if(waterQualityVO == null )waterQualityVO = new WaterQualityVO();
//负荷率 CSL/设计规模 ()
String factoryProScaleSql = "select round( ("+waterQualityVO.getCsl() +"/(pro_scale * 100) ),2) fhl from sys_factory_info where depart_id = '"+departId+"'";
System.out.println("factoryProScaleSql = "+factoryProScaleSql);
// System.out.println("factoryProScaleSql = "+factoryProScaleSql);
Double yxfhl = getJdbcTemplate().queryForObject(factoryProScaleSql,Double.class);
waterQualityVO.setYxfhl( yxfhl );
//吨水电耗,吨水药耗
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24, ReportConstant.fieldDl+","+ ReportConstant.fieldWnl+","+ ReportConstant.fieldYj, departId, startTime,endTime,"sum");
System.out.println("dataViewName3a24 = "+dataViewName3a24);
// System.out.println("dataViewName3a24 = "+dataViewName3a24);
StringBuffer sql2 = new StringBuffer("select aaa.WNL as 'tnl' ,round((aaa.DLHJ /"+waterQualityVO.getCsl()+"),2) 'dsdh' , ");
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)/ "+waterQualityVO.getCsl()+"),2) 'dsyh' from ");
sql2.append(" "+dataViewName3a24+" aaa ");
System.out.println("sql2 = "+sql2.toString());
waterQualityVOList = getJdbcTemplate().query( sql2.toString(), new BeanPropertyRowMapper<WaterQualityVO>(WaterQualityVO.class));
if(waterQualityVOList != null && !waterQualityVOList.isEmpty() ){
WaterQualityVO waterQualityVOTemp = waterQualityVOList.get(0);
......
......@@ -559,9 +559,7 @@ public class PowerAnalysisNewServiceImpl implements IPowerAnalysisNewService {
//耗电量/((进水COD-出水COD)*处理水量)
//CSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN,JSAD,CSAD
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl +","+ReportConstant.fieldSz, departIds, startTime,endTime);
//System.out.println("dataViewName2119 ="+dataViewName2119);
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,ReportConstant.fieldDl, departIds, startTime,endTime);
//System.out.println("dataViewName3a24 ="+dataViewName3a24);
String sql = "select bbb.depart_id ,IFNULL(ccc.DLHJ,0) as hdl, IFNULL(round (IFNULL(ccc.DLHJ,0) / bbb.codValue ,2),0) 'codValue',IFNULL(round (IFNULL(ccc.DLHJ,0) / bbb.nh3nValue,2),0) 'nh3nValue',";
sql += " IFNULL(round (IFNULL(ccc.DLHJ,0) / bbb.tpValue,2),0) 'tpValue',IFNULL(round (IFNULL(ccc.DLHJ,0) / bbb.tnValue,2),0) 'tnValue' from ( ";
sql += " select aaa.depart_id,SUM(aaa.CSL) clsl,sum(IFNULL(aaa.JSCOD,0)) 'JSCOD',sum(aaa.CSCOD) 'CSCOD',round( (sum(IFNULL(aaa.JSCOD,0)) - sum(IFNULL(aaa.CSCOD,0)) ) * sum(IFNULL(aaa.CSL,0)) *1000/1000000 ,2) 'codValue',";
......
......@@ -179,7 +179,7 @@ public class MajorIssuesProcessController {
String roleId = sysConfigService.queryValueByKey("YXBG_ROLE_ID");
if(StringUtils.isNotEmpty(roleId)){
smsService.pushMsgNoProcessByRoleId("请及时查看重点事项推进进展" ,message ,roleId,"MajorIssuesProcess");
smsService.pushMsgNoProcessByRoleId("请及时查看重点事项推进进展" ,message ,roleId,"MajorIssuesProcess","5");
result.setResult(majorIssuesProcess);
result.setSuccess(true);
}else{
......
......@@ -13,7 +13,7 @@ public interface MajorIssuesProcessMapper extends BaseMapper<MajorIssuesProcess>
/**
* 级联删除
* @param id
* @param matterProcessId
*/
void deleteItemById(@Param("id") String id);
void deleteItemById(@Param("matterProcessId") String matterProcessId);
}
......
......@@ -3,6 +3,6 @@
<mapper namespace="com.skua.modules.report.mapper.MajorIssuesProcessMapper">
<delete id="deleteItemById" >
delete from f_major_issues_process where matter_process_id = #{id}
delete from f_major_issues_process_item where matter_process_id = #{matterProcessId}
</delete>
</mapper>
......
......@@ -24,10 +24,10 @@ public class SmsService {
@Autowired
private WebNoticePushServiceExt webNoticePushServiceExt;
public void pushMsgNoProcessByRoleId(String messageTitle ,String messageBody ,String roleId,String forwardTag){
public void pushMsgNoProcessByRoleId(String messageTitle ,String messageBody ,String roleId,String forwardTag,String msgCategory){
if(StringUtils.isNotEmpty(roleId)){
List<SysUser> sysUserList = userService.queryUserByRoleId(roleId);
pushMessage(sysUserList,messageTitle , messageBody , forwardTag);
pushMessage(sysUserList,messageTitle , messageBody , forwardTag,msgCategory);
}
}
......@@ -38,13 +38,13 @@ public class SmsService {
* @param userIds
* @param forwardTag
*/
public void pushMsgNoProcess(String messageTitle ,String messageBody ,String userIds,String forwardTag){
public void pushMsgNoProcess(String messageTitle ,String messageBody ,String userIds,String forwardTag,String msgCategory){
if(StringUtils.isNotEmpty(userIds)){
List<SysUser> sysUserList = userService.getUserByUserIds(userIds);
pushMessage(sysUserList,messageTitle , messageBody , forwardTag);
pushMessage(sysUserList,messageTitle , messageBody , forwardTag,msgCategory);
}
}
private void pushMessage(List<SysUser> sysUserList,String messageTitle ,String messageBody ,String forwardTag){
private void pushMessage(List<SysUser> sysUserList,String messageTitle ,String messageBody ,String forwardTag,String msgCategory){
List<String> userCidList = sysUserList.stream().map(SysUser::getCid).filter(v -> StringUtils.isNotBlank(v)).collect(Collectors.toList());
List<String> userIdList = sysUserList.stream().map(SysUser::getId).collect(Collectors.toList());
......@@ -56,10 +56,11 @@ public class SmsService {
messageEntity.setSendUser(BaseContextHandler.getUserName());
messageEntity.setForwardTag(forwardTag);//消息提醒类型 保持唯一
IPushService appPushService = PushMessageFactory.getPushService("MOB");
// IPushService webPushService = PushMessageFactory.getPushService("WEB");
appPushService.pushMessage(messageEntity);
webNoticePushServiceExt.pushMessage(messageEntity,"5");
webNoticePushServiceExt.pushMessage(messageEntity,msgCategory);
}
/***
......@@ -93,7 +94,7 @@ public class SmsService {
* @param userIds
* @param forwardTag
*/
public void webPushMsgNoProcess(String messageTitle ,String messageBody ,String userIds,String forwardTag){
public void webPushMsgNoProcess(String messageTitle ,String messageBody ,String userIds,String forwardTag,String msgCategory){
if(StringUtils.isNotEmpty(userIds)){
List<SysUser> sysUserList = userService.getUserByUserIds(userIds);
List<String> userCidList = sysUserList.stream().map(SysUser::getCid).filter(v -> StringUtils.isNotBlank(v)).collect(Collectors.toList());
......@@ -106,8 +107,7 @@ public class SmsService {
messageEntity.setSendUser(BaseContextHandler.getUserName());
messageEntity.setForwardTag(forwardTag);//消息提醒类型 保持唯一
IPushService webPushService = PushMessageFactory.getPushService("WEB");
webPushService.pushMessage(messageEntity);
webNoticePushServiceExt.pushMessage(messageEntity,msgCategory);
}
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!