Merge remote-tracking branch 'origin/master'
| | |
| | | } |
| | | |
| | | /** |
| | | * è·åæå®æ¶é´ä¹åçå å¹´ qsw |
| | | */ |
| | | public static Date getYearAfter(Date data,int number) { |
| | | Calendar c = Calendar.getInstance(); |
| | | c.setTime(data); |
| | | c.add(Calendar.YEAR, number); |
| | | Date afterTime = c.getTime(); |
| | | // SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | // String resultDate = f.format(afterTime); |
| | | return afterTime; |
| | | } |
| | | |
| | | /** |
| | | * è·åæå®æ¶é´ä¹åçå 天 qsw |
| | | */ |
| | | public static Date getDayAfter(Date data,int number) { |
| | |
| | | } |
| | | List<Map<String, Object>> precisionParameterList = calibrationOrderService.getPrecisionParameterList(equipmentId); |
| | | record.setPrecisionParameterList(precisionParameterList); |
| | | if("4".equals(status)){ |
| | | if("data".equals(managementMode)){ |
| | | List<CalibrationOrderDetail> calibrationOrderDetails = calibrationOrderDetailService.lambdaQuery() |
| | | .eq(CalibrationOrderDetail::getCalibrationOrderId, id) |
| | | .eq(CalibrationOrderDetail::getJudgmentResult, "fail") |
| | | .eq(CalibrationOrderDetail::getDelFlag,"0").list(); |
| | | if(calibrationOrderDetails.size()>0){ |
| | | record.setCalibrationResult("å¼å¸¸"); |
| | | }else{ |
| | | record.setCalibrationResult("æ£å¸¸"); |
| | | } |
| | | }else{ |
| | | List<CalibrationOrderReport> calibrationOrderReports = calibrationOrderReportService.lambdaQuery() |
| | | .eq(CalibrationOrderReport::getCalibrationOrderId, id) |
| | | .eq(CalibrationOrderReport::getJudgmentResult, "fail") |
| | | .eq(CalibrationOrderReport::getDelFlag, "0").list(); |
| | | if(calibrationOrderReports.size()>0){ |
| | | record.setCalibrationResult("å¼å¸¸"); |
| | | }else{ |
| | | record.setCalibrationResult("æ£å¸¸"); |
| | | } |
| | | } |
| | | } |
| | | // if("4".equals(status)){ |
| | | // if("data".equals(managementMode)){ |
| | | // List<CalibrationOrderDetail> calibrationOrderDetails = calibrationOrderDetailService.lambdaQuery() |
| | | // .eq(CalibrationOrderDetail::getCalibrationOrderId, id) |
| | | // .eq(CalibrationOrderDetail::getJudgmentResult, "fail") |
| | | // .eq(CalibrationOrderDetail::getDelFlag,"0").list(); |
| | | // if(calibrationOrderDetails.size()>0){ |
| | | // record.setCalibrationResult("å¼å¸¸"); |
| | | // }else{ |
| | | // record.setCalibrationResult("æ£å¸¸"); |
| | | // } |
| | | // }else{ |
| | | // List<CalibrationOrderReport> calibrationOrderReports = calibrationOrderReportService.lambdaQuery() |
| | | // .eq(CalibrationOrderReport::getCalibrationOrderId, id) |
| | | // .eq(CalibrationOrderReport::getJudgmentResult, "fail") |
| | | // .eq(CalibrationOrderReport::getDelFlag, "0").list(); |
| | | // if(calibrationOrderReports.size()>0){ |
| | | // record.setCalibrationResult("å¼å¸¸"); |
| | | // }else{ |
| | | // record.setCalibrationResult("æ£å¸¸"); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | return Result.OK(pageList); |
| | | } |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.api.ISysBaseAPI; |
| | | import org.jeecg.common.system.base.entity.SysUpload; |
| | |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.util.StrUtils; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.entity.CalibrationOrder; |
| | | import org.jeecg.modules.eam.entity.CalibrationOrderReport; |
| | | import org.jeecg.modules.eam.entity.Equipment; |
| | | import org.jeecg.modules.eam.entity.EquipmentDocument; |
| | | import org.jeecg.modules.eam.service.ICalibrationOrderReportService; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import org.jeecg.modules.eam.service.ICalibrationOrderService; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecgframework.poi.excel.ExcelImportUtil; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | |
| | | /** |
| | | /** |
| | | * @Description: mom_eam_calibration_order_report |
| | | * @Author: jeecg-boot |
| | | * @Date: 2023-07-20 |
| | | * @Date: 2023-07-20 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="mom_eam_calibration_order_report") |
| | | @Api(tags = "mom_eam_calibration_order_report") |
| | | @RestController |
| | | @RequestMapping("/eam/calibrationOrderReport") |
| | | @Slf4j |
| | | public class CalibrationOrderReportController extends JeecgController<CalibrationOrderReport, ICalibrationOrderReportService> { |
| | | @Autowired |
| | | private ICalibrationOrderReportService calibrationOrderReportService; |
| | | @Autowired |
| | | private ICalibrationOrderReportService calibrationOrderReportService; |
| | | |
| | | @Autowired |
| | | private ISysBaseAPI sysBaseApi; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param calibrationOrderReport |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "mom_eam_calibration_order_report-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="mom_eam_calibration_order_report-å页å表æ¥è¯¢", notes="mom_eam_calibration_order_report-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<CalibrationOrderReport>> queryPageList(CalibrationOrderReport calibrationOrderReport, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<CalibrationOrderReport> queryWrapper = QueryGenerator.initQueryWrapper(calibrationOrderReport, req.getParameterMap()); |
| | | Page<CalibrationOrderReport> page = new Page<CalibrationOrderReport>(pageNo, pageSize); |
| | | IPage<CalibrationOrderReport> pageList = calibrationOrderReportService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | @Autowired |
| | | private ICalibrationOrderService calibrationOrderService; |
| | | @Autowired |
| | | private ISysBaseAPI sysBaseApi; |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/add") |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Result<?> add(MultipartHttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | String str = request.getParameter("data"); |
| | | JSONObject json = JSONObject.parseObject(str); |
| | | |
| | | boolean isFileChange = true; |
| | | String uploadId = json.getString("uploadId"); |
| | | String fileType = json.getString("fileType"); |
| | | String description = json.getString("remark"); |
| | | String type = json.getString("type"); |
| | | |
| | | CalibrationOrderReport calibrationOrderReport = json.toJavaObject(CalibrationOrderReport.class); |
| | | calibrationOrderReport.setType(fileType); |
| | | calibrationOrderReportService.save(calibrationOrderReport); |
| | | // æä»¶åæ´ |
| | | if (isFileChange) { |
| | | if (StrUtils.isNotBlankOrNull(uploadId)) { |
| | | // æ
å½¢ä¸ãä»æä»¶ç®¡çä¸éæ© |
| | | // uploadRelaService.saveOrUpdateUploadRale(partRouteFile.getId(), partRouteFile.getType(), uploadId); |
| | | } else { |
| | | // æ
å½¢äºãéæ°ä¸ä¼ |
| | | // 1ãæä¹
upload |
| | | MultipartFile multipartFile = request.getFile("file"); |
| | | List<MultipartFile> multipartFileList = new ArrayList<>(); |
| | | multipartFileList.add(multipartFile); |
| | | // List<SysUpload> sysUploads = uploadService.batchUploadFile(fileType, multipartFileList, description); |
| | | // // 2ãå建/ä¿®æ¹ uploadRela |
| | | // // 注ï¼å½åè§ä¸ºåæä»¶ä¸ä¼ æ§å¶ï¼åç»å¯è½ä¼æå个产åå·¥èºæä»¶å¯¹åºå¤ä¸ªä¸ä¼ æä»¶çåçº§è°æ´ï¼ä¿®æ¹åæ³¨ææ´ç»æ¤æ®µæ³¨é |
| | | // uploadRelaService.saveOrUpdateUploadRale(equipmentDocument.getId(), type, sysUploads.get(0).getId()); |
| | | List<SysUpload> sysUploads = sysBaseApi.batchUploadFile(fileType, multipartFileList, description); |
| | | // 2ãå建/ä¿®æ¹ uploadRela |
| | | // 注ï¼å½åè§ä¸ºåæä»¶ä¸ä¼ æ§å¶ï¼åç»å¯è½ä¼æå个产åå·¥èºæä»¶å¯¹åºå¤ä¸ªä¸ä¼ æä»¶çåçº§è°æ´ï¼ä¿®æ¹åæ³¨ææ´ç»æ¤æ®µæ³¨é |
| | | sysBaseApi.saveOrUpdateUploadRale(calibrationOrderReport.getId(), type, sysUploads.get(0).getId()); |
| | | } |
| | | } |
| | | |
| | | return Result.ok("ä¸ä¼ æå!"); |
| | | } |
| | | |
| | | @PostMapping(value = "/edit") |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Result<?> edit(MultipartHttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | String str = request.getParameter("data"); |
| | | JSONObject json = JSONObject.parseObject(str); |
| | | |
| | | boolean isFileChange = json.getBoolean("isFileChange"); |
| | | String uploadId = json.getString("uploadId"); |
| | | String fileType = json.getString("fileType"); |
| | | String description = json.getString("remark"); |
| | | String type = json.getString("type"); |
| | | |
| | | CalibrationOrderReport calibrationOrderReport = json.toJavaObject(CalibrationOrderReport.class); |
| | | calibrationOrderReport.setType(fileType); |
| | | calibrationOrderReportService.saveOrUpdate(calibrationOrderReport); |
| | | // æä»¶åæ´ |
| | | if (isFileChange) { |
| | | if (StrUtils.isNotBlankOrNull(uploadId)) { |
| | | // æ
å½¢ä¸ãä»æä»¶ç®¡çä¸éæ© |
| | | // uploadRelaService.saveOrUpdateUploadRale(partRouteFile.getId(), partRouteFile.getType(), uploadId); |
| | | } else { |
| | | // æ
å½¢äºãéæ°ä¸ä¼ |
| | | // 1ãæä¹
upload |
| | | MultipartFile multipartFile = request.getFile("file"); |
| | | List<MultipartFile> multipartFileList = new ArrayList<>(); |
| | | multipartFileList.add(multipartFile); |
| | | // List<SysUpload> sysUploads = uploadService.batchUploadFile(fileType, multipartFileList, description); |
| | | // // 2ãå建/ä¿®æ¹ uploadRela |
| | | // // 注ï¼å½åè§ä¸ºåæä»¶ä¸ä¼ æ§å¶ï¼åç»å¯è½ä¼æå个产åå·¥èºæä»¶å¯¹åºå¤ä¸ªä¸ä¼ æä»¶çåçº§è°æ´ï¼ä¿®æ¹åæ³¨ææ´ç»æ¤æ®µæ³¨é |
| | | // uploadRelaService.saveOrUpdateUploadRale(equipmentDocument.getId(), type, sysUploads.get(0).getId()); |
| | | List<SysUpload> sysUploads = sysBaseApi.batchUploadFile(fileType, multipartFileList, description); |
| | | // 2ãå建/ä¿®æ¹ uploadRela |
| | | // 注ï¼å½åè§ä¸ºåæä»¶ä¸ä¼ æ§å¶ï¼åç»å¯è½ä¼æå个产åå·¥èºæä»¶å¯¹åºå¤ä¸ªä¸ä¼ æä»¶çåçº§è°æ´ï¼ä¿®æ¹åæ³¨ææ´ç»æ¤æ®µæ³¨é |
| | | sysBaseApi.saveOrUpdateUploadRale(calibrationOrderReport.getId(), type, sysUploads.get(0).getId()); |
| | | } |
| | | } |
| | | |
| | | return Result.ok("ä¸ä¼ æå!"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "mom_eam_calibration_order_report-éè¿idå é¤") |
| | | @ApiOperation(value="mom_eam_calibration_order_report-éè¿idå é¤", notes="mom_eam_calibration_order_report-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:mom_eam_calibration_order_report:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | //å é¤æä»¶ç®¡çä¸ä¸å¡æ°æ®å
³ç³» |
| | | // List<SysUploadRela> sysUploadRelas = uploadRelaService.lambdaQuery().eq(SysUploadRela::getBusId, id).eq(SysUploadRela::getDelFlag, 0).list(); |
| | | List<SysUploadRela> sysUploadRelas = sysBaseApi.listByBusIdAndBusType(id, null); |
| | | for (SysUploadRela sysUploadRela : sysUploadRelas) { |
| | | String uploadId = sysUploadRela.getUploadId(); |
| | | // uploadService.removeById(uploadId); |
| | | // uploadRelaService.removeById(sysUploadRela); |
| | | sysBaseApi.removeUploadById(uploadId); |
| | | sysBaseApi.removeUploadRelaById(sysUploadRela.getId()); |
| | | } |
| | | calibrationOrderReportService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "mom_eam_calibration_order_report-æ¹éå é¤") |
| | | @ApiOperation(value="mom_eam_calibration_order_report-æ¹éå é¤", notes="mom_eam_calibration_order_report-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:mom_eam_calibration_order_report:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.calibrationOrderReportService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "mom_eam_calibration_order_report-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value="mom_eam_calibration_order_report-éè¿idæ¥è¯¢", notes="mom_eam_calibration_order_report-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<CalibrationOrderReport> queryById(@RequestParam(name="id",required=true) String id) { |
| | | CalibrationOrderReport calibrationOrderReport = calibrationOrderReportService.getById(id); |
| | | if(calibrationOrderReport==null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(calibrationOrderReport); |
| | | } |
| | | @Autowired |
| | | private IEamEquipmentService eamEquipmentService; |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param calibrationOrderReport |
| | | */ |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param calibrationOrderReport |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "mom_eam_calibration_order_report-å页å表æ¥è¯¢") |
| | | @ApiOperation(value = "mom_eam_calibration_order_report-å页å表æ¥è¯¢", notes = "mom_eam_calibration_order_report-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<CalibrationOrderReport>> queryPageList(CalibrationOrderReport calibrationOrderReport, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
| | | QueryWrapper<CalibrationOrderReport> queryWrapper = QueryGenerator.initQueryWrapper(calibrationOrderReport, req.getParameterMap()); |
| | | Page<CalibrationOrderReport> page = new Page<CalibrationOrderReport>(pageNo, pageSize); |
| | | IPage<CalibrationOrderReport> pageList = calibrationOrderReportService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/add") |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Result<?> add(MultipartHttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | String str = request.getParameter("data"); |
| | | JSONObject json = JSONObject.parseObject(str); |
| | | |
| | | boolean isFileChange = true; |
| | | String uploadId = json.getString("uploadId"); |
| | | String fileType = json.getString("fileType"); |
| | | String description = json.getString("remark"); |
| | | String type = json.getString("type"); |
| | | |
| | | CalibrationOrderReport calibrationOrderReport = json.toJavaObject(CalibrationOrderReport.class); |
| | | calibrationOrderReport.setType(fileType); |
| | | calibrationOrderReportService.save(calibrationOrderReport); |
| | | |
| | | // æä»¶åæ´ |
| | | if (isFileChange) { |
| | | if (StrUtils.isNotBlankOrNull(uploadId)) { |
| | | // æ
å½¢ä¸ãä»æä»¶ç®¡çä¸éæ© |
| | | // uploadRelaService.saveOrUpdateUploadRale(partRouteFile.getId(), partRouteFile.getType(), uploadId); |
| | | } else { |
| | | // æ
å½¢äºãéæ°ä¸ä¼ |
| | | // 1ãæä¹
upload |
| | | MultipartFile multipartFile = request.getFile("file"); |
| | | List<MultipartFile> multipartFileList = new ArrayList<>(); |
| | | multipartFileList.add(multipartFile); |
| | | // List<SysUpload> sysUploads = uploadService.batchUploadFile(fileType, multipartFileList, description); |
| | | // // 2ãå建/ä¿®æ¹ uploadRela |
| | | // // 注ï¼å½åè§ä¸ºåæä»¶ä¸ä¼ æ§å¶ï¼åç»å¯è½ä¼æå个产åå·¥èºæä»¶å¯¹åºå¤ä¸ªä¸ä¼ æä»¶çåçº§è°æ´ï¼ä¿®æ¹åæ³¨ææ´ç»æ¤æ®µæ³¨é |
| | | // uploadRelaService.saveOrUpdateUploadRale(equipmentDocument.getId(), type, sysUploads.get(0).getId()); |
| | | List<SysUpload> sysUploads = sysBaseApi.batchUploadFile(fileType, multipartFileList, description); |
| | | // 2ãå建/ä¿®æ¹ uploadRela |
| | | // 注ï¼å½åè§ä¸ºåæä»¶ä¸ä¼ æ§å¶ï¼åç»å¯è½ä¼æå个产åå·¥èºæä»¶å¯¹åºå¤ä¸ªä¸ä¼ æä»¶çåçº§è°æ´ï¼ä¿®æ¹åæ³¨ææ´ç»æ¤æ®µæ³¨é |
| | | sysBaseApi.saveOrUpdateUploadRale(calibrationOrderReport.getId(), type, sysUploads.get(0).getId()); |
| | | } |
| | | } |
| | | // æ´æ°ä¸»è¡¨ä¸ºå·²å®æ |
| | | CalibrationOrder calibrationOrder = calibrationOrderService.getById(calibrationOrderReport.getCalibrationOrderId()); |
| | | // status 已宿 |
| | | calibrationOrder.setStatus("4"); |
| | | calibrationOrder.setCalibrationResult(calibrationOrderReport.getJudgmentResult()); |
| | | calibrationOrder.setCalibrationTime(new Date()); |
| | | calibrationOrderService.updateById(calibrationOrder); |
| | | // æ´æ°è®¾å¤ææ¯ç¶æ |
| | | Equipment equipment = eamEquipmentService.getById(calibrationOrder.getEquipmentId()); |
| | | |
| | | if (StringUtils.isNotBlank(equipment.getId())) { |
| | | equipment.setTechnologyStatus(calibrationOrderReport.getJudgmentResult()); |
| | | eamEquipmentService.updateById(equipment); |
| | | } |
| | | |
| | | return Result.ok("ä¸ä¼ æå!"); |
| | | } |
| | | |
| | | @PostMapping(value = "/edit") |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Result<?> edit(MultipartHttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | String str = request.getParameter("data"); |
| | | JSONObject json = JSONObject.parseObject(str); |
| | | |
| | | boolean isFileChange = json.getBoolean("isFileChange"); |
| | | String uploadId = json.getString("uploadId"); |
| | | String fileType = json.getString("fileType"); |
| | | String description = json.getString("remark"); |
| | | String type = json.getString("type"); |
| | | |
| | | CalibrationOrderReport calibrationOrderReport = json.toJavaObject(CalibrationOrderReport.class); |
| | | calibrationOrderReport.setType(fileType); |
| | | calibrationOrderReportService.saveOrUpdate(calibrationOrderReport); |
| | | // æä»¶åæ´ |
| | | if (isFileChange) { |
| | | if (StrUtils.isNotBlankOrNull(uploadId)) { |
| | | // æ
å½¢ä¸ãä»æä»¶ç®¡çä¸éæ© |
| | | // uploadRelaService.saveOrUpdateUploadRale(partRouteFile.getId(), partRouteFile.getType(), uploadId); |
| | | } else { |
| | | // æ
å½¢äºãéæ°ä¸ä¼ |
| | | // 1ãæä¹
upload |
| | | MultipartFile multipartFile = request.getFile("file"); |
| | | List<MultipartFile> multipartFileList = new ArrayList<>(); |
| | | multipartFileList.add(multipartFile); |
| | | // List<SysUpload> sysUploads = uploadService.batchUploadFile(fileType, multipartFileList, description); |
| | | // // 2ãå建/ä¿®æ¹ uploadRela |
| | | // // 注ï¼å½åè§ä¸ºåæä»¶ä¸ä¼ æ§å¶ï¼åç»å¯è½ä¼æå个产åå·¥èºæä»¶å¯¹åºå¤ä¸ªä¸ä¼ æä»¶çåçº§è°æ´ï¼ä¿®æ¹åæ³¨ææ´ç»æ¤æ®µæ³¨é |
| | | // uploadRelaService.saveOrUpdateUploadRale(equipmentDocument.getId(), type, sysUploads.get(0).getId()); |
| | | List<SysUpload> sysUploads = sysBaseApi.batchUploadFile(fileType, multipartFileList, description); |
| | | // 2ãå建/ä¿®æ¹ uploadRela |
| | | // 注ï¼å½åè§ä¸ºåæä»¶ä¸ä¼ æ§å¶ï¼åç»å¯è½ä¼æå个产åå·¥èºæä»¶å¯¹åºå¤ä¸ªä¸ä¼ æä»¶çåçº§è°æ´ï¼ä¿®æ¹åæ³¨ææ´ç»æ¤æ®µæ³¨é |
| | | sysBaseApi.saveOrUpdateUploadRale(calibrationOrderReport.getId(), type, sysUploads.get(0).getId()); |
| | | } |
| | | } |
| | | |
| | | return Result.ok("ä¸ä¼ æå!"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "mom_eam_calibration_order_report-éè¿idå é¤") |
| | | @ApiOperation(value = "mom_eam_calibration_order_report-éè¿idå é¤", notes = "mom_eam_calibration_order_report-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:mom_eam_calibration_order_report:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name = "id", required = true) String id) { |
| | | //å é¤æä»¶ç®¡çä¸ä¸å¡æ°æ®å
³ç³» |
| | | // List<SysUploadRela> sysUploadRelas = uploadRelaService.lambdaQuery().eq(SysUploadRela::getBusId, id).eq(SysUploadRela::getDelFlag, 0).list(); |
| | | List<SysUploadRela> sysUploadRelas = sysBaseApi.listByBusIdAndBusType(id, null); |
| | | for (SysUploadRela sysUploadRela : sysUploadRelas) { |
| | | String uploadId = sysUploadRela.getUploadId(); |
| | | // uploadService.removeById(uploadId); |
| | | // uploadRelaService.removeById(sysUploadRela); |
| | | sysBaseApi.removeUploadById(uploadId); |
| | | sysBaseApi.removeUploadRelaById(sysUploadRela.getId()); |
| | | } |
| | | calibrationOrderReportService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "mom_eam_calibration_order_report-æ¹éå é¤") |
| | | @ApiOperation(value = "mom_eam_calibration_order_report-æ¹éå é¤", notes = "mom_eam_calibration_order_report-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:mom_eam_calibration_order_report:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | this.calibrationOrderReportService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "mom_eam_calibration_order_report-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value = "mom_eam_calibration_order_report-éè¿idæ¥è¯¢", notes = "mom_eam_calibration_order_report-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<CalibrationOrderReport> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | CalibrationOrderReport calibrationOrderReport = calibrationOrderReportService.getById(id); |
| | | if (calibrationOrderReport == null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(calibrationOrderReport); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param calibrationOrderReport |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:mom_eam_calibration_order_report:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, CalibrationOrderReport calibrationOrderReport) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("mom_eam_calibration_order_report:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è®¾å¤æ£å® è·åæ£å®æ¥å |
| | | * qsw 2023-7-20 |
| | | */ |
| | | @GetMapping("getCalibrationOrderReportList") |
| | | public Result<?> getCalibrationOrderReportList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam Map<String, Object> params) { |
| | | IPage<Map<String, Object>> calibrationOrderReports = calibrationOrderReportService.getCalibrationOrderReportById(pageNo, pageSize, params); |
| | | for (Map<String, Object> calibrationOrderReport : calibrationOrderReports.getRecords()) { |
| | | //è·åæ¯å¦ææ å¼å¸¸ç
§çæ°æ® |
| | | /** |
| | | * è®¾å¤æ£å® è·åæ£å®æ¥å |
| | | * qsw 2023-7-20 |
| | | */ |
| | | @GetMapping("getCalibrationOrderReportList") |
| | | public Result<?> getCalibrationOrderReportList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam Map<String, Object> params) { |
| | | IPage<Map<String, Object>> calibrationOrderReports = calibrationOrderReportService.getCalibrationOrderReportById(pageNo, pageSize, params); |
| | | for (Map<String, Object> calibrationOrderReport : calibrationOrderReports.getRecords()) { |
| | | //è·åæ¯å¦ææ å¼å¸¸ç
§çæ°æ® |
| | | // List<SysUploadRela> sysUploadRelas = uploadRelaService.lambdaQuery().eq(SysUploadRela::getBusId, (String) calibrationOrderReport.get("id")).eq(SysUploadRela::getDelFlag, 0).list(); |
| | | List<SysUploadRela> sysUploadRelas =sysBaseApi.listByBusIdAndBusType((String) calibrationOrderReport.get("id"), null); |
| | | if (sysUploadRelas.size() > 0) { |
| | | List<SysUploadRela> sysUploadRelas = sysBaseApi.listByBusIdAndBusType((String) calibrationOrderReport.get("id"), null); |
| | | if (sysUploadRelas.size() > 0) { |
| | | |
| | | // List<SysUploadRela> uploadRelas = uploadRelaService.listByBusIdAndBusType((String) calibrationOrderReport.get("id"), "calibration_order_report"); |
| | | List<SysUploadRela> uploadRelas = sysBaseApi.listByBusIdAndBusType((String) calibrationOrderReport.get("id"), "calibration_order_report"); |
| | | SysUpload upload = new SysUpload(); |
| | | if (CollectionUtils.isNotEmpty(uploadRelas)) { |
| | | //upload = uploadService.getById(uploadRelas.get(0).getUploadId()); |
| | | upload = sysBaseApi.getUploadById(uploadRelas.get(0).getUploadId()); |
| | | } |
| | | calibrationOrderReport.put("upload", upload); |
| | | } else { |
| | | List<SysUploadRela> uploadRelas = sysBaseApi.listByBusIdAndBusType((String) calibrationOrderReport.get("id"), "calibration_order_report"); |
| | | SysUpload upload = new SysUpload(); |
| | | if (CollectionUtils.isNotEmpty(uploadRelas)) { |
| | | //upload = uploadService.getById(uploadRelas.get(0).getUploadId()); |
| | | upload = sysBaseApi.getUploadById(uploadRelas.get(0).getUploadId()); |
| | | } |
| | | calibrationOrderReport.put("upload", upload); |
| | | } else { |
| | | |
| | | SysUpload upload = new SysUpload(); |
| | | calibrationOrderReport.put("upload", upload); |
| | | } |
| | | } |
| | | return Result.ok(calibrationOrderReports); |
| | | } |
| | | SysUpload upload = new SysUpload(); |
| | | calibrationOrderReport.put("upload", upload); |
| | | } |
| | | } |
| | | return Result.ok(calibrationOrderReports); |
| | | } |
| | | |
| | | } |
| | |
| | | @RequestMapping(value = "/editTechnologyStatus", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | @Transactional(rollbackFor = { Exception.class }) |
| | | public Result<String> editTechnologyStatus(@RequestBody Equipment equipment) { |
| | | equipment.setTechnologyStatusVerificationType("1"); |
| | | equipmentService.updateById(equipment); |
| | | |
| | | DailyMaintenanceOrder dailyMaintenanceOrder = dailyMaintenanceOrderService.getById(equipment.getMaintenanceOrderId()); |
| | |
| | | import org.jeecg.common.system.base.entity.SysUpload; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.base.entity.Constructor; |
| | | import org.jeecg.modules.base.service.IConstructorService; |
| | | import org.jeecg.modules.base.service.IFactoryModelService; |
| | | import org.jeecg.modules.eam.entity.*; |
| | | import org.jeecg.modules.eam.model.DepartVo; |
| | | import org.jeecg.modules.eam.service.*; |
| | |
| | | |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | |
| | | import org.jeecg.modules.system.entity.SysDepart; |
| | | import org.jeecg.modules.system.service.ISysDepartService; |
| | | import org.jeecgframework.poi.excel.ExcelImportUtil; |
| | | import org.jeecgframework.poi.excel.entity.ImportParams; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private IProcessParametersTemplateService processParametersTemplateService; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private ISysBaseAPI sysBaseApi; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IEquipmentCategoryService equipmentCategoryService; |
| | | |
| | | @Autowired |
| | | private ISysDepartService departService; |
| | | |
| | | @Autowired |
| | | private ITeamService teamService; |
| | | |
| | | @Autowired |
| | | private IConstructorService constructorService; |
| | | |
| | | @Autowired |
| | | private IAreaService areaService; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | |
| | | @GetMapping(value = "/getResumeCalibrationRecordList") |
| | | public Result<?> getResumeCalibrationRecordList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam Map<String, Object> params) { |
| | | IPage<Map<String, Object>> resumeCalibrationRecordList = equipmentService.getResumeCalibrationRecordList(pageNo, pageSize, params); |
| | | for (Map<String, Object> record : resumeCalibrationRecordList.getRecords()) { |
| | | String id = (String)record.get("id"); |
| | | String status = (String)record.get("status"); |
| | | String managementMode = (String)record.get("managementMode"); |
| | | if("4".equals(status)){ |
| | | if("data".equals(managementMode)){ |
| | | List<CalibrationOrderDetail> calibrationOrderDetails = calibrationOrderDetailService.lambdaQuery() |
| | | .eq(CalibrationOrderDetail::getCalibrationOrderId, id) |
| | | .eq(CalibrationOrderDetail::getJudgmentResult, "fail") |
| | | .eq(CalibrationOrderDetail::getDelFlag,"0").list(); |
| | | if(calibrationOrderDetails.size()>0){ |
| | | record.put("calibrationResult","å¼å¸¸"); |
| | | }else{ |
| | | record.put("calibrationResult","æ£å¸¸å¸¸"); |
| | | } |
| | | }else{ |
| | | List<CalibrationOrderReport> calibrationOrderReports = calibrationOrderReportService.lambdaQuery() |
| | | .eq(CalibrationOrderReport::getCalibrationOrderId, id) |
| | | .eq(CalibrationOrderReport::getJudgmentResult, "fail") |
| | | .eq(CalibrationOrderReport::getDelFlag, "0").list(); |
| | | if(calibrationOrderReports.size()>0){ |
| | | record.put("calibrationResult","å¼å¸¸"); |
| | | }else{ |
| | | record.put("calibrationResult","æ£å¸¸å¸¸"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // for (Map<String, Object> record : resumeCalibrationRecordList.getRecords()) { |
| | | // String id = (String)record.get("id"); |
| | | // String status = (String)record.get("status"); |
| | | // String managementMode = (String)record.get("managementMode"); |
| | | // if("4".equals(status)){ |
| | | // if("data".equals(managementMode)){ |
| | | // List<CalibrationOrderDetail> calibrationOrderDetails = calibrationOrderDetailService.lambdaQuery() |
| | | // .eq(CalibrationOrderDetail::getCalibrationOrderId, id) |
| | | // .eq(CalibrationOrderDetail::getJudgmentResult, "fail") |
| | | // .eq(CalibrationOrderDetail::getDelFlag,"0").list(); |
| | | // if(calibrationOrderDetails.size()>0){ |
| | | // record.put("calibrationResult","å¼å¸¸"); |
| | | // }else{ |
| | | // record.put("calibrationResult","æ£å¸¸å¸¸"); |
| | | // } |
| | | // }else{ |
| | | // List<CalibrationOrderReport> calibrationOrderReports = calibrationOrderReportService.lambdaQuery() |
| | | // .eq(CalibrationOrderReport::getCalibrationOrderId, id) |
| | | // .eq(CalibrationOrderReport::getJudgmentResult, "fail") |
| | | // .eq(CalibrationOrderReport::getDelFlag, "0").list(); |
| | | // if(calibrationOrderReports.size()>0){ |
| | | // record.put("calibrationResult","å¼å¸¸"); |
| | | // }else{ |
| | | // record.put("calibrationResult","æ£å¸¸å¸¸"); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | return Result.ok(resumeCalibrationRecordList); |
| | | } |
| | | |
| | |
| | | try { |
| | | List<EquipmentImportVo> list = ExcelImportUtil.importExcel(file.getInputStream(), EquipmentImportVo.class, params); |
| | | for(int i = 0;i<list.size();i++){ |
| | | Equipment equipment = new Equipment(); |
| | | EquipmentImportVo equipmentImportVo = list.get(i); |
| | | EquipmentCategory equipmentCategory = equipmentCategoryService.getOne(new QueryWrapper<EquipmentCategory>().eq("name",equipmentImportVo.getEquipmentCategoryName()),false); |
| | | String equipmentCategoryName = equipmentImportVo.getEquipmentCategoryName(); |
| | | String useId = equipmentImportVo.getUseId(); |
| | | String areaId = equipmentImportVo.getFactoryModelId(); |
| | | String manageId = equipmentImportVo.getManageId(); |
| | | String constructorId = equipmentImportVo.getConstructorId(); |
| | | String teamId = equipmentImportVo.getTeamId(); |
| | | if(StringUtils.isBlank(equipmentImportVo.getNum())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :ç»ä¸ç¼ç 缺失,请填åå¿
填项åå导å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getName())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :设å¤å称缺失,请填åå¿
填项åå导å
¥;"; |
| | | exceptionNum++; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getUseId())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :使ç¨é¨é¨ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | exceptionNum++; |
| | | } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getEquipmentUda1())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :å·¥åºç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | // exceptionNum++; |
| | | // } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getManageId())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :ç»´æ¤é¨é¨ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getTeamId())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :ç»´ä¿®çç»ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getEquipmentImportanceId())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :ABCæ è¯ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | exceptionNum++; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getEquipmentCategoryName())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :设å¤å类缺失,请填åå¿
填项åå导å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getEquipmentStatus())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :设å¤ç¶æç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getTechnologyStatus())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :è®¾å¤ææ¯ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :è®¾å¤ææ¯ç¶æç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getFactoryModelId())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :车é´ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | else if(StringUtils.isBlank(equipmentImportVo.getModel())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :设å¤åå·ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getWorkCenterId())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :产线缺失,请填åå¿
填项åå导å
¥;"; |
| | | else if(StringUtils.isBlank(useId)){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :使ç¨é¨é¨ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | else if(ObjectUtils.isNotNull(equipmentImportVo.getWarrantyStart())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :è´¨ä¿å¼å§æ¥æç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | else if(StringUtils.isBlank(areaId)){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :å·¥åºç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getPropertyStatus())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :èµäº§ç¶æç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | else if(StringUtils.isBlank(manageId)){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :ç»´æ¤é¨é¨ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | //éå¿
填项 |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getEquipmentUda5())){ |
| | | else if(StringUtils.isBlank(equipmentCategoryName)){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :设å¤å类缺失,请填åå¿
填项åå导å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | else if(StringUtils.isBlank(teamId)){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :ç»´ä¿®çç»ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | //éå¿
填项 |
| | | // else if(ObjectUtils.isNotNull(equipmentImportVo.getWarrantyStart())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :è´¨ä¿å¼å§æ¥æç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getPropertyStatus())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :èµäº§ç¶æç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getEquipmentUda5())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :åè½ä½ç½®ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getLocation())){ |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getLocation())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :å®è£
ä½ç½®ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getLeaveFactoryDate())){ |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getLeaveFactoryDate())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :åºåæ¥æç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getProjectApprovalNo())){ |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getProjectApprovalNo())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :ç«é¡¹å¡å·ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getFundSource())){ |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getFundSource())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :èµéæ¥æºç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getAcceptanceCheckDate())){ |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getAcceptanceCheckDate())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :éªæ¶æ¥æç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getLeaveFactoryDate())){ |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getLeaveFactoryDate())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :åºåæ¥æç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getFactoryNo())){ |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getFactoryNo())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :åºåç¼å·ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if( StringUtils.isBlank(equipmentImportVo.getConstructorId())){ |
| | | // else if( StringUtils.isBlank(equipmentImportVo.getConstructorId())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :èµäº§å¶é å缺失,请填åå¿
填项åå导å
¥;"; |
| | | // exceptionNum++; |
| | | // } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getModel())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :设å¤åå·ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | exceptionNum++; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getSpecification())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :设å¤è§æ ¼ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | exceptionNum++; |
| | | } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getSpecification())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :设å¤è§æ ¼ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getGpo())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :设å¤åç缺失,请填åå¿
填项åå导å
¥;"; |
| | | // exceptionNum++; |
| | | // } |
| | | else if(ObjectUtils.isNull(equipmentCategory)) |
| | | { |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :è¯¥è®¾å¤æå±ç±»å«ä¸åå¨ï¼è¯·å
ç»´æ¤è®¾å¤ç±»å«;"; |
| | | exceptionNum++; |
| | | } |
| | | else{ |
| | | SysDepart use = departService.getOne(new QueryWrapper<SysDepart>().eq("depart_name",useId.trim()),false); |
| | | if(ObjectUtils.isNull(useId)){ |
| | | equipment.setUseId(use.getId()); |
| | | }else { |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :ä¸åå¨è¯¥ä½¿ç¨é¨é¨,请维æ¤é¨é¨æ°æ®åå导å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | Area area = areaService.getOne(new QueryWrapper<Area>().eq("name",areaId.trim())); |
| | | if(ObjectUtils.isNotNull(area)){ |
| | | equipment.setFactoryModelId(area.getId()); |
| | | }else { |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :ä¸åå¨è¯¥å·¥åº,请维æ¤å·¥åºæ°æ®åå导å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | SysDepart manage = departService.getOne(new QueryWrapper<SysDepart>().eq("depart_name",manageId.trim())); |
| | | if(ObjectUtils.isNotNull(manage)){ |
| | | equipment.setManageId(manage.getId()); |
| | | }else{ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :ä¸åå¨è¯¥ç»´æ¤é¨é¨,请å
ç»´æ¤é¨é¨æ°æ®åå导å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | EquipmentCategory equipmentCategory = equipmentCategoryService.getOne(new QueryWrapper<EquipmentCategory>().eq("name",equipmentCategoryName.trim()),false); |
| | | if(ObjectUtils.isNotNull(equipmentCategory)){ |
| | | equipment.setEquipmentCategoryId(equipmentCategory.getId()); |
| | | } |
| | | else { |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :ä¸åå¨è¯¥è®¾å¤åç±»,请å
ç»´æ¤è®¾å¤åç±»æ°æ®åå导å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | Team team = teamService.getOne(new QueryWrapper<Team>().eq("name",teamId.trim()),false); |
| | | if(ObjectUtils.isNotNull(team)){ |
| | | equipment.setTeamId(team.getId()); |
| | | }else { |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :ä¸åå¨è¯¥çç»,请å
ç»´æ¤çç»æ°æ®åå导å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | if(StringUtils.isNotBlank(constructorId)){ |
| | | Constructor constructor = constructorService.getByName(constructorId.trim()); |
| | | if(ObjectUtils.isNotNull(constructor)){ |
| | | equipment.setConstructorId(constructor.getId()); |
| | | }else { |
| | | constructor = new Constructor(); |
| | | constructor.setName(constructorId); |
| | | constructor.setDelFlag(0); |
| | | constructorService.save(constructor); |
| | | equipment.setConstructorId(constructor.getId()); |
| | | } |
| | | } |
| | | if(equipmentImportVo.getPropertyStatus().equals("warranty")){ |
| | | if( |
| | | ObjectUtils.isNull(equipmentImportVo.getWarrantyStart()) |
| | |
| | | } |
| | | |
| | | }else{ |
| | | Equipment oriEquipment = equipmentService.getOne(new QueryWrapper<Equipment>().eq("num",equipmentImportVo.getNum()),false); |
| | | Equipment oriEquipment = equipmentService |
| | | .getOne(new QueryWrapper<Equipment>() |
| | | .eq("num",equipmentImportVo.getNum()),false); |
| | | if(ObjectUtils.isNull(oriEquipment)){ |
| | | Equipment equipment = new Equipment(); |
| | | equipment.setNum(equipmentImportVo.getNum()) |
| | | .setName(equipmentImportVo.getName()) |
| | | .setUseId(equipmentImportVo.getUseId()) |
| | | .setEquipmentUda1(equipmentImportVo.getEquipmentUda1()) |
| | | .setManageId(equipmentImportVo.getManageId()) |
| | | .setTeamId(equipmentImportVo.getTeamId()) |
| | | .setTechnologyStatus(equipmentImportVo.getTechnologyStatus()) |
| | | .setEquipmentImportanceId(equipmentImportVo.getEquipmentImportanceId()) |
| | | .setEquipmentCategoryId(equipmentCategory.getId()) |
| | | .setSpecificEquipment(equipmentImportVo.getKeyEquipmentIdentification()) |
| | | .setSecurityConfiguration(equipmentImportVo.getSecurityConfiguration()) |
| | | .setCoolingSystem(equipmentImportVo.getCoolingSystem()) |
| | | .setFireExtinguisher(equipmentImportVo.getFireExtinguisher()) |
| | | .setFireExtinguisherValidityPeriod(equipmentImportVo.getFireExtinguisherValidityPeriod()) |
| | | .setOperatingSystem(equipmentImportVo.getOperatingSystem()) |
| | | .setSystem(equipmentImportVo.getSystem()) |
| | | .setPort(equipmentImportVo.getPort()) |
| | | .setCoordinateNum(equipmentImportVo.getCoordinateNum()) |
| | |
| | | .setFundSource(equipmentImportVo.getFundSource()) |
| | | .setAcceptanceCheckDate(equipmentImportVo.getAcceptanceCheckDate()) |
| | | .setFactoryNumber(equipmentImportVo.getFactoryNumber()) |
| | | .setConstructorId(equipmentImportVo.getConstructorId()) |
| | | .setSourceCountry(equipmentImportVo.getSourceCountry()) |
| | | .setModel(equipmentImportVo.getModel()) |
| | | .setSpecification(equipmentImportVo.getSpecification()) |
| | | .setFactoryModelId(equipmentImportVo.getFactoryModelId()) |
| | | .setWorkCenterId(equipmentImportVo.getWorkCenterId()) |
| | | .setPropertyStatus(equipmentImportVo.getPropertyStatus()) |
| | | .setWarrantyStart(equipmentImportVo.getWarrantyStart()) |
| | | .setWarrantyEnd(equipmentImportVo.getWarrantyEnd()) |
| | |
| | | }else { |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥ï¼åå ï¼ç»ä¸ç¼ç å·²åå¨ï¼æ°æ®éå¤å¯¼å
¥;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | if(exceptionNum!=0){ |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.dto.message.MessageDTO; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecg.modules.eam.service.IEquipmentReportRepairService; |
| | | import org.jeecg.modules.eam.service.IFaultDescriptionService; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private ISysBaseAPI sysBaseApi; |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | @Autowired |
| | | @Lazy |
| | | private IFaultDescriptionService faultDescriptionService; |
| | | // @Autowired |
| | | // private IUploadRelaService uploadRelaService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | |
| | | @AutoLog(value = "mom_eam_equipment_report_repair-æ·»å ") |
| | | @ApiOperation(value = "mom_eam_equipment_report_repair-æ·»å ", notes = "mom_eam_equipment_report_repair-æ·»å ") |
| | | @PostMapping(value = "/add") |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Result<String> add(@RequestBody EquipmentReportRepair equipmentReportRepair) { |
| | | equipmentReportRepair.setStatus("1"); |
| | | equipmentReportRepair.setSource("1"); |
| | | equipmentReportRepair.setIsCreateOrder(0); |
| | | equipmentReportRepairService.save(equipmentReportRepair); |
| | | Equipment equipment = equipmentService.getById(equipmentReportRepair.getEquipmentId()); |
| | | equipment.setEquipmentStatus("2"); |
| | | String teamId = equipment.getTeamId(); |
| | | if(StringUtils.isNotBlank(teamId)){ |
| | | List<SysUser> sysUsers = userService.list(new QueryWrapper<SysUser>() |
| | | .eq("team_id",teamId) |
| | | .eq("del_flag",0)); |
| | | for(SysUser user:sysUsers){ |
| | | String msg = "ç»ä¸ç¼å·ä¸ºã"+equipment.getNum()+"ãç设å¤éè¦ç»´ä¿®ï¼è¯·ç§»æ¥è³æ
éæ¥ä¿®æ¥ç"; |
| | | MessageDTO messageDTO = new MessageDTO(); |
| | | messageDTO.setTitle("æ
éæ¥ä¿®æé"); |
| | | messageDTO.setContent(msg); |
| | | messageDTO.setCategory("æ
éæ¥ä¿®æé"); |
| | | messageDTO.setFromUser("æ
éæ¥ä¿®æéå°å©æ"); |
| | | messageDTO.setToUser(user.getUsername()); |
| | | sysBaseApi.sendSysAnnouncement(messageDTO); |
| | | } |
| | | }else { |
| | | return Result.error("该设å¤å°æªç»´æ¤ç»´ä¿®çç»,请维æ¤ååæ¥ä¿®"); |
| | | } |
| | | //æ·»å æ
éæè¿°ä¿¡æ¯ |
| | | FaultDescription faultDescription = new FaultDescription(); |
| | | faultDescription.setFaultDetails(equipmentReportRepair.getFaultDescription()); |
| | | faultDescription.setFaultId(equipmentReportRepair.getId()); |
| | | faultDescription.setPhoto(equipmentReportRepair.getPhoto()); |
| | | faultDescriptionService.save(faultDescription); |
| | | equipmentService.updateById(equipment); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.modules.eam.entity.InspectionProject; |
| | | import org.jeecg.modules.eam.entity.InspectionProjectCategory; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.ImportExcelUtil; |
| | | import org.jeecg.modules.base.entity.Unit; |
| | | import org.jeecg.modules.base.service.IUnitService; |
| | | import org.jeecg.modules.eam.entity.*; |
| | | import org.jeecg.modules.eam.service.IInspectionProjectService; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | |
| | | import org.jeecg.modules.eam.service.IInspectionProjectCategoryService; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.eam.vo.InspectionProjectImportVo; |
| | | import org.jeecg.modules.system.entity.SysDict; |
| | | import org.jeecg.modules.system.entity.SysDictItem; |
| | | import org.jeecg.modules.system.service.ISysDictItemService; |
| | | import org.jeecg.modules.system.service.ISysDictService; |
| | | import org.jeecgframework.poi.excel.ExcelImportUtil; |
| | | import org.jeecgframework.poi.excel.entity.ImportParams; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | private IInspectionProjectService inspectionProjectService; |
| | | @Autowired |
| | | private IInspectionProjectCategoryService inspectionProjectCategoryService; |
| | | @Autowired |
| | | private ISysDictService sysDictService; |
| | | @Autowired |
| | | private ISysDictItemService sysDictItemService; |
| | | @Autowired |
| | | private IUnitService unitService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | |
| | | */ |
| | | //@RequiresPermissions("mom_eam_inspection_project:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, InspectionProject.class); |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) throws IOException { |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); |
| | | // éè¯¯ä¿¡æ¯ |
| | | List<String> errorMessage = new ArrayList<>(); |
| | | int successLines = 0, errorLines = 0; |
| | | for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { |
| | | MultipartFile file = entity.getValue(); |
| | | ImportParams params = new ImportParams(); |
| | | params.setNeedSave(true); |
| | | try { |
| | | List<InspectionProjectImportVo> list = ExcelImportUtil.importExcel(file.getInputStream(), InspectionProjectImportVo.class, params); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | InspectionProjectImportVo inspectionProjectImportVo = list.get(i); |
| | | InspectionProject inspectionProject = new InspectionProject(); |
| | | InspectionProjectCategory inspectionProjectCategory = inspectionProjectCategoryService.getOne(new QueryWrapper<InspectionProjectCategory>().eq("name", inspectionProjectImportVo.getInspectionProjectCategoryId()), false); |
| | | Unit unit = unitService.getOne(new QueryWrapper<Unit>().eq("name",inspectionProjectImportVo.getUnitId()),false); |
| | | inspectionProject.setInspectionTool(inspectionProjectImportVo.getInspectionTool()); |
| | | if (StringUtils.isBlank(inspectionProjectImportVo.getNum())) { |
| | | errorMessage.add("第" + (i + 1) + "è¡å¯¼å
¥å¤±è´¥,åå :ç¹æ£é¡¹ç®ç¼ç 缺失,请填åå¿
填项åå导å
¥;"); |
| | | errorLines++; |
| | | continue; |
| | | }else { |
| | | inspectionProject.setNum(inspectionProjectImportVo.getNum()); |
| | | } |
| | | if(StringUtils.isBlank(inspectionProjectImportVo.getName())){ |
| | | errorMessage.add("第"+(i+1)+"è¡å¯¼å
¥å¤±è´¥,åå :ç¹æ£é¡¹ç®å称缺失,请填åå¿
填项åå导å
¥;"); |
| | | errorLines++; |
| | | continue; |
| | | }else { |
| | | inspectionProject.setNum(inspectionProjectImportVo.getName()); |
| | | } |
| | | if(StringUtils.isBlank(inspectionProjectImportVo.getTestValueType())){ |
| | | errorMessage.add("第"+(i+1)+"è¡å¯¼å
¥å¤±è´¥,åå :æ£éªå¼ç±»å缺失,请填åå¿
填项åå导å
¥;"); |
| | | errorLines++; |
| | | continue; |
| | | }else if(CollectionUtils.isEmpty(sysDictItemService.lambdaQuery().eq(SysDictItem::getDictId,sysDictService.lambdaQuery().eq(SysDict::getDictCode,"test_value_type").one().getId()).eq(SysDictItem::getItemText,inspectionProjectImportVo.getTestValueType()).list())){ |
| | | errorMessage.add("第" + (i + 1) + "è¡å¯¼å
¥å¤±è´¥,åå :æ£éªå¼ç±»åä¸åå¨,请å
ç»´æ¤æ£éªå¼ç±»å;"); |
| | | errorLines++; |
| | | continue; |
| | | }else { |
| | | inspectionProject.setTestValueType(sysDictItemService.lambdaQuery().eq(SysDictItem::getDictId,sysDictService.lambdaQuery().eq(SysDict::getDictCode,"test_value_type").one().getId()).eq(SysDictItem::getItemText,inspectionProjectImportVo.getInspectionMethod()).one().getItemValue()); |
| | | } |
| | | if(ObjectUtils.isNull(inspectionProjectCategory)) { |
| | | errorMessage.add("第"+(i+1)+"è¡å¯¼å
¥å¤±è´¥,åå :è¯¥ç¹æ£é¡¹ç®åç±»ä¸åå¨ï¼è¯·å
ç»´æ¤ç¹æ£é¡¹ç®åç±»;"); |
| | | errorLines++; |
| | | continue; |
| | | }else { |
| | | inspectionProject.setInspectionProjectCategoryId(inspectionProjectCategory.getId()); |
| | | } |
| | | if("æä¸¾å".equals(inspectionProjectImportVo.getTestValueType())){ |
| | | if(ObjectUtils.isNull(inspectionProjectImportVo.getDetectionStandard())){ |
| | | errorMessage.add("第"+(i+1)+"è¡å¯¼å
¥å¤±è´¥,åå :æ£æµæ å缺失ï¼è¯·å¡«åå¿
填项åå导å
¥;"); |
| | | errorLines++; |
| | | continue; |
| | | }else { |
| | | inspectionProject.setDetectionStandard(inspectionProjectImportVo.getDetectionStandard()); |
| | | } |
| | | } |
| | | if("æ°å¼å".equals(inspectionProjectImportVo.getTestValueType())){ |
| | | if(ObjectUtils.isNull(inspectionProjectImportVo.getSurfaceValue())){ |
| | | errorMessage.add("第"+(i+1)+"è¡å¯¼å
¥å¤±è´¥,åå :åä¹å¼ç¼ºå¤±ï¼è¯·å¡«åå¿
填项åå导å
¥;"); |
| | | errorLines++; |
| | | continue; |
| | | }else{ |
| | | inspectionProject.setSurfaceValue(inspectionProjectImportVo.getSurfaceValue()); |
| | | } |
| | | if(ObjectUtils.isNull(inspectionProjectImportVo.getUpValue())){ |
| | | errorMessage.add("第"+(i+1)+"è¡å¯¼å
¥å¤±è´¥,åå :ä¸å差缺失ï¼è¯·å¡«åå¿
填项åå导å
¥;"); |
| | | errorLines++; |
| | | continue; |
| | | }else{ |
| | | inspectionProject.setUpValue(inspectionProjectImportVo.getUpValue()); |
| | | } |
| | | if(ObjectUtils.isNull(inspectionProjectImportVo.getDownValue())){ |
| | | errorMessage.add("第"+(i+1)+"è¡å¯¼å
¥å¤±è´¥,åå :ä¸å差缺失ï¼è¯·å¡«åå¿
填项åå导å
¥;"); |
| | | errorLines++; |
| | | continue; |
| | | }else { |
| | | inspectionProject.setDownValue(inspectionProjectImportVo.getDownValue()); |
| | | } |
| | | } |
| | | if(CollectionUtils.isEmpty(sysDictItemService.lambdaQuery().eq(SysDictItem::getDictId,sysDictService.lambdaQuery().eq(SysDict::getDictCode,"inspection_method").one().getId()).eq(SysDictItem::getItemText,inspectionProjectImportVo.getInspectionMethod()).list())){ |
| | | errorMessage.add("第" + (i + 1) + "è¡å¯¼å
¥å¤±è´¥,åå :ç¹æ£æ¹æ³ä¸åå¨,请å
ç»´æ¤ç¹æ£æ¹æ³;"); |
| | | errorLines++; |
| | | continue; |
| | | }else{ |
| | | inspectionProject.setInspectionMethod(sysDictItemService.lambdaQuery().eq(SysDictItem::getDictId,sysDictService.lambdaQuery().eq(SysDict::getDictCode,"inspection_method").one().getId()).eq(SysDictItem::getItemText,inspectionProjectImportVo.getInspectionMethod()).one().getItemValue()); |
| | | } |
| | | if(ObjectUtils.isNull(unit)){ |
| | | errorMessage.add("第" + (i + 1) + "è¡å¯¼å
¥å¤±è´¥,åå :计éåä½ä¸åå¨,请å
ç»´æ¤è®¡éåä½;"); |
| | | errorLines++; |
| | | continue; |
| | | }else { |
| | | inspectionProject.setUnitId(unit.getId()); |
| | | } |
| | | List<InspectionProject> inspectionProjectList = inspectionProjectService.lambdaQuery().eq(InspectionProject::getNum,inspectionProjectImportVo.getNum()).eq(InspectionProject::getDelFlag,CommonConstant.DEL_FLAG_0).list(); |
| | | if(CollectionUtils.isEmpty(inspectionProjectList)){ |
| | | inspectionProjectService.save(inspectionProject); |
| | | successLines++; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | errorMessage.add("åçå¼å¸¸ï¼" + e.getMessage()); |
| | | log.error(e.getMessage(), e); |
| | | return (Result<?>) errorMessage; |
| | | } finally { |
| | | try { |
| | | file.getInputStream().close(); |
| | | } catch (IOException e) { |
| | | log.error(e.getMessage(), e); |
| | | } |
| | | } |
| | | } |
| | | return ImportExcelUtil.imporReturnRes(errorLines, successLines, errorMessage); |
| | | } |
| | | |
| | | } |
| | |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.entity.DailyMaintenanceOrder; |
| | | import org.jeecg.modules.eam.entity.Equipment; |
| | | import org.jeecg.modules.eam.entity.MaintenanceThreeAcceptance; |
| | | import org.jeecg.modules.eam.service.IDailyMaintenanceOrderService; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecg.modules.eam.service.IMaintenanceThreeAcceptanceService; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | |
| | | @Autowired |
| | | private IDailyMaintenanceOrderService dailyMaintenanceOrderService; |
| | | |
| | | @Autowired |
| | | private IEamEquipmentService equipmentService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = sysUser.getId(); |
| | | String maintenanceOrderId = maintenanceThreeAcceptance.getMaintenanceOrderId(); |
| | | String equipmentId = maintenanceThreeAcceptance.getEquipmentId(); |
| | | int maintenanceCycle = Integer.parseInt(maintenanceThreeAcceptance.getMaintenanceCycle()); |
| | | List<MaintenanceThreeAcceptance> maintenanceThreeAcceptances = maintenanceThreeAcceptance.getMaintenanceThreeAcceptances(); |
| | | String checkStatus = "1";//ä¸çº§ä¿å
»éªæ¶ç¶æï¼1éè¿ï¼2æªéè¿ï¼ |
| | | for (MaintenanceThreeAcceptance threeAcceptance : maintenanceThreeAcceptances) { |
| | | threeAcceptance.setMaintenanceOrderId(maintenanceOrderId); |
| | | // threeAcceptance.setId(""); |
| | | maintenanceThreeAcceptanceService.saveOrUpdate(threeAcceptance); |
| | | |
| | | String firstInspect = threeAcceptance.getFirstInspect(); |
| | | String secondInspect = threeAcceptance.getSecondInspect(); |
| | | if("2".equals(firstInspect) || "2".equals(secondInspect)){ |
| | | checkStatus = "2"; |
| | | } |
| | | |
| | | } |
| | | DailyMaintenanceOrder maintenanceOrder = dailyMaintenanceOrderService.getById(maintenanceOrderId); |
| | | maintenanceOrder.setInspectUser(sysUser.getRealname()); |
| | | maintenanceOrder.setNotPassReason(maintenanceThreeAcceptance.getNotPassReason()); |
| | | maintenanceOrder.setCheckStatus(checkStatus); |
| | | maintenanceOrder.setInspectDate(new Date()); |
| | | // maintenanceOrder.setStatus("8"); |
| | | dailyMaintenanceOrderService.updateById(maintenanceOrder); |
| | | |
| | | if("1".equals(checkStatus)){ |
| | | Equipment equipment = equipmentService.getById(equipmentId); |
| | | Date dayAfter = DateUtils.getYearAfter(new Date(), maintenanceCycle); |
| | | equipment.setNextThirdMaintenanceTime(dayAfter); |
| | | equipment.setThirdMaintenanceTime(new Date()); |
| | | equipmentService.updateById(equipment); |
| | | } |
| | | |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | |
| | | |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.eam.entity.OperationCertificateApplyDetail; |
| | | import org.jeecg.modules.eam.service.IdentityService; |
| | | import org.jeecg.modules.system.service.SysIdentityService; |
| | | import org.jeecgframework.poi.excel.ExcelImportUtil; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | |
| | | private IOperationCertificateDetailService operationCertificateDetailService; |
| | | |
| | | @Autowired |
| | | private SysIdentityService sysIdentityService; |
| | | private IdentityService identityService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | |
| | | @PostMapping(value = "/addOperationCertificate") |
| | | public Result<String> addOperationCertificate(@RequestBody List<OperationCertificateApplyDetail> operationCertificateList) { |
| | | for(OperationCertificateApplyDetail operationCertificateApplyDetail : operationCertificateList){ |
| | | if("Y".equals(operationCertificateApplyDetail.getExaminationConclusion())){ |
| | | if("pass".equals(operationCertificateApplyDetail.getExaminationConclusion())){ |
| | | Date currentDate = new Date(); |
| | | Calendar c = Calendar.getInstance(); |
| | | c.setTime(currentDate); |
| | | c.add(Calendar.YEAR, 1); |
| | | currentDate = c.getTime(); |
| | | OperationCertificate operationCertificate = new OperationCertificate(); |
| | | operationCertificate.setNum(sysIdentityService.getNumByTypeAndLength("OperationCertificate", 4)); |
| | | operationCertificate.setNum(identityService.getNumByTypeAndLength("OperationCertificate", 4)); |
| | | operationCertificate.setUserId(operationCertificateApplyDetail.getUserId()); |
| | | operationCertificate.setEquipmentIds(operationCertificateApplyDetail.getEquipmentIds()); |
| | | operationCertificate.setCurrentCycleScore(12); |
| | |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.eam.entity.*; |
| | | import org.jeecg.modules.eam.service.IDailyMaintenanceOrderService; |
| | | import org.jeecg.modules.eam.service.IPrecisionInspectionDetailService; |
| | | import org.jeecg.modules.eam.service.IPrecisionInspectionService; |
| | | import org.jeecg.modules.eam.service.IPrecisionParametersService; |
| | | import org.jeecg.modules.eam.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | |
| | | |
| | | @Autowired |
| | | private IPrecisionParametersService precisionParametersService; |
| | | |
| | | @Autowired |
| | | private IEamEquipmentService equipmentService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | |
| | | |
| | | PrecisionInspection preInspection = precisionInspectionService.getById(precisionInspection.getId()); |
| | | DailyMaintenanceOrder maintenanceOrder = dailyMaintenanceOrderService.getById(preInspection.getMaintenanceOrderId()); |
| | | Equipment equipment = equipmentService.getById(maintenanceOrder.getEquipmentId()); |
| | | String precisionInspectionStatus = maintenanceOrder.getPrecisionInspectionStatus(); |
| | | |
| | | if ("0".equals(precisionInspectionStatus)){ |
| | |
| | | |
| | | maintenanceOrder.setPrecisionInspectionStatus("5"); |
| | | // maintenanceOrder.setStatus("8"); |
| | | //æ´æ°è®¾å¤ææ¯ç¶æ |
| | | equipment.setTechnologyStatus(precisionInspection.getJudgmentResult()); |
| | | } |
| | | |
| | | preInspection.setRemark(precisionInspection.getRemark()); |
| | | dailyMaintenanceOrderService.updateById(maintenanceOrder); |
| | | precisionInspectionService.updateById(preInspection); |
| | | |
| | | equipmentService.updateById(equipment); |
| | | return Result.OK("å®¡æ¹æå!"); |
| | | } |
| | | |
| | |
| | | @Autowired |
| | | @Lazy |
| | | private IProjectMaintenanceOrderService projectMaintenanceOrderService; |
| | | @Autowired |
| | | @Lazy |
| | | private IdentityService sysIdentityService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PutMapping(value = "/start") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result<?> orderStart(@RequestBody RepairOrder repairOrder){ |
| | | if(StringUtils.isNotBlank(repairOrder.getReportRepairId())){ |
| | | EquipmentReportRepair equipmentReportRepair = equipmentReportRepairService.getById(repairOrder.getReportRepairId()); |
| | | equipmentReportRepair.setStatus("3"); |
| | | equipmentReportRepairService.updateById(equipmentReportRepair); |
| | | if(StringUtils.isNotBlank(equipmentReportRepair.getEquipmentId())){ |
| | | Equipment equipment = equipmentService.getById(equipmentReportRepair.getEquipmentId()); |
| | | equipment.setEquipmentStatus("7"); |
| | | equipmentService.updateById(equipment); |
| | | } |
| | | } |
| | | if(StringUtils.isNotBlank(repairOrder.getProjectMaintenanceOrderId())){ |
| | | //å¤æé¡¹ç®æ§ç»´ä¿®åè¡¨ç¶æ |
| | | ProjectMaintenanceOrderDetail projectMaintenanceOrderDetail = projectMaintenanceOrderDetailService.getById(repairOrder.getProjectMaintenanceOrderId()); |
| | |
| | | } |
| | | return Result.OK(repairOrderService.update(new UpdateWrapper<RepairOrder>().set("status",7).eq("id",repairOrder.getId()))); |
| | | } |
| | | |
| | | @PostMapping("addBySelectReport") |
| | | public Result<?> addBySelectReport(@RequestBody List<EquipmentReportRepair> equipmentReportRepairs){ |
| | | LoginUser user= (LoginUser)SecurityUtils.getSubject().getPrincipal(); |
| | | for(EquipmentReportRepair equipmentReportRepair:equipmentReportRepairs){ |
| | | String num = sysIdentityService.getNumByTypeAndLength("RepairOrder",4); |
| | | Equipment equipment = equipmentService.getById(equipmentReportRepair.getEquipmentId()); |
| | | equipmentReportRepair.setStatus("2"); |
| | | RepairOrder repairOrder = new RepairOrder(); |
| | | repairOrder.setNum(num); |
| | | repairOrder.setReportRepairId(equipmentReportRepair.getId()); |
| | | repairOrder.setStatus("2"); |
| | | repairOrder.setEquipmentId(equipment.getId()); |
| | | repairOrder.setTeamId(equipment.getTeamId()); |
| | | repairOrder.setDepartId(equipment.getUseId()); |
| | | repairOrder.setFaultDescription(equipmentReportRepair.getFaultDescription()); |
| | | repairOrder.setFaultTime(equipmentReportRepair.getFaultTime()); |
| | | repairOrder.setResponsibilityId(user.getId()); |
| | | repairOrder.setRepairOrderType(0); |
| | | repairOrder.setDelFlag(0); |
| | | repairOrderService.save(repairOrder); |
| | | } |
| | | equipmentReportRepairService.updateBatchById(equipmentReportRepairs); |
| | | return Result.OK("é¢åæå"); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Excel(name = "æ£å®ç»æ", width = 15) |
| | | @ApiModelProperty(value = "æ£å®ç»æ") |
| | | @Dict(dicCode = "technology_status") |
| | | private String calibrationResult; |
| | | /** |
| | | * æ£å®ç»ææè¿° |
| | |
| | | @ApiModelProperty(value = "3ä¿éªæ¶åæ£æ¥æ¶é´") |
| | | private Date inspectDate; |
| | | |
| | | @ApiModelProperty(value = "3ä¿éªæ¶æªéè¿åå ") |
| | | private String notPassReason; |
| | | |
| | | @ApiModelProperty(value = "ä¸çº§ä¿å
»éªæ¶ç¶æï¼1éè¿ï¼2æªéè¿ï¼") |
| | | private String checkStatus; |
| | | |
| | | @TableField(exist = false) |
| | | private List<DailyMaintenanceOrderDetail> dailyMaintenanceOrderDetails; |
| | | } |
| | |
| | | @Dict(dicCode = "id",dictTable = "mom_eam_precision_parameters_template",dicText = "name") |
| | | private String precisionParametersTemplateId; |
| | | |
| | | @ApiModelProperty(value = "ææ¯ç¶æé´å®ç±»åï¼åå
¸technology_status_verification_typeï¼") |
| | | @Dict(dicCode = "technology_status_verification_type") |
| | | private String technologyStatusVerificationType; |
| | | |
| | | @ApiModelProperty(value = "ææ¯ç¶æé´å®åæ®") |
| | | private String technologyStatusVerificationBill; |
| | | |
| | | @TableField(exist = false) |
| | | private String processParametersTemplateName; |
| | | |
| | |
| | | private List<EquipmentProcessParameters> processEditTableList; |
| | | @TableField(exist = false) |
| | | private List<EquipmentPrecisionParameters> precisionEditTableList; |
| | | @Dict(dicCode = "id",dictTable = "mom_base_factory_model",dicText = "name") |
| | | @Excel(width = 15,dicCode = "id",dictTable = "mom_base_factory_model",dicText = "name",orderNum = "39", name = "车é´") |
| | | @Dict(dicCode = "id",dictTable = "mom_base_area",dicText = "name") |
| | | @Excel(width = 15,dicCode = "id",dictTable = "mom_base_area",dicText = "name",orderNum = "39", name = "å·¥åº") |
| | | private String factoryModelId; |
| | | @Excel(width = 15,dicCode = "id",dictTable = "mom_base_work_center",dicText = "name",name = "产线",orderNum = "40") |
| | | @Dict(dicCode = "id",dictTable = "mom_base_work_center",dicText = "name") |
| | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class EquipmentImportVo { |
| | | @Excel(name = "è®¾å¤æå±åç±»") |
| | | private String equipmentCategoryName; |
| | | |
| | | @Excel(name="ç»ä¸ç¼ç ") |
| | | private String num; |
| | | |
| | | @Excel(name = "设å¤åç§°") |
| | | private String name; |
| | | |
| | | @Excel(name = "使ç¨é¨é¨",dictTable = "sys_depart",dicCode = "id",dicText = "depart_name") |
| | | @Excel(name = "åå·") |
| | | private String model; |
| | | |
| | | // @Excel(name = "使ç¨é¨é¨",dictTable = "sys_depart",dicCode = "id",dicText = "depart_name") |
| | | private String useId; |
| | | |
| | | @Excel(name = "å·¥åº") |
| | | private String equipmentUda1; |
| | | // @Excel(name = "å·¥åº",dicCode = "id",dictTable = "mom_base_area",dicText = "name") |
| | | private String factoryModelId; |
| | | |
| | | @Excel(name = "ç»´æ¤é¨é¨",dictTable = "sys_depart",dicCode = "id",dicText = "depart_name") |
| | | // @Excel(name = "ç»´æ¤é¨é¨",dictTable = "sys_depart",dicCode = "id",dicText = "depart_name") |
| | | private String manageId; |
| | | |
| | | @Excel(name = "ç»´ä¿®çç»",dictTable = "mom_base_team",dicCode = "id",dicText = "name") |
| | | // @Excel(name = "ç»´ä¿®çç»",dictTable = "mom_base_team",dicCode = "id"2,dicText = "name") |
| | | private String teamId; |
| | | |
| | | @Excel(name = "ABCæ è¯",dicCode = "id",dictTable="mom_eam_equipment_importance",dicText="name") |
| | | // @Excel(name = "èµäº§å¶é å",dicCode = "id",dictTable="mom_base_constructor",dicText="name") |
| | | private String constructorId; |
| | | |
| | | @Excel(name = "ABCæ è¯",dicCode = "ABC-standard-result") |
| | | private String equipmentImportanceId; |
| | | |
| | | @Excel(name = "è®¾å¤æå±åç±»") |
| | | private String equipmentCategoryName; |
| | | @Excel(name = "设å¤ç¶æ",dicCode = "equipment_status") |
| | | private String equipmentStatus; |
| | | |
| | | @Excel(name = "å
³é®è®¾å¤æ è¯") |
| | | @Excel(name = "ææ¯ç¶æ",dicCode = "technology_status") |
| | | private String technologyStatus; |
| | | |
| | | @Excel(name = "å
³é®è®¾å¤æ è¯",dicCode = "specific_equipment") |
| | | private String keyEquipmentIdentification; |
| | | |
| | | @Excel(name = "å®å
¨é
ç½®") |
| | | private String securityConfiguration; |
| | | @Excel(name = "èµäº§ç¶æ",dicCode = "property_status") |
| | | private String propertyStatus; |
| | | |
| | | @Excel(name = "å·å´ç³»ç»") |
| | | @Excel(name = "å·å´ç³»ç»",dicCode = "cooling_system") |
| | | private String coolingSystem; |
| | | |
| | | @Excel(name = "çç«å¨") |
| | |
| | | |
| | | @Excel(name = "çç«å¨æææ") |
| | | private String fireExtinguisherValidityPeriod; |
| | | |
| | | @Excel(name = "æä½ç³»ç»") |
| | | private String operatingSystem; |
| | | |
| | | @Excel(name = "ç³»ç»") |
| | | private String system; |
| | |
| | | |
| | | @Excel(name = "åæ æ°é") |
| | | private BigDecimal coordinateNum; |
| | | |
| | | @Excel(name = "设å¤ç¶æ",dicCode = "equipment_status") |
| | | private String equipmentStatus; |
| | | |
| | | @Excel(name = "éé") |
| | | private String equipmentUda3; |
| | |
| | | @Excel(name = "åºåç¼å·") |
| | | private String factoryNumber; |
| | | |
| | | @Excel(name = "èµäº§å¶é å",dicCode = "id",dictTable="mom_base_constructor",dicText="name") |
| | | private String constructorId; |
| | | |
| | | @Excel(name = "èµäº§çæ¥æºå½å®¶") |
| | | private String sourceCountry; |
| | | |
| | | @Excel(name = "åå·") |
| | | private String model; |
| | | @Excel(name = "å®å
¨é
ç½®") |
| | | private String securityConfiguration; |
| | | |
| | | @Excel(name = "è§æ ¼") |
| | | private String specification; |
| | |
| | | @Excel(name = "æ»åç") |
| | | private String gpo; |
| | | |
| | | @Excel(name = "ææ¯ç¶æ",dicCode = "technology_status") |
| | | private String technologyStatus; |
| | | |
| | | @Excel(dicCode = "id",dictTable = "mom_base_factory_model",dicText = "name", name = "车é´") |
| | | private String factoryModelId; |
| | | |
| | | @Excel(dicCode = "id",dictTable = "mom_base_work_center",dicText = "name",name = "产线") |
| | | private String workCenterId; |
| | | |
| | | @Excel(name = "è´¨ä¿å¼å§æ¥æ",format = "yyyyMMdd") |
| | | private Date warrantyStart; |
| | | |
| | | @Excel(name = "è´¨ä¿ç»ææ¥æ",format = "yyyyMMdd") |
| | | private Date warrantyEnd; |
| | | |
| | | @Excel(dicCode = "property_status",name = "èµäº§ç¶æ") |
| | | private String propertyStatus; |
| | | |
| | | @Excel(name = "䏿¬¡ææ¯ç¶æé´å®æ¶é´", width = 20, format = "yyyyMMdd") |
| | | private Date nextTechnologyStatusQualificationTime; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.entity.JeecgEntity; |
| | | import org.jeecg.common.system.base.entity.SysUpload; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | |
| | | import java.io.Serializable; |
| | |
| | | * æ
éæ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "æ
éæ¶é´") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date faultTime; |
| | | /** |
| | | * æ¯å¦åæº |
| | |
| | | */ |
| | | @TableField(exist = false) |
| | | private List<SysUpload> sysUploadList; |
| | | |
| | | @TableField(exist = false) |
| | | private String teamId; |
| | | } |
| | |
| | | /**ç¹æ£é¡¹ç®id*/ |
| | | @Excel(name = "ç¹æ£é¡¹ç®id", width = 15) |
| | | @ApiModelProperty(value = "ç¹æ£é¡¹ç®id") |
| | | @Dict(dictTable = "mom_eam_inspection_project", dicCode = "id", dicText = "num") |
| | | @Dict(dictTable = "mom_eam_inspection_project", dicCode = "id", dicText = "name") |
| | | private String inspectionProjectId; |
| | | /**åºå·*/ |
| | | @Excel(name = "åºå·", width = 15) |
| | |
| | | /**3ä¿å·¥åid*/ |
| | | @Excel(name = "3ä¿å·¥åid", width = 15) |
| | | @ApiModelProperty(value = "3ä¿å·¥åid") |
| | | private java.lang.String maintenanceOrderId; |
| | | private java.lang.String maintenanceOrderDetailId; |
| | | /**ä¿å
»é¨ä½*/ |
| | | @Excel(name = "ä¿å
»é¨ä½", width = 15) |
| | | @ApiModelProperty(value = "ä¿å
»é¨ä½") |
| | |
| | | |
| | | @TableField(exist = false) |
| | | private List<MaintenanceThreeAcceptance> maintenanceThreeAcceptances; |
| | | |
| | | @TableField(exist = false) |
| | | private String maintenanceOrderId; |
| | | |
| | | @TableField(exist = false) |
| | | private String notPassReason; |
| | | |
| | | @TableField(exist = false) |
| | | private String maintenanceCycle; |
| | | |
| | | @TableField(exist = false) |
| | | private String equipmentId; |
| | | } |
| | |
| | | @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id") |
| | | @ApiModelProperty(value = "ç³è¯·äºº") |
| | | private String applicant; |
| | | /**åç人*/ |
| | | @Excel(name = "åç人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "id") |
| | | @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id") |
| | | @ApiModelProperty(value = "åç人") |
| | | private String handlePerson; |
| | | /**å®¡æ ¸ç¶æ*/ |
| | | @Excel(name = "å®¡æ ¸ç¶æ", width = 15, dicCode = "certificate_apply_status") |
| | | @Dict(dicCode = "certificate_apply_status") |
| | |
| | | package org.jeecg.modules.eam.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | |
| | | @Excel(name = "屿§å段5", width = 15) |
| | | @ApiModelProperty(value = "屿§å段5") |
| | | private String uda5; |
| | | |
| | | |
| | | @ApiModelProperty(value = "æ£é¤åæ°") |
| | | @TableField(exist = false) |
| | | private Integer deductionScore; |
| | | |
| | | @ApiModelProperty(value = "æ£å项å
容") |
| | | @TableField(exist = false) |
| | | private String deductionScoreName; |
| | | |
| | | @ApiModelProperty(value = "æ£å设å¤") |
| | | @TableField(exist = false) |
| | | private String equipmentName; |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | List<RepairOrderDetail> orderDetails; |
| | | |
| | | @TableField(exist = false) |
| | | private String factoryModelId; |
| | | @TableField(exist = false) |
| | | private String equipmentCategoryId; |
| | | @TableField(exist = false) |
| | | private String userId; |
| | | |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.eam.entity; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | |
| | | import org.jeecg.modules.eam.vo.UsetTeamVo; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: å®é
å·¥æ¶ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2023-04-25 |
| | | * @Date: 2023-04-25 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("mom_eam_repair_order_actual_work_hours") |
| | | @ApiModel(value="mom_eam_repair_order_actual_work_hours对象", description="å®é
å·¥æ¶") |
| | | @ApiModel(value = "mom_eam_repair_order_actual_work_hours对象", description = "å®é
å·¥æ¶") |
| | | @Accessors(chain = true) |
| | | public class RepairOrderActualWorkHours implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /**主é®id*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | /** |
| | | * 主é®id |
| | | */ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主é®id") |
| | | private String id; |
| | | /**ç¨æ·id*/ |
| | | @Excel(name = "ç¨æ·id", width = 15) |
| | | /** |
| | | * ç¨æ·id |
| | | */ |
| | | @Excel(name = "ç¨æ·id", width = 15) |
| | | @ApiModelProperty(value = "ç¨æ·id") |
| | | @Dict(dictTable = "sys_user",dicCode = "id",dicText = "realname") |
| | | @Dict(dictTable = "sys_user", dicCode = "id", dicText = "realname") |
| | | private String userId; |
| | | /**维修工åid*/ |
| | | /** |
| | | * 维修工åid |
| | | */ |
| | | @ApiModelProperty(value = "维修工åid") |
| | | private String repairOrderId; |
| | | /**ä¿®åæ±æ¥åid*/ |
| | | /** |
| | | * ä¿®åæ±æ¥åid |
| | | */ |
| | | @ApiModelProperty(value = "ä¿®åæ±æ¥åid") |
| | | private String reportAfterRepairId; |
| | | /**çç»id*/ |
| | | @Excel(name = "çç»id", width = 15) |
| | | /** |
| | | * çç»id |
| | | */ |
| | | @Excel(name = "çç»id", width = 15) |
| | | @ApiModelProperty(value = "çç»id") |
| | | @Dict(dictTable = "mom_base_team",dicCode = "id",dicText = "name") |
| | | @Dict(dictTable = "mom_base_team", dicCode = "id", dicText = "name") |
| | | private String teamId; |
| | | /**å®é
å·¥æ¶*/ |
| | | @Excel(name = "å®é
å·¥æ¶", width = 15) |
| | | |
| | | @Excel(name = "çç»id", width = 15) |
| | | @ApiModelProperty(value = "çç»id") |
| | | @Dict(dicCode = "yn") |
| | | private String principalContractor; |
| | | /** |
| | | * å®é
å·¥æ¶ |
| | | */ |
| | | @Excel(name = "å®é
å·¥æ¶", width = 15) |
| | | @ApiModelProperty(value = "å®é
å·¥æ¶") |
| | | private java.math.BigDecimal actualHour; |
| | | |
| | | @ApiModelProperty(value = "å¼å§æ¶é´") |
| | | @Excel(name = "å¼å§æ¶é´", width = 20, format = "yyyy-MM-dd HH:mm") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") |
| | | private java.util.Date startTime; |
| | | |
| | | @ApiModelProperty(value = "ç»ææ¶é´") |
| | | @Excel(name = "ç»ææ¶é´", width = 20, format = "yyyy-MM-dd HH:mm") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") |
| | | private java.util.Date endTime; |
| | | |
| | | /** |
| | | * å®é
å·¥æ¶ |
| | | */ |
| | | @Excel(name = "ç论工æ¶", width = 15) |
| | | @ApiModelProperty(value = "ç论工æ¶") |
| | | private String theoreticalTime; |
| | | |
| | | /** |
| | | * å建人 |
| | | */ |
| | |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private java.util.Date updateTime; |
| | | /**ç§æ·id*/ |
| | | @Excel(name = "ç§æ·id", width = 15) |
| | | /** |
| | | * ç§æ·id |
| | | */ |
| | | @Excel(name = "ç§æ·id", width = 15) |
| | | @ApiModelProperty(value = "ç§æ·id") |
| | | private String tenantId; |
| | | /**å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)*/ |
| | | @Excel(name = "å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)", width = 15) |
| | | /** |
| | | * å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤) |
| | | */ |
| | | @Excel(name = "å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)", width = 15) |
| | | @ApiModelProperty(value = "å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)") |
| | | private Integer delFlag= CommonConstant.DEL_FLAG_0; |
| | | /**夿³¨*/ |
| | | @Excel(name = "夿³¨", width = 15) |
| | | private Integer delFlag = CommonConstant.DEL_FLAG_0; |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @Excel(name = "夿³¨", width = 15) |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | /**å¤ç¨å段1*/ |
| | | @Excel(name = "å¤ç¨å段1", width = 15) |
| | | /** |
| | | * å¤ç¨å段1 |
| | | */ |
| | | @Excel(name = "å¤ç¨å段1", width = 15) |
| | | @ApiModelProperty(value = "å¤ç¨å段1") |
| | | private String repairOrderActualHoursUda1; |
| | | /**å¤ç¨å段2*/ |
| | | @Excel(name = "å¤ç¨å段2", width = 15) |
| | | /** |
| | | * å¤ç¨å段2 |
| | | */ |
| | | @Excel(name = "å¤ç¨å段2", width = 15) |
| | | @ApiModelProperty(value = "å¤ç¨å段2") |
| | | private String repairOrderActualHoursUda2; |
| | | /**å¤ç¨å段3*/ |
| | | @Excel(name = "å¤ç¨å段3", width = 15) |
| | | /** |
| | | * å¤ç¨å段3 |
| | | */ |
| | | @Excel(name = "å¤ç¨å段3", width = 15) |
| | | @ApiModelProperty(value = "å¤ç¨å段3") |
| | | private String repairOrderActualHoursUda3; |
| | | /**å¤ç¨å段4*/ |
| | | @Excel(name = "å¤ç¨å段4", width = 15) |
| | | /** |
| | | * å¤ç¨å段4 |
| | | */ |
| | | @Excel(name = "å¤ç¨å段4", width = 15) |
| | | @ApiModelProperty(value = "å¤ç¨å段4") |
| | | private String repairOrderActualHoursUda4; |
| | | /**å¤ç¨å段5*/ |
| | | @Excel(name = "å¤ç¨å段5", width = 15) |
| | | /** |
| | | * å¤ç¨å段5 |
| | | */ |
| | | @Excel(name = "å¤ç¨å段5", width = 15) |
| | | @ApiModelProperty(value = "å¤ç¨å段5") |
| | | private String repairOrderActualHoursUda5; |
| | | /**ç¶æ 0 ç¦ç¨ 1 å¯ç¨*/ |
| | | @Excel(name = "ç¶æ 0 ç¦ç¨ 1 å¯ç¨", width = 15) |
| | | /** |
| | | * ç¶æ 0 ç¦ç¨ 1 å¯ç¨ |
| | | */ |
| | | @Excel(name = "ç¶æ 0 ç¦ç¨ 1 å¯ç¨", width = 15) |
| | | @ApiModelProperty(value = "ç¶æ 0 ç¦ç¨ 1 å¯ç¨") |
| | | private String status; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.job; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import org.jeecg.common.api.dto.message.MessageDTO; |
| | | import org.jeecg.common.system.api.ISysBaseAPI; |
| | | import org.jeecg.modules.eam.entity.Equipment; |
| | | import org.jeecg.modules.eam.entity.EquipmentReportRepair; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecg.modules.eam.service.IEquipmentReportRepairService; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanWarnService; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.quartz.Job; |
| | | import org.quartz.JobExecutionContext; |
| | | import org.quartz.JobExecutionException; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æè½é |
| | | */ |
| | | public class RepairOrderWarning implements Job { |
| | | @Resource |
| | | private IEquipmentReportRepairService equipmentReportRepairService; |
| | | |
| | | @Resource |
| | | private IEamEquipmentService equipmentService; |
| | | |
| | | @Resource |
| | | private ISysBaseAPI sysBaseAPI; |
| | | |
| | | @Resource |
| | | private ISysUserService sysUserService; |
| | | |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext context) throws JobExecutionException { |
| | | LocalDateTime currentDateTime = LocalDateTime.now(); |
| | | LocalDateTime dateBefore3Days = currentDateTime.minusDays(3); |
| | | LocalDateTime dateBefore1Days = currentDateTime.minusDays(1); |
| | | Date result3 = Date.from(dateBefore3Days.atZone(ZoneId.systemDefault()).toInstant()); |
| | | Date result1= Date.from(dateBefore1Days.atZone(ZoneId.systemDefault()).toInstant()); |
| | | List<EquipmentReportRepair> equipmentReportRepairs1 = equipmentReportRepairService.list(new QueryWrapper<EquipmentReportRepair>().lt("fault_time",result1).eq("status","1")); |
| | | List<EquipmentReportRepair> equipmentReportRepairs3 = equipmentReportRepairService.list(new QueryWrapper<EquipmentReportRepair>().lt("fault_time",result3).eq("status","1")); |
| | | for(EquipmentReportRepair equipmentReportRepair1:equipmentReportRepairs1){ |
| | | Equipment equipment1 = equipmentService.getById(equipmentReportRepair1.getEquipmentId()); |
| | | if(StringUtils.isNotBlank(equipment1.getSpecificEquipment())){ |
| | | String teamId = equipment1.getTeamId(); |
| | | if(StringUtils.isNotBlank(teamId)){ |
| | | List<SysUser> sysUsers = sysUserService.list(new QueryWrapper<SysUser>() |
| | | .eq("team_id",teamId) |
| | | .eq("del_flag",0)); |
| | | for(SysUser user:sysUsers){ |
| | | String msg = "ç»ä¸ç¼å·ä¸ºã"+equipment1.getNum()+"ãç设å¤å·²ç»è¶
è¿ä¸å¤©æªç»´ä¿®ï¼è¯·ç§»æ¥è³æ
éæ¥ä¿®æ¥ç"; |
| | | MessageDTO messageDTO = new MessageDTO(); |
| | | messageDTO.setTitle("æ
éæ¥ä¿®æé"); |
| | | messageDTO.setContent(msg); |
| | | messageDTO.setCategory("æ
éæ¥ä¿®æé"); |
| | | messageDTO.setFromUser("æ
éæ¥ä¿®æéå°å©æ"); |
| | | messageDTO.setToUser(user.getUsername()); |
| | | sysBaseAPI.sendSysAnnouncement(messageDTO); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | for(EquipmentReportRepair equipmentReportRepair3:equipmentReportRepairs3){ |
| | | Equipment equipment3 = equipmentService.getById(equipmentReportRepair3.getEquipmentId()); |
| | | if(StringUtils.isNotBlank(equipment3.getSpecificEquipment())){ |
| | | String teamId = equipment3.getTeamId(); |
| | | if(StringUtils.isNotBlank(teamId)){ |
| | | List<SysUser> sysUsers = sysUserService.list(new QueryWrapper<SysUser>() |
| | | .eq("team_id",teamId) |
| | | .eq("del_flag",0)); |
| | | for(SysUser user:sysUsers){ |
| | | String msg = "ç»ä¸ç¼å·ä¸ºã"+equipment3.getNum()+"ãç设å¤å·²ç»è¶
è¿ä¸å¤©æªç»´ä¿®ï¼è¯·ç§»æ¥è³æ
éæ¥ä¿®æ¥ç"; |
| | | MessageDTO messageDTO = new MessageDTO(); |
| | | messageDTO.setTitle("æ
éæ¥ä¿®æé"); |
| | | messageDTO.setContent(msg); |
| | | messageDTO.setCategory("æ
éæ¥ä¿®æé"); |
| | | messageDTO.setFromUser("æ
éæ¥ä¿®æéå°å©æ"); |
| | | messageDTO.setToUser(user.getUsername()); |
| | | sysBaseAPI.sendSysAnnouncement(messageDTO); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.job; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.hibernate.annotations.Source; |
| | | import org.jeecg.common.api.dto.message.MessageDTO; |
| | | import org.jeecg.common.system.api.ISysBaseAPI; |
| | | import org.jeecg.common.system.vo.DictModel; |
| | | import org.jeecg.modules.eam.entity.Equipment; |
| | | import org.jeecg.modules.eam.entity.EquipmentReportRepair; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecg.modules.system.entity.*; |
| | | import org.jeecg.modules.system.service.*; |
| | | import org.quartz.Job; |
| | | import org.quartz.JobExecutionContext; |
| | | import org.quartz.JobExecutionException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public class ThirdMaintenaceAlart implements Job { |
| | | |
| | | @Resource |
| | | private IEamEquipmentService equipmentService; |
| | | @Resource |
| | | private ISysBaseAPI sysBaseApi; |
| | | @Resource |
| | | private ISysRoleService sysRoleService; |
| | | @Resource |
| | | private ISysDictService sysDictService; |
| | | @Resource |
| | | private ISysDictItemService sysDictItemService; |
| | | @Resource |
| | | private ISysUserRoleService sysUserRoleService; |
| | | @Resource |
| | | private ISysUserService sysUserService; |
| | | @Override |
| | | public void execute(JobExecutionContext context) throws JobExecutionException { |
| | | LocalDateTime currentDateTime = LocalDateTime.now(); |
| | | LocalDateTime dateBefore2Months = currentDateTime.plusMonths(2); |
| | | Date result = Date.from(dateBefore2Months.atZone(ZoneId.systemDefault()).toInstant()); |
| | | List<Equipment> needAlerts = equipmentService.list(new QueryWrapper<Equipment>().lt("next_third_maintenance_time",result).eq("property_status","normal").eq("del_flag",0)); |
| | | SysDict sysDict = sysDictService.getOne(new QueryWrapper<SysDict>().eq("dict_code","info_type"),false); |
| | | SysDictItem sysDictItem = sysDictItemService.getOne(new QueryWrapper<SysDictItem>().eq("item_text","ä¸ä¿æ¶æ¯").eq("dict_id",sysDict.getId()),false); |
| | | String roleCode = sysDictItem.getItemValue(); |
| | | SysRole sysRole = sysRoleService.getOne(new QueryWrapper<SysRole>().eq("role_code",roleCode),false); |
| | | List<SysUserRole> sysUserRoles = sysUserRoleService.list(new QueryWrapper<SysUserRole>().eq("role_id",sysRole.getId())); |
| | | for(SysUserRole sysUserRole:sysUserRoles){ |
| | | SysUser sysUser = sysUserService.getById(sysUserRole.getUserId()); |
| | | String title = "设å¤ä¸æ¬¡ä¸ä¿å°ææé!"; |
| | | String msg = "ç»ä¸ç¼ç 为ï¼"; |
| | | for(Equipment equipment:needAlerts){ |
| | | msg = msg+"ã"+equipment.getNum()+"ã"; |
| | | } |
| | | msg = msg+"ç设å¤ç¦»ä¸æ¬¡ä¸ä¿çæ¥æä¸è¶³ä¸¤ä¸ªæï¼è¯·åæ¶å¤ç"; |
| | | MessageDTO messageDTO = new MessageDTO(); |
| | | messageDTO.setTitle(title); |
| | | messageDTO.setContent(msg); |
| | | messageDTO.setCategory("ä¸ä¿æ¶æ¯"); |
| | | messageDTO.setFromUser("admin"); |
| | | messageDTO.setToUser(sysUser.getUsername()); |
| | | if(needAlerts.size()!=0){ |
| | | sysBaseApi.sendSysAnnouncement(messageDTO); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | @Param("equipmentNum") String equipmentNum, |
| | | @Param("equipmentName") String equipmentName, |
| | | @Param("status") String status, |
| | | @Param("repairOrderType") Integer repairOrderType |
| | | @Param("repairOrderType") Integer repairOrderType, |
| | | @Param("equipmentCategoryId") String equipmentCategoryId, |
| | | @Param("factoryModelId") String factoryModelId, |
| | | @Param("specificEquipment") String specificEquipment, |
| | | @Param("teamId") String teamId |
| | | ); |
| | | |
| | | IPage<Map<String, Object>> getUserTeam(IPage<Map> pageData, @Param("realname") String realname); |
| | |
| | | left join mom_sys_upload_rela t4 on t4.bus_id = t1.id |
| | | LEFT JOIN mom_sys_upload t2 ON t4.upload_id = t2.id |
| | | LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'common_upload_type' ) t3 ON t3.item_value = t2.type |
| | | LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'judgment_result' ) t5 ON t5.item_value = t1.judgment_result |
| | | LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'technology_status' ) t5 ON t5.item_value = t1.judgment_result |
| | | WHERE t1.del_flag = 0 |
| | | <if test="params.calibrationOrderId != null and params.calibrationOrderId != ''"> |
| | | and t1.calibration_order_id = #{params.calibrationOrderId} |
| | |
| | | t3.maintenance_require as maintenanceRequire, |
| | | concat(t6.code, '/', t6.name) as maintenanceCycleName, |
| | | t5.name as maintenanceSpecialtyName, |
| | | t1.maintenance_order_detail_uda1 as maintenanceOrderDetailUda1 |
| | | t1.maintenance_order_detail_uda1 as maintenanceOrderDetailUda1, |
| | | t1.maintenance_order_detail_uda2 as maintenanceOrderDetailUda2 |
| | | FROM |
| | | mom_eam_daily_maintenance_order_detail t1 |
| | | LEFT JOIN mom_eam_maintenance_standard_detail t2 ON t1.maintenance_standard_detail_id = t2.id |
| | |
| | | t1.photo, |
| | | t1.maintenance_project_id as maintenanceProjectId, |
| | | t3.num as maintenanceProjectNum, |
| | | t3.name as maintenanceProjectName, |
| | | t3.standard, |
| | | t4.item_text as maintenanceMethod, |
| | | t3.maintenance_tool as maintenanceTool |
| | |
| | | t1.status, |
| | | t5.item_text as statusName, |
| | | t1.num, |
| | | t1.num as technologyStatusVerificationBill, |
| | | t4.id as maintenanceCycleId, |
| | | t4.maintenance_type as maintenanceType, |
| | | t10.item_text as maintenanceTypeName, |
| | | t4.cycle as maintenanceCycle, |
| | | concat(t4.code, '/', t4.name) as maintenanceCycleName, |
| | | t3.id as equipmentId, |
| | | t3.num as equipmentNum, |
| | |
| | | t1.precision_inspection_status as precisionInspectionStatus, |
| | | t1.stove_exempt_status as stoveExemptStatus, |
| | | t1.inspect_user as inspectUser, |
| | | t1.inspect_date as inspectDate |
| | | t1.inspect_date as inspectDate, |
| | | t12.item_text as checkStatusName, |
| | | t1.not_pass_reason as notPassReason |
| | | FROM |
| | | mom_eam_daily_maintenance_order t1 |
| | | LEFT JOIN mom_eam_maintenance_standard t2 ON t1.maintenance_standard_id = t2.id |
| | |
| | | left join sys_user t8 on t1.maintenance_user_id = t8.id |
| | | left join ( SELECT * FROM v_sys_dict WHERE dict_code = 'assign_mode' ) t9 on t9.item_value = t2.assign_mode |
| | | left join (SELECT * FROM v_sys_dict WHERE dict_code = 'maintenance_type') t10 on t10.item_value = t4.maintenance_type |
| | | left join (SELECT * FROM v_sys_dict WHERE dict_code = 'check_status') t12 on t12.item_value = t1.check_status |
| | | WHERE t1.del_flag = 0 and t2.del_flag = 0 and t3.del_flag = 0 and t4.del_flag = 0 and t4.maintenance_type =#{params.maintenanceType} |
| | | <if test="params.num != null and params.num != ''"> |
| | | and t1.num like concat('%',#{params.num},'%') |
| | |
| | | t1.location, |
| | | t1.photo, |
| | | t1.maintenance_project_id AS maintenanceProjectId, |
| | | case t1.maintenance_role when 'operator' then 'æä½äººåä¿å
Ȍ
容' else '维修人åä¿å
Ȍ
容' end as maintenanceRole, |
| | | t3.num AS maintenanceProjectNum, |
| | | t3.name as maintenanceProjectName, |
| | | t3.standard, |
| | | t4.item_text AS maintenanceMethod, |
| | | t3.maintenance_tool AS maintenanceTool, |
| | | t3.working_hour_quota AS workingHourQuota |
| | | t3.working_hour_quota AS workingHourQuota, |
| | | tt.maintenance_order_detail_uda1 as maintenanceOrderDetailUda1, |
| | | tt.maintenance_order_detail_uda2 as maintenanceOrderDetailUda2 |
| | | FROM |
| | | mom_eam_daily_maintenance_order_detail tt |
| | | LEFT JOIN mom_eam_maintenance_standard_detail t1 ON tt.maintenance_standard_detail_id = t1.id |
| | |
| | | t1.property_status propertyStatus, |
| | | t1.check_period checkPeriod, |
| | | t1.next_technology_status_qualification_time nextTechnologyStatusQualificationTime, |
| | | t1.technology_status_qualification_time technologyStatusQualificationTime |
| | | t1.technology_status_qualification_time technologyStatusQualificationTime, |
| | | t1.technology_status_verification_type technologyStatusVerificationType |
| | | from mom_eam_equipment t1 |
| | | left join (select * from mom_eam_equipment_category where del_flag = 0) t2 on t1.equipment_category_id = t2.id |
| | | where t1.del_flag = 0 |
| | |
| | | t2.num equipmentNum, |
| | | t2.name equipmentName, |
| | | t2.model equipmentModel, |
| | | t2.team_id teamId, |
| | | t2.specification equipmentSpecification, |
| | | t3.depart_name departName, |
| | | t4.item_text urgencyName, |
| | |
| | | mom_eam_equipment_report_repair t1 |
| | | left join mom_eam_equipment t2 on t1.equipment_id = t2.id |
| | | left join sys_depart t3 on t1.use_depart_id = t3.id |
| | | left join sys_user t8 on t2.team_id = t2.team_id |
| | | left join (select * from v_sys_dict where dict_code='urgency') t4 on t1.urgency = t4.item_value |
| | | left join (select * from v_sys_dict where dict_code='equipment_report_repair_status') t5 on t1.status = t5.item_value |
| | | left join (select * from v_sys_dict where dict_code='is_stop') t6 on t1.is_stop = t6.item_value |
| | |
| | | <if test="params.equipmentNum != null and params.equipmentNum != ''"> |
| | | and t2.num like concat('%',#{params.equipmentNum},'%') |
| | | </if> |
| | | <if test="params.equipmentName != null and params.equipmentName != ''"> |
| | | and t2.name like concat('%',#{params.equipmentName},'%') |
| | | </if> |
| | | <if test="params.status != null and params.status != ''"> |
| | | and t1.status = #{params.status} |
| | | </if> |
| | | <if test="params.teamId != null and params.teamId != ''"> |
| | | and t2.team_id = #{params.teamId} |
| | | </if> |
| | | ORDER BY t1.create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | t1.photo, |
| | | t1.inspection_project_id as inspectionProjectId, |
| | | t3.num as inspectionProjectNum, |
| | | t3.name as inspectionProjectName, |
| | | t3.detection_standard as detectionStandard, |
| | | t3.acceptability_limit AS acceptabilityLimit, |
| | | t3.inspection_method as inspectionMethod, |
| | |
| | | t1.photo, |
| | | t1.inspection_project_id AS inspectionProjectId, |
| | | t3.num AS inspectionProjectNum, |
| | | t3.name as inspectionProjectName, |
| | | t3.detection_standard AS detectionStandard, |
| | | t3.acceptability_limit AS acceptabilityLimit, |
| | | t3.inspection_method AS inspectionMethod, |
| | |
| | | |
| | | <select id="getMaintenanceThreeAcceptanceList" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | | t1.id AS id, |
| | | t1.position, |
| | | t1.content, |
| | | t1.standard, |
| | | t1.first_inspect as firstInspect, |
| | | t1.second_inspect as secondInspect |
| | | t1.id, |
| | | t1.id as maintenanceOrderDetailId, |
| | | t1.daily_maintenance_order_id AS maintenanceOrderId, |
| | | t2.location AS position, |
| | | t3.name AS content, |
| | | t3.standard, |
| | | t4.first_inspect AS firstInspect, |
| | | t4.second_inspect AS secondInspect |
| | | FROM |
| | | mom_eam_maintenance_three_acceptance t1 |
| | | WHERE t1.del_flag = '0' AND t1.maintenance_order_id = #{maintenanceOrderId} |
| | | mom_eam_daily_maintenance_order_detail t1 |
| | | LEFT JOIN mom_eam_maintenance_standard_detail t2 ON t1.maintenance_standard_detail_id = t2.id |
| | | LEFT JOIN mom_eam_maintenance_project t3 ON t1.maintenance_project_id = t3.id |
| | | LEFT JOIN mom_eam_maintenance_three_acceptance t4 ON t1.id = t4.maintenance_order_detail_id |
| | | WHERE t1.del_flag = '0' AND t1.daily_maintenance_order_id = #{maintenanceOrderId} |
| | | </select> |
| | | </mapper> |
| | |
| | | operation_certificate_id = #{mainId} </delete> |
| | | |
| | | <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.eam.entity.OperationCertificateDetail"> |
| | | SELECT * |
| | | FROM mom_eam_operation_certificate_detail |
| | | SELECT t1.*,t3.name equipmentName,t4.deduction_score deductionScore,t4.content deductionScoreName |
| | | FROM mom_eam_operation_certificate_detail t1 |
| | | left join mom_eam_operation_certificate t2 on t1.operation_certificate_id = t2.id |
| | | left join mom_eam_equipment t3 on t3.id = t1.equipment_id |
| | | left join mom_eam_base_deduction_item t4 on t4.id = t1.deduction_item |
| | | WHERE |
| | | operation_certificate_id = #{mainId} </select> |
| | | </mapper> |
| | |
| | | resultType="org.jeecg.modules.eam.entity.RepairOrderActualWorkHours"> |
| | | |
| | | SELECT t1.id id, |
| | | t1.user_num as userNum, |
| | | t2.id userId, |
| | | t1.start_time startTime, |
| | | t1.end_time endTime, |
| | | t1.principal_contractor principalContractor, |
| | | t1.theoretical_time theoreticalTime, |
| | | t6.item_text principalContractor_dictText, |
| | | t1.user_num as userNum, |
| | | t2.id userId, |
| | | t1.repair_order_id as repairOrderId, |
| | | t1.actual_hour, |
| | | t2.username username, |
| | | t1.actual_hour,---------- |
| | | t2.username username, |
| | | t2.realname as realname, |
| | | -- t4.name as teamName, |
| | | concat(t6.num, '/', t6.name, '/', t6.model) as equipmentId |
| | | FROM mom_eam_repair_order_actual_work_hours t1 |
| | | LEFT JOIN sys_user t2 on t2.id = t1.user_id |
| | | -- LEFT JOIN mom_base_team_class t3 on t3.id = t2.team_class_id |
| | | -- LEFT JOIN mom_base_team_class t3 on t3.id = t2.team_class_id |
| | | -- LEFT JOIN mom_base_team t4 on t4.id = t3.team_id |
| | | LEFT JOIN mom_eam_repair_order t5 on t5.id = t1.repair_order_id |
| | | LEFT JOIN mom_eam_equipment t6 on t6.id = t5.equipment_id |
| | | |
| | | left join (select * from v_sys_dict where dict_code = 'yn') t6 |
| | | on t1.principal_contractor = t6.item_value |
| | | WHERE t1.repair_order_id = #{mainId} |
| | | and t1.del_flag = 0 |
| | | |
| | |
| | | <if test="status != null and status != ''"> |
| | | and t1.status = #{status} |
| | | </if> |
| | | <if test="equipmentCategoryId != null and equipmentCategoryId != ''"> |
| | | and t2.equipment_category_id = #{equipmentCategoryId} |
| | | </if> |
| | | <if test="factoryModelId != null and factoryModelId != ''"> |
| | | and t2.factory_model_id = #{factoryModelId} |
| | | </if> |
| | | <if test="specificEquipment != null and specificEquipment != ''"> |
| | | and t2.specific_equipment = #{specificEquipment} |
| | | </if> |
| | | <if test="teamId != null and teamId != ''"> |
| | | and t1.team_id = #{teamId} |
| | | </if> |
| | | and t1.repair_order_type = #{repairOrderType} |
| | | order by t1.create_time desc |
| | | </select> |
| | |
| | | import org.jeecg.modules.eam.mapper.CalibrationOrderMapper; |
| | | import org.jeecg.modules.eam.model.MaintenanceCycleVo; |
| | | import org.jeecg.modules.eam.service.ICalibrationOrderService; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Autowired |
| | | private CalibrationOrderDetailMapper calibrationOrderDetailMapper; |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveMain(CalibrationOrder calibrationOrder, List<CalibrationOrderDetail> calibrationOrderDetailList) { |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | |
| | | //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.system.entity.SysUser; |
| | | import org.jeecg.modules.system.mapper.SysUserMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | // private IUploadRelaService uploadRelaService; |
| | | @Autowired |
| | | private ISysBaseAPI sysBaseApi; |
| | | @Autowired |
| | | private SysUserMapper userMapper; |
| | | /** |
| | | * æ
éæ¥ä¿®æ·»å |
| | | * |
| | |
| | | baseMapper.updateById(faultTimeVerify(equipmentReportRepair)); |
| | | // éªè¯ä¿®æ¹åä¿®æ¹åæ¯å¦ä¸è´ |
| | | if (!equipmentReportRepair.getPhoto().equals(equipmentReportRepair1.getPhoto())) { |
| | | // uploadRelaService.delSysUploadRelaByBusIdAndBusType(id, "equipment_management_failure_photo"); |
| | | sysBaseApi.delSysUploadRelaByBusIdAndBusType(id, "equipment_management_failure_photo"); |
| | | establishRelations(equipmentReportRepair.getSysUploadList(), id); |
| | | } |
| | |
| | | sysUploadRelaList.add(sysUploadRela); |
| | | }); |
| | | // ä¸ä¼ æä»¶ä¸ä¸å¡æ°æ®å
³ç³» |
| | | // uploadRelaService.saveBatch(sysUploadRelaList); |
| | | sysBaseApi.saveOrUpdateBatchUploadRela(sysUploadRelaList); |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public IPage<Map<String, Object>> getReportRepairList(Integer pageNo, Integer pageSize, Map<String, Object> params) { |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | if(StringUtils.isNotBlank((String)params.get("userId"))){ |
| | | SysUser sysUser = userMapper.selectById((String)params.get("userId")); |
| | | params.put("teamId",sysUser.getTeamId()); |
| | | } |
| | | return super.getBaseMapper().getReportRepairList(pageData, params) ; |
| | | } |
| | | } |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.eam.entity.RepairOrder; |
| | |
| | | import org.jeecg.modules.eam.mapper.*; |
| | | import org.jeecg.modules.eam.service.IRepairOrderDetailService; |
| | | import org.jeecg.modules.eam.service.IRepairOrderService; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.mapper.SysUserMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private RepairOrderActualWorkHoursMapper repairOrderActualWorkHoursMapper; |
| | | @Autowired |
| | | private EquipmentDocumentMapper equipmentDocumentMapper; |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | @Override |
| | | public Page<RepairOrder> getRepairOrderList(Page<RepairOrder> page, RepairOrder repairOrder) { |
| | | if(StringUtils.isNotBlank(repairOrder.getUserId())){ |
| | | SysUser sysUser = sysUserMapper.selectById(repairOrder.getUserId()); |
| | | repairOrder.setTeamId(sysUser.getTeamId()); |
| | | }else{ |
| | | repairOrder.setTeamId(""); |
| | | } |
| | | |
| | | return page.setRecords(baseMapper.getRepairOrderList(page,repairOrder.getNum(),repairOrder.getEquipmentNum(),repairOrder.getEquipmentName(),repairOrder.getStatus(),repairOrder.getRepairOrderType())); |
| | | return page.setRecords(baseMapper.getRepairOrderList(page,repairOrder.getNum(),repairOrder.getEquipmentNum(),repairOrder.getEquipmentName(),repairOrder.getStatus(),repairOrder.getRepairOrderType(),repairOrder.getEquipmentCategoryId(),repairOrder.getFactoryModelId(),repairOrder.getSpecificEquipment(),repairOrder.getTeamId())); |
| | | } |
| | | |
| | | @Override |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class InspectionProjectImportVo { |
| | | |
| | | @Excel(name= "ç¹æ£é¡¹ç®åç±»") |
| | | private String inspectionProjectCategoryId; |
| | | |
| | | @Excel(name="ç¹æ£é¡¹ç®ç¼ç ") |
| | | private String num; |
| | | |
| | | @Excel(name = "ç¹æ£é¡¹ç®åç§°") |
| | | private String name; |
| | | |
| | | @Excel(name = "计éåä½",dictTable = "mom_base_unit", dicCode = "id", dicText = "name") |
| | | private String unitId; |
| | | |
| | | @Excel(name = "æ£éªå¼ç±»å",dicCode = "test_value_type") |
| | | private String testValueType; |
| | | |
| | | @Excel(name = "ç¹æ£æ¹æ³",dicCode = "inspection_method") |
| | | private String inspectionMethod; |
| | | |
| | | @Excel(name = "æ£æµæ å") |
| | | private String detectionStandard; |
| | | |
| | | @Excel(name = "ç¹æ£å·¥å
·") |
| | | private String inspectionTool; |
| | | |
| | | @Excel(name = "åä¹å¼") |
| | | private BigDecimal surfaceValue; |
| | | |
| | | @Excel(name = "ä¸åå·®") |
| | | private BigDecimal upValue; |
| | | |
| | | @Excel(name = "ä¸åå·®") |
| | | private BigDecimal downValue; |
| | | |
| | | @Excel(name = "夿³¨") |
| | | private String remark; |
| | | |
| | | } |
| | |
| | | @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id") |
| | | @ApiModelProperty(value = "ç³è¯·äºº") |
| | | private String applicant; |
| | | /**åç人*/ |
| | | @Excel(name = "åç人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "id") |
| | | @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id") |
| | | @ApiModelProperty(value = "åç人") |
| | | private String handlePerson; |
| | | /**å®¡æ ¸ç¶æ*/ |
| | | @Excel(name = "å®¡æ ¸ç¶æ", width = 15, dicCode = "certificate_apply_status") |
| | | @Dict(dicCode = "certificate_apply_status") |
| | |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.apache.shiro.SecurityUtils; |
| | |
| | | import org.jeecg.common.util.SqlInjectionUtil; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.message.websocket.WebSocket; |
| | | import org.jeecg.modules.system.entity.SysAnnouncementSend; |
| | | import org.jeecg.modules.system.entity.*; |
| | | import org.jeecg.modules.system.model.AnnouncementSendModel; |
| | | import org.jeecg.modules.system.service.ISysAnnouncementSendService; |
| | | import org.jeecg.modules.system.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | private ISysAnnouncementSendService sysAnnouncementSendService; |
| | | @Autowired |
| | | private WebSocket webSocket; |
| | | |
| | | @Autowired |
| | | private ISysRoleService sysRoleService; |
| | | @Autowired |
| | | private ISysDictService sysDictService; |
| | | @Autowired |
| | | private ISysDictItemService sysDictItemService; |
| | | @Autowired |
| | | private ISysUserRoleService sysUserRoleService; |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * @param sysAnnouncementSend |
| | |
| | | result.setResult(pageList); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param sysAnnouncementSend |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * @param sysAnnouncementSend |
| | |
| | | result.success("æä½æå!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * @param id |
| | |
| | | result.success("å 餿å!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @param ids |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * @param id |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @åè½ï¼æ´æ°ç¨æ·ç³»ç»æ¶æ¯é
è¯»ç¶æ |
| | | * @param json |
| | |
| | | result.setSuccess(true); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @åè½ï¼è·åæçæ¶æ¯ |
| | | * @return |
| | |
| | | AnnouncementSendModel model = sysAnnouncementSendService.getOne(sendId); |
| | | return Result.ok(model); |
| | | } |
| | | @GetMapping("getPrimaryInfo") |
| | | public Result<?> getPrimaryInfo(@RequestParam(name="userId",required=true) String userId){ |
| | | SysDict sysDict = sysDictService.getOne(new QueryWrapper<SysDict>().eq("dict_code","info_type"),false); |
| | | List<SysDictItem> sysDictItemList = sysDictItemService.list(new QueryWrapper<SysDictItem>().eq("dict_id",sysDict.getId())); |
| | | // List<String> rollCodeList = sysDictItemList.stream().map(SysDictItem::getItemValue).collect(Collectors.toList()); |
| | | // List<SysUserRole> sysUserRoles = sysUserRoleService.list(new QueryWrapper<SysUserRole>().eq("user_id",userId)); |
| | | // List<String> roleIds = sysUserRoles.stream().map(SysUserRole::getRoleId).collect(Collectors.toList()); |
| | | // List<SysRole> sysRoles = sysRoleService.list(new QueryWrapper<SysRole>().in("role_code",rollCodeList).in("id",roleIds)); |
| | | List<String> msgCategoryList = sysDictItemList.stream().map(SysDictItem::getItemText).collect(Collectors.toList()); |
| | | List<SysAnnouncementSend> list = sysAnnouncementSendService.getPrimaryInfo(userId,msgCategoryList); |
| | | for(SysAnnouncementSend sysAnnouncementSend:list){ |
| | | sysAnnouncementSend.setReadFlag("1"); |
| | | sysAnnouncementSendService.updateById(sysAnnouncementSend); |
| | | } |
| | | return Result.OK(list); |
| | | } |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | |
| | | @TableName("sys_announcement_send") |
| | | public class SysAnnouncementSend implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | /**id*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | private java.lang.String id; |
| | |
| | | * æ¯å¦æ æ å½å¼ä¸º1æ¯æ ææ¶æ¯ |
| | | */ |
| | | private String starFlag; |
| | | @TableField(exist = false) |
| | | private String msgCategory; |
| | | @TableField(exist = false) |
| | | private String msgContent; |
| | | |
| | | } |
| | |
| | | */ |
| | | @TableField(exist = false) |
| | | private String homePath; |
| | | @Dict(dicCode = "id",dictTable = "mom_base_team",dicText = "name") |
| | | private String teamId; |
| | | } |
| | |
| | | * ä¿®æ¹ä¸ºå·²è¯»æ¶æ¯ |
| | | */ |
| | | void updateReaded(@Param("userId") String userId, @Param("annoceIdList") List<String> annoceIdList); |
| | | /** |
| | | * è·åé¦é¡µæ¶æ¯ |
| | | */ |
| | | List<SysAnnouncementSend> getPrimaryInfo(@Param("userId") String userId,@Param("msgCategoryList")List<String> msgCategoryList); |
| | | } |
| | |
| | | <?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="org.jeecg.modules.system.mapper.SysAnnouncementSendMapper"> |
| | | |
| | | |
| | | <resultMap id="AnnouncementSendModel" type="org.jeecg.modules.system.model.AnnouncementSendModel" > |
| | | <result column="id" property="id" jdbcType="VARCHAR"/> |
| | | <result column="annt_id" property="anntId" jdbcType="VARCHAR"/> |
| | |
| | | <result column="open_type" property="openType" jdbcType="VARCHAR"/> |
| | | <result column="open_page" property="openPage" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="queryByUserId" parameterType="String" resultType="String"> |
| | | select sas.annt_id from sys_announcement_send sas |
| | | select sas.annt_id from sys_announcement_send sas |
| | | where sas.user_id = #{userId} |
| | | </select> |
| | | |
| | | |
| | | <select id="getMyAnnouncementSendList" parameterType="Object" resultMap="AnnouncementSendModel"> |
| | | select |
| | | sas.id, |
| | |
| | | <!-- ä¿®æ¹ä¸ºå·²è¯»æ¶æ¯ --> |
| | | <update id="updateReaded"> |
| | | update sys_announcement_send set read_flag = '1' |
| | | where user_id = #{userId} |
| | | where user_id = #{userId} |
| | | and annt_id in |
| | | <foreach collection="annoceIdList" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </update> |
| | | |
| | | <select id="getPrimaryInfo" resultType="org.jeecg.modules.system.entity.SysAnnouncementSend"> |
| | | select |
| | | t1.id id, |
| | | t1.annt_id anntId, |
| | | t1.user_id userId, |
| | | t1.read_flag readFlag, |
| | | t2.msg_content msgContent, |
| | | t2.msg_category msgCategory |
| | | from |
| | | sys_announcement_send t1 |
| | | left join sys_announcement t2 |
| | | on t1.annt_id = t2.id |
| | | where t1.read_flag = '0' |
| | | and t1.user_id = #{userId} |
| | | <if test="msgCategoryList.size != 0"> |
| | | and t2.msg_category in ( |
| | | <foreach item="msgCategory" collection="msgCategoryList" separator=","> |
| | | #{msgCategory} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | | </mapper> |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.system.entity.SysAnnouncementSend; |
| | | import org.jeecg.modules.system.model.AnnouncementSendModel; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | public List<String> queryByUserId(String userId); |
| | | |
| | | |
| | | /** |
| | | * è·åæçæ¶æ¯ |
| | | * @param announcementSendModel |
| | |
| | | * @return |
| | | */ |
| | | AnnouncementSendModel getOne(String sendId); |
| | | |
| | | |
| | | List<SysAnnouncementSend> getPrimaryInfo(String userId,List<String> msgCategoryList); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @Resource |
| | | private SysAnnouncementSendMapper sysAnnouncementSendMapper; |
| | | |
| | | |
| | | @Override |
| | | public List<String> queryByUserId(String userId) { |
| | | return sysAnnouncementSendMapper.queryByUserId(userId); |
| | |
| | | return sysAnnouncementSendMapper.getOne(sendId); |
| | | } |
| | | |
| | | @Override |
| | | public List<SysAnnouncementSend> getPrimaryInfo(String userId, List<String> msgCategoryList) { |
| | | return baseMapper.getPrimaryInfo(userId,msgCategoryList); |
| | | } |
| | | |
| | | } |