7c9ac516 张雷

安环禅道问题修改

1 个父辈 d6ca71fe
正在显示 20 个修改的文件 包含 220 行增加104 行删除
......@@ -33,6 +33,7 @@ public class EmergencyPlanDatabase{
/**厂站ID(河道-排水管网id)*/
@Excel(name = "厂站ID", width = 15)
@ApiModelProperty(value = "厂站ID(河道-排水管网id)")
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
private String departId;
/**编制单位*/
@Excel(name = "编制单位", width = 15)
......
......@@ -32,7 +32,7 @@ public class FlowBussinessDescManageServiceImpl implements IFlowBusinessDescServ
String ids = tableMap.get(tableName).substring(1);
List<String> avgIndexCodeArray = Arrays.asList(ids.split(","));
String inSqlPart = avgIndexCodeArray.stream().map(s -> "'"+s.trim()+"'").collect(Collectors.joining(","));
String sql = "select id,create_by,'镜检申请' as title from check_microscopic_manage where id in("+inSqlPart+")";
String sql = "select id,create_by,'-镜检申请' as title from check_microscopic_manage where id in("+inSqlPart+")";
List<Map<String, Object>> dataList = masterDB.queryForList(sql);
for(Map<String, Object> dataMap : dataList) {
resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("create_by"))+""+ConvertUtils.getString(dataMap.get("title")));
......@@ -42,14 +42,13 @@ public class FlowBussinessDescManageServiceImpl implements IFlowBusinessDescServ
String ids = tableMap.get(tableName).substring(1);
List<String> avgIndexCodeArray = Arrays.asList(ids.split(","));
String inSqlPart = avgIndexCodeArray.stream().map(s -> "'"+s.trim()+"'").collect(Collectors.joining(","));
String sql = "SELECT a.id," +
" CONCAT(b.equipment_name,'维修申请') as title " +
"FROM\r\n" +
" equipment_repair a\r\n" +
"LEFT JOIN equipment_info b ON a.info_id = b.id\r\n" +
"WHERE\r\n" +
String sql = "SELECT a.id," +
" CONCAT(b.equipment_name,'-维修申请') as title " +
"FROM " +
" equipment_repair a " +
"LEFT JOIN equipment_info b ON a.info_id = b.id " +
"WHERE " +
" a.id in ("+inSqlPart+")";
//String sql = "select id,create_by,'的镜检申请' as title from check_microscopic_manage where id in("+inSqlPart+")";
List<Map<String, Object>> dataList = masterDB.queryForList(sql);
for(Map<String, Object> dataMap : dataList) {
resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("title")));
......@@ -61,9 +60,9 @@ public class FlowBussinessDescManageServiceImpl implements IFlowBusinessDescServ
String inSqlPart = avgIndexCodeArray.stream().map(s -> "'" + s.trim() + "'").collect(Collectors.joining(","));
String sql = "SELECT a.id," +
" CONCAT(problem_name,'-问题上报') as title " +
"FROM\r\n" +
" problem_report_plan a\r\n" +
"WHERE\r\n" +
"FROM " +
" problem_report_plan a " +
"WHERE " +
" a.id in (" + inSqlPart + ")";
List<Map<String, Object>> dataList = masterDB.queryForList(sql);
for (Map<String, Object> dataMap : dataList) {
......@@ -76,9 +75,9 @@ public class FlowBussinessDescManageServiceImpl implements IFlowBusinessDescServ
String inSqlPart = avgIndexCodeArray.stream().map(s -> "'" + s.trim() + "'").collect(Collectors.joining(","));
String sql = "SELECT a.id," +
" CONCAT(equipment_name,'-缺陷上报') as title " +
"FROM\r\n" +
" equipment_defect_management a\r\n" +
"WHERE\r\n" +
"FROM " +
" equipment_defect_management a " +
"WHERE " +
" a.id in (" + inSqlPart + ")";
List<Map<String, Object>> dataList = masterDB.queryForList(sql);
for (Map<String, Object> dataMap : dataList) {
......@@ -90,11 +89,10 @@ public class FlowBussinessDescManageServiceImpl implements IFlowBusinessDescServ
List<String> avgIndexCodeArray = Arrays.asList(ids.split(","));
String inSqlPart = avgIndexCodeArray.stream().map(s -> "'" + s.trim() + "'").collect(Collectors.joining(","));
String sql = "SELECT a.id," +
" CONCAT(a.risk_name,'-应急风险事件流程') as title " +
"FROM\r\n" +
" emergency_risk_event a\r\n" +
"WHERE\r\n" +
" CONCAT(a.risk_name,'-应急风险事件') as title " +
"FROM " +
" emergency_risk_event a " +
"WHERE " +
" a.id in (" + inSqlPart + ")";
List<Map<String, Object>> dataList = masterDB.queryForList(sql);
for (Map<String, Object> dataMap : dataList) {
......@@ -108,10 +106,9 @@ public class FlowBussinessDescManageServiceImpl implements IFlowBusinessDescServ
String inSqlPart = avgIndexCodeArray.stream().map(s -> "'" + s.trim() + "'").collect(Collectors.joining(","));
String sql = "SELECT a.id," +
" CONCAT((select struct_name from sys_struct_dict where id = a.rec_ord_body),'-安全隐患流程') as title " +
"FROM\r\n" +
" ajh_rectification_info a\r\n" +
"WHERE\r\n" +
"FROM " +
" ajh_rectification_info a " +
"WHERE " +
" a.id in (" + inSqlPart + ")";
List<Map<String, Object>> dataList = masterDB.queryForList(sql);
for (Map<String, Object> dataMap : dataList) {
......@@ -124,9 +121,9 @@ public class FlowBussinessDescManageServiceImpl implements IFlowBusinessDescServ
String inSqlPart = avgIndexCodeArray.stream().map(s -> "'" + s.trim() + "'").collect(Collectors.joining(","));
String sql = "SELECT a.id," +
" CONCAT(alarm_param_name,'-报警申请') as title " +
"FROM\r\n" +
" alarm_record_history a\r\n" +
"WHERE\r\n" +
"FROM " +
" alarm_record_history a " +
"WHERE " +
" a.id in (" + inSqlPart + ")";
List<Map<String, Object>> dataList = masterDB.queryForList(sql);
for (Map<String, Object> dataMap : dataList) {
......@@ -139,10 +136,24 @@ public class FlowBussinessDescManageServiceImpl implements IFlowBusinessDescServ
String inSqlPart = avgIndexCodeArray.stream().map(s -> "'" + s.trim() + "'").collect(Collectors.joining(","));
String sql = "SELECT a.id," +
" CONCAT(a.task_name,'-生产任务流程') as title " +
"FROM\r\n" +
" productive_task a\r\n" +
"WHERE\r\n" +
"FROM " +
" productive_task a " +
"WHERE " +
" a.id in (" + inSqlPart + ")";
List<Map<String, Object>> dataList = masterDB.queryForList(sql);
for (Map<String, Object> dataMap : dataList) {
resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("title")));
}
}else if (tableName.equals("data_assessment_socre_master")) {
//生产任务
String ids = tableMap.get(tableName).substring(1);
List<String> avgIndexCodeArray = Arrays.asList(ids.split(","));
String inSqlPart = avgIndexCodeArray.stream().map(s -> "'" + s.trim() + "'").collect(Collectors.joining(","));
String sql = "SELECT a.id," +
" CONCAT(a.create_by,'-考核评价审批') as title " +
"FROM " +
" data_assessment_socre_master a " +
"WHERE " +
" a.id in (" + inSqlPart + ")";
List<Map<String, Object>> dataList = masterDB.queryForList(sql);
for (Map<String, Object> dataMap : dataList) {
......
......@@ -14,6 +14,7 @@ import com.skua.modules.material.entity.MaterialInfoHandleRecord;
import com.skua.modules.material.entity.MaterialInformation;
import com.skua.modules.material.service.IMaterialInfoHandleRecordService;
import com.skua.modules.material.service.IMaterialInfoService;
import com.skua.modules.system.service.ISysDepartService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
......@@ -30,6 +31,7 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
......@@ -55,6 +57,8 @@ public class MaterialInfoController {
private IMaterialInfoService materialInfoService;
@Autowired
private IMaterialInfoHandleRecordService materialInfoHandleRecordService;
@Resource
private ISysDepartService departService;
/**
* 分页列表查询
......@@ -72,13 +76,15 @@ public class MaterialInfoController {
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
String departIds = null;
Result<IPage<MaterialInfo>> result = new Result<IPage<MaterialInfo>>();
QueryWrapper<MaterialInfo> queryWrapper = QueryGenerator.initQueryWrapper(materialInfo, req.getParameterMap());
Page<MaterialInfo> page = new Page<MaterialInfo>(pageNo, pageSize);
if (StringUtils.isBlank(materialInfo.getDepartId())&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) {
queryWrapper.in("depart_id", BaseContextHandler.getDeparts().split(","));
departIds = departService.getChildDepartId(BaseContextHandler.getDeparts());
}else{
departIds = departService.getChildDepartId(materialInfo.getDepartId());
}
IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper);
IPage<MaterialInfo> pageList = materialInfoService.getList(page, materialInfo, departIds);
result.setSuccess(true);
result.setResult(pageList);
return result;
......@@ -292,16 +298,20 @@ public class MaterialInfoController {
/**
* 类型统计查询
*
* @param MaterialInfo
* @param materialInfo
* @return
*/
@AutoLog(value = "厂区资料管理-类型统计查询")
@ApiOperation(value = "厂区资料管理-类型统计查询", notes = "厂区资料管理-类型统计查询")
@GetMapping(value = "/getAnalysis")
public Result<List<Map<String, Object>>> getAnalysis(MaterialInfo MaterialInfo) {
public Result<List<Map<String, Object>>> getAnalysis(MaterialInfo materialInfo) {
Result<List<Map<String, Object>>> result = new Result<>();
List<Map<String, Object>> pageList = materialInfoService.getAnalysis(MaterialInfo);
if (StringUtils.isBlank(materialInfo.getDepartId())&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) {
materialInfo.setDepartId(departService.getChildDepartId(BaseContextHandler.getDeparts()));
}else{
materialInfo.setDepartId(departService.getChildDepartId(materialInfo.getDepartId()));
}
List<Map<String, Object>> pageList = materialInfoService.getAnalysis(materialInfo);
result.setSuccess(true);
result.setResult(pageList);
return result;
......@@ -312,8 +322,10 @@ public class MaterialInfoController {
@GetMapping(value = "/flowStatistics")
public Result<List<Map<String, Object>>> flowStatistics(String departId,String startTime,String endTime) {
Result<List<Map<String, Object>>> result = new Result<>();
if(StringUtils.isEmpty(departId)) {
departId = BaseContextHandler.getDeparts();
if (StringUtils.isBlank(departId)&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) {
departId = departService.getChildDepartId(BaseContextHandler.getDeparts());
}else{
departId = departService.getChildDepartId(departId);
}
List<Map<String, Object>> pageList = materialInfoService.flowStatistics(departId,startTime,endTime);
result.setSuccess(true);
......
......@@ -67,16 +67,42 @@ public class MaterialInfo {
@Excel(name = "附件地址", width = 15)
@ApiModelProperty(value = "附件地址")
private String docuAddr;
/**附件地址*/
@Excel(name = "厂区Id", width = 15)
@ApiModelProperty(value = "厂区Id")
/**所属厂区*/
@Excel(name = "所属厂区", width = 15)
@ApiModelProperty(value = "所属厂区")
@Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
private String departId;
/**内容摘要*/
@ApiModelProperty(value = "内容摘要")
private String contentSummary;
/**文件类型*/
@ApiModelProperty(value = "文件类型【doc/xls/pdf等等】")
private String fileType;
/**文件大小*/
@ApiModelProperty(value = "文件大小")
private String fileSize;
/**制度类型*/
@Dict(dicCode = "rules_type")
@ApiModelProperty(value = "制度类型")
private String rulesType;
/**发布时间*/
@Excel(name = "发布时间", width = 15)
@ApiModelProperty(value = "发布时间")
private String releaseTime;
/**有效时间*/
@Excel(name = "有效时间", width = 15)
@ApiModelProperty(value = "有效时间")
private String effectiveTime;
/**版本号*/
@Excel(name = "版本号", width = 15)
@ApiModelProperty(value = "版本号")
private String fileVersion;
/**所属部门*/
@Excel(name = "所属部门", width = 15)
@ApiModelProperty(value = "所属部门")
private String fileDepart;
/**修订过程*/
@Excel(name = "修订过程", width = 15)
@ApiModelProperty(value = "修订过程")
private String updateHistory;
}
......
......@@ -28,4 +28,6 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> {
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime);
List<MaterialInfo> getList(@Param("materialInfo") MaterialInfo materialInfo, @Param("departIds") String departIds);
}
......
......@@ -53,5 +53,20 @@
GROUP BY
b.create_time,b.handle_type
</select>
<select id="getList" resultType="com.skua.modules.material.entity.MaterialInfo">
select * from material_info
where del_flag = 0
<if test="departIds!=null and departIds!=''">
and depart_id in
<foreach item="item" index="index" collection="departIds.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
<if test="materialInfo.facInformationtype!=null and materialInfo.facInformationtype!=''">
and fac_informationtype = #{materialInfo.facInformationtype}
</if>
<if test="materialInfo.facInformationName!=null and materialInfo.facInformationName!=''">
and fac_information_name like CONCAT(CONCAT('%', #{materialInfo.facInformationName}),'%')
</if>
</select>
</mapper>
......
package com.skua.modules.material.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skua.modules.material.entity.MaterialInfo;
......@@ -40,4 +42,6 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime);
IPage<MaterialInfo> getList(Page<MaterialInfo> page, MaterialInfo materialInfo, String departIds);
}
......
package com.skua.modules.material.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.skua.core.util.ConvertUtils;
import com.skua.core.util.DateUtils;
......@@ -62,4 +64,11 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
}
return resultList;
}
@Override
public IPage<MaterialInfo> getList(Page<MaterialInfo> page, MaterialInfo materialInfo, String departIds) {
List<MaterialInfo> list = baseMapper.getList(materialInfo, departIds);
page.setRecords(list);
return page;
}
}
......
......@@ -13,9 +13,8 @@ import cn.hutool.core.util.StrUtil;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.query.QueryGenerator;
import com.skua.modules.safe.entity.safetyProductionManagement;
import com.skua.modules.safe.service.IsafetyProductionManagementService;
import java.util.Date;
import com.skua.modules.safe.entity.SafetyProductionManagement;
import com.skua.modules.safe.service.ISafetyProductionManagementService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -43,10 +42,10 @@ import io.swagger.annotations.ApiOperation;
@Api(tags="安全生产管理")
@RestController
@RequestMapping("/safe/safetyProductionManagement")
public class safetyProductionManagementController {
public class SafetyProductionManagementController {
@Autowired
private IsafetyProductionManagementService safetyProductionManagementService;
private ISafetyProductionManagementService safetyProductionManagementService;
/**
* 分页列表查询
* @param safetyProductionManagement
......@@ -58,19 +57,19 @@ public class safetyProductionManagementController {
@AutoLog(value = "安全生产管理-分页列表查询")
@ApiOperation(value="安全生产管理-分页列表查询", notes="安全生产管理-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<safetyProductionManagement>> queryPageList(safetyProductionManagement safetyProductionManagement,
public Result<IPage<SafetyProductionManagement>> queryPageList(SafetyProductionManagement safetyProductionManagement,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<safetyProductionManagement>> result = new Result<IPage<safetyProductionManagement>>();
QueryWrapper<safetyProductionManagement> queryWrapper = QueryGenerator.initQueryWrapper(safetyProductionManagement, req.getParameterMap());
Page<safetyProductionManagement> page = new Page<safetyProductionManagement>(pageNo, pageSize);
IPage<safetyProductionManagement> pageList = safetyProductionManagementService.page(page, queryWrapper);
Result<IPage<SafetyProductionManagement>> result = new Result<IPage<SafetyProductionManagement>>();
QueryWrapper<SafetyProductionManagement> queryWrapper = QueryGenerator.initQueryWrapper(safetyProductionManagement, req.getParameterMap());
Page<SafetyProductionManagement> page = new Page<SafetyProductionManagement>(pageNo, pageSize);
IPage<SafetyProductionManagement> pageList = safetyProductionManagementService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
/**
* 添加
* @param safetyProductionManagement
......@@ -79,8 +78,8 @@ public class safetyProductionManagementController {
@AutoLog(value = "安全生产管理-添加")
@ApiOperation(value="安全生产管理-添加", notes="安全生产管理-添加")
@PostMapping(value = "/add")
public Result<safetyProductionManagement> add(@RequestBody safetyProductionManagement safetyProductionManagement) {
Result<safetyProductionManagement> result = new Result<safetyProductionManagement>();
public Result<SafetyProductionManagement> add(@RequestBody SafetyProductionManagement safetyProductionManagement) {
Result<SafetyProductionManagement> result = new Result<SafetyProductionManagement>();
try {
safetyProductionManagementService.save(safetyProductionManagement);
result.success("添加成功!");
......@@ -90,7 +89,7 @@ public class safetyProductionManagementController {
}
return result;
}
/**
* 编辑
* @param safetyProductionManagement
......@@ -99,9 +98,9 @@ public class safetyProductionManagementController {
@AutoLog(value = "安全生产管理-编辑")
@ApiOperation(value="安全生产管理-编辑", notes="安全生产管理-编辑")
@PutMapping(value = "/edit")
public Result<safetyProductionManagement> edit(@RequestBody safetyProductionManagement safetyProductionManagement) {
Result<safetyProductionManagement> result = new Result<safetyProductionManagement>();
safetyProductionManagement safetyProductionManagementEntity = safetyProductionManagementService.getById(safetyProductionManagement.getId());
public Result<SafetyProductionManagement> edit(@RequestBody SafetyProductionManagement safetyProductionManagement) {
Result<SafetyProductionManagement> result = new Result<SafetyProductionManagement>();
SafetyProductionManagement safetyProductionManagementEntity = safetyProductionManagementService.getById(safetyProductionManagement.getId());
if(safetyProductionManagementEntity==null) {
result.error500("未找到对应实体");
}else {
......@@ -111,10 +110,10 @@ public class safetyProductionManagementController {
result.success("修改成功!");
}
}
return result;
}
/**
* 通过id删除
* @param id
......@@ -132,7 +131,7 @@ public class safetyProductionManagementController {
}
return Result.ok("删除成功!");
}
/**
* 批量删除
* @param ids
......@@ -141,8 +140,8 @@ public class safetyProductionManagementController {
@AutoLog(value = "安全生产管理-批量删除")
@ApiOperation(value="安全生产管理-批量删除", notes="安全生产管理-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<safetyProductionManagement> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
Result<safetyProductionManagement> result = new Result<safetyProductionManagement>();
public Result<SafetyProductionManagement> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
Result<SafetyProductionManagement> result = new Result<SafetyProductionManagement>();
if(ids==null || "".equals(ids.trim())) {
result.error500("参数不识别!");
}else {
......@@ -151,7 +150,7 @@ public class safetyProductionManagementController {
}
return result;
}
/**
* 通过id查询
* @param id
......@@ -160,9 +159,9 @@ public class safetyProductionManagementController {
@AutoLog(value = "安全生产管理-通过id查询")
@ApiOperation(value="安全生产管理-通过id查询", notes="安全生产管理-通过id查询")
@GetMapping(value = "/queryById")
public Result<safetyProductionManagement> queryById(@RequestParam(name="id",required=true) String id) {
Result<safetyProductionManagement> result = new Result<safetyProductionManagement>();
safetyProductionManagement safetyProductionManagement = safetyProductionManagementService.getById(id);
public Result<SafetyProductionManagement> queryById(@RequestParam(name="id",required=true) String id) {
Result<SafetyProductionManagement> result = new Result<SafetyProductionManagement>();
SafetyProductionManagement safetyProductionManagement = safetyProductionManagementService.getById(id);
if(safetyProductionManagement==null) {
result.error500("未找到对应实体");
}else {
......@@ -181,12 +180,12 @@ public class safetyProductionManagementController {
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
// Step.1 组装查询条件
QueryWrapper<safetyProductionManagement> queryWrapper = null;
QueryWrapper<SafetyProductionManagement> queryWrapper = null;
try {
String paramsStr = request.getParameter("paramsStr");
if (StrUtil.isNotEmpty(paramsStr)) {
String deString = URLDecoder.decode(paramsStr, "UTF-8");
safetyProductionManagement safetyProductionManagement = JSON.parseObject(deString, safetyProductionManagement.class);
SafetyProductionManagement safetyProductionManagement = JSON.parseObject(deString, SafetyProductionManagement.class);
queryWrapper = QueryGenerator.initQueryWrapper(safetyProductionManagement, request.getParameterMap());
}
} catch (UnsupportedEncodingException e) {
......@@ -195,10 +194,10 @@ public class safetyProductionManagementController {
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<safetyProductionManagement> pageList = safetyProductionManagementService.list(queryWrapper);
List<SafetyProductionManagement> pageList = safetyProductionManagementService.list(queryWrapper);
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "安全生产管理列表");
mv.addObject(NormalExcelConstants.CLASS, safetyProductionManagement.class);
mv.addObject(NormalExcelConstants.CLASS, SafetyProductionManagement.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("安全生产管理列表数据", "导出人:Jeecg", "导出信息"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
......@@ -222,7 +221,7 @@ public class safetyProductionManagementController {
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<safetyProductionManagement> listsafetyProductionManagements = ExcelImportUtil.importExcel(file.getInputStream(), safetyProductionManagement.class, params);
List<SafetyProductionManagement> listsafetyProductionManagements = ExcelImportUtil.importExcel(file.getInputStream(), SafetyProductionManagement.class, params);
safetyProductionManagementService.saveBatch(listsafetyProductionManagements);
return Result.ok("文件导入成功!数据行数:" + listsafetyProductionManagements.size());
} catch (Exception e) {
......
......@@ -25,7 +25,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="safety_production_management对象", description="安全生产管理")
public class safetyProductionManagement {
public class SafetyProductionManagement {
/**id*/
@TableId(type = IdType.UUID)
......
package com.skua.modules.safe.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.safe.entity.safetyProductionManagement;
import com.skua.modules.safe.entity.SafetyProductionManagement;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 安全生产管理
*/
public interface safetyProductionManagementMapper extends BaseMapper<safetyProductionManagement> {
public interface SafetyProductionManagementMapper extends BaseMapper<SafetyProductionManagement> {
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.safe.mapper.safetyProductionManagementMapper">
<mapper namespace="com.skua.modules.safe.mapper.SafetyProductionManagementMapper">
</mapper>
\ No newline at end of file
</mapper>
......
package com.skua.modules.safe.service;
import com.skua.modules.safe.entity.safetyProductionManagement;
import com.skua.modules.safe.entity.SafetyProductionManagement;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 安全生产管理
*/
public interface IsafetyProductionManagementService extends IService<safetyProductionManagement> {
public interface ISafetyProductionManagementService extends IService<SafetyProductionManagement> {
}
......
package com.skua.modules.safe.service.impl;
import com.skua.modules.safe.entity.safetyProductionManagement;
import com.skua.modules.safe.mapper.safetyProductionManagementMapper;
import com.skua.modules.safe.service.IsafetyProductionManagementService;
import com.skua.modules.safe.entity.SafetyProductionManagement;
import com.skua.modules.safe.mapper.SafetyProductionManagementMapper;
import com.skua.modules.safe.service.ISafetyProductionManagementService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
* 安全生产管理
*/
@Service
public class safetyProductionManagementServiceImpl extends ServiceImpl<safetyProductionManagementMapper, safetyProductionManagement> implements IsafetyProductionManagementService {
public class SafetyProductionManagementServiceImpl extends ServiceImpl<SafetyProductionManagementMapper, SafetyProductionManagement> implements ISafetyProductionManagementService {
}
......
......@@ -220,8 +220,7 @@ public class EquipmentSparepartController {
@GetMapping(value = "/list")
public Result<IPage<EquipmentSparepartVO>> queryPageList(EquipmentSparepartDTO equipmentSparepartDTO,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) throws Exception {
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) throws Exception {
Result<IPage<EquipmentSparepartVO>> result = new Result<>();
Page page = new Page(pageNo, pageSize);
Set<String> sparepartTypeSet = new HashSet<>();
......@@ -253,26 +252,24 @@ public class EquipmentSparepartController {
.like(StringUtils.isNotEmpty(equipmentSparepartDTO.getSparepartCode()), "equipment_sparepart_supplies.sparepart_code", equipmentSparepartDTO.getSparepartCode())
.like(StringUtils.isNotEmpty(equipmentSparepartDTO.getSpecification()), "equipment_sparepart_supplies.specification", equipmentSparepartDTO.getSpecification())
.like(StringUtils.isNotEmpty(equipmentSparepartDTO.getSparepartName()), "equipment_sparepart_supplies.sparepart_name", equipmentSparepartDTO.getSparepartName())
.in(!sparepartTypeSet.isEmpty(), "equipment_sparepart_supplies.sparepart_type", sparepartTypeSet)
.like(StringUtils.isNotEmpty(equipmentSparepartDTO.getIsEmergency()), "equipment_sparepart.is_emergency", equipmentSparepartDTO.getIsEmergency())
.like(StringUtils.isNotEmpty(equipmentSparepartDTO.getIsDangerous()), "equipment_sparepart.is_dangerous", equipmentSparepartDTO.getIsDangerous())
.in(!sparepartTypeSet.isEmpty(), "equipment_sparepart_supplies.sparepart_type", sparepartTypeSet)
.like(StringUtils.isNotEmpty(equipmentSparepartDTO.getWarehouseName()), "warehouse_name", equipmentSparepartDTO.getWarehouseName())
.like(StringUtils.isNotEmpty(equipmentSparepartDTO.getSuppliesWarehouseId()), "supplies_warehouse_id", equipmentSparepartDTO.getSuppliesWarehouseId())
.between(StringUtils.isNotEmpty(equipmentSparepartDTO.getStartTime()) && StringUtils.isNotEmpty(equipmentSparepartDTO.getEndTime()), "inventory_update_time", equipmentSparepartDTO.getStartTime(), equipmentSparepartDTO.getEndTime())
.apply("库存不足".equals(equipmentSparepartDTO.getStorageWarn()), "equipment_sparepart_supplies.storage_num < equipment_sparepart_supplies.storage_min_num")
.apply("库存过量".equals(equipmentSparepartDTO.getStorageWarn()), "equipment_sparepart.equipment_sparepart_supplies > equipment_sparepart_supplies.storage_max_num")
// .orderBy(true, false, "update_time")
.orderBy(true, false, "equipment_sparepart.inventory_update_time").queryForPage(page);
//.selectMapsPage(page);
Map<String, String> equipmentSparepartTypeVal2KeyMap = key2ValueService.dictKey2Val("equipmentSparepartType", false);
Map<String, String> suppliesWarehouseVal2KeyMap = key2ValueService.dictKey2Val("suppliesWarehouse", false);
Map<String, String> departInfoVal2KeyMap = key2ValueService.dictKey2Val("sysDepart", false);
Map<String, String> unitInfoVal2KeyMap = key2ValueService.dictKey2Val("equipment-sparepart_measuring_unit", false);
JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
//品牌厂商
//List<Map<String, Object>> purchaseSupplierMapList = masterDB.queryForList("select * from purchase_supplier");
List<Map<String, Object>> purchaseSupplierMapList = masterDB.queryForList("select * from equipment_brand");
Map<String, String> manufacturerMap = purchaseSupplierMapList.stream().collect(Collectors.toMap(item -> "" + item.get("id"), item -> "" + item.get("brand_company")));
List<Map<String, Object>> convertMapList = WrapperFactory.result()
.addCallback("EquipmentSparepartSupplies_sparepartType", "sparepartType_dictText")
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.skua.core.aspect.annotation.Dict;
import com.skua.tool.annotation.BeanAnno;
import com.skua.tool.annotation.JoinSqlQueryAnno;
import com.skua.tool.enums.JoinSqlQueryEnum;
......@@ -223,11 +224,23 @@ public class EquipmentSparepart {
@ApiModelProperty(value = "仓库id")
private String suppliesWarehouseId;
// /**
// * 厂站id
// */
@Excel(name = "厂站id", width = 15)
@ApiModelProperty(value = "厂站id")
/**
* 所属厂站
*/
@Excel(name = "所属厂站", width = 15)
@ApiModelProperty(value = "所属厂站")
private String departId;
/** 是否应急物资 */
@Excel(name = "是否应急物资", width = 15)
@ApiModelProperty(value = "是否应急物资")
@Dict(dicCode = "yn")
private String isEmergency;
/** 是否危化品 */
@Excel(name = "是否危化品", width = 15)
@ApiModelProperty(value = "是否危化品")
@Dict(dicCode = "yn")
private String isDangerous;
}
......
......@@ -138,4 +138,6 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
String getDepartTreeByParentDepartId(@Param("parentDepartId")String parentDepartId);
List<DepartTree> getJimuDepartTree(@Param("pid") String pid);
String getChildDepartId(@Param("departIds") String departIds);
}
......
......@@ -111,6 +111,7 @@
<select id="getCenterByJt" resultType="com.skua.modules.system.entity.SysDepart">
select * from sys_depart where org_type = 3 and org_code like CONCAT(#{orgCode},'%') ORDER BY depart_order
</select>
<select id="getCenterAllList" parameterType="java.util.List" resultType="com.skua.modules.system.entity.SysDepart">
SELECT
id,
......@@ -202,4 +203,24 @@
where parent_id = #{pid}
ORDER BY depart_order
</select>
<select id="getChildDepartId" resultType="java.lang.String">
SELECT
GROUP_CONCAT( id SEPARATOR ',' ) AS depart_ids
FROM
sys_depart
WHERE
parent_id IN
<foreach item="item" index="index" collection="departIds.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
OR id IN
<foreach item="item" index="index" collection="departIds.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
OR parent_id IN ( SELECT id FROM sys_depart WHERE parent_id IN
<foreach item="item" index="index" collection="departIds.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
)
</select>
</mapper>
......
......@@ -168,4 +168,6 @@ public interface ISysDepartService extends IService<SysDepart>{
String getDepartTreeByParentDepartId(String parentDepartId);
List<DepartTree> getJimuDepartTree(String pid);
String getChildDepartId(String departIds);
}
......
......@@ -447,4 +447,9 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
return list;
}
@Override
public String getChildDepartId(String departIds) {
return sysDepartMapper.getChildDepartId(departIds);
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!