9f853064 张雷

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

2 个父辈 53df1ae8 b3fb43c6
正在显示 16 个修改的文件 包含 143 行增加35 行删除
......@@ -26,6 +26,7 @@ import com.skua.modules.ajh.service.IAjhMeetingSendService;
import com.skua.modules.ajh.service.IAjhMeetingService;
import com.skua.modules.guest.util.DateUtil;
import com.skua.modules.system.service.ISysConfigService;
import com.skua.modules.system.service.ISysUserService;
import lombok.extern.slf4j.Slf4j;
......@@ -80,6 +81,9 @@ public class AjhMeetingMinutesController {
@Autowired
private ISysUserService userService;
@Autowired
private ISysConfigService sysConfigService;
/**
* <pre>
......@@ -412,21 +416,22 @@ public class AjhMeetingMinutesController {
//添加图片
// 第三部分:图片
File minutesimageFile = new File(minutesimage);
if(minutesimageFile.exists()){
WordImageEntity img = new WordImageEntity();
img.setType(WordImageEntity.URL);
img.setUrl(minutesimage);
//img.setUrl("https://s2.51cto.com/media/2024/blog/logo.png");
img.setWidth(550);
img.setHeight(500);
paramMap.put("meetingImg" , img);
if(minutesimage != null ){
File minutesimageFile = new File(minutesimage);
if(minutesimageFile.exists()){
WordImageEntity img = new WordImageEntity();
img.setType(WordImageEntity.URL);
img.setUrl(minutesimage);
//img.setUrl("https://s2.51cto.com/media/2024/blog/logo.png");
img.setWidth(550);
img.setHeight(500);
paramMap.put("meetingImg" , img);
}
}
//导出word
exportWordData( templatePath , exportName , paramMap ,response);
}
/**
* 导出word模板
* @param templatePath
......@@ -440,12 +445,15 @@ public class AjhMeetingMinutesController {
try {
//获取word文档解析对象
File file = new File(templatePath);
if(file.exists()){
inputStream = new FileInputStream(templatePath);
}else{//判断文件是否存在,如果不存在使用默认模板
Resource resource = new ClassPathResource("templates" + File.separator + "template_AjhMeetingMinutes.docx");
inputStream = resource.getInputStream();
if( ! file.exists()){////判断文件是否存在,如果不存在使用默认模板
templatePath = sysConfigService.queryValueByKey("MEETING_MINUTES_TEMPLATE_PATH");
//file = new File(bak_templatePath);
//}else{
//inputStream = this.getClass().getResourceAsStream(File.separator +"templates" + File.separator + "template_AjhMeetingMinutes.docx");
//Resource resource = new ClassPathResource("templates" + File.separator + "template_AjhMeetingMinutes.docx");
// inputStream = resource.getInputStream();
}
inputStream = new FileInputStream(templatePath);
//加载模板文件
MyXWPFDocument document = new MyXWPFDocument(inputStream);
//解析07版的Word并且进行赋值
......
......@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.erp.service.IPurchaseMaterialService;
import com.skua.modules.erp.vo.DistributContractVO;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
......@@ -75,10 +76,10 @@ public class DistributContractController {
@AutoLog(value = "erp分销合同-添加")
@ApiOperation(value="erp分销合同-添加", notes="erp分销合同-添加")
@PostMapping(value = "/add")
public Result<DistributContract> add(@RequestBody DistributContract distributContract) {
Result<DistributContract> result = new Result<DistributContract>();
public Result<DistributContractVO> add(@RequestBody DistributContractVO distributContract) {
Result<DistributContractVO> result = new Result<DistributContractVO>();
try {
distributContractService.save(distributContract);
distributContractService.saveDistributContractVO(distributContract);
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(),e);
......@@ -90,13 +91,13 @@ public class DistributContractController {
@AutoLog(value = "erp分销合同-编辑")
@ApiOperation(value="erp分销合同-编辑", notes="erp分销合同-编辑")
@PutMapping(value = "/edit")
public Result<DistributContract> edit(@RequestBody DistributContract distributContract) {
public Result<DistributContract> edit(@RequestBody DistributContractVO distributContract) {
Result<DistributContract> result = new Result<DistributContract>();
DistributContract distributContractEntity = distributContractService.getById(distributContract.getId());
if(distributContractEntity==null) {
result.error500("未找到对应实体");
}else {
boolean ok = distributContractService.updateById(distributContract);
boolean ok = distributContractService.updateDistributContractVO(distributContract);
//TODO 返回false说明什么?
if(ok) {
result.success("修改成功!");
......@@ -111,7 +112,7 @@ public class DistributContractController {
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
try {
distributContractService.removeById(id);
distributContractService.delById(id);
} catch (Exception e) {
log.error("删除失败",e.getMessage());
return Result.error("删除失败!");
......
......@@ -96,4 +96,9 @@ public class PurchaseMaterial {
@ApiModelProperty(value = "厂站名称")
private String departName;
@TableField(exist=false)
@ApiModelProperty(value = "扩展:采购物料数量")
private String materialNum;
}
......
......@@ -26,7 +26,7 @@
<if test="goodCode != null and goodCode != ''">
AND m.good_code like concat('%', #{goodCode}, '%')
</if>
<if test="noticeType != null and noticeType != ''">
<if test="departId != null and departId != ''">
AND pc.departs like concat('%', #{departId}, '%')
</if>
) aaa
......@@ -40,15 +40,17 @@
from (
select m.* from erp_purchase_material m , erp_purchase_contract pc where m.contract_id = pc.id
<if test="goodCode != null and goodCode != ''">
AND m.good_code like concat('%', #{goodCode}, '%')
AND m.good_code like concat('', #{goodCode}, '%')
</if>
<if test="noticeType != null and noticeType != ''">
<if test="departId != null and departId != ''">
AND pc.departs like concat('%', #{departId}, '%')
</if>
limit 1
) aaa
left join equipment_sparepart_supplies ss on aaa.sparepart_id = ss.id
left join equipment_sparepart_type st on st.id = aaa.sparepart_type
left join ajh_supplier_manage sm on sm.id = aaa.supplier_id
</select>
......
......@@ -10,8 +10,12 @@
pp.id = pi.plan_id
<if test="ev.sparepartType != null and ev.sparepartType != '' ">
and pi.sparepart_type = #{ev.sparepartType}
</if> <if test="ev.sparepartName != null and ev.sparepartName != '' ">
AND pi.sparepart_name like concat('%', #{ev.sparepartName}, '%')
</if>
<if test="ev.sparepartCode != null and ev.sparepartCode != '' ">
AND pi.sparepart_code like concat('%', #{ev.sparepartCode}, '%')
</if>
<if test="ev.sparepartName != null and ev.sparepartName != '' ">
AND pi.sparepart_name like concat('%', #{ev.sparepartName}, '%')
</if>
<if test="ev.applyYear != null and ev.applyYear != '' ">
and pp.apply_year = #{ev.applyYear}
......@@ -28,7 +32,7 @@
group by pi.sparepart_id
)aaa
left join equipment_sparepart_supplies ss on aaa.sparepart_id = ss.id
left join equipment_sparepart_type st on st.id = aaa.sparepart_type
left join equipment_sparepart_type st on st.id = ss.sparepart_type
</select>
......
......@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.erp.entity.PurchaseMaterial;
import com.skua.modules.erp.mapper.PurchaseMaterialMapper;
import com.skua.modules.erp.service.IPurchaseMaterialService;
import com.skua.modules.erp.vo.PurchasePlanSearchVO;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......
......@@ -25,10 +25,12 @@ public class PurchasePlanSearchVO {
@ApiModelProperty(value = "物料编号")
public String sparepartId;
@ApiModelProperty(value = "物料Code")
public String sparepartCode;
@ApiModelProperty(value = "权限下的部门编号集合")
private String departs;
@ApiModelProperty(value = "开始时间")
private String startTime;
......
......@@ -13,6 +13,7 @@ import com.skua.modules.safe.service.IDangerInspectionItemService;
import com.skua.modules.safe.service.IDangerInspectionRecordService;
import com.skua.modules.safe.vo.DangerInspectionRecordVO;
import com.skua.modules.safe.vo.DangerLevelManageVO;
import com.skua.modules.safe.vo.InspectionRecordStatisticsVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
......@@ -67,6 +68,15 @@ public class APPDangerInspectionRecordController {
if(StringUtils.isNotBlank(dangerInspectionRecord.getEndTime())){
queryWrapper.le("report_date", dangerInspectionRecord.getEndTime() ) ;
}
if(StringUtils.isNotBlank(dangerInspectionRecord.getDangerName())){
queryWrapper.like("danger_name", dangerInspectionRecord.getDangerName() ) ;
}
if(StringUtils.isNotBlank(dangerInspectionRecord.getStatus())){
queryWrapper.eq("status", dangerInspectionRecord.getStatus() ) ;
}
if(StringUtils.isNotBlank(dangerInspectionRecord.getStartTime())){
queryWrapper.ge("report_date", dangerInspectionRecord.getStartTime() ) ;
}
// queryWrapper.eq("report_user", BaseContextHandler.getUserId());
IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper);
result.setSuccess(true);
......@@ -98,6 +108,18 @@ public class APPDangerInspectionRecordController {
}
return result;
}
//Statistics
@AutoLog(value = "隐患排查记录:根据风险点统计记录")
@ApiOperation(value="隐患排查记录:根据风险点统计记录", notes="隐患排查记录:根据风险点统计记录")
@GetMapping(value = "/statistics")
public Result<InspectionRecordStatisticsVO> statistics(@RequestParam(name="dangerId") String dangerId) {
Result<InspectionRecordStatisticsVO> result = new Result<InspectionRecordStatisticsVO>();
InspectionRecordStatisticsVO statisticsVO = inspectionRecordService.queryByStatistics(dangerId);
result.setResult(statisticsVO);
result.setSuccess(true);
return result;
}
}
\ No newline at end of file
......
......@@ -3,6 +3,7 @@ package com.skua.modules.safe.mapper;
import java.util.List;
import com.skua.modules.safe.vo.DangerLevelManageVO;
import com.skua.modules.safe.vo.InspectionRecordStatisticsVO;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.safe.entity.DangerInspectionRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -24,4 +25,11 @@ public interface DangerInspectionRecordMapper extends BaseMapper<DangerInspectio
* @return
*/
public DangerLevelManageVO queryDangerLevelAndInspectionRecord(@Param("inspectionRecordId") String inspectionRecordId);
/***
* 根据风险点统计记录
* @param dangerId
* @return
*/
public InspectionRecordStatisticsVO queryByStatistics(@Param("dangerId") String dangerId);
}
......
......@@ -12,4 +12,13 @@
where ir.id = #{inspectionRecordId}
</select>
<!-- 根据风险点统计记录 -->
<select id="queryByStatistics" resultType="com.skua.modules.safe.vo.InspectionRecordStatisticsVO">
select
(select count(1) from danger_inspection_record t1 where t1.danger_id =#{dangerId}) as 'total_num',
(select count(1) from danger_inspection_record t2 where t2.status = 1 and t2.danger_id =#{dangerId}) as 'un_complete_num',
(select count(1) from danger_inspection_record t3 where t3.status = 2 and t3.danger_id =#{dangerId}) as 'complete_num'
from dual
</select>
</mapper>
\ No newline at end of file
......
......@@ -5,6 +5,7 @@ import com.skua.modules.safe.entity.DangerInspectionRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skua.modules.safe.entity.DangerLevelManage;
import com.skua.modules.safe.vo.DangerLevelManageVO;
import com.skua.modules.safe.vo.InspectionRecordStatisticsVO;
import java.util.List;
......@@ -53,4 +54,11 @@ public interface IDangerInspectionRecordService extends IService<DangerInspectio
* @return
*/
public DangerLevelManageVO queryListByRecordId(String inspectionRecordId);
/***
* 根据风险点统计记录
* @param dangerId
* @return
*/
public InspectionRecordStatisticsVO queryByStatistics(String dangerId);
}
......
......@@ -7,6 +7,7 @@ import com.skua.modules.safe.entity.*;
import com.skua.modules.safe.mapper.*;
import com.skua.modules.safe.service.IDangerInspectionRecordService;
import com.skua.modules.safe.vo.DangerLevelManageVO;
import com.skua.modules.safe.vo.InspectionRecordStatisticsVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -118,6 +119,7 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect
inspectionItem.setItemName( inspectItem.getItemName());
inspectionItem.setItemType( inspectItem.getItemType());
inspectionItem.setInspectionInfoId (inspectionInfo.getId());
inspectionItem.setStatus( inspectItem.getStatus() );
dangerInspectionItemMapper.insert(inspectionItem);
}
}
......@@ -259,5 +261,12 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect
return dangerLevelManageVO;
}
/***
* 根据风险点统计记录
* @param dangerId
* @return
*/
public InspectionRecordStatisticsVO queryByStatistics(String dangerId){
return this.baseMapper.queryByStatistics(dangerId);
}
}
......
......@@ -27,9 +27,18 @@ public class DangerInspectionRecordVO {
@ApiModelProperty(value = "风险等级编号")
private String dangerId;
@ApiModelProperty(value = "巡检记录编号")
private String inspectionRecord;
@Excel(name = "风险等级名称", width = 15)
@ApiModelProperty(value = "风险等级名称")
private String dangerName;
@ApiModelProperty(value = "巡检状态(1:开始,2:结束)")
private String status;
@TableField(exist=false)
@ApiModelProperty(value = "条件:开始时间")
private String startTime;
......
package com.skua.modules.safe.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @auther kangwei
* @create 2024-09-25-18:03
*/
@Data
@ApiModel(value="InspectionRecord 隐患排查统计对象", description="隐患排查统计对象")
public class InspectionRecordStatisticsVO {
@ApiModelProperty(value = "全部数据")
private Integer totalNum;
@ApiModelProperty(value = "未完成数量")
private Integer unCompleteNum;//未处理数量
@ApiModelProperty(value = "完成数量")
private Integer completeNum;//已经处理数据
}
......@@ -91,7 +91,6 @@ public class EquipmentSparepartSuppliesController {
* @author 开发者姓名, 开发时间
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@AutoLog(value = "物料信息表-分页列表查询")
@ApiOperation(value = "物料信息表-分页列表查询", notes = "物料信息表-分页列表查询")
@GetMapping(value = "/list")
......@@ -214,11 +213,9 @@ public class EquipmentSparepartSuppliesController {
}
supplies.setStorageNum(BigDecimal.valueOf(totalSum));
}
}
return equipmentSparepartSuppliesVOS;
}
/**
* <pre>
* 添加
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!