Merge branch 'develop' of http://117.34.109.166:18448/r/mdc_430 into develop
| | |
| | | equipmentService.updateBatchById(equipmentList); |
| | | return Result.OK("ç¼è¾æå"); |
| | | } |
| | | |
| | | @PostMapping("/updateKeyEquipment") |
| | | public Result<?>updateKeyEquipment(@RequestBody Equipment equipment){ |
| | | equipmentService.update(new UpdateWrapper<Equipment>().eq("specific_equipment","0").set("specific_equipment",null)); |
| | | List<Equipment> keyEquipmentUpdateList = equipment.getKeyEquipmentUpdateList(); |
| | | for(Equipment updateEquipment:keyEquipmentUpdateList){ |
| | | updateEquipment.setId(updateEquipment.getEquipmentId()); |
| | | equipmentService.updateById(updateEquipment); |
| | | } |
| | | return Result.OK("ä¿®æ¹æå"); |
| | | } |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.dto.message.MessageDTO; |
| | | import org.jeecg.common.api.vo.Result; |
| | |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.entity.*; |
| | | import org.jeecg.modules.eam.service.*; |
| | | import org.jeecg.modules.eam.vo.RepairReportExportVo; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | private IdentityService sysIdentityService; |
| | | @Autowired |
| | | private IFaultInfoService faultInfoService; |
| | | @Value("${jeecg.path.upload}") |
| | | private String upLoadPath; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | return Result.OK("éªæ¶æå"); |
| | | } |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param equipmentReportRepair |
| | | */ |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, RepairReportExportVo equipmentReportRepair) { |
| | | // Step.1 ç»è£
æ¥è¯¢æ¡ä»¶ |
| | | String title = "æ
éæ¥ä¿®å¯¼åº"; |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | // Step.2 è·åå¯¼åºæ°æ® |
| | | List<RepairReportExportVo> exportList = equipmentReportRepairService.exportList(equipmentReportRepair); |
| | | |
| | | // Step.3 AutoPoi 导åºExcel |
| | | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); |
| | | //æ¤å¤è®¾ç½®çfilenameæ æ ,å端ä¼éæ´æ°è®¾ç½®ä¸ä¸ |
| | | mv.addObject(NormalExcelConstants.FILE_NAME, title); |
| | | mv.addObject(NormalExcelConstants.CLASS, RepairReportExportVo.class); |
| | | //update-begin--Author:liusq Date:20210126 forï¼å¾çå¯¼åºæ¥éï¼ImageBasePathæªè®¾ç½®-------------------- |
| | | ExportParams exportParams=new ExportParams(title + "æ¥è¡¨", "导åºäºº:" + sysUser.getRealname(), title); |
| | | exportParams.setImageBasePath(upLoadPath); |
| | | //update-end--Author:liusq Date:20210126 forï¼å¾çå¯¼åºæ¥éï¼ImageBasePathæªè®¾ç½®---------------------- |
| | | mv.addObject(NormalExcelConstants.PARAMS,exportParams); |
| | | mv.addObject(NormalExcelConstants.DATA_LIST, exportList); |
| | | return mv; |
| | | } |
| | | } |
| | |
| | | List<EquipmentMaintenancePlanDetail> details = new ArrayList<>(); |
| | | for(ABCAssessment abcAssessment:abcAssessments){ |
| | | Equipment equipment = equipmentService.getById(abcAssessment.getEquipmentId()); |
| | | String oldStandard = equipment.getEquipmentImportanceId(); |
| | | String oldStandard = abcAssessment.getOldStandard(); |
| | | String newStandard = abcAssessment.getFinalStandard(); |
| | | LocalDate currentDate = LocalDate.now(); |
| | | |
| | |
| | | @TableField(exist = false) |
| | | @Dict(dicCode = "ABC-standard-result") |
| | | private String equipmentImportanceId; |
| | | @Dict(dicCode = "ABC-standard-result") |
| | | private String oldStandard; |
| | | } |
| | |
| | | @Dict(dicCode = "is_product") |
| | | @TableField(exist = false) |
| | | private String nums; |
| | | @TableField(exist = false) |
| | | private String equipmentId; |
| | | @TableField(exist = false) |
| | | private List<Equipment> keyEquipmentUpdateList; |
| | | |
| | | |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.eam.entity.ChangeCause; |
| | | import org.jeecg.modules.eam.entity.EquipmentReportRepair; |
| | | import org.jeecg.modules.eam.vo.RepairReportExportVo; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | public interface EquipmentReportRepairMapper extends BaseMapper<EquipmentReportRepair> { |
| | | |
| | | IPage<Map<String, Object>> getReportRepairList(IPage<Map> pageData, @Param("params") Map<String,Object> params,@Param("equipNums") List<String> equipNums); |
| | | |
| | | List<RepairReportExportVo> exportList( |
| | | @Param("num")String num, |
| | | @Param("faultStartTime")Date faultStartTime, |
| | | @Param("faultEndTime")Date faultEndTime, |
| | | @Param("isStop")String isStop, |
| | | @Param("status")String status, |
| | | @Param("errUda2")String errUda2, |
| | | @Param("errUda1")String errUda1, |
| | | @Param("createBy")String createBy, |
| | | @Param("equipmentNum")String equipmentNum, |
| | | @Param("equipmentName")String equipmentName, |
| | | @Param("equipmentModel")String equipmentModel, |
| | | @Param("specification")String specification, |
| | | @Param("useId")String useId, |
| | | @Param("equipNums")List<String> equipNums |
| | | ); |
| | | } |
| | |
| | | t1.create_time createTime, |
| | | t1.update_by updateBy, |
| | | t1.update_time updateTime, |
| | | t1.accept_time acceptTime, |
| | | t1.fault_hour faultHour, |
| | | t2.num equipmentNum, |
| | | t2.name equipmentName, |
| | | t2.model equipmentModel, |
| | |
| | | </if> |
| | | ORDER BY t1.create_time desc |
| | | </select> |
| | | <select id="exportList" resultType="org.jeecg.modules.eam.vo.RepairReportExportVo"> |
| | | SELECT |
| | | t1.id, |
| | | t1.err_uda1 errUda1, |
| | | t1.err_uda2 errUda2, |
| | | t1.num num, |
| | | t1.equipment_id equipmentId, |
| | | t1.fault_reason faultReason, |
| | | t1.fault_description faultDescription, |
| | | t1.photo photo, |
| | | t1.is_stop isStop, |
| | | t1.approval approval, |
| | | t1.fault_time faultTime, |
| | | t1.source source, |
| | | t1.source_id sourceId, |
| | | t1.urgency urgency, |
| | | t1.is_create_order isCreateOrder, |
| | | t1.use_depart_id useDepartId, |
| | | t1.remark remark, |
| | | t1.status status, |
| | | t1.create_by createBy, |
| | | t1.create_time createTime, |
| | | t1.update_by updateBy, |
| | | t1.update_time updateTime, |
| | | t1.accept_time acceptTime, |
| | | t1.fault_hour faultHour, |
| | | t2.num equipmentNum, |
| | | t2.name equipmentName, |
| | | t2.model equipmentModel, |
| | | t2.team_id teamId, |
| | | t2.specification specification, |
| | | t2.use_id useId, |
| | | t2.specific_equipment specificEquipment |
| | | FROM |
| | | mom_eam_equipment_report_repair t1 |
| | | left join mom_eam_equipment t2 on t1.equipment_id = t2.id |
| | | WHERE t1.del_flag = 0 |
| | | <if test="num != null and num != ''"> |
| | | and t1.num like concat('%',#{num},'%') |
| | | </if> |
| | | <if test="faultStartTime != null and faultStartTime != ''"> |
| | | and t1.fault_time >= #{faultStartTime} |
| | | </if> |
| | | <if test="faultEndTime != null and faultEndTime != ''"> |
| | | and t1.fault_time <= #{faultEndTime} |
| | | </if> |
| | | <if test="isStop != null and isStop != ''"> |
| | | and t1.is_stop = #{isStop} |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | and t1.status = #{status} |
| | | </if> |
| | | <if test="errUda2 != null and errUda2 != ''"> |
| | | and t1.err_uda2 like concat('%',#{errUda2},'%') |
| | | </if> |
| | | <if test="errUda1 != null and errUda1 != ''"> |
| | | and t1.err_uda1 = #{errUda1} |
| | | </if> |
| | | <if test="createBy!= null and createBy != ''"> |
| | | and t1.create_by like concat('%',#{createBy},'%') |
| | | </if> |
| | | <if test="equipmentNum != null and equipmentNum != ''"> |
| | | and t2.num like concat('%',#{equipmentNum},'%') |
| | | </if> |
| | | <if test="equipmentName != null and equipmentName != ''"> |
| | | and t2.name like concat('%',#{equipmentName},'%') |
| | | </if> |
| | | <if test="equipmentModel != null and equipmentModel != ''"> |
| | | and t2.model like concat('%',#{model},'%') |
| | | </if> |
| | | <if test="specification != null and specification != ''"> |
| | | and t2.specification like concat('%',#{specification},'%') |
| | | </if> |
| | | <if test="useId != null and useId != ''"> |
| | | and t2.use_id = #{useId} |
| | | </if> |
| | | <if test="equipNums.size!=0"> |
| | | and t2.num in |
| | | <foreach collection="equipNums" open="(" separator="," close=")" item="num"> |
| | | #{num} |
| | | </foreach> |
| | | </if> |
| | | ORDER BY t1.create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.eam.entity.ChangeCause; |
| | | import org.jeecg.modules.eam.entity.EquipmentReportRepair; |
| | | import org.jeecg.modules.eam.vo.RepairReportExportVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | void updateEquipmentReportRepairById(EquipmentReportRepair equipmentReportRepair); |
| | | |
| | | IPage<Map<String, Object>> getReportRepairList(Integer pageNo, Integer pageSize, Map<String, Object> params); |
| | | |
| | | List<RepairReportExportVo> exportList(RepairReportExportVo repairReportExportVo); |
| | | } |
| | |
| | | //import org.jeecg.modules.system.entity.SysUpload; |
| | | //import org.jeecg.modules.system.entity.SysUploadRela; |
| | | //import org.jeecg.modules.system.service.IUploadRelaService; |
| | | import org.jeecg.modules.eam.vo.RepairReportExportVo; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.mapper.SysUserMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | } |
| | | return super.getBaseMapper().getReportRepairList(pageData, params,equipNums) ; |
| | | } |
| | | |
| | | @Override |
| | | public List<RepairReportExportVo> exportList(RepairReportExportVo repairReportExportVo) { |
| | | List<String> equipNums = new ArrayList<>(); |
| | | if(StringUtils.isNotBlank(repairReportExportVo.getNums())){ |
| | | equipNums = Arrays.asList(repairReportExportVo.getNums().trim().split("\n")); |
| | | } |
| | | return baseMapper.exportList( |
| | | repairReportExportVo.getNum(), |
| | | repairReportExportVo.getFaultStartTime(), |
| | | repairReportExportVo.getFaultEndTime(), |
| | | repairReportExportVo.getIsStop(), |
| | | repairReportExportVo.getStatus(), |
| | | repairReportExportVo.getErrUda2(), |
| | | repairReportExportVo.getErrUda1(), |
| | | repairReportExportVo.getCreateBy(), |
| | | repairReportExportVo.getEquipmentNum(), |
| | | repairReportExportVo.getEquipmentName(), |
| | | repairReportExportVo.getModel(), |
| | | repairReportExportVo.getSpecification(), |
| | | repairReportExportVo.getUseId(), |
| | | equipNums |
| | | ); |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author h1829 |
| | | */ |
| | | @Data |
| | | public class RepairReportExportVo implements Serializable { |
| | | @Excel(name = "å
³é®è®¾å¤æ è¯", width = 15,orderNum = "0",dicCode = "specific_equipment") |
| | | private String specificEquipment; |
| | | @Excel(name = "ç¶æ", width = 15,orderNum = "1",dicCode = "equipment_report_repair_status") |
| | | private String status; |
| | | @Excel(name = "åæ®å·", width = 15,orderNum = "2") |
| | | private String num; |
| | | /**设å¤ç¼ç */ |
| | | @Excel(name = "ç»ä¸ç¼ç ", width = 15,orderNum = "3") |
| | | private String equipmentNum; |
| | | /**设å¤åç§°*/ |
| | | @Excel(name = "设å¤åç§°", width = 15,orderNum = "4") |
| | | private String equipmentName; |
| | | /**设å¤åå·*/ |
| | | @Excel(name = "设å¤åå·", width = 15,orderNum = "5") |
| | | private String model; |
| | | @Excel(name = "使ç¨é¨é¨", width = 15,orderNum = "6",dicCode = "id",dictTable="sys_depart",dicText="depart_name") |
| | | private String useId; |
| | | @Excel(name = "æ¥ä¿®äºº", width = 15,orderNum = "7") |
| | | private String errUda2; |
| | | @Excel(name = "æ
éæ¶é´", width = 15,orderNum = "8",databaseFormat = "yyyy-MM-dd HH:mm:ss",exportFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date faultTime; |
| | | @Excel(name = "æ
éæè¿°", width = 15,orderNum = "9") |
| | | private String faultDescription; |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "éªæ¶æ¶é´", width = 15,orderNum = "11",databaseFormat = "yyyy-MM-dd HH:mm:ss",exportFormat = "yyyy-MM-dd HH:mm:ss" ) |
| | | private Date acceptTime; |
| | | @Excel(name = "åæºæ¶é¿", width = 15,orderNum = "12") |
| | | private String faultHour; |
| | | @Excel(name = "æ¯å¦åæºç»´ä¿®", width = 15,orderNum = "13",dicCode = "is_stop") |
| | | private String isStop; |
| | | @Excel(name = "æ¯å¦å¨å å·¥é¶ä»¶", width = 15,orderNum = "14",dicCode = "is_product") |
| | | private String errUda1; |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date faultStartTime; |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date faultEndTime; |
| | | private String specification; |
| | | @Excel(name = "å¶å人", width = 15,orderNum = "15") |
| | | private String createBy; |
| | | private String nums; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | ALTER TABLE [dbo].[mom_eam_ABC_assessment] ADD [old_standard] nvarchar(16) NULL |
| | | GO |
| | | |
| | | EXEC sp_addextendedproperty |
| | | 'MS_Description', N'èç»æ', |
| | | 'SCHEMA', N'dbo', |
| | | 'TABLE', N'mom_eam_ABC_assessment', |
| | | 'COLUMN', N'old_standard' |