kangwei: 年度经营方案配置,与数据填报

          联调:备品备件的入库记录、出库记录,物料的库存信息
         bug修改,
1 个父辈 f0644138
正在显示 18 个修改的文件 包含 261 行增加123 行删除
......@@ -30,6 +30,9 @@ public class TreeNodeVO {
@ApiModelProperty(value = "负责人")
private String responsibler;
@ApiModelProperty(value = "用户标准版化")
private String userStandard;
@ApiModelProperty(value = "子集合")
private List<TreeNodeVO> children = new ArrayList<>();
......
......@@ -7,28 +7,17 @@ import com.skua.core.util.push.MessageEntity;
import com.skua.core.util.push.PushMessageFactory;
import com.skua.modules.alarmtmp.entity.AlarmRecordHistory;
import com.skua.modules.alarmtmp.entity.AlarmRuleLevelConfigTemplate;
import com.skua.modules.alarmtmp.enums.AlarmRecordStatusEnum;
import com.skua.modules.alarmtmp.service.AlarmRecordHistoryService;
import com.skua.modules.alarmtmp.service.AlarmRuleConfigService;
import com.skua.modules.flow.business.service.FlowBusinessService;
import com.skua.modules.flow.business.service.IFlowService;
import com.skua.modules.flow.core.constant.ProcessConstant;
import com.skua.modules.flow.core.entity.BladeFlow;
import com.skua.modules.flow.core.utils.FlowUtil;
import com.skua.modules.flow.support.Kv;
import com.skua.modules.flow.utils.Func;
import com.skua.modules.system.entity.SysUser;
import com.skua.modules.system.service.ISysDictService;
import com.skua.modules.system.service.ISysPermissionService;
import com.skua.modules.system.service.ISysUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.flowable.engine.ProcessEngine;
import org.flowable.engine.ProcessEngines;
import org.flowable.engine.TaskService;
import org.flowable.identitylink.api.IdentityLink;
import org.flowable.identitylink.api.IdentityLinkType;
import org.flowable.task.service.impl.persistence.entity.TaskEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......
......@@ -21,7 +21,6 @@ import com.skua.modules.ajh.vo.AjhPlanScheduleConfigXls;
import com.skua.tool.util.TreeBuilder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
......@@ -69,9 +68,9 @@ public class AjhPlanScheduleConfigController {
@ApiOperation(value="经营方案计划表-分页列表查询", notes="经营方案计划表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AjhPlanScheduleConfig>> queryPageList(AjhPlanScheduleConfig ajhPlanScheduleConfig,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<AjhPlanScheduleConfig>> result = new Result<IPage<AjhPlanScheduleConfig>>();
QueryWrapper<AjhPlanScheduleConfig> queryWrapper = QueryGenerator.initQueryWrapper(ajhPlanScheduleConfig, req.getParameterMap());
Page<AjhPlanScheduleConfig> page = new Page<AjhPlanScheduleConfig>(pageNo, pageSize);
......@@ -87,19 +86,22 @@ public class AjhPlanScheduleConfigController {
@ApiOperation(value="经营方案计划表-列表查询(树结构)", notes="经营方案计划表-列表查询(树结构)")
@GetMapping(value = "/treeList")
public Result<List<TreeNodeVO>> queryTreeList(AjhPlanScheduleConfig ajhPlanScheduleConfig,
HttpServletRequest req) {
HttpServletRequest req) {
Result<List<TreeNodeVO>> result = new Result<List<TreeNodeVO>>();
QueryWrapper<AjhPlanScheduleConfig> queryWrapper = QueryGenerator.initQueryWrapper(ajhPlanScheduleConfig, req.getParameterMap());
if(StringUtils.isEmpty(ajhPlanScheduleConfig.getFactoryId())){
queryWrapper.eq("factory_id",BaseContextHandler.getRealDepartId());
}
/*if(StringUtils.isEmpty(ajhPlanScheduleConfig.getDepartId())){
queryWrapper.eq("depart_id", BaseContextHandler.getRealDepartId());
}*/
queryWrapper.orderByAsc("sort_num");
List<AjhPlanScheduleConfig> configList = ajhPlanScheduleConfigService.list( queryWrapper);
List<TreeNodeVO> treeList = new ArrayList<TreeNodeVO>();
TreeNodeVO treeNodeVO = null;
if(configList != null && !configList.isEmpty()){
for(AjhPlanScheduleConfig config : configList){
//String id, String parentId, String label, String completeTime, String responsibler
treeList.add( new TreeNodeVO(config.getId(),config.getParentId(),config.getConfigName(),config.getCompleteTime(),config.getResponsibler()));
treeNodeVO = new TreeNodeVO(config.getId(),config.getParentId(),config.getConfigName(),config.getCompleteTime(),config.getResponsibler());
treeNodeVO.setUserStandard(config.getUserStandard());
treeList.add(treeNodeVO);
}
treeList = TreeBuilder.buildTree(treeList);
}
......@@ -226,7 +228,7 @@ public class AjhPlanScheduleConfigController {
return result;
}
/**
/**
* <pre>
* 导出excel
* </pre>
......@@ -237,31 +239,31 @@ public class AjhPlanScheduleConfigController {
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
// Step.1 组装查询条件
QueryWrapper<AjhPlanScheduleConfig> queryWrapper = null;
try {
String paramsStr = request.getParameter("paramsStr");
if (ConvertUtils.isNotEmpty(paramsStr)) {
String deString = URLDecoder.decode(paramsStr, "UTF-8");
AjhPlanScheduleConfig ajhPlanScheduleConfig = JSON.parseObject(deString, AjhPlanScheduleConfig.class);
queryWrapper = QueryGenerator.initQueryWrapper(ajhPlanScheduleConfig, request.getParameterMap());
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
// Step.1 组装查询条件
QueryWrapper<AjhPlanScheduleConfig> queryWrapper = null;
try {
String paramsStr = request.getParameter("paramsStr");
if (ConvertUtils.isNotEmpty(paramsStr)) {
String deString = URLDecoder.decode(paramsStr, "UTF-8");
AjhPlanScheduleConfig ajhPlanScheduleConfig = JSON.parseObject(deString, AjhPlanScheduleConfig.class);
queryWrapper = QueryGenerator.initQueryWrapper(ajhPlanScheduleConfig, request.getParameterMap());
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<AjhPlanScheduleConfig> pageList = ajhPlanScheduleConfigService.list(queryWrapper);
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "经营方案计划表列表");
mv.addObject(NormalExcelConstants.CLASS, AjhPlanScheduleConfig.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("经营方案计划表列表数据", "导出人:Jeecg", "导出信息"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<AjhPlanScheduleConfig> pageList = ajhPlanScheduleConfigService.list(queryWrapper);
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "经营方案计划表列表");
mv.addObject(NormalExcelConstants.CLASS, AjhPlanScheduleConfig.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("经营方案计划表列表数据", "导出人:Jeecg", "导出信息"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
/**
* 导出配置模版
......@@ -282,7 +284,7 @@ public class AjhPlanScheduleConfigController {
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
/**
/**
* <pre>
* 通过excel导入数据
* </pre>
......@@ -292,34 +294,33 @@ public class AjhPlanScheduleConfigController {
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
String factoryId = request.getParameter("departId");
String year = request.getParameter("year");
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<AjhPlanScheduleConfigXls> listAjhPlanScheduleConfigs = ExcelImportUtil.importExcel(file.getInputStream(), AjhPlanScheduleConfigXls.class, params);
ajhPlanScheduleConfigService.importExcel(listAjhPlanScheduleConfigs,factoryId,year);
return Result.ok("文件导入成功!数据行数:" + listAjhPlanScheduleConfigs.size());
} catch (Exception e) {
log.error(e.getMessage(),e);
return Result.error("文件导入失败:"+e.getMessage());
} finally {
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return Result.ok("文件导入失败!");
}
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
String factoryId = request.getParameter("departId");
String year = request.getParameter("year");
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<AjhPlanScheduleConfigXls> listAjhPlanScheduleConfigs = ExcelImportUtil.importExcel(file.getInputStream(), AjhPlanScheduleConfigXls.class, params);
ajhPlanScheduleConfigService.importExcel(listAjhPlanScheduleConfigs,factoryId,year);
return Result.ok("文件导入成功!数据行数:" + listAjhPlanScheduleConfigs.size());
} catch (Exception e) {
log.error(e.getMessage(),e);
return Result.error("文件导入失败:"+e.getMessage());
} finally {
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return Result.ok("文件导入失败!");
}
}
......
......@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.ajh.vo.AjhPlanScheduleDataVO;
import com.skua.modules.common.vo.TreeNodeVO;
import com.skua.tool.util.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
......@@ -160,16 +161,17 @@ public class AjhPlanScheduleDataController {
@AutoLog(value = "经营方案数据表-通过id查询")
@ApiOperation(value="经营方案数据表-通过id查询", notes="经营方案数据表-通过id查询")
@GetMapping(value = "/queryById")
public Result<List<AjhPlanScheduleDataVO>> queryById(@RequestParam(name="factoryId",required=true) String factoryId , @RequestParam(name="month",required=true) String month) {
public Result<List<AjhPlanScheduleDataVO>> queryById(@RequestParam(name="departId",required=true) String departId , @RequestParam(name="month",required=true) String month) {
Result<List<AjhPlanScheduleDataVO>> result = new Result<List<AjhPlanScheduleDataVO>>();
QueryWrapper<AjhPlanScheduleData> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("sd.factory_id",factoryId);
queryWrapper.eq("sd.depart_id",departId);
queryWrapper.eq("sd.date_time",month);
List<AjhPlanScheduleDataVO> scheduleDataVOList = ajhPlanScheduleDataService.queryByList( queryWrapper);
AjhPlanScheduleDataVO dataVO = null;
List<AjhPlanScheduleDataVO> dataList = new ArrayList<>();
List<TreeNodeVO> treeNodeVOList = ajhPlanScheduleConfigService.queryTreeList(factoryId);
Integer year = DateUtils.getDateYear(month+"-01");
List<TreeNodeVO> treeNodeVOList = ajhPlanScheduleConfigService.queryTreeList(departId,year);
if(treeNodeVOList != null && !treeNodeVOList.isEmpty()){
for(TreeNodeVO treeNodeVO : treeNodeVOList){
if(treeNodeVO.getChildren() != null && !treeNodeVO.getChildren().isEmpty()){
......@@ -177,7 +179,7 @@ public class AjhPlanScheduleDataController {
//String factoryId,String workItermName, String workContent,String configLevel1, String completeTime1,String configLevel2, String responsibler1, String completeTime2, String responsibler2
dataVO = queryAjhPlanScheduleDataVO(scheduleDataVOList,childrenVO.getParentId(), childrenVO.getId());
if(dataVO == null ){
dataVO = new AjhPlanScheduleDataVO(factoryId ,month,treeNodeVO.getLabel(),childrenVO.getLabel(),treeNodeVO.getId(),treeNodeVO.getCompleteTime(),treeNodeVO.getResponsibler(),
dataVO = new AjhPlanScheduleDataVO(departId ,month,treeNodeVO.getLabel(),childrenVO.getLabel(),treeNodeVO.getId(),treeNodeVO.getCompleteTime(),treeNodeVO.getResponsibler(),
childrenVO.getId(),childrenVO.getCompleteTime(),childrenVO.getResponsibler());
}
dataList.add(dataVO );
......@@ -185,7 +187,7 @@ public class AjhPlanScheduleDataController {
}else{
dataVO = queryAjhPlanScheduleDataVO(scheduleDataVOList, treeNodeVO.getId());
if(dataVO == null ){
dataVO = new AjhPlanScheduleDataVO(factoryId ,month,treeNodeVO.getLabel(),treeNodeVO.getId(),treeNodeVO.getCompleteTime(),treeNodeVO.getResponsibler());
dataVO = new AjhPlanScheduleDataVO(departId ,month,treeNodeVO.getLabel(),treeNodeVO.getId(),treeNodeVO.getCompleteTime(),treeNodeVO.getResponsibler());
}
//String factoryId,String workItermName,String configLevel1, String completeTime1, String responsibler1
dataList.add(dataVO );
......
package com.skua.modules.ajh.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -24,7 +22,6 @@ import org.jeecgframework.poi.excel.annotation.Excel;
@Accessors(chain = true)
@ApiModel(value="ajh_plan_schedule_config对象", description="经营方案计划表")
public class AjhPlanScheduleConfig {
/**id*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "id")
......@@ -32,7 +29,8 @@ public class AjhPlanScheduleConfig {
/**所属厂站*/
@Excel(name = "所属厂站", width = 15)
@ApiModelProperty(value = "所属厂站")
private String factoryId;
private String departId;
@ApiModelProperty(value = "年份")
private String years;
......@@ -87,17 +85,16 @@ public class AjhPlanScheduleConfig {
private Date updateTime;
public AjhPlanScheduleConfig(){
}
public AjhPlanScheduleConfig( String factoryId,String years, String configName) {
public AjhPlanScheduleConfig( String departId,String years, String configName) {
this.years = years;
this.factoryId = factoryId;
this.departId = departId;
this.configName = configName;
}
public AjhPlanScheduleConfig(String factoryId, String year, String parentId, String configName, String completeTime, String responsibler) {
this.factoryId = factoryId;
public AjhPlanScheduleConfig(String departId, String year, String parentId, String configName, String completeTime, String responsibler) {
this.departId = departId;
this.years = years;
this.parentId = parentId;
this.configName = configName;
......
package com.skua.modules.ajh.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -31,7 +29,7 @@ public class AjhPlanScheduleData {
private String id;
@Excel(name = "所属厂站", width = 15)
@ApiModelProperty(value = "所属厂站")
private String factoryId;
private String departId;
@ApiModelProperty(value = "时间yyyy-MM")
private String dateTime;
@ApiModelProperty(value = "一级指标编号")
......
......@@ -14,7 +14,6 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
......
......@@ -14,10 +14,10 @@ import java.util.List;
public interface IAjhPlanScheduleConfigService extends IService<AjhPlanScheduleConfig> {
/***
* 列表查询
* @param factoryId
* @param departid
* @return
*/
List<TreeNodeVO> queryTreeList(String factoryId);
List<TreeNodeVO> queryTreeList(String departid,Integer years);
/**
* 导入excel文件
......
......@@ -7,6 +7,7 @@ import com.skua.modules.ajh.service.IAjhPlanScheduleConfigService;
import com.skua.modules.common.vo.TreeNodeVO;
import com.skua.modules.ajh.vo.AjhPlanScheduleConfigXls;
import com.skua.tool.util.TreeBuilder;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -25,12 +26,18 @@ public class AjhPlanScheduleConfigServiceImpl extends ServiceImpl<AjhPlanSchedul
/***
* 列表查询
* @param factoryId
* @param departId
* @return
*/
public List<TreeNodeVO> queryTreeList(String factoryId){
public List<TreeNodeVO> queryTreeList(String departId,Integer year){
QueryWrapper<AjhPlanScheduleConfig> queryConfigWrapper = new QueryWrapper();
queryConfigWrapper.eq("factory_id", factoryId);
if (StringUtils.isNotEmpty(departId)) {
queryConfigWrapper.eq("depart_id", departId);
}
if(year != null){
queryConfigWrapper.eq("years", year);
}
//
List<AjhPlanScheduleConfig> configList = this.baseMapper.selectList( queryConfigWrapper);
List<TreeNodeVO> treeList = new ArrayList<TreeNodeVO>();
if(configList != null && !configList.isEmpty()){
......
......@@ -14,15 +14,13 @@ import org.jeecgframework.poi.excel.annotation.Excel;
@Data
@ApiModel(value="ajh_plan_schedule_data数据传输对象", description="经营方案数据表")
public class AjhPlanScheduleDataVO {
/**id*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "id")
private String id;
@Excel(name = "所属厂站", width = 15)
@ApiModelProperty(value = "所属厂站")
private String factoryId;
private String departId;
@ApiModelProperty(value = "所属厂站名称")
private String departName;
......@@ -91,8 +89,8 @@ public class AjhPlanScheduleDataVO {
public AjhPlanScheduleDataVO() {
}
public AjhPlanScheduleDataVO(String factoryId,String dateTime,String workItermName, String workContent,String configLevel1, String completeTime1, String responsibler1, String configLevel2,String completeTime2, String responsibler2) {
this.factoryId = factoryId;
public AjhPlanScheduleDataVO(String departId,String dateTime,String workItermName, String workContent,String configLevel1, String completeTime1, String responsibler1, String configLevel2,String completeTime2, String responsibler2) {
this.departId = departId;
this.dateTime = dateTime;
this.workItermName = workItermName;
this.workContent = workContent;
......@@ -106,8 +104,8 @@ public class AjhPlanScheduleDataVO {
this.responsibler2 = responsibler2;
}
public AjhPlanScheduleDataVO(String factoryId,String dateTime,String workItermName,String configLevel1, String completeTime1, String responsibler1) {
this.factoryId = factoryId;
public AjhPlanScheduleDataVO(String departId,String dateTime,String workItermName,String configLevel1, String completeTime1, String responsibler1) {
this.departId = departId;
this.workItermName = workItermName;
this.workContent = workContent;
......
......@@ -155,6 +155,8 @@ public class WorkAnalysisController {
result.setSuccess(true);
return result;
}
@ApiOperation(value = "安全管理进度统计-数量统计", notes = "安全管理进度-数量统计 timeType = 1 表示月份,timeType=2 表示年")
@GetMapping("/analysisTotalBySafeProgress")
public Result<SafeProgressVO> analysisTotalBySafeProgress(@RequestParam(defaultValue = "1") Integer departType, String departId ,@RequestParam(defaultValue = "1") Integer timeType, String startTime, String endTime) {
......@@ -186,6 +188,55 @@ public class WorkAnalysisController {
}
return result;
}
/***
* 工作流流程数量统计
* @param departIds
* @param startTime
* @param endTime
* @return
*/
private String getProcessProgressSql( String departIds,String startTime, String endTime){
String sql = "";
//隐患记录:隐患排查
sql += " left join ( select t.depart_id , count(1) 'count' from ajh_rectification_info t where t.rec_ord_report_date >='2025-02-01' and t.rec_ord_report_date <='2025-02-28' group by t.depart_id) aa on aa.depart_id = d.id";
sql += " left join ( select t.depart_id , count(1) 'count' from ajh_rectification_info t where t.handle_result = '3' and t.rec_ord_end_date >='2025-02-01' and t.rec_ord_end_date <='2025-02-28' group by t.depart_id) aaaa on aaaa.depart_id = d.id";
//危险作业:
sql += " left join ( select t.depart_id , count(1) 'count' from dangerous_operation_manage t where t.report_date >='2025-02-01' and t.report_date <='2025-02-28' group by t.depart_id) aa on aa.depart_id = d.id";
sql += " left join ( select t.depart_id , count(1) 'count' from dangerous_operation_manage t where t.operation_status = '1' and t.operation_date >='2025-02-01' and t.operation_date <='2025-02-28' group by t.depart_id) aaaa on aaaa.depart_id = d.id";
//事故事件 没有完成结束时间
sql += " left join ( select t.depart_id , count(1) 'count' from emergency_risk_event t where t.report_date >='2025-02-01' and t.report_date <='2025-02-28' group by t.depart_id) aa on aa.depart_id = d.id";
sql += " left join ( select t.depart_id , count(1) 'count' from emergency_risk_event t where t.handle_result = '3' and t.report_date >='2025-02-01' and t.report_date <='2025-02-28' group by t.depart_id) aaaa on aaaa.depart_id = d.id";
//设备维修:
sql += " left join ( select t.depart_id , count(1) 'count' from equipment_repair t where t.repair_date >='2025-02-01' and t.repair_date <='2025-02-28' group by t.depart_id) aa on aa.depart_id = d.id";
sql += " left join ( select t.depart_id , count(1) 'count' from equipment_repair t where t.finish_flag in ('ywx','yys') and t.reality_maintenance_end_time >='2025-02-01' and t.reality_maintenance_end_time <='2025-02-28' group by t.depart_id) aaaa on aaaa.depart_id = d.id";
//考核评价
sql += " left join ( select t.depart_id , count(1) 'count' from data_assessment_socre_master t where t.assessment_date >='2025-02-01' and t.assessment_date <='2025-02-28' group by t.depart_id) aa on aa.depart_id = d.id";
sql += " left join ( select t.depart_id , '0' 'count' from data_assessment_socre_master t where t.assessment_date >='2025-02-01' and t.assessment_date <='2025-02-28' group by t.depart_id) aaaa on aaaa.depart_id = d.id";
//问题上报:问题记录
sql += " left join ( select t.depart_id , count(1) 'count' from problem_report_plan t where t.report_time >='2025-02-01' and t.report_time <='2025-02-28' group by t.depart_id) aa on aa.depart_id = d.id";
sql += " left join ( select t.depart_id , count(1) 'count' from problem_report_plan t where t.handle_status = '3' and t.handle_time >='2025-02-01' and t.handle_time <='2025-02-28' group by t.depart_id) aaaa on aaaa.depart_id = d.id";
//报警任务
sql += " left join ( select t.depart_id , count(1) 'count' from alarm_record_history t where t.record_time >='2025-02-01' and t.record_time <='2025-02-28' group by t.depart_id) aa on aa.depart_id = d.id";
sql += " left join ( select t.depart_id , count(1) 'count' from alarm_record_history t where t.handle_status = '1' and t.record_time >='2025-02-01' and t.record_time <='2025-02-28' group by t.depart_id) aaaa on aaaa.depart_id = d.id";
//维护任务:保养
sql += " left join ( select t.depart_id , count(1) 'count' from equipment_maintain_task t where t.real_start_time >='2025-02-01' and t.real_end_time <='2025-02-28' group by t.depart_id) aa on aa.depart_id = d.id";
sql += " left join ( select t.depart_id , count(1) 'count' from equipment_maintain_task t where t.results_enforcement = '2' and t.real_start_time >='2025-02-01' and t.real_end_time <='2025-02-28' group by t.depart_id) aaaa on aaaa.depart_id = d.id";
//巡检任务
sql += " left join ( select t.depart_id , count(1) 'count' from inspection_task t where t.task_start_time >='2025-02-01' and t.task_end_time <='2025-02-28' group by t.depart_id) aa on aa.depart_id = d.id";
sql += " left join ( select t.depart_id , count(1) 'count' from inspection_task t where t.task_state = 2 and t.task_start_time >='2025-02-01' and t.task_end_time <='2025-02-28' group by t.depart_id) aaaa on aaaa.depart_id = d.id";
return sql ;
}
private String getSafeProgressSql( String departIds,String startTime, String endTime){
JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtils.getBean("master");
String userIdsSql = "select GROUP_CONCAT( DISTINCT exam_user_ids) 'user_ids' from edu_paper where end_time >='"+startTime+"' and end_time <= '"+endTime+"'";
......@@ -250,10 +301,13 @@ public class WorkAnalysisController {
return sql;
}
private String getSelfDepartIds(String departIds){
String sql = "select GROUP_CONCAT(id) 'departIds' from sys_depart where depart_type =1 and parent_id <> '1818215543140909056' and id in ("+JSUtils.quoteEach(departIds,",")+")";
return getJdbcTemplate().queryForObject(sql,String.class);
}
private String getEFDepartIds(String departIds){//获取恩菲水厂编号
String sql = "select GROUP_CONCAT(id) 'departIds' from sys_depart where depart_type =1 and parent_id = '1818215543140909056' and id in ("+JSUtils.quoteEach(departIds,",")+")";
return getJdbcTemplate().queryForObject(sql,String.class);
......
package com.skua.modules.dataAnalysis.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @auther kangwei
* @create 2025-02-28-16:26
*/
@Data
@ApiModel(value = "流程进度统计对象", description = "流程进度统计对象")
public class ProcessProgressVO {
@ApiModelProperty(value = "所属厂站")
private String departId;
@ApiModelProperty(value = "所属厂站")
private String departName;
// 隐患记录:隐患排查ajh_rectification_info
@ApiModelProperty(value = "隐患记录总数")
private String yhjlTotal;
@ApiModelProperty(value = "隐患记录处理数量")
private String yhjlHandleNum;
//危险作业: dangerous_operation_manage
@ApiModelProperty(value = "隐患记录总数")
private String wxrwTotal;
@ApiModelProperty(value = "隐患记录处理数量")
private String wxrwHandleNum;
//事故事件 emergency_risk_event
@ApiModelProperty(value = "事故事件总数")
private String sgsjTotal;
@ApiModelProperty(value = "事故事件处理数量")
private String sgsjHandleNum;
///设备维修: equipment_repair
@ApiModelProperty(value = "设备维修总数")
private String sbwxTotal;
@ApiModelProperty(value = "设备维修处理数量")
private String sbwxHandleNum;
//考核评价: data_assessment_socre_master
@ApiModelProperty(value = "考核评价总数")
private String khpjTotal;
@ApiModelProperty(value = "考核评价处理数量")
private String khpjHandleNum;
//问题上报:问题记录 problem_report_plan
@ApiModelProperty(value = "问题上报总数")
private String wtsbTotal;
@ApiModelProperty(value = "隐患记录处理数量")
private String wtsbHandleNum;
//报警任务:alarm_record_history
@ApiModelProperty(value = "报警任务总数")
private String bjrwTotal;
@ApiModelProperty(value = "报警任务处理数量")
private String bjrwHandleNum;
//维护任务:保养 equipment_maintain_task
@ApiModelProperty(value = "维护任务总数")
private String whrwTotal;
@ApiModelProperty(value = "维护任务处理数量")
private String whrwHandleNum;
@ApiModelProperty(value = "维护任务及时数量")
private String whrwJSNum;
//巡检任务: inspection_task
@ApiModelProperty(value = "巡检任务总数")
private String xjrwTotal;
@ApiModelProperty(value = "巡检任务处理数量")
private String xjrwHandleNum;
@ApiModelProperty(value = "巡检任务应急数量")
private String xjrwJSNum;
}
......@@ -213,12 +213,12 @@ public class EquipmentSparepartController {
@AutoLog(value = "备品备件表-入库记录列表")
@ApiOperation(value = "备品备件表-入库记录列表", notes = "备品备件表-入库记录列表")
@GetMapping(value = "/queryEquipmentInList")
public Result<IPage<EquipmentInOutRecordVO>> queryEquipmentInList(String sparepartId,
public Result<IPage<EquipmentInOutRecordVO>> queryEquipmentInList(EquipmentSparepartSearchVO sparepartSearchVO,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) throws Exception {
Result<IPage<EquipmentInOutRecordVO>> result = new Result<>();
Page<EquipmentInOutRecordVO> page = new Page<EquipmentInOutRecordVO>(pageNo, pageSize);
IPage<EquipmentInOutRecordVO> pageList = equipmentSparepartService.queryEquipmentInList(page,sparepartId);
IPage<EquipmentInOutRecordVO> pageList = equipmentSparepartService.queryEquipmentInList(page,sparepartSearchVO);
result.setSuccess(true);
result.setResult(pageList);
......@@ -228,12 +228,12 @@ public class EquipmentSparepartController {
@AutoLog(value = "备品备件表-出库记录列表")
@ApiOperation(value = "备品备件表-出库记录列表", notes = "备品备件表-出库记录列表")
@GetMapping(value = "/queryEquipmentOutList")
public Result<IPage<EquipmentInOutRecordVO>> queryEquipmentOutList(String sparepartId,
public Result<IPage<EquipmentInOutRecordVO>> queryEquipmentOutList(EquipmentSparepartSearchVO sparepartSearchVO,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) throws Exception {
Result<IPage<EquipmentInOutRecordVO>> result = new Result<>();
Page<EquipmentInOutRecordVO> page = new Page<EquipmentInOutRecordVO>(pageNo, pageSize);
IPage<EquipmentInOutRecordVO> pageList = equipmentSparepartService.queryEquipmentOutList(page,sparepartId);
IPage<EquipmentInOutRecordVO> pageList = equipmentSparepartService.queryEquipmentOutList(page,sparepartSearchVO);
result.setSuccess(true);
result.setResult(pageList);
......
......@@ -36,7 +36,7 @@ public interface EquipmentSparepartMapper extends BaseMapper<EquipmentSparepart>
* @param sparepartId
* @return
*/
public IPage<EquipmentInOutRecordVO> queryEquipmentInList(Page<EquipmentInOutRecordVO> page, @Param("sparepartId") String sparepartId);
public IPage<EquipmentInOutRecordVO> queryEquipmentInList(Page<EquipmentInOutRecordVO> page, @Param("sparepartId") String sparepartId, @Param("departId")String departId, @Param("suppliesWarehouseId")String suppliesWarehouseId);
/***
* 备品备件表-出库记录列表
......@@ -44,7 +44,7 @@ public interface EquipmentSparepartMapper extends BaseMapper<EquipmentSparepart>
* @param sparepartId
* @return
*/
public IPage<EquipmentInOutRecordVO> queryEquipmentOutList(Page<EquipmentInOutRecordVO> page, @Param("sparepartId") String sparepartId);
public IPage<EquipmentInOutRecordVO> queryEquipmentOutList(Page<EquipmentInOutRecordVO> page, @Param("sparepartId") String sparepartId, @Param("departId")String departId, @Param("suppliesWarehouseId")String suppliesWarehouseId);
/***
* 备品备件表-入库详情
* @param page
......
......@@ -73,6 +73,7 @@
<select id="queryById" parameterType="java.lang.String"
resultType="com.skua.modules.equipment.vo.EquipmentMaintainPlanVO">
SELECT emp.id AS id,
emp.plan_cost,emp.maintenance_type,
emp.plan_name AS planName,
sd1.id AS departId,
sd1.depart_name AS departName,
......
......@@ -43,10 +43,16 @@
left join equipment_sparepart_supplies ss on ss.id = mic.sparepart_id
left join equipment_sparepart_type st on st.id = ss.sparepart_type
where mic.sparepart_id = #{sparepartId}
<if test="departId != null and departId!=''">
and ei.depart_id = #{departId}
</if>
<if test="suppliesWarehouseId != null and suppliesWarehouseId!=''">
and ei.supplies_warehouse_id = #{suppliesWarehouseId}
</if>
</select>
<select id="queryEquipmentOutList" resultType="com.skua.modules.equipment.vo.EquipmentInOutRecordVO">
select eo.depart_id,eo.out_order 'in_out_order' ,eo.out_date 'inOutDate' ,eo.use_by,eo.choose_time,eo.supplies_warehouse_id,sw.warehouse_name,
select eo.depart_id,eo.out_order 'in_out_order' ,eo.out_date 'inOutDate' ,eo.use_by,eo.choose_time,eo.supplies_warehouse_id,sw.warehouse_name,
moc.sparepart_id , moc.actual_num 'storageNum',moc.out_num 'inOutNum',moc.batch_num,
ss.sparepart_code,ss.sparepart_name, ss.specification,ss.measuring_unit,st.item_text as 'sparepart_type_name'
from equipment_out_child moc
......@@ -55,6 +61,12 @@
left join equipment_sparepart_supplies ss on ss.id = moc.sparepart_id
left join equipment_sparepart_type st on st.id = ss.sparepart_type
where moc.sparepart_id = #{sparepartId}
<if test="departId != null and departId!=''">
and eo.depart_id = #{departId}
</if>
<if test="suppliesWarehouseId != null and suppliesWarehouseId!=''">
and eo.supplies_warehouse_id = #{suppliesWarehouseId}
</if>
</select>
<!-- 分页查询:物料的入库详情 -->
......
......@@ -32,18 +32,18 @@ public interface IEquipmentSparepartService extends IService<EquipmentSparepart>
/***
* 备品备件表-入库记录列表
* @param page
* @param sparepartId
* @param
* @return
*/
public IPage<EquipmentInOutRecordVO> queryEquipmentInList(Page<EquipmentInOutRecordVO> page, String sparepartId);
public IPage<EquipmentInOutRecordVO> queryEquipmentInList(Page<EquipmentInOutRecordVO> page,EquipmentSparepartSearchVO sparepartSearchVO );
/***
* 备品备件表-出库记录列表
* @param page
* @param sparepartId
* @param
* @return
*/
public IPage<EquipmentInOutRecordVO> queryEquipmentOutList(Page<EquipmentInOutRecordVO> page, String sparepartId);
public IPage<EquipmentInOutRecordVO> queryEquipmentOutList(Page<EquipmentInOutRecordVO> page, EquipmentSparepartSearchVO sparepartSearchVO);
/***
* 备品备件表-入库详情
......
......@@ -45,21 +45,21 @@ public class EquipmentSparepartServiceImpl extends ServiceImpl<EquipmentSparepar
/***
* 备品备件表-入库记录列表
* @param page
* @param sparepartId
* @param sparepartSearchVO
* @return
*/
public IPage<EquipmentInOutRecordVO> queryEquipmentInList(Page<EquipmentInOutRecordVO> page, String sparepartId){
return baseMapper.queryEquipmentInList(page,sparepartId);
public IPage<EquipmentInOutRecordVO> queryEquipmentInList(Page<EquipmentInOutRecordVO> page, EquipmentSparepartSearchVO sparepartSearchVO){
return baseMapper.queryEquipmentInList(page,sparepartSearchVO.getSparepartId(),sparepartSearchVO.getDepartId(),sparepartSearchVO.getSuppliesWarehouseId());
}
/***
* 备品备件表-出库记录列表
* @param page
* @param sparepartId
* @param
* @return
*/
public IPage<EquipmentInOutRecordVO> queryEquipmentOutList(Page<EquipmentInOutRecordVO> page, String sparepartId){
return baseMapper.queryEquipmentOutList(page,sparepartId);
public IPage<EquipmentInOutRecordVO> queryEquipmentOutList(Page<EquipmentInOutRecordVO> page, EquipmentSparepartSearchVO sparepartSearchVO){
return baseMapper.queryEquipmentOutList(page,sparepartSearchVO.getSparepartId(),sparepartSearchVO.getDepartId(),sparepartSearchVO.getSuppliesWarehouseId());
}
/***
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!