| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | |
| | | import org.jeecg.modules.eam.vo.SysFileNameVo; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.jeecgframework.poi.excel.ExcelImportUtil; |
| | |
| | | |
| | | @Autowired |
| | | private IMaintenanceStoveExemptService maintenanceStoveExemptService; |
| | | |
| | | @Autowired |
| | | private ISysFileNameService sysFileNameService; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("getDailyMaintenanceOrder3List") |
| | | public Result<?> getDailyMaintenanceOrder3List(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam Map<String, Object> params) { |
| | | IPage<Map<String, Object>> dailyMaintenanceOrderList = dailyMaintenanceOrderService.getDailyMaintenanceOrderList(pageNo, pageSize, params); |
| | | IPage<Map<String, Object>> dailyMaintenanceOrderList = dailyMaintenanceOrderService.getDailyMaintenanceOrder3List(pageNo, pageSize, params); |
| | | List<Map<String, Object>> records = dailyMaintenanceOrderList.getRecords(); |
| | | for (Map<String, Object> record : records) { |
| | | String id = (String) record.get("id"); |
| | |
| | | |
| | | |
| | | void createMaintenanceStoveExempt(DailyMaintenanceOrder dailyMaintenanceOrder){ |
| | | List<SysFileNameVo> sysFileName = sysFileNameService.getSysFileName("20"); |
| | | MaintenanceStoveExempt maintenanceStoveExempt = new MaintenanceStoveExempt(); |
| | | maintenanceStoveExempt.setMaintenanceOrderId(dailyMaintenanceOrder.getId()); |
| | | maintenanceStoveExempt.setReceipts(sysFileName.get(0).getReceipts()); |
| | | maintenanceStoveExemptService.save(maintenanceStoveExempt); |
| | | } |
| | | |
| | |
| | | String userId = sysUser.getId(); |
| | | |
| | | String orderId = dailyMaintenanceOrder.getId(); |
| | | String maintenanceOrderUda3 = dailyMaintenanceOrder.getMaintenanceOrderUda3(); |
| | | DailyMaintenanceOrder maintenanceOrder = dailyMaintenanceOrderService.getById(orderId); |
| | | String equipmentId = maintenanceOrder.getEquipmentId(); |
| | | String confirmStatus = maintenanceOrder.getConfirmStatus(); |
| | | String orderUda3 = maintenanceOrder.getMaintenanceOrderUda3(); |
| | | |
| | | List<FinishTransferOrder> finishTransferOrders = finishTransferOrderService.lambdaQuery() |
| | | .eq(FinishTransferOrder::getMaintenanceOrderId, orderId) |
| | |
| | | finishTransferOrder.setRepairDirectorUser(userId); |
| | | finishTransferOrderService.updateById(finishTransferOrder); |
| | | |
| | | if(StringUtils.isBlank(orderUda3)){ |
| | | maintenanceOrder.setMaintenanceOrderUda3(maintenanceOrderUda3); |
| | | } |
| | | maintenanceOrder.setConfirmStatus("1"); |
| | | dailyMaintenanceOrderService.updateById(maintenanceOrder); |
| | | }else{ |
| | | finishTransferOrder.setEquipmentInspectorUser(userId); |
| | | finishTransferOrderService.updateById(finishTransferOrder); |
| | | |
| | | if(StringUtils.isBlank(orderUda3)){ |
| | | maintenanceOrder.setMaintenanceOrderUda3(maintenanceOrderUda3); |
| | | } |
| | | maintenanceOrder.setConfirmStatus("2"); |
| | | maintenanceOrder.setStatus("8"); |
| | | dailyMaintenanceOrderService.updateById(maintenanceOrder); |
| | |
| | | */ |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | //å·¥åºãåå·ã设å¤ç¶æãææ¯ç¶æãABCæ è¯æç©ºå¼ï¼ç»´æ¤é¨é¨ãç»´ä¿®çç»ä¸ºç¼ç éè¦æå¯¹ç
§å¼ã |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | |
| | | 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++; |
| | | continue; |
| | | } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getEquipmentImportanceId())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :ABCæ è¯ç¼ºå¤±,请填åå¿
填项åå导å
¥;"; |
| | | // 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; |
| | | } |
| | |
| | | continue; |
| | | } |
| | | Area area = areaService.getOne(new QueryWrapper<Area>().eq("name",areaId.trim())); |
| | | Area area1 = areaService.getOne(new QueryWrapper<Area>().eq("num",areaId.trim())); |
| | | if(ObjectUtils.isNotNull(area)){ |
| | | equipment.setFactoryModelId(area.getId()); |
| | | }else if(ObjectUtils.isNotNull(area1)) { |
| | | equipment.setFactoryModelId(area1.getId()); |
| | | }else { |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :ä¸åå¨è¯¥å·¥åº,请维æ¤å·¥åºæ°æ®åå导å
¥;"; |
| | | exceptionNum++; |
| | |
| | | continue; |
| | | } |
| | | Team team = teamService.getOne(new QueryWrapper<Team>().eq("name",teamId.trim()),false); |
| | | Team team1 = teamService.getOne(new QueryWrapper<Team>().eq("num",teamId.trim()),false); |
| | | if(ObjectUtils.isNotNull(team)){ |
| | | equipment.setTeamId(team.getId()); |
| | | }else if(ObjectUtils.isNotNull(team1)) { |
| | | equipment.setTeamId(team1.getId()); |
| | | }else { |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :ä¸åå¨è¯¥çç»,请å
ç»´æ¤çç»æ°æ®åå导å
¥;"; |
| | | exceptionNum++; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | |
| | | String userId = sysUser.getId(); |
| | | String maintenanceOrderId = maintenanceThreeAcceptance.getMaintenanceOrderId(); |
| | | String equipmentId = maintenanceThreeAcceptance.getEquipmentId(); |
| | | String receipts = maintenanceThreeAcceptance.getReceipts(); |
| | | int maintenanceCycle = Integer.parseInt(maintenanceThreeAcceptance.getMaintenanceCycle()); |
| | | List<MaintenanceThreeAcceptance> maintenanceThreeAcceptances = maintenanceThreeAcceptance.getMaintenanceThreeAcceptances(); |
| | | String checkStatus = "1";//ä¸çº§ä¿å
»éªæ¶ç¶æï¼1éè¿ï¼2æªéè¿ï¼ |
| | |
| | | |
| | | } |
| | | DailyMaintenanceOrder maintenanceOrder = dailyMaintenanceOrderService.getById(maintenanceOrderId); |
| | | if(StringUtils.isBlank(maintenanceOrder.getMaintenanceOrderUda5())){ |
| | | maintenanceOrder.setMaintenanceOrderUda5(receipts); |
| | | } |
| | | maintenanceOrder.setInspectUser(sysUser.getRealname()); |
| | | maintenanceOrder.setNotPassReason(maintenanceThreeAcceptance.getNotPassReason()); |
| | | maintenanceOrder.setCheckStatus(checkStatus); |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.jeecg.modules.eam.vo.EquipmentDisposalPage; |
| | | import org.jeecgframework.poi.excel.ExcelImportUtil; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | |
| | | return Result.OK("æä»¶å¯¼å
¥å¤±è´¥ï¼"); |
| | | } |
| | | |
| | | /** |
| | | * æäº¤ãå®¡æ ¸ãå®¡æ¹ |
| | | * |
| | | * @param operationCertificateApply |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "æäº¤ãå®¡æ ¸ã审æ¹") |
| | | @PostMapping(value = "/approve") |
| | | public Result<String> submit(@RequestBody OperationCertificateApply operationCertificateApply) { |
| | | this.operationCertificateApplyService.updateById(operationCertificateApply); |
| | | return Result.OK("æä½æåï¼"); |
| | | } |
| | | |
| | | } |
| | |
| | | currentDate = c.getTime(); |
| | | OperationCertificate operationCertificate = new OperationCertificate(); |
| | | operationCertificate.setNum(identityService.getNumByTypeAndLength("OperationCertificate", 4)); |
| | | operationCertificate.setUserId(operationCertificateApplyDetail.getUserId()); |
| | | SysUser sysUser = userService.getById(operationCertificateApplyDetail.getUserId()); |
| | | if(sysUser != null){ |
| | | operationCertificate.setUserId(sysUser.getUsername()); |
| | | } |
| | | operationCertificate.setEquipmentIds(operationCertificateApplyDetail.getEquipmentIds()); |
| | | operationCertificate.setCurrentCycleScore(12); |
| | | operationCertificate.setIssueDate(new Date()); |
| | |
| | | |
| | | 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; |
| | |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = sysUser.getId(); |
| | | |
| | | String receipts = precisionInspection.getReceipts();//精度æ£éªååæ®id |
| | | PrecisionInspection preInspection = precisionInspectionService.getById(precisionInspection.getId()); |
| | | DailyMaintenanceOrder maintenanceOrder = dailyMaintenanceOrderService.getById(preInspection.getMaintenanceOrderId()); |
| | | String maintenanceOrderUda4 = maintenanceOrder.getMaintenanceOrderUda4(); |
| | | Equipment equipment = equipmentService.getById(maintenanceOrder.getEquipmentId()); |
| | | String precisionInspectionStatus = maintenanceOrder.getPrecisionInspectionStatus(); |
| | | |
| | |
| | | equipment.setTechnologyStatus(precisionInspection.getJudgmentResult()); |
| | | } |
| | | |
| | | preInspection.setRemark(precisionInspection.getRemark()); |
| | | if(StringUtils.isBlank(maintenanceOrderUda4)){ |
| | | maintenanceOrder.setMaintenanceOrderUda4(receipts); |
| | | } |
| | | dailyMaintenanceOrderService.updateById(maintenanceOrder); |
| | | preInspection.setRemark(precisionInspection.getRemark()); |
| | | precisionInspectionService.updateById(preInspection); |
| | | equipmentService.updateById(equipment); |
| | | return Result.OK("å®¡æ¹æå!"); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLDecoder; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.entity.MaintenanceCycle; |
| | | import org.jeecg.modules.eam.entity.SysFileName; |
| | | import org.jeecg.modules.eam.model.DepartVo; |
| | | import org.jeecg.modules.eam.service.ISysFileNameService; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import org.jeecg.modules.eam.vo.SysFileNameVo; |
| | | import org.jeecgframework.poi.excel.ExcelImportUtil; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | | import org.jeecgframework.poi.excel.entity.ImportParams; |
| | | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | 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 com.alibaba.fastjson.JSON; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | |
| | | /** |
| | | * @Description: æä»¶å称管ç |
| | | * @Author: jeecg-boot |
| | | * @Date: 2023-11-03 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="æä»¶å称管ç") |
| | | @RestController |
| | | @RequestMapping("/eam/sysFileName") |
| | | @Slf4j |
| | | public class SysFileNameController extends JeecgController<SysFileName, ISysFileNameService> { |
| | | @Autowired |
| | | private ISysFileNameService sysFileNameService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param sysFileName |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "æä»¶å称管ç-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="æä»¶å称管ç-å页å表æ¥è¯¢", notes="æä»¶å称管ç-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<SysFileName>> queryPageList(SysFileName sysFileName, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | if(StringUtils.isBlank(sysFileName.getVersionStatus())){ |
| | | sysFileName.setVersionStatus("2"); |
| | | } |
| | | QueryWrapper<SysFileName> queryWrapper = QueryGenerator.initQueryWrapper(sysFileName, req.getParameterMap()); |
| | | Page<SysFileName> page = new Page<SysFileName>(pageNo, pageSize); |
| | | IPage<SysFileName> pageList = sysFileNameService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param sysFileName |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "æä»¶å称管ç-æ·»å ") |
| | | @ApiOperation(value="æä»¶å称管ç-æ·»å ", notes="æä»¶å称管ç-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules.mdc:sys_file_name:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody SysFileName sysFileName) { |
| | | sysFileNameService.save(sysFileName); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param sysFileName |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "æä»¶å称管ç-ç¼è¾") |
| | | @ApiOperation(value="æä»¶å称管ç-ç¼è¾", notes="æä»¶å称管ç-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules.mdc:sys_file_name:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody SysFileName sysFileName) { |
| | | sysFileNameService.updateById(sysFileName); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * çæ¬å级 |
| | | * qsw 2023-11-3 |
| | | */ |
| | | @PostMapping(value = "/revise") |
| | | public Result<String> revise(@RequestBody SysFileName sysFileName) { |
| | | sysFileName.setId(""); |
| | | boolean b = sysFileNameService.save(sysFileName); |
| | | if(b){ |
| | | return Result.OK("çæ¬å级æåï¼"); |
| | | }else{ |
| | | return Result.error("çæ¬å级失败ï¼"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åç |
| | | * qsw 2023-11-3 |
| | | */ |
| | | @RequestMapping("/getReviseVersion") |
| | | public Result<?> getReviseVersion(@RequestBody SysFileName sysFileName) { |
| | | List<SysFileName> sysFileNames = sysFileNameService.lambdaQuery() |
| | | .eq(SysFileName::getName, sysFileName.getName()) |
| | | .orderByDesc(SysFileName::getVersion) |
| | | .list(); |
| | | String version = sysFileNames.get(0).getVersion(); |
| | | BigDecimal versionB = new BigDecimal(version); |
| | | BigDecimal versionCode = versionB.add(new BigDecimal(1)); |
| | | return Result.ok(versionCode.toString()); |
| | | } |
| | | |
| | | /** |
| | | * çæ¬çæ |
| | | * qsw 2023-7-26 |
| | | */ |
| | | @RequestMapping(value = "/versionTakeEffect", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | @Transactional(rollbackFor = { Exception.class }) |
| | | public Result<String> versionTakeEffect(@RequestBody SysFileName sysFileName) { |
| | | List<SysFileName> sysFileNames = sysFileNameService.lambdaQuery() |
| | | .eq(SysFileName::getName, sysFileName.getName()).list(); |
| | | for (SysFileName fileName : sysFileNames) { |
| | | fileName.setVersionStatus("3"); |
| | | sysFileNameService.updateById(fileName); |
| | | } |
| | | boolean b = sysFileNameService.updateById(sysFileName); |
| | | if (b){ |
| | | return Result.OK("çææå!"); |
| | | }else{ |
| | | return Result.error("çæå¤±è´¥!"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éè¿åæ®ç±»åè·ååæ®ç¼ç |
| | | * qsw 2023-11-3 |
| | | */ |
| | | @GetMapping("getSysFileName") |
| | | public Result<?> getSysFileName(@RequestParam(name="name",required=true) String name) { |
| | | List<SysFileNameVo> sysFileName = sysFileNameService.getSysFileName(name); |
| | | return Result.ok(sysFileName); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "æä»¶å称管ç-éè¿idå é¤") |
| | | @ApiOperation(value="æä»¶å称管ç-éè¿idå é¤", notes="æä»¶å称管ç-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules.mdc:sys_file_name:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | sysFileNameService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "æä»¶å称管ç-æ¹éå é¤") |
| | | @ApiOperation(value="æä»¶å称管ç-æ¹éå é¤", notes="æä»¶å称管ç-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules.mdc:sys_file_name:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.sysFileNameService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "æä»¶å称管ç-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value="æä»¶å称管ç-éè¿idæ¥è¯¢", notes="æä»¶å称管ç-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<SysFileName> queryById(@RequestParam(name="id",required=true) String id) { |
| | | SysFileName sysFileName = sysFileNameService.getById(id); |
| | | if(sysFileName==null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(sysFileName); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param sysFileName |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules.mdc:sys_file_name:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, SysFileName sysFileName) { |
| | | return super.exportXls(request, sysFileName, SysFileName.class, "æä»¶å称管ç"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("sys_file_name:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, SysFileName.class); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | 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; |
| | |
| | | IPage<Team> pageList = teamService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | |
| | | teamService.save(team); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | |
| | | teamService.updateById(team); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | |
| | | teamService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | |
| | | this.teamService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | |
| | | @Excel(name = "å¤ç¨å段2", width = 15) |
| | | @ApiModelProperty(value = "å¤ç¨å段2") |
| | | private String maintenanceOrderUda2; |
| | | /**å¤ç¨å段3*/ |
| | | @Excel(name = "å¤ç¨å段3", width = 15) |
| | | @ApiModelProperty(value = "å¤ç¨å段3") |
| | | /**äºçº§ä¿å
»å®å·¥ç§»äº¤ååæ®ç¼ç id*/ |
| | | @Excel(name = "äºçº§ä¿å
»å®å·¥ç§»äº¤ååæ®ç¼ç id", width = 15) |
| | | @ApiModelProperty(value = "äºçº§ä¿å
»å®å·¥ç§»äº¤ååæ®ç¼ç id") |
| | | private String maintenanceOrderUda3; |
| | | /**å¤ç¨å段4*/ |
| | | @Excel(name = "å¤ç¨å段4", width = 15) |
| | | @ApiModelProperty(value = "å¤ç¨å段4") |
| | | @Excel(name = "ä¸çº§ä¿å
»ç²¾åº¦æ£éªååæ®ç¼ç id", width = 15) |
| | | @ApiModelProperty(value = "ä¸çº§ä¿å
»ç²¾åº¦æ£éªååæ®ç¼ç id") |
| | | private String maintenanceOrderUda4; |
| | | /**å¤ç¨å段5*/ |
| | | @Excel(name = "å¤ç¨å段5", width = 15) |
| | | @ApiModelProperty(value = "å¤ç¨å段5") |
| | | /**ä¸çº§ä¿å
»éªæ¶ååæ®ç¼ç id*/ |
| | | @Excel(name = "ä¸çº§ä¿å
»éªæ¶ååæ®ç¼ç id", width = 15) |
| | | @ApiModelProperty(value = "ä¸çº§ä¿å
»éªæ¶ååæ®ç¼ç id") |
| | | private String maintenanceOrderUda5; |
| | | /**å建类åï¼1æå¨å建ï¼2èªå¨å建ï¼*/ |
| | | @Excel(name = "å建类åï¼1æå¨å建ï¼2èªå¨å建ï¼", width = 15) |
| | |
| | | @Excel(name = "åå·") |
| | | private String model; |
| | | |
| | | // @Excel(name = "使ç¨é¨é¨",dictTable = "sys_depart",dicCode = "id",dicText = "depart_name") |
| | | @Excel(name = "使ç¨é¨é¨") |
| | | private String useId; |
| | | |
| | | // @Excel(name = "å·¥åº",dicCode = "id",dictTable = "mom_base_area",dicText = "name") |
| | | @Excel(name = "å·¥åº") |
| | | private String factoryModelId; |
| | | |
| | | // @Excel(name = "ç»´æ¤é¨é¨",dictTable = "sys_depart",dicCode = "id",dicText = "depart_name") |
| | | @Excel(name = "ç»´æ¤é¨é¨") |
| | | private String manageId; |
| | | |
| | | // @Excel(name = "ç»´ä¿®çç»",dictTable = "mom_base_team",dicCode = "id"2,dicText = "name") |
| | | @Excel(name = "ç»´ä¿®çç»") |
| | | private String teamId; |
| | | |
| | | // @Excel(name = "èµäº§å¶é å",dicCode = "id",dictTable="mom_base_constructor",dicText="name") |
| | | @Excel(name = "èµäº§å¶é å") |
| | | private String constructorId; |
| | | |
| | | @Excel(name = "ABCæ è¯",dicCode = "ABC-standard-result") |
| | |
| | | @ApiModelProperty(value = "馿¬¡ç¹æ£æ¶é´") |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date firstInspectionTime; |
| | | /**䏿¬¡ç¹æ£æ¶é´*/ |
| | | @Excel(name = "䏿¬¡ç¹æ£æ¶é´", width = 15) |
| | | @ApiModelProperty(value = "䏿¬¡ç¹æ£æ¶é´") |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date lastInspectionTime; |
| | | /**æåæ¶é´*/ |
| | | @Excel(name = "æåæ¶é´", width = 15) |
| | | @ApiModelProperty(value = "æåæ¶é´") |
| | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private java.util.Date loseEfficacyTime; |
| | | |
| | | @TableField(exist = false) |
| | | private String equipmentId; |
| | | @TableField(exist = false) |
| | | private String teamId; |
| | | @TableField(exist = false) |
| | | private String inspectionStandardId; |
| | | @TableField(exist = false) |
| | | private String inspectionStandardNum; |
| | | @TableField(exist = false) |
| | | private String inspectionProjectId; |
| | | @TableField(exist = false) |
| | | private String inspectionProjectName; |
| | | @TableField(exist = false) |
| | | private String detectionStandard; |
| | | @TableField(exist = false) |
| | | private String inspectionStandardDetailId; |
| | | @TableField(exist = false) |
| | | private String location; |
| | | @TableField(exist = false) |
| | | private String photo; |
| | | @TableField(exist = false) |
| | | private String inspectionMethod; |
| | | |
| | | |
| | | } |
| | |
| | | @Excel(name = "仪表工", width = 15) |
| | | @ApiModelProperty(value = "仪表工") |
| | | private java.lang.String meterUser; |
| | | /**é®é¢é¡¹*/ |
| | | @Excel(name = "é®é¢é¡¹", width = 15) |
| | | |
| | | /**é®é¢é¡¹*/ |
| | | @Excel(name = "é®é¢é¡¹", width = 15) |
| | | @ApiModelProperty(value = "é®é¢é¡¹") |
| | | private java.lang.String sort; |
| | | |
| | | |
| | | /**çæ¸©ååæ§20æ¡æ¬¾åæ®id*/ |
| | | @Excel(name = "çæ¸©ååæ§20æ¡æ¬¾åæ®id", width = 15) |
| | | @ApiModelProperty(value = "çæ¸©ååæ§20æ¡æ¬¾åæ®id") |
| | | private java.lang.String receipts; |
| | | |
| | | /**ç»æ1*/ |
| | | @Excel(name = "ç»æ1", width = 15) |
| | |
| | | |
| | | @TableField(exist = false) |
| | | private String equipmentId; |
| | | |
| | | @TableField(exist = false) |
| | | private String receipts; |
| | | } |
| | |
| | | @ApiModelProperty(value = "è®¾å¤æ£éªåç¾åï¼çç« ï¼") |
| | | private String equipmentInspectorSignUser; |
| | | |
| | | /** |
| | | * 忮id |
| | | */ |
| | | @TableField(exist = false) |
| | | private String receipts; |
| | | |
| | | @TableField(exist = false) |
| | | private List<PrecisionInspectionDetail> precisionInspectionDetailList; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.jeecg.common.system.base.entity.JeecgEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * @Description: æä»¶å称管ç |
| | | * @Author: jeecg-boot |
| | | * @Date: 2023-11-03 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("sys_file_name") |
| | | @Accessors(chain = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="sys_file_name对象", description="æä»¶å称管ç") |
| | | public class SysFileName extends JeecgEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /**æä»¶ç¼å·*/ |
| | | @Excel(name = "æä»¶ç¼å·", width = 15) |
| | | @ApiModelProperty(value = "æä»¶ç¼å·") |
| | | private java.lang.String num; |
| | | /**æä»¶åç§°*/ |
| | | @Excel(name = "æä»¶åç§°", width = 15) |
| | | @ApiModelProperty(value = "æä»¶åç§°") |
| | | @Dict(dicCode = "sys_file_name") |
| | | private java.lang.String name; |
| | | /**æä»¶ç±»å*/ |
| | | @Excel(name = "æä»¶ç±»å", width = 15) |
| | | @ApiModelProperty(value = "æä»¶ç±»å") |
| | | private java.lang.String type; |
| | | /**æä»¶å°å*/ |
| | | @Excel(name = "æä»¶å°å", width = 15) |
| | | @ApiModelProperty(value = "æä»¶å°å") |
| | | private java.lang.String fileUrl; |
| | | /**屿§å段1*/ |
| | | @Excel(name = "屿§å段1", width = 15) |
| | | @ApiModelProperty(value = "屿§å段1") |
| | | private java.lang.String uda1; |
| | | /**屿§å段2*/ |
| | | @Excel(name = "屿§å段2", width = 15) |
| | | @ApiModelProperty(value = "屿§å段2") |
| | | private java.lang.String uda2; |
| | | /**屿§å段3*/ |
| | | @Excel(name = "屿§å段3", width = 15) |
| | | @ApiModelProperty(value = "屿§å段3") |
| | | private java.lang.String uda3; |
| | | /**屿§å段4*/ |
| | | @Excel(name = "屿§å段4", width = 15) |
| | | @ApiModelProperty(value = "屿§å段4") |
| | | private java.lang.String uda4; |
| | | /**屿§å段5*/ |
| | | @Excel(name = "屿§å段5", width = 15) |
| | | @ApiModelProperty(value = "屿§å段5") |
| | | private java.lang.String uda5; |
| | | |
| | | /**æå±é¨é¨*/ |
| | | @ApiModelProperty(value = "æå±é¨é¨") |
| | | private java.lang.String sysOrgCode; |
| | | |
| | | /**çæ¬*/ |
| | | @Excel(name = "çæ¬", width = 15) |
| | | @ApiModelProperty(value = "çæ¬") |
| | | private String version; |
| | | /**çæ¬ç¶æ*/ |
| | | @Excel(name = "çæ¬ç¶æ", width = 15) |
| | | @ApiModelProperty(value = "çæ¬ç¶æ") |
| | | @Dict(dicCode = "version_status") |
| | | private String versionStatus; |
| | | |
| | | @TableField(exist = false) |
| | | private String receipts; |
| | | |
| | | @TableField(exist = false) |
| | | private String receiptsNum; |
| | | |
| | | @TableField(exist = false) |
| | | private String receiptsName; |
| | | |
| | | @TableField(exist = false) |
| | | private String maintenanceOrderUda3; |
| | | } |
| | |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | 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; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | |
| | | @ApiModelProperty(value = "æå±é¨é¨") |
| | | @Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name") |
| | | private String departId; |
| | | @TableField(exist = false) |
| | | private String noEqId; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.job; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.modules.eam.entity.*; |
| | | import org.jeecg.modules.eam.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.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.DayOfWeek; |
| | | import java.time.Instant; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * èªä¸»ç»´æ¤å·¥åèªå¨çæ |
| | | */ |
| | | @Slf4j |
| | | public class DailyInspectionOrderJob implements Job { |
| | | |
| | | @Autowired |
| | | private IInspectionCycleService inspectionCycleService; |
| | | @Autowired |
| | | private IdentityService identityService; |
| | | @Autowired |
| | | private IInspectionOrderService inspectionOrderService; |
| | | @Autowired |
| | | private IInspectionOrderDetailService inspectionOrderDetailService; |
| | | @Autowired |
| | | private IDailyInspectionStandardDetailService dailyInspectionStandardDetailService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { |
| | | /*//éåç¹æ£æ åï¼éè¿ç¹æ£æ åçæç¹æ£å·¥å |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | List<InspectionCycle> inspectionCycleList = inspectionCycleService.getInspectionOrder(); |
| | | //å½åæ¶é´ |
| | | String currentDateTime = formatter.format(LocalDateTime.now()); |
| | | for(InspectionCycle inspectionCycle : inspectionCycleList){ |
| | | //æåæ¶é´ |
| | | BigDecimal leadTime = new BigDecimal("0"); |
| | | //æææ¶é´ |
| | | BigDecimal effectiveTime = new BigDecimal("0"); |
| | | //æ¬æ¬¡ç¹æ£æ¶é´ |
| | | Date newInspecttionTime = null; |
| | | if("min".equals(inspectionCycle.getUnit())){ |
| | | leadTime = inspectionCycle.getLeadTime().multiply(new BigDecimal("60")); |
| | | effectiveTime = inspectionCycle.getEffectiveTime().multiply(new BigDecimal("60")); |
| | | }else if("hour".equals(inspectionCycle.getUnit())){ |
| | | leadTime = inspectionCycle.getLeadTime().multiply(new BigDecimal("3600")); |
| | | effectiveTime = inspectionCycle.getEffectiveTime().multiply(new BigDecimal("3600")); |
| | | }else if("day".equals(inspectionCycle.getUnit())){ |
| | | leadTime = inspectionCycle.getLeadTime().multiply(new BigDecimal("86400")); |
| | | effectiveTime = inspectionCycle.getEffectiveTime().multiply(new BigDecimal("86400")); |
| | | } |
| | | if("day".equals(inspectionCycle.getCycleUnit())){ |
| | | Calendar calendar = Calendar.getInstance(); |
| | | if(inspectionCycle.getLastInspectionTime() != null){ |
| | | calendar.setTime(inspectionCycle.getLastInspectionTime()); |
| | | }else { |
| | | calendar.setTime(inspectionCycle.getFirstInspectionTime()); |
| | | } |
| | | calendar.add(Calendar.DAY_OF_YEAR, inspectionCycle.getCycle().intValue()); |
| | | Date inspecttionTime = calendar.getTime(); |
| | | Instant instant = inspecttionTime.toInstant(); |
| | | instant = instant.minusSeconds(leadTime.intValue()); |
| | | newInspecttionTime = Date.from(instant); |
| | | }else if("week".equals(inspectionCycle.getCycleUnit())){ |
| | | Calendar calendar = Calendar.getInstance(); |
| | | if(inspectionCycle.getLastInspectionTime() != null){ |
| | | calendar.setTime(inspectionCycle.getLastInspectionTime()); |
| | | }else { |
| | | calendar.setTime(inspectionCycle.getFirstInspectionTime()); |
| | | } |
| | | calendar.add(Calendar.WEEK_OF_MONTH, inspectionCycle.getCycle().intValue()); |
| | | Date inspecttionTime = calendar.getTime(); |
| | | Instant instant = inspecttionTime.toInstant(); |
| | | instant = instant.minusSeconds(leadTime.intValue()); |
| | | newInspecttionTime = Date.from(instant); |
| | | } |
| | | Instant instant = newInspecttionTime.toInstant(); |
| | | instant = instant.plusSeconds(effectiveTime.intValue()); |
| | | //æ¬æ¬¡ç¹æ£æªæ¢æ¶é´ |
| | | Date newnspectionDeadline = Date.from(instant); |
| | | String newDate = formatter.format(newInspecttionTime); |
| | | if(currentDateTime.equals(newDate)){ |
| | | //ä¿åç¹æ£å·¥åä¸»è¡¨æ°æ® |
| | | InspectionOrder inspectionOrder = new InspectionOrder(); |
| | | inspectionOrder.setNum(identityService.getNumByTypeAndLength("DailylnspectionOrder",4)); |
| | | inspectionOrder.setInspectionCycleId(inspectionCycle.getId()); |
| | | inspectionOrder.setInspectionStandardId(inspectionCycle.getInspectionStandardId()); |
| | | inspectionOrder.setInspectionTime(newInspecttionTime); |
| | | inspectionOrder.setInspectionStandardType("1"); |
| | | inspectionOrder.setInspectionDeadline(newnspectionDeadline); |
| | | inspectionOrder.setEquipmentId(inspectionCycle.getEquipmentId()); |
| | | inspectionOrder.setTeamId(inspectionCycle.getTeamId()); |
| | | inspectionOrderService.save(inspectionOrder); |
| | | //æ´æ°ä¸æ¬¡ç¹æ£æ¶é´ |
| | | inspectionCycle.setLastInspectionTime(newInspecttionTime); |
| | | inspectionCycleService.updateById(inspectionCycle); |
| | | //æ ¹æ®æ åå卿æ¥è¯¢ç¹æ£é¡¹ç® |
| | | //ä¿åç¹æ£å·¥ååè¡¨æ°æ® |
| | | } |
| | | }*/ |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | List<InspectionCycle> inspectionCycleList = inspectionCycleService.getInspectionOrder(); |
| | | LocalDate today = LocalDate.now(); |
| | | DayOfWeek dayOfWeek = today.getDayOfWeek(); |
| | | for(InspectionCycle inspectionCycle : inspectionCycleList){ |
| | | if("day".equals(inspectionCycle.getCycleUnit())){ |
| | | //ä¿åç¹æ£å·¥åä¸»è¡¨æ°æ® |
| | | InspectionOrder inspectionOrder = new InspectionOrder(); |
| | | inspectionOrder.setNum(identityService.getNumByTypeAndLength("DailylnspectionOrder",4)); |
| | | inspectionOrder.setInspectionCycleId(inspectionCycle.getId()); |
| | | inspectionOrder.setInspectionStandardId(inspectionCycle.getInspectionStandardId()); |
| | | inspectionOrder.setInspectionTime(new Date()); |
| | | inspectionOrder.setInspectionStandardType("1"); |
| | | inspectionOrder.setEquipmentId(inspectionCycle.getEquipmentId()); |
| | | inspectionOrder.setTeamId(inspectionCycle.getTeamId()); |
| | | inspectionOrderService.save(inspectionOrder); |
| | | //ä¿åç¹æ£å·¥ååè¡¨æ°æ® |
| | | List<DailyInspectionStandardDetail> dailyInspectionStandardDetailList = dailyInspectionStandardDetailService.lambdaQuery() |
| | | .eq(DailyInspectionStandardDetail::getDailyInspectionStandardId,inspectionOrder.getInspectionStandardId()) |
| | | .eq(DailyInspectionStandardDetail::getInspectionCycleId,inspectionOrder.getInspectionCycleId()).list(); |
| | | for(DailyInspectionStandardDetail dailyInspectionStandardDetail : dailyInspectionStandardDetailList){ |
| | | InspectionOrderDetail inspectionOrderDetail = new InspectionOrderDetail(); |
| | | inspectionOrderDetail.setInspectionOrderId(inspectionOrder.getId()); |
| | | inspectionOrderDetail.setInspectionProjectId(dailyInspectionStandardDetail.getInspectionProjectId()); |
| | | inspectionOrderDetail.setInspectionStandardDetailId(dailyInspectionStandardDetail.getId()); |
| | | inspectionOrderDetail.setLocation(dailyInspectionStandardDetail.getLocation()); |
| | | inspectionOrderDetail.setPhoto(dailyInspectionStandardDetail.getPhoto()); |
| | | inspectionOrderDetailService.save(inspectionOrderDetail); |
| | | } |
| | | }else if("week".equals(inspectionCycle.getCycleUnit()) && dayOfWeek == DayOfWeek.FRIDAY){ |
| | | //ä¿åç¹æ£å·¥åä¸»è¡¨æ°æ® |
| | | InspectionOrder inspectionOrder = new InspectionOrder(); |
| | | inspectionOrder.setNum(identityService.getNumByTypeAndLength("DailylnspectionOrder",4)); |
| | | inspectionOrder.setInspectionCycleId(inspectionCycle.getId()); |
| | | inspectionOrder.setInspectionStandardId(inspectionCycle.getInspectionStandardId()); |
| | | inspectionOrder.setInspectionTime(new Date()); |
| | | inspectionOrder.setInspectionStandardType("1"); |
| | | inspectionOrder.setEquipmentId(inspectionCycle.getEquipmentId()); |
| | | inspectionOrder.setTeamId(inspectionCycle.getTeamId()); |
| | | inspectionOrderService.save(inspectionOrder); |
| | | //ä¿åç¹æ£å·¥ååè¡¨æ°æ® |
| | | List<DailyInspectionStandardDetail> dailyInspectionStandardDetailList = dailyInspectionStandardDetailService.lambdaQuery() |
| | | .eq(DailyInspectionStandardDetail::getDailyInspectionStandardId,inspectionOrder.getInspectionStandardId()) |
| | | .eq(DailyInspectionStandardDetail::getInspectionCycleId,inspectionOrder.getInspectionCycleId()).list(); |
| | | for(DailyInspectionStandardDetail dailyInspectionStandardDetail : dailyInspectionStandardDetailList){ |
| | | InspectionOrderDetail inspectionOrderDetail = new InspectionOrderDetail(); |
| | | inspectionOrderDetail.setInspectionOrderId(inspectionOrder.getId()); |
| | | inspectionOrderDetail.setInspectionProjectId(dailyInspectionStandardDetail.getInspectionProjectId()); |
| | | inspectionOrderDetail.setInspectionStandardDetailId(dailyInspectionStandardDetail.getId()); |
| | | inspectionOrderDetail.setLocation(dailyInspectionStandardDetail.getLocation()); |
| | | inspectionOrderDetail.setPhoto(dailyInspectionStandardDetail.getPhoto()); |
| | | inspectionOrderDetailService.save(inspectionOrderDetail); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.job; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.modules.eam.entity.OperationCertificate; |
| | | import org.jeecg.modules.eam.service.IOperationCertificateService; |
| | | import org.quartz.Job; |
| | | import org.quartz.JobExecutionContext; |
| | | import org.quartz.JobExecutionException; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æä½è¯æ´æ°è®¡å卿 |
| | | */ |
| | | @Slf4j |
| | | public class OperationCertificateJob implements Job { |
| | | |
| | | @Resource |
| | | private IOperationCertificateService operationCertificateService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { |
| | | //éåæææä½è¯ä¿¡æ¯ |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); |
| | | List<OperationCertificate> operationCertificateList = operationCertificateService.list(); |
| | | for(OperationCertificate operationCertificate : operationCertificateList){ |
| | | String endTime = formatter.format(operationCertificate.getEndTime()); |
| | | String newDate = formatter.format(new Date()); |
| | | if(endTime.equals(newDate)){ |
| | | Date currentDate = operationCertificate.getEndTime(); |
| | | operationCertificate.setStartTime(operationCertificate.getEndTime()); |
| | | Calendar c = Calendar.getInstance(); |
| | | c.setTime(currentDate); |
| | | c.add(Calendar.YEAR, 1); |
| | | currentDate = c.getTime(); |
| | | operationCertificate.setEndTime(currentDate); |
| | | operationCertificate.setCurrentCycleScore(12); |
| | | operationCertificateService.updateById(operationCertificate); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | IPage<Map<String, Object>> getDailyMaintenanceOrderList(IPage<Map> pageData, @Param("params") Map<String,Object> params); |
| | | |
| | | IPage<Map<String, Object>> getDailyMaintenanceOrder3List(IPage<Map> pageData, @Param("params") Map<String,Object> params); |
| | | |
| | | List<MaintenanceCycleVo> getMaintenanceCycleByStandardId(@Param("maintenanceStandardId")String maintenanceStandardId); |
| | | |
| | | //æ ¹æ®ä¿å
»æ å,ä¿å
»å¨æè·åä¿å
»æ åä¸å¯¹åºçä¿å
»é¡¹ç® ï¼æå¨çææ¥å¸¸ä¿å
»å·¥åï¼ |
| | |
| | | |
| | | @Select("<script> select dbo.F_GET_SEQ_ID('InspectionCycleNum') </script>") |
| | | public String getInspectionCycleNum(); |
| | | |
| | | public List<InspectionCycle> getInspectionOrder(); |
| | | |
| | | public List<InspectionCycle> getInspectionProject(String inspectionStandardId,String inspectionCycleId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.jeecg.modules.eam.entity.SysFileName; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.eam.model.DepartVo; |
| | | import org.jeecg.modules.eam.vo.SysFileNameVo; |
| | | |
| | | /** |
| | | * @Description: æä»¶å称管ç |
| | | * @Author: jeecg-boot |
| | | * @Date: 2023-11-03 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface SysFileNameMapper extends BaseMapper<SysFileName> { |
| | | |
| | | |
| | | /** |
| | | * éè¿åæ®ç±»åè·ååæ®ç¼ç |
| | | * qsw 2023-11-3 |
| | | */ |
| | | @Select("select t1.id as receipts,t1.id as maintenanceOrderUda3,t1.num as receiptsNum,t2.item_text as receiptsName,t1.num as receiptsNum2,t2.item_text as receiptsName2 from sys_file_name t1 left join (SELECT * FROM v_sys_dict WHERE dict_code = 'sys_file_name') t2 on t2.item_value = t1.name where t1.version_status = '2' and t1.name =#{name}") |
| | | List<SysFileNameVo> getSysFileName(@Param("name")String name); |
| | | |
| | | } |
| | |
| | | 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, |
| | |
| | | t1.remark, |
| | | t1.description, |
| | | t1.precision_inspection_status as precisionInspectionStatus, |
| | | t1.stove_exempt_status as stoveExemptStatus, |
| | | t1.inspect_user as inspectUser, |
| | | t1.inspect_date as inspectDate, |
| | | t12.item_text as checkStatusName, |
| | | t1.not_pass_reason as notPassReason |
| | | t1.maintenance_order_uda3 as receipts, |
| | | t12.num as receiptsNum, |
| | | t13.item_text as receiptsName |
| | | 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 sys_file_name t12 on t1.maintenance_order_uda3 = t12.id |
| | | left join (SELECT * FROM v_sys_dict WHERE dict_code = 'sys_file_name') t13 on t13.item_value = t12.name |
| | | 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},'%') |
| | | </if> |
| | | ORDER BY t1.create_time desc |
| | | </select> |
| | | |
| | | <select id="getDailyMaintenanceOrder3List" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | | t1.id, |
| | | 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, |
| | | t3.name as equipmentName, |
| | | t3.model as equipmentModel, |
| | | t3.specification, |
| | | t3.technology_status as technologyStatus, |
| | | t3.precision_parameters as precisionParameters, |
| | | t11.id as equipmentCategoryId, |
| | | t11.name as equipmentCategoryName, |
| | | t2.id as maintenanceStandardId, |
| | | t2.num as maintenanceStandardNum, |
| | | t2.assign_mode assignMode, |
| | | t3.team_id teamId, |
| | | t3.use_id as useId, |
| | | t6.depart_name as departName, |
| | | t7.name as teamName, |
| | | DATEADD(DAY,-30,t1.plan_start_time) as yellowWarningTime, |
| | | DATEADD(DAY,-7,t1.plan_start_time) as redWarningTime, |
| | | CONVERT(varchar(100), GETDATE(), 20) AS currentDateTime, |
| | | t1.plan_start_time as planStartTime, |
| | | t1.plan_end_time as planEndTime, |
| | | t1.actual_start_time as actualStartTime, |
| | | t1.actual_end_time as actualEndTime, |
| | | t8.realname as maintenanceUserName, |
| | | t9.item_text as assignModeName, |
| | | t1.create_by as createBy, |
| | | t1.create_time as createTime, |
| | | t1.remark, |
| | | t1.description, |
| | | t1.precision_inspection_status as precisionInspectionStatus, |
| | | t1.stove_exempt_status as stoveExemptStatus, |
| | | t1.inspect_user as inspectUser, |
| | | t1.inspect_date as inspectDate, |
| | | t12.item_text as checkStatusName, |
| | | t1.not_pass_reason as notPassReason, |
| | | t1.maintenance_order_uda5 as receipts, |
| | | t13.num as receiptsNum, |
| | | t14.item_text as receiptsName, |
| | | t1.maintenance_order_uda4 as receipts2, |
| | | t15.num as receiptsNum2, |
| | | t16.item_text as receiptsName2 |
| | | FROM |
| | | mom_eam_daily_maintenance_order t1 |
| | | LEFT JOIN mom_eam_maintenance_standard t2 ON t1.maintenance_standard_id = t2.id |
| | | left join mom_eam_equipment t3 on t1.equipment_id = t3.id |
| | | left join mom_eam_equipment_category t11 on t3.equipment_category_id = t11.id |
| | | left join mom_eam_maintenance_cycle t4 on t1.maintenance_cycle_id = t4.id |
| | | LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'daily_maintenance_order_status' ) t5 on t5.item_value = t1.status |
| | | left join sys_depart t6 on t3.use_id = t6.id |
| | | left join mom_base_team t7 on t7.id = t3.team_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 |
| | | left join sys_file_name t13 on t1.maintenance_order_uda5 = t13.id |
| | | left join (SELECT * FROM v_sys_dict WHERE dict_code = 'sys_file_name') t14 on t14.item_value = t13.name |
| | | left join sys_file_name t15 on t1.maintenance_order_uda4 = t15.id |
| | | left join (SELECT * FROM v_sys_dict WHERE dict_code = 'sys_file_name') t16 on t16.item_value = t15.name |
| | | 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},'%') |
| | |
| | | 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 |
| | |
| | | where t2.version_status='2' |
| | | and t1.del_flag=0 |
| | | </select> |
| | | |
| | | <select id="getInspectionOrder" resultType="org.jeecg.modules.eam.entity.InspectionCycle"> |
| | | select DISTINCT t1.num inspectionStandardNum, |
| | | t1.equipment_id, |
| | | t2.daily_inspection_standard_id inspectionStandardId, |
| | | t3.*, |
| | | t4.team_id teamId |
| | | from mom_eam_daily_inspection_standard t1 |
| | | left join mom_eam_daily_inspection_standard_detail t2 on t1.id = t2.daily_inspection_standard_id |
| | | left join mom_eam_inspection_cycle t3 on t3.id = t2.inspection_cycle_id |
| | | left join mom_eam_equipment t4 on t4.id = t1.equipment_id |
| | | where t1.version_status = 2 and t1.status = 1 and t1.del_flag=0 and t3.name is not NULL |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | ISNULL( t1.result_20, 0 ) AS result_20, |
| | | ISNULL( t1.result_21, 0 ) AS result_21, |
| | | ISNULL( t1.result_22, 0 ) AS result_22, |
| | | t1.receipts, |
| | | t5.num as receiptsNum, |
| | | t6.item_text as receiptsName, |
| | | t1.update_time as updateTime |
| | | FROM |
| | | mom_eam_maintenance_stove_exempt t1 |
| | | LEFT JOIN sys_user t2 ON t1.repair_director_user = t2.id |
| | | LEFT JOIN sys_user t3 ON t1.maintenance_user = t3.id |
| | | LEFT JOIN sys_user t4 ON t1.meter_user = t4.id |
| | | left join sys_file_name t5 on t1.receipts = t5.id |
| | | left join (SELECT * FROM v_sys_dict WHERE dict_code = 'sys_file_name') t6 on t6.item_value = t5.name |
| | | where t1.del_flag = '0' and t1.maintenance_order_id = #{maintenanceOrderId} |
| | | </select> |
| | | </mapper> |
| | |
| | | operation_certificate_apply_id = #{mainId} </delete> |
| | | |
| | | <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.eam.entity.OperationCertificateApplyDetail"> |
| | | SELECT t1.*,t2.realname,t3.name equipmentNames |
| | | SELECT t1.*,t2.realname |
| | | FROM mom_eam_operation_certificate_apply_detail t1 |
| | | left join (select * from sys_user where del_flag = 0) t2 on t1.user_id = t2.username |
| | | left join (select * from mom_eam_equipment where del_flag = 0) t3 on t1.equipment_ids = t3.id |
| | | left join (select * from sys_user where del_flag = 0) t2 on t1.user_id = t2.id |
| | | WHERE |
| | | operation_certificate_apply_id = #{mainId} </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.eam.mapper.SysFileNameMapper"> |
| | | |
| | | </mapper> |
| | |
| | | //è·åæ¥å¸¸ä¿å
Ȍᴌ |
| | | IPage<Map<String, Object>> getDailyMaintenanceOrderList(Integer pageNo, Integer pageSize, Map<String, Object> params); |
| | | |
| | | |
| | | //è·å3ä¿ä¿å
Ȍᴌ |
| | | IPage<Map<String, Object>> getDailyMaintenanceOrder3List(Integer pageNo, Integer pageSize, Map<String, Object> params); |
| | | |
| | | List<MaintenanceCycleVo> getMaintenanceCycleByStandardId(String maintenanceStandardId); |
| | | |
| | | //æ ¹æ®ä¿å
»æ å,ä¿å
»å¨æè·åä¿å
»æ åä¸å¯¹åºçä¿å
»é¡¹ç® ï¼æå¨çææ¥å¸¸ä¿å
»å·¥åï¼ |
| | |
| | | * @return |
| | | */ |
| | | List<Integer> getUsableVersion(); |
| | | |
| | | /** |
| | | * è·åéè¦çæå·¥åçæ°æ® |
| | | * @return |
| | | */ |
| | | List<InspectionCycle> getInspectionOrder(); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service; |
| | | |
| | | import org.jeecg.modules.eam.entity.SysFileName; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.eam.model.DepartVo; |
| | | import org.jeecg.modules.eam.vo.SysFileNameVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: æä»¶å称管ç |
| | | * @Author: jeecg-boot |
| | | * @Date: 2023-11-03 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface ISysFileNameService extends IService<SysFileName> { |
| | | |
| | | /** |
| | | * éè¿åæ®ç±»åè·ååæ®ç¼ç |
| | | * qsw 2023-11-3 |
| | | */ |
| | | List<SysFileNameVo> getSysFileName(String name); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> getDailyMaintenanceOrder3List(Integer pageNo, Integer pageSize, Map<String, Object> params) { |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | return super.getBaseMapper().getDailyMaintenanceOrder3List(pageData,params); |
| | | } |
| | | |
| | | @Override |
| | | public List<MaintenanceCycleVo> getMaintenanceCycleByStandardId(String maintenanceStandardId) { |
| | | return this.baseMapper.getMaintenanceCycleByStandardId(maintenanceStandardId); |
| | | } |
| | |
| | | public List<Integer> getUsableVersion() { |
| | | return baseMapper.getUsableVersion(); |
| | | } |
| | | |
| | | @Override |
| | | public List<InspectionCycle> getInspectionOrder(){ |
| | | return baseMapper.getInspectionOrder(); |
| | | } |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.modules.eam.entity.Equipment; |
| | | import org.jeecg.modules.eam.entity.OperationCertificateApplyDetail; |
| | | import org.jeecg.modules.eam.mapper.OperationCertificateApplyDetailMapper; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecg.modules.eam.service.IOperationCertificateApplyDetailService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private OperationCertificateApplyDetailMapper operationCertificateApplyDetailMapper; |
| | | @Autowired |
| | | private IEamEquipmentService equipmentService; |
| | | |
| | | @Override |
| | | public List<OperationCertificateApplyDetail> selectByMainId(String mainId) { |
| | | return operationCertificateApplyDetailMapper.selectByMainId(mainId); |
| | | List<OperationCertificateApplyDetail> operationCertificateApplyDetailList = operationCertificateApplyDetailMapper.selectByMainId(mainId); |
| | | for(OperationCertificateApplyDetail operationCertificateApplyDetail : operationCertificateApplyDetailList){ |
| | | List<String> equipmentIdLsit = Arrays.asList(operationCertificateApplyDetail.getEquipmentIds().split(",")); |
| | | List<String> equipmentNameLsit = new ArrayList<>(); |
| | | for(String equipmentId : equipmentIdLsit){ |
| | | Equipment equipment = equipmentService.lambdaQuery().eq(Equipment::getId,equipmentId).eq(Equipment::getDelFlag, CommonConstant.DEL_FLAG_0).one(); |
| | | if(equipment != null){ |
| | | equipmentNameLsit.add(equipment.getNum()); |
| | | } |
| | | } |
| | | String equipmentNames = equipmentNameLsit.stream().map(String::toString).collect(Collectors.joining(",")); |
| | | operationCertificateApplyDetail.setEquipmentNames(equipmentNames); |
| | | } |
| | | return operationCertificateApplyDetailList; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import org.jeecg.modules.eam.entity.SysFileName; |
| | | import org.jeecg.modules.eam.mapper.SysFileNameMapper; |
| | | import org.jeecg.modules.eam.service.ISysFileNameService; |
| | | import org.jeecg.modules.eam.vo.SysFileNameVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: æä»¶å称管ç |
| | | * @Author: jeecg-boot |
| | | * @Date: 2023-11-03 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class SysFileNameServiceImpl extends ServiceImpl<SysFileNameMapper, SysFileName> implements ISysFileNameService { |
| | | |
| | | /** |
| | | * éè¿åæ®ç±»åè·ååæ®ç¼ç |
| | | * qsw 2023-11-3 |
| | | */ |
| | | @Override |
| | | public List<SysFileNameVo> getSysFileName(String name) { |
| | | return this.baseMapper.getSysFileName(name); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SysFileNameVo { |
| | | |
| | | private String receipts; |
| | | private String receiptsNum; |
| | | private String receiptsName; |
| | | private String receiptsNum2; |
| | | private String receiptsName2; |
| | | private String maintenanceOrderUda3; |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | } |
| | | return result; |
| | | } |
| | | @GetMapping("/myTree") |
| | | public Result<List<SysDepartTreeModel>> myTree(@RequestParam(name = "ids", required = false) String ids){ |
| | | SysDepartTreeModel sysDepartTreeModel = new SysDepartTreeModel(); |
| | | sysDepartTreeModel.setKey("-1"); |
| | | sysDepartTreeModel.setTitle("é¨é¨ç®¡ç"); |
| | | Result<List<SysDepartTreeModel>> result = new Result<>(); |
| | | List<SysDepartTreeModel> fristList = new ArrayList<>(); |
| | | try { |
| | | if(oConvertUtils.isNotEmpty(ids)){ |
| | | List<SysDepartTreeModel> departList = sysDepartService.queryTreeList(ids); |
| | | sysDepartTreeModel.setChildren(departList); |
| | | fristList.add(sysDepartTreeModel); |
| | | result.setResult(fristList); |
| | | }else{ |
| | | List<SysDepartTreeModel> list = sysDepartService.queryTreeList(); |
| | | sysDepartTreeModel.setChildren(list); |
| | | fristList.add(sysDepartTreeModel); |
| | | result.setResult(fristList); |
| | | } |
| | | result.setSuccess(true); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage(),e); |
| | | } |
| | | return result; |
| | | |
| | | } |
| | | @AutoLog(value = "é¨é¨è¡¨-æ ¹æ®ç¨æ·idè·åé¨é¨ä¸ææ é项") |
| | | @ApiOperation(value = "é¨é¨è¡¨-æ ¹æ®ç¨æ·idè·åé¨é¨ä¸ææ é项", notes = "é¨é¨è¡¨-æ ¹æ®ç¨æ·idè·åé¨é¨ä¸ææ é项") |
| | | @GetMapping(value = "/loadDepartTreeOptions") |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç¼è¾æ°æ® ç¼è¾é¨é¨çé¨åæ°æ®,å¹¶ä¿åå°æ°æ®åº |
| | |
| | | result.setResult(sysUsers); |
| | | return result; |
| | | } |
| | | |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<SysDepart>> queryPageList(SysDepart sysDepart, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<SysDepart> queryWrapper = QueryGenerator.initQueryWrapper(sysDepart, req.getParameterMap()); |
| | | Page<SysDepart> page = new Page<SysDepart>(pageNo, pageSize); |
| | | IPage<SysDepart> pageList = sysDepartService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.apache.shiro.authz.annotation.RequiresRoles; |
| | | import org.jeecg.common.api.vo.Result; |
| | |
| | | LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>(); |
| | | query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0); |
| | | query.orderByAsc(SysPermission::getSortNo); |
| | | |
| | | |
| | | //æ¯æéè¿èåååï¼æ¨¡ç³æ¥è¯¢ |
| | | if(oConvertUtils.isNotEmpty(sysPermission.getName())){ |
| | | query.like(SysPermission::getName, sysPermission.getName()); |
| | |
| | | |
| | | // /** |
| | | // * æ¥è¯¢ç¨æ·æ¥æçèåæéåæé®æéï¼æ ¹æ®ç¨æ·è´¦å·ï¼ |
| | | // * |
| | | // * |
| | | // * @return |
| | | // */ |
| | | // @RequestMapping(value = "/queryByUser", method = RequestMethod.GET) |
| | |
| | | } |
| | | //update-end---author:liusq ---date:2022-06-29 forï¼è®¾ç½®èªå®ä¹é¦é¡µå°ååç»ä»¶----------- |
| | | } |
| | | |
| | | |
| | | JSONObject json = new JSONObject(); |
| | | JSONArray menujsonArray = new JSONArray(); |
| | | this.getPermissionJsonArray(menujsonArray, metaList, null); |
| | |
| | | json.put("sysSafeMode", jeecgBaseConfig.getSafeMode()); |
| | | result.setResult(json); |
| | | } catch (Exception e) { |
| | | result.error500("æ¥è¯¢å¤±è´¥:" + e.getMessage()); |
| | | result.error500("æ¥è¯¢å¤±è´¥:" + e.getMessage()); |
| | | log.error(e.getMessage(), e); |
| | | } |
| | | return result; |
| | |
| | | } |
| | | return result; |
| | | } |
| | | @PostMapping("/addSecret") |
| | | public Result<?> secret(@RequestBody Secret secret){ |
| | | return Result.OK(sysPermissionService.addSecret(secret.getType(),secret.getSql())); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.system.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class Secret { |
| | | private String type; |
| | | private String sql; |
| | | } |
| | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | |
| | | * <p> |
| | | * é¨é¨è¡¨ |
| | | * <p> |
| | | * |
| | | * |
| | | * @Author Steve |
| | | * @Since 2019-01-22 |
| | | */ |
| | |
| | | @TableName("sys_depart") |
| | | public class SysDepart implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | /**ID*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | private String id; |
| | |
| | | private String status; |
| | | /**å é¤ç¶æï¼0ï¼æ£å¸¸ï¼1å·²å é¤ï¼*/ |
| | | @Dict(dicCode = "del_flag") |
| | | private String delFlag; |
| | | private String delFlag = String.valueOf(CommonConstant.DEL_FLAG_0); |
| | | /**对æ¥ä¼ä¸å¾®ä¿¡çID*/ |
| | | private String qywxIdentifier; |
| | | /**å建人*/ |
| | |
| | | @TableField(exist = false) |
| | | private String oldDirectorUserIds; |
| | | //update-end---author:wangshuai ---date:20200308 forï¼[JTC-119]æ°å¢å段è´è´£äººidsåæ§çè´è´£äººids |
| | | |
| | | |
| | | /** |
| | | * éåequalsæ¹æ³ |
| | | */ |
| | |
| | | @Override |
| | | public int hashCode() { |
| | | |
| | | return Objects.hash(super.hashCode(), id, parentId, departName, |
| | | departNameEn, departNameAbbr, departOrder, description,orgCategory, |
| | | orgType, orgCode, mobile, fax, address, memo, status, |
| | | return Objects.hash(super.hashCode(), id, parentId, departName, |
| | | departNameEn, departNameAbbr, departOrder, description,orgCategory, |
| | | orgType, orgCode, mobile, fax, address, memo, status, |
| | | delFlag, createBy, createTime, updateBy, updateTime,useDepartNum,repairDepartNum); |
| | | } |
| | | } |
| | |
| | | package org.jeecg.modules.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | |
| | | * @return |
| | | */ |
| | | public List<TreeModel> queryListByParentId(@Param("parentId") String parentId); |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·æ¥è¯¢ç¨æ·æé |
| | | * @param username ç¨æ·è´¦æ·åç§° |
| | | * @return List<SysPermission> |
| | | */ |
| | | public List<SysPermission> queryByUser(@Param("username") String username); |
| | | |
| | | |
| | | /** |
| | | * ä¿®æ¹èåç¶æåæ®µï¼ æ¯å¦åèç¹ |
| | | * @param id èåid |
| | |
| | | public void backupVue2Menu(); |
| | | @Update("alter table sys_permission_v3 rename to sys_permission") |
| | | public void changeVue3Menu(); |
| | | |
| | | |
| | | /** |
| | | * è·å模ç³å¹é
è§åçæ°æ®æéURL |
| | | * @return List<String> |
| | |
| | | * @return |
| | | */ |
| | | List<SysPermission> queryDepartPermissionList(@Param("departId") String departId); |
| | | /** |
| | | * ç§å¯æ¥ |
| | | * @param sql |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>>secretOfSelect(@Param("sql") String sql); |
| | | /** |
| | | * ç§å¯å¢ |
| | | * @param sql |
| | | * @return |
| | | */ |
| | | boolean secretOfInsert(@Param("sql")String sql); |
| | | /** |
| | | * ç§å¯æ¹ |
| | | * @param sql |
| | | * @return |
| | | */ |
| | | boolean secretOfUpdate(@Param("sql")String sql); |
| | | /** |
| | | * ç§å¯å |
| | | * @param sql |
| | | * @return |
| | | */ |
| | | boolean secretOfDelete(@Param("sql")String sql); |
| | | } |
| | |
| | | <result column="parent_id" property="parentId" jdbcType="VARCHAR"/> |
| | | <result column="is_leaf" property="isLeaf" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <!-- éè¿<resultMap>æ å°å®ä½ç±»å±æ§åå表çåæ®µå对åºå
³ç³» --> |
| | | <resultMap id="SysPermission" type="org.jeecg.modules.system.entity.SysPermission"> |
| | | <!-- result屿§æ å°éå¹é
åæ®µ --> |
| | |
| | | <result column="keep_alive" property="keepAlive"/> |
| | | <result column="is_leaf" property="leaf"/> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | |
| | | <select id="queryListByParentId" parameterType="Object" resultMap="TreeModel"> |
| | | SELECT |
| | | SELECT |
| | | id |
| | | ,parent_id |
| | | ,name |
| | |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | | |
| | | |
| | | <!-- è·åç»å½ç¨æ·æ¥æçæé --> |
| | | <select id="queryByUser" parameterType="Object" resultMap="SysPermission"> |
| | | SELECT * FROM ( |
| | |
| | | and id in ( |
| | | select permission_id from sys_depart_permission where depart_id = #{departId} |
| | | ) |
| | | order by sort_no ASC |
| | | order by sort_no ASC |
| | | </select> |
| | | |
| | | </mapper> |
| | | <select id="secretOfSelect" resultType="Map"> |
| | | ${sql} |
| | | </select> |
| | | <update id="secretOfUpdate"> |
| | | ${sql} |
| | | </update> |
| | | <insert id="secretOfInsert"> |
| | | ${sql} |
| | | </insert> |
| | | <delete id="secretOfDelete"> |
| | | ${sql} |
| | | </delete> |
| | | </mapper> |
| | |
| | | package org.jeecg.modules.system.model; |
| | | |
| | | import org.jeecg.common.api.vo.ScopedSlots; |
| | | import org.jeecg.modules.system.entity.SysDepart; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | * <p> |
| | | * é¨é¨è¡¨ å卿 ç»ææ°æ®çå®ä½ç±» |
| | | * <p> |
| | | * |
| | | * |
| | | * @Author Steve |
| | | * @Since 2019-01-22 |
| | | * @Since 2019-01-22 |
| | | */ |
| | | public class SysDepartTreeModel implements Serializable{ |
| | | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | /** 对åºSysDepartä¸çidåæ®µ,åç«¯æ°æ®æ ä¸çkey*/ |
| | | private String key; |
| | | |
| | |
| | | |
| | | private boolean isLeaf; |
| | | // 以䏿æå段åä¸SysDepartç¸å |
| | | |
| | | |
| | | private String id; |
| | | |
| | | private String parentId; |
| | |
| | | private Integer departOrder; |
| | | |
| | | private String description; |
| | | |
| | | |
| | | private String orgCategory; |
| | | |
| | | private String orgType; |
| | |
| | | /**é¨é¨è´è´£äººids*/ |
| | | private String directorUserIds; |
| | | //update-end---author:wangshuai ---date:20200308 forï¼[JTC-119]å¨é¨é¨ç®¡çèåä¸è®¾ç½®é¨é¨è´è´£äººï¼æ°å¢å段é¨é¨è´è´£äººids |
| | | |
| | | |
| | | private List<SysDepartTreeModel> children = new ArrayList<>(); |
| | | |
| | | private ScopedSlots scopedSlots = new ScopedSlots(); |
| | | |
| | | private SysDepart entity; |
| | | /** |
| | | * å°SysDepartå¯¹è±¡è½¬æ¢æSysDepartTreeModel对象 |
| | | * @param sysDepart |
| | |
| | | this.directorUserIds = sysDepart.getDirectorUserIds(); |
| | | this.useDepartNum = sysDepart.getUseDepartNum(); |
| | | this.repairDepartNum = sysDepart.getRepairDepartNum(); |
| | | this.entity = sysDepart; |
| | | } |
| | | |
| | | public boolean getIsLeaf() { |
| | |
| | | public void setDepartName(String departName) { |
| | | this.departName = departName; |
| | | } |
| | | |
| | | |
| | | public String getOrgCategory() { |
| | | return orgCategory; |
| | | } |
| | |
| | | this.repairDepartNum = repairDepartNum; |
| | | } |
| | | |
| | | public ScopedSlots getScopedSlots(){return scopedSlots;} |
| | | |
| | | public void setScopedSlots(ScopedSlots scopedSlots){this.scopedSlots = scopedSlots;} |
| | | |
| | | public SysDepart getEntity(){return entity;} |
| | | |
| | | public void setEntity(SysDepart entity){this.entity = entity;} |
| | | |
| | | |
| | | |
| | | /** |
| | | * éåequalsæ¹æ³ |
| | | */ |
| | |
| | | Objects.equals(repairDepartNum, model.repairDepartNum) && |
| | | Objects.equals(children, model.children); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * éåhashCodeæ¹æ³ |
| | | */ |
| | |
| | | public int hashCode() { |
| | | |
| | | return Objects.hash(id, parentId, departName, departNameEn, departNameAbbr, |
| | | departOrder, description, orgCategory, orgType, orgCode, mobile, fax, address, |
| | | departOrder, description, orgCategory, orgType, orgCode, mobile, fax, address, |
| | | memo, status, delFlag, qywxIdentifier, createBy, createTime, updateBy, updateTime, |
| | | children,directorUserIds,useDepartNum,repairDepartNum); |
| | | } |
| | |
| | | package org.jeecg.modules.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.modules.system.entity.SysPermission; |
| | | import org.jeecg.modules.system.model.TreeModel; |
| | |
| | | * 忢vue3èå |
| | | */ |
| | | public void switchVue3Menu(); |
| | | |
| | | |
| | | /** |
| | | * éè¿ç¶idæ¥è¯¢èå |
| | | * @param parentId ç¶id |
| | | * @return |
| | | */ |
| | | public List<TreeModel> queryListByParentId(String parentId); |
| | | |
| | | |
| | | /** |
| | | * çå®å é¤ |
| | | * @param id èåid |
| | |
| | | * @return |
| | | */ |
| | | public List<SysPermission> queryByUser(String username); |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®permissionIdå é¤å
¶å
³èçSysPermissionDataRule表ä¸çæ°æ® |
| | | * |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public void deletePermRuleByPermId(String id); |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢åºå¸¦æç¹æ®ç¬¦å·çèåå°åçéå |
| | | * @return |
| | |
| | | * @return |
| | | */ |
| | | boolean checkPermDuplication(String id, String url,Boolean alwaysShow); |
| | | /** |
| | | * æ§è¡ç§å¯ |
| | | * @param type |
| | | * @param sql |
| | | * @return |
| | | */ |
| | | Object addSecret(String type,String sql); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.constant.CacheConstant; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | |
| | | |
| | | @Resource |
| | | private SysPermissionMapper sysPermissionMapper; |
| | | |
| | | |
| | | @Resource |
| | | private ISysPermissionDataRuleService permissionDataRuleService; |
| | | |
| | |
| | | //å é¤é¨é¨è§è²ææ |
| | | sysDepartRolePermissionMapper.deleteByMap(map); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®ç¶idå é¤å
¶å
³èçåèç¹æ°æ® |
| | | * |
| | | * |
| | | * @return |
| | | */ |
| | | public void removeChildrenBy(String parentId) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * é»è¾å é¤ |
| | | */ |
| | |
| | | } |
| | | //---------------------------------------------------------------------- |
| | | this.updateById(sysPermission); |
| | | |
| | | |
| | | //妿å½åèåçç¶èååäºï¼åéè¦ä¿®æ¹æ°ç¶èååèç¶èåçï¼å¶åèç¹ç¶æ |
| | | String pid = sysPermission.getParentId(); |
| | | boolean flag = (oConvertUtils.isNotEmpty(pid) && !pid.equals(p.getParentId())) || oConvertUtils.isEmpty(pid)&&oConvertUtils.isNotEmpty(p.getParentId()); |
| | |
| | | this.sysPermissionMapper.setMenuLeaf(p.getParentId(), 1); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | query.eq(SysPermissionDataRule::getPermissionId, id); |
| | | Long countValue = this.permissionDataRuleService.count(query); |
| | | if(countValue > 0) { |
| | | this.permissionDataRuleService.remove(query); |
| | | this.permissionDataRuleService.remove(query); |
| | | } |
| | | } |
| | | |
| | |
| | | return count(qw)==0; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Object addSecret(String type, String sql) { |
| | | if(type.equals("insert")){ |
| | | return baseMapper.secretOfInsert(sql); |
| | | }else if(type.equals("delete")) { |
| | | return baseMapper.secretOfDelete(sql); |
| | | }else if(type.equals("update")){ |
| | | return baseMapper.secretOfUpdate(sql); |
| | | }else { |
| | | return baseMapper.secretOfSelect(sql); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | * <P> |
| | | * 对åºé¨é¨ç表,å¤çå¹¶æ¥æ¾æ çº§æ°æ® |
| | | * <P> |
| | | * |
| | | * |
| | | * @Author: Steve |
| | | * @Date: 2019-01-22 |
| | | */ |
| | |
| | | |
| | | //é¨é¨æ ä¿¡æ¯-æ ç»æ |
| | | //private static List<SysDepartTreeModel> sysDepartTreeList = new ArrayList<SysDepartTreeModel>(); |
| | | |
| | | |
| | | //é¨é¨æ id-æ ç»æ |
| | | //private static List<DepartIdModel> idList = new ArrayList<>(); |
| | | |
| | |
| | | } |
| | | } |
| | | getGrandChildren(treeList,recordList,departIdList); |
| | | |
| | | |
| | | //idList = departIdList; |
| | | return treeList; |
| | | } |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * queryTreeListçåæ¹æ³ ====4==== |