| | |
| | | "avatar": "", |
| | | "version": "4.9.2", |
| | | "createdTime": "2025-3-10 16:38:19", |
| | | "updatedTime": "2025-7-21 18:29:46", |
| | | "updatedTime": "2025-7-22 14:27:53", |
| | | "dbConns": [], |
| | | "profile": { |
| | | "default": { |
| | |
| | | "id": "951E3090-8A27-4E30-A5F0-308B3E9F8E6D" |
| | | }, |
| | | { |
| | | "defKey": "technology_genarate_flag", |
| | | "defKey": "technology_generate_flag", |
| | | "defName": "ææ¯ç¶æé´å®çææ è®°", |
| | | "comment": "1 å·²çæ 0 䏿¬¡å¾
çæ", |
| | | "type": "", |
| | |
| | | "id": "0F8E5A79-4399-42B0-B893-254A6D9DEFAD" |
| | | }, |
| | | { |
| | | "defKey": "third_maintenance_genarate_flag", |
| | | "defKey": "third_maintenance_generate_flag", |
| | | "defName": "ä¸ä¿çææ è®°", |
| | | "comment": "1 å·²çæ 0 䏿¬¡å¾
çæ", |
| | | "type": "", |
| | |
| | | "extProps": {}, |
| | | "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792", |
| | | "id": "589C45F0-0F8C-4497-8999-A8314DE5D601" |
| | | }, |
| | | { |
| | | "defKey": "acceptance_check_comment", |
| | | "defName": "éªæ¶æè§", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573", |
| | | "id": "0177078A-470B-44DE-8196-D8013935A223" |
| | | } |
| | | ], |
| | | "correlations": [], |
| | |
| | | "baseType": "89D69E81-EA34-42EE-9FA2-93B8BD27E098" |
| | | }, |
| | | { |
| | | "defKey": "equipment_id", |
| | | "defName": "设å¤ID", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "16120F75-6AA7-4483-868D-F07F511BB081", |
| | | "id": "013BD2A8-0A95-4AC3-BF62-11D03C96304F" |
| | | }, |
| | | { |
| | | "defKey": "application_status", |
| | | "defName": "ç³è¯·åç¶æ", |
| | | "comment": "å¾
æäº¤ãå¾
åä½å®¤çº§é¢å¯¼å®¡æ ¸ãç产设å¤ç®¡çä¸»ç®¡å®¡æ ¸ãå¾
ä¿éé¨é¢å¯¼å®¡æ ¸ãå·²ä½åºã已宿", |
| | |
| | | "attr9": "", |
| | | "id": "1FDD4335-E2A5-4925-B353-DFB1518E8893", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64" |
| | | }, |
| | | { |
| | | "defKey": "remark", |
| | | "defName": "夿³¨", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573", |
| | | "id": "77353547-B01B-4592-BCF4-04635339597F" |
| | | } |
| | | ], |
| | | "correlations": [], |
| | |
| | | String SECOND_MAINTENANCE_CODE_RULE = "SecondMaintenanceCodeRule"; |
| | | //ä¸ä¿ç¼ç è§å |
| | | String THIRD_MAINTENANCE_CODE_RULE = "ThirdMaintenanceCodeRule"; |
| | | //ä¸ä¿åæ´ç¼ç è§å |
| | | String THIRD_MAINTENANCE_CHANGE_CODE_RULE = "ThirdMaintenanceChangeCodeRule"; |
| | | //设å¤ååºå½è¿ |
| | | String LEAN_OUT_CODE_RULE = "EquipmentLeanOutCodeRule"; |
| | | //设å¤å°åå¯å° |
| | |
| | | SECOND_MAINTENANCE, //äºä¿ |
| | | THIRD_MAINTENANCE_HANDOVER, //ä¸ä¿ç§»äº¤å |
| | | THIRD_MAINTENANCE_ACCEPTANCE, //ä¸ä¿éªæ¶å |
| | | THIRD_MAINTENANCE_CHANGE, //ä¸ä¿åæ´å |
| | | TECHNICAL_STATUS_EVALUATION, //ææ¯ç¶æé´å®è¡¨ |
| | | TECHNICAL_STATUS_EVALUATION_SAFETY_CHECK, //设å¤å®å
¨è£
ç½®æ£æ¥å |
| | | TECHNICAL_STATUS_EVALUATION_OTHER_CHECK, //å
¶ä»æ£æ¥é¡¹ç® |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.constant; |
| | | |
| | | public enum ThirdMaintenanceChangeReasonEnum { |
| | | PRODUCTION_WORK_ORDER_EXPEDITED, //çäº§ä»»å¡æ¥æ æ³åæº |
| | | EQUIPMENT_BREAKDOWN_REPAIR, //è®¾å¤æ
鿣å¤äºç»´ä¿®ç¶æ |
| | | EQUIPMENT_SCRAPPED, //设å¤å·²æ¥åº |
| | | EQUIPMENT_MAJOR, //设å¤å¤§ä¿®ã项修 |
| | | EQUIPMENT_RETROFITTING, //è®¾å¤æ¹é |
| | | ; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.constant; |
| | | |
| | | public enum ThirdMaintenanceChangeStatusEnum { |
| | | WAIT_SUBMIT, //å¾
æäº¤ |
| | | EQUIPMENT_MANAGER_SIGNING, //主管é¢å¯¼ç¾åä¸ |
| | | DEPART_MANAGER_SIGNING, //é¨é¨é¢å¯¼ç¾åä¸ |
| | | PRODUCTION_SUPPORT_SIGNING, //ä¿éé¨é¢å¯¼ç¾åä¸ |
| | | ABOLISH, //å·²ä½åº |
| | | REJECTED, //已驳å |
| | | COMPLETED, //已宿 |
| | | ; |
| | | |
| | | public static ThirdMaintenanceChangeStatusEnum getInstance(String code) { |
| | | ThirdMaintenanceChangeStatusEnum[] values = ThirdMaintenanceChangeStatusEnum.values(); |
| | | for (ThirdMaintenanceChangeStatusEnum value : values) { |
| | | if (value.name().equals(code)) { |
| | | return value; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | package org.jeecg.modules.eam.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | */ |
| | | @Excel(name = "ä¸ä¿å·¥åID", width = 15) |
| | | @ApiModelProperty(value = "ä¸ä¿å·¥åID") |
| | | @Dict(dictTable = "eam_third_maintenance_order", dicCode = "id", dicText = "order_num") |
| | | private String orderId; |
| | | /** |
| | | * åæ´åå· |
| | |
| | | */ |
| | | @Excel(name = "ç³è¯·äºº", width = 15) |
| | | @ApiModelProperty(value = "ç³è¯·äºº") |
| | | @Dict(dicCode = "sys_user, realname, username") |
| | | @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") |
| | | private String applicant; |
| | | /** |
| | | * ç³è¯·é¨é¨ |
| | | */ |
| | | @Excel(name = "ç³è¯·é¨é¨", width = 15) |
| | | @ApiModelProperty(value = "ç³è¯·é¨é¨") |
| | | @Dict(dictTable = "eam_base_factory",dicText = "factory_name",dicCode = "org_code") |
| | | private String factoryOrgCode; |
| | | /** |
| | | * ç³è¯·æ¥æ |
| | |
| | | */ |
| | | @Excel(name = "ç³è¯·ç±»å;æ¥åºãå»¶ä¿", width = 15) |
| | | @ApiModelProperty(value = "ç³è¯·ç±»å;æ¥åºãå»¶ä¿") |
| | | @Dict(dicCode = "third_maintenance_change_category") |
| | | private String applyCategory; |
| | | /** |
| | | * åæ´ç¶æ;å¾
æäº¤ãå¾
ä¸»ç®¡å®¡æ ¸ãå¾
é¨é¨ç¡®è®¤ãå¾
ä¿éé¨ç¡®è®¤ãå·²ä½åºã已宿 |
| | | */ |
| | | @Excel(name = "åæ´ç¶æ;å¾
æäº¤ãå¾
ä¸»ç®¡å®¡æ ¸ãå¾
é¨é¨ç¡®è®¤ãå¾
ä¿éé¨ç¡®è®¤ãå·²ä½åºã已宿", width = 15) |
| | | @ApiModelProperty(value = "åæ´ç¶æ;å¾
æäº¤ãå¾
ä¸»ç®¡å®¡æ ¸ãå¾
é¨é¨ç¡®è®¤ãå¾
ä¿éé¨ç¡®è®¤ãå·²ä½åºã已宿") |
| | | @Dict(dicCode = "third_maintenance_change_status") |
| | | private String changeStatus; |
| | | /** |
| | | * å»¶ä¿åå ç±»å;ç产任å¡ãè®¾å¤æ
éãæ¥åºãå¤§ä¿®é¡¹ä¿®ãæ¬è¿ |
| | | */ |
| | | @Excel(name = "å»¶ä¿åå ç±»å;ç产任å¡ãè®¾å¤æ
éãæ¥åºãå¤§ä¿®é¡¹ä¿®ãæ¬è¿", width = 15) |
| | | @ApiModelProperty(value = "å»¶ä¿åå ç±»å;ç产任å¡ãè®¾å¤æ
éãæ¥åºãå¤§ä¿®é¡¹ä¿®ãæ¬è¿") |
| | | @Dict(dicCode = "third_maintenance_change_reason") |
| | | private String applyReasonType; |
| | | /** |
| | | * å»¶ä¿(åæ´)åå |
| | |
| | | */ |
| | | @Excel(name = "主管é¢å¯¼ç¾å", width = 15) |
| | | @ApiModelProperty(value = "主管é¢å¯¼ç¾å") |
| | | @Dict(dicCode = "sys_user, realname, username") |
| | | @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") |
| | | private String equipmentManagerSignature; |
| | | /** |
| | | * 主管é¢å¯¼ç¾åæ¶é´ |
| | |
| | | */ |
| | | @Excel(name = "é¨é¨é¢å¯¼ç¾å;æ ¹æ®å»¶ä¿åå ç±»ååºåä¸åç人审æ¹", width = 15) |
| | | @ApiModelProperty(value = "é¨é¨é¢å¯¼ç¾å;æ ¹æ®å»¶ä¿åå ç±»ååºåä¸åç人审æ¹") |
| | | @Dict(dicCode = "sys_user, realname, username") |
| | | @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") |
| | | private String departManagerSignature; |
| | | /** |
| | | * é¨é¨é¢å¯¼ç¾åæ¶é´ |
| | |
| | | */ |
| | | @Excel(name = "ç产ä¿éé¨é¢å¯¼ç¾å", width = 15) |
| | | @ApiModelProperty(value = "ç产ä¿éé¨é¢å¯¼ç¾å") |
| | | @Dict(dicCode = "sys_user, realname, username") |
| | | @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") |
| | | private String productionSupportSignature; |
| | | /** |
| | | * ç产ä¿éé¨é¢å¯¼ç¾åæ¶é´ |
| | |
| | | @Excel(name = "HFç¼ç ", width = 15) |
| | | @ApiModelProperty(value = "HFç¼ç ") |
| | | private String hfCode; |
| | | |
| | | //å表å±ç¤º |
| | | @TableField(exist = false) |
| | | private String equipmentCode; |
| | | @TableField(exist = false) |
| | | private String equipmentName; |
| | | @TableField(exist = false) |
| | | private String equipmentModel; |
| | | } |
| | |
| | | private String equipmentCode; |
| | | @TableField(exist = false) |
| | | private String equipmentName; |
| | | @TableField(exist = false) |
| | | private String equipmentModel; |
| | | } |
| | |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd") |
| | | @ApiModelProperty(value = "ç¹æ£æ¥æ") |
| | | private Date inspectionDate; |
| | | private Date planInspectionDate; |
| | | |
| | | /**ç¹æ£äºº*/ |
| | | @ApiModelProperty(value = "ç¹æ£äºº-æ¯é¢å人") |
| | |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | List<EquipmentSearchResult> asyncLoadEquipment(String keyword, Integer pageSize, String id); |
| | | List<EquipmentSearchResult> asyncLoadEquipment(String keyword, Integer pageSize, String id, String factoryOrgCode); |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤ä¿¡æ¯ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<EquipmentSearchResult> asyncLoadEquipment(String keyword, Integer pageSize, String id) { |
| | | public List<EquipmentSearchResult> asyncLoadEquipment(String keyword, Integer pageSize, String id, String factoryOrgCode) { |
| | | if (StringUtils.isNotBlank(id)) { |
| | | EamEquipment eamEquipment = eamEquipmentMapper.selectById(id); |
| | | if (eamEquipment != null) { |
| | |
| | | list(new LambdaQueryWrapper<BaseFactoryUser>().eq(BaseFactoryUser::getUserId,sysUser.getId())); |
| | | if(!CollectionUtils.isEmpty(baseFactoryUserList)){ |
| | | Set<String> factoryIds = baseFactoryUserList.stream().map(BaseFactoryUser::getFactoryId).collect(Collectors.toSet()); |
| | | Set<String> factoryCode= baseFactoryService.listByIds(factoryIds).stream().map(BaseFactory::getOrgCode).collect(Collectors.toSet()); |
| | | Set<String> factoryCode = baseFactoryService.listByIds(factoryIds).stream().map(BaseFactory::getOrgCode).collect(Collectors.toSet()); |
| | | queryWrapper.in("e.factory_org_code", factoryCode); |
| | | } else { |
| | | return Collections.emptyList(); |
| | |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(keyword)) { |
| | | queryWrapper.like("equipment_code", keyword); |
| | | queryWrapper.or().like("equipment_name", keyword); |
| | | queryWrapper.like("e.equipment_code", keyword); |
| | | queryWrapper.or().like("e.equipment_name", keyword); |
| | | } |
| | | queryWrapper.eq("del_flag", CommonConstant.DEL_FLAG_0); |
| | | if(StringUtils.isNotBlank(factoryOrgCode)){ |
| | | queryWrapper.likeRight("e.factory_org_code", factoryOrgCode); |
| | | } |
| | | queryWrapper.eq("e.del_flag", CommonConstant.DEL_FLAG_0); |
| | | IPage<EamEquipment> pageResult = eamEquipmentMapper.queryPageList(page, queryWrapper); |
| | | if (pageResult != null && CollectionUtil.isNotEmpty(pageResult.getRecords())) { |
| | | List<EquipmentSearchResult> resultList = new ArrayList<>(); |
| | |
| | | */ |
| | | private String text; |
| | | |
| | | private String equipmentModel; |
| | | private String equipmentCode; |
| | | private String equipmentName; |
| | | private String factoryOrgCode; |
| | | |
| | | public EquipmentSearchResult() { |
| | | } |
| | | |
| | | public EquipmentSearchResult(EamEquipment eamEquipment) { |
| | | this.value = eamEquipment.getId(); |
| | | this.text = eamEquipment.getEquipmentCode() + "[" + eamEquipment.getEquipmentName() + "]"; |
| | | this.equipmentModel = eamEquipment.getEquipmentModel(); |
| | | this.equipmentCode = eamEquipment.getEquipmentCode(); |
| | | this.equipmentName = eamEquipment.getEquipmentName(); |
| | | this.factoryOrgCode = eamEquipment.getFactoryOrgCode(); |
| | | } |
| | | } |
| | |
| | | @GetMapping(value = "/asyncLoadEquipment") |
| | | public Result<?> asyncLoadEquipment(@RequestParam(name="keyword",required = false) String keyword, |
| | | @RequestParam(value = "pageSize", required = false, defaultValue = "20") Integer pageSize, |
| | | @RequestParam(name="id",required = false) String id) { |
| | | List<EquipmentSearchResult> resultList = eamEquipmentService.asyncLoadEquipment(keyword, pageSize, id); |
| | | return Result.ok(resultList); |
| | | @RequestParam(name="id",required = false) String id, |
| | | @RequestParam(name="factoryOrgCode",required = false) String factoryOrgCode) { |
| | | List<EquipmentSearchResult> resultList = eamEquipmentService.asyncLoadEquipment(keyword, pageSize, id, factoryOrgCode); |
| | | List<JSONObject> items = new ArrayList<>(); |
| | | try { |
| | | for(EquipmentSearchResult vo : resultList) { |
| | | String json = objectMapper.writeValueAsString(vo); |
| | | JSONObject item = JSONObject.parseObject(json, Feature.OrderedField); |
| | | translateDictTextUtils.translateField("factoryOrgCode", vo.getFactoryOrgCode(), item, "eam_base_factory,factory_name,org_code"); |
| | | items.add(item); |
| | | } |
| | | return Result.OK(items); |
| | | }catch (Exception e) { |
| | | return Result.error("æ°æ®è½¬è¯å¤±è´¥ï¼"); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param eamInspectionOrder |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:ç¹æ£å·¥å:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, EamInspectionOrder eamInspectionOrder) { |
| | | return super.exportXls(request, eamInspectionOrder, EamInspectionOrder.class, "ç¹æ£å·¥å"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("ç¹æ£å·¥å:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, EamInspectionOrder.class); |
| | | } |
| | | |
| | | /** |
| | | * 导åºè·ååºæ¬ä¿¡æ¯ |
| | | * @param equipmentCode ç»ä¸ç¼ç |
| | | * @param inspectionDate æ¥æ |
| | |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.util.TranslateDictTextUtils; |
| | | import org.jeecg.modules.eam.constant.TechnicalStatusChangeOrderStatusEnum; |
| | | import org.jeecg.modules.eam.entity.EamTechnicalStatusChange; |
| | | import org.jeecg.modules.eam.entity.EamTechnicalStatusChangeDetail; |
| | | import org.jeecg.modules.eam.request.EamTechnicalStatusChangeQuery; |
| | | import org.jeecg.modules.eam.request.EamTechnicalStatusChangeRequest; |
| | | import org.jeecg.modules.eam.service.IEamTechnicalStatusChangeService; |
| | |
| | | public class EamTechnicalStatusChangeController extends JeecgController<EamTechnicalStatusChange, IEamTechnicalStatusChangeService> { |
| | | @Autowired |
| | | private IEamTechnicalStatusChangeService eamTechnicalStatusChangeService; |
| | | @Autowired |
| | | private ObjectMapper objectMapper; |
| | | @Autowired |
| | | private TranslateDictTextUtils translateDictTextUtils; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | |
| | | @GetMapping(value = "/queryById") |
| | | public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
| | | EamTechnicalStatusChange eamTechnicalStatusChange = eamTechnicalStatusChangeService.getById(id); |
| | | return Result.OK(eamTechnicalStatusChange); |
| | | if (eamTechnicalStatusChange == null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | try { |
| | | String json = objectMapper.writeValueAsString(eamTechnicalStatusChange); |
| | | JSONObject item = JSONObject.parseObject(json, Feature.OrderedField); |
| | | translateDictTextUtils.translateField("designer", eamTechnicalStatusChange.getDesigner(), item, "sys_user,realname,username"); |
| | | translateDictTextUtils.translateField("factoryOrgCode", eamTechnicalStatusChange.getFactoryOrgCode(), item, "eam_base_factory,factory_name,org_code"); |
| | | return Result.OK(item); |
| | | } catch (JsonProcessingException e) { |
| | | return Result.error("æ°æ®è½¬è¯å¤±è´¥ï¼"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éªæ¶ |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "ææ¯ç¶æåæ´ç³è¯·æç»-éªæ¶", notes = "ææ¯ç¶æåæ´ç³è¯·æç»-éªæ¶") |
| | | @PostMapping(value = "/acceptance") |
| | | public Result<?> acceptance(@RequestBody EamTechnicalStatusChangeDetail request) { |
| | | if (request == null) { |
| | | return Result.error("éªæ¶ç»æå¯¹è±¡ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | boolean b = eamTechnicalStatusChangeService.acceptance(request); |
| | | if (!b) { |
| | | return Result.error("æä½å¤±è´¥ï¼"); |
| | | } |
| | | return Result.OK("æä½æåï¼"); |
| | | } |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.util.TranslateDictTextUtils; |
| | | import org.jeecg.modules.eam.entity.EamTechnicalStatusChangeDetail; |
| | | import org.jeecg.modules.eam.service.IEamTechnicalStatusChangeDetailService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public class EamTechnicalStatusChangeDetailController extends JeecgController<EamTechnicalStatusChangeDetail, IEamTechnicalStatusChangeDetailService> { |
| | | @Autowired |
| | | private IEamTechnicalStatusChangeDetailService orderDetailService; |
| | | @Autowired |
| | | private ObjectMapper objectMapper; |
| | | @Autowired |
| | | private TranslateDictTextUtils translateDictTextUtils; |
| | | |
| | | /** |
| | | * 䏿¬¡å è½½ |
| | |
| | | @GetMapping(value = "/queryList") |
| | | public Result<?> queryList(@RequestParam("orderId") String orderId) { |
| | | List<EamTechnicalStatusChangeDetail> list = orderDetailService.queryList(orderId); |
| | | return Result.OK(list); |
| | | List<JSONObject> items = new ArrayList<>(); |
| | | try { |
| | | for(EamTechnicalStatusChangeDetail vo : list) { |
| | | String json = objectMapper.writeValueAsString(vo); |
| | | JSONObject item = JSONObject.parseObject(json, Feature.OrderedField); |
| | | translateDictTextUtils.translateField("acceptanceChecker", vo.getAcceptanceChecker(), item, "sys_user,realname,username"); |
| | | translateDictTextUtils.translateField("changeCategory", vo.getChangeCategory(), item, "technical_status_change_reason"); |
| | | translateDictTextUtils.translateField("changeTechnicalStatus", vo.getChangeTechnicalStatus(), item, "equipment_technology_status"); |
| | | translateDictTextUtils.translateField("acceptanceCheckResult", vo.getAcceptanceCheckResult(), item, "equipment_technology_status"); |
| | | items.add(item); |
| | | } |
| | | return Result.OK(items); |
| | | }catch (Exception e) { |
| | | return Result.error("æ°æ®è½¬è¯å¤±è´¥ï¼"); |
| | | } |
| | | } |
| | | } |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.util.TranslateDictTextUtils; |
| | | import org.jeecg.modules.eam.constant.TechnicalStatusEvaluationApplicationStatusEnum; |
| | | import org.jeecg.modules.eam.entity.EamTechnicalStatusEvaluationApplication; |
| | | import org.jeecg.modules.eam.request.EamTechnicalStatusEvaluationApplicationQuery; |
| | |
| | | public class EamTechnicalStatusEvaluationApplicationController extends JeecgController<EamTechnicalStatusEvaluationApplication, IEamTechnicalStatusEvaluationApplicationService> { |
| | | @Autowired |
| | | private IEamTechnicalStatusEvaluationApplicationService eamTechnicalStatusEvaluationApplicationService; |
| | | |
| | | @Autowired |
| | | private ObjectMapper objectMapper; |
| | | @Autowired |
| | | private TranslateDictTextUtils translateDictTextUtils; |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | |
| | | @GetMapping(value = "/queryById") |
| | | public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | EamTechnicalStatusEvaluationApplication eamTechnicalStatusEvaluationApplication = eamTechnicalStatusEvaluationApplicationService.getById(id); |
| | | return Result.OK(eamTechnicalStatusEvaluationApplication); |
| | | if (eamTechnicalStatusEvaluationApplication == null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | try { |
| | | String json = objectMapper.writeValueAsString(eamTechnicalStatusEvaluationApplication); |
| | | JSONObject item = JSONObject.parseObject(json, Feature.OrderedField); |
| | | translateDictTextUtils.translateField("applicant", eamTechnicalStatusEvaluationApplication.getApplicant(), item, "sys_user,realname,username"); |
| | | translateDictTextUtils.translateField("factoryOrgCode", eamTechnicalStatusEvaluationApplication.getFactoryOrgCode(), item, "eam_base_factory,factory_name,org_code"); |
| | | return Result.OK(item); |
| | | } catch (JsonProcessingException e) { |
| | | return Result.error("æ°æ®è½¬è¯å¤±è´¥ï¼"); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.util.TranslateDictTextUtils; |
| | | import org.jeecg.modules.eam.constant.ThirdMaintenanceChangeStatusEnum; |
| | | import org.jeecg.modules.eam.entity.EamTechnicalStatusEvaluationOrderChange; |
| | | import org.jeecg.modules.eam.entity.EamThirdMaintenanceChange; |
| | | import org.jeecg.modules.eam.request.EamTechnicalStatusEvaluationOrderChangeRequest; |
| | | import org.jeecg.modules.eam.request.EamThirdMaintenanceChangeQuery; |
| | | import org.jeecg.modules.eam.request.EamThirdMaintenanceChangeRequest; |
| | | import org.jeecg.modules.eam.service.IEamThirdMaintenanceChangeService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | |
| | | |
| | | @Resource |
| | | private IEamThirdMaintenanceChangeService eamThirdMaintenanceChangeService; |
| | | @Resource |
| | | private ObjectMapper objectMapper; |
| | | @Resource |
| | | private TranslateDictTextUtils translateDictTextUtils; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param eamThirdMaintenanceChange |
| | | * @param query |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | |
| | | @AutoLog(value = "ä¸ä¿åæ´-å页å表æ¥è¯¢") |
| | | @ApiOperation(value = "ä¸ä¿åæ´-å页å表æ¥è¯¢", notes = "ä¸ä¿åæ´-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<?> queryPageList(EamThirdMaintenanceChange eamThirdMaintenanceChange, |
| | | public Result<?> queryPageList(EamThirdMaintenanceChangeQuery query, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<EamThirdMaintenanceChange> queryWrapper = QueryGenerator.initQueryWrapper(eamThirdMaintenanceChange, req.getParameterMap()); |
| | | Page<EamThirdMaintenanceChange> page = new Page<EamThirdMaintenanceChange>(pageNo, pageSize); |
| | | IPage<EamThirdMaintenanceChange> pageList = eamThirdMaintenanceChangeService.page(page, queryWrapper); |
| | | IPage<EamThirdMaintenanceChange> pageList = eamThirdMaintenanceChangeService.queryPageList(page, query); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param eamThirdMaintenanceChange |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ä¸ä¿åæ´-æ·»å ") |
| | | @ApiOperation(value = "ä¸ä¿åæ´-æ·»å ", notes = "ä¸ä¿åæ´-æ·»å ") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody EamThirdMaintenanceChange eamThirdMaintenanceChange) { |
| | | eamThirdMaintenanceChangeService.save(eamThirdMaintenanceChange); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | public Result<?> add(@RequestBody EamThirdMaintenanceChange request) { |
| | | if (request == null) { |
| | | return Result.error("æ·»å ç对象ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | boolean b = eamThirdMaintenanceChangeService.saveThirdMaintenanceChange(request); |
| | | if (!b) { |
| | | return Result.error("åæ´å¤±è´¥ï¼"); |
| | | } |
| | | return Result.OK("åæ´æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param eamThirdMaintenanceChange |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ä¸ä¿åæ´-ç¼è¾") |
| | | @ApiOperation(value = "ä¸ä¿åæ´-ç¼è¾", notes = "ä¸ä¿åæ´-ç¼è¾") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<?> edit(@RequestBody EamThirdMaintenanceChange eamThirdMaintenanceChange) { |
| | | eamThirdMaintenanceChangeService.updateById(eamThirdMaintenanceChange); |
| | | public Result<?> edit(@RequestBody EamThirdMaintenanceChange request) { |
| | | if (request == null) { |
| | | return Result.error("ç¼è¾ç对象ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | boolean b = eamThirdMaintenanceChangeService.editThirdMaintenanceChange(request); |
| | | if (!b) { |
| | | return Result.error("ç¼è¾å¤±è´¥ï¼"); |
| | | } |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | |
| | | return Result.OK("æ¹éå 餿åï¼"); |
| | | } |
| | | |
| | | @AutoLog(value = "ä¸ä¿åæ´-æäº¤") |
| | | @ApiOperation(value = "ä¸ä¿åæ´-æäº¤", notes = "ä¸ä¿åæ´-æäº¤") |
| | | @GetMapping("/submit") |
| | | public Result<?> submit(@RequestParam(name = "id") String id) { |
| | | boolean b = eamThirdMaintenanceChangeService.submit(id); |
| | | if (!b) { |
| | | return Result.error("æäº¤å¤±è´¥ï¼"); |
| | | } |
| | | return Result.OK("æäº¤æå!"); |
| | | } |
| | | |
| | | @AutoLog(value = "ä¸ä¿åæ´-ä½åº") |
| | | @ApiOperation(value = "ä¸ä¿åæ´-ä½åº", notes = "ä¸ä¿åæ´-ä½åº") |
| | | @GetMapping("/abolish") |
| | | public Result<?> abolish(@RequestParam(name = "id") String id) { |
| | | EamThirdMaintenanceChange entity = eamThirdMaintenanceChangeService.getById(id); |
| | | if (entity == null) { |
| | | return Result.error("è¦ä½åºçæ°æ®ä¸åå¨ï¼è¯·å·æ°éè¯ï¼"); |
| | | } |
| | | if (!ThirdMaintenanceChangeStatusEnum.WAIT_SUBMIT.name().equals(entity.getChangeStatus())) { |
| | | return Result.error("è¯¥ç¶æçæ°æ®ä¸å
许è¿è¡ä½åºï¼"); |
| | | } |
| | | entity.setChangeStatus(ThirdMaintenanceChangeStatusEnum.ABOLISH.name()); |
| | | eamThirdMaintenanceChangeService.updateById(entity); |
| | | return Result.OK("ä½åºæå!"); |
| | | } |
| | | |
| | | @AutoLog(value = "ä¸ä¿åæ´-审æ¹") |
| | | @ApiOperation(value = "ä¸ä¿åæ´-审æ¹", notes = "ä¸ä¿åæ´-审æ¹") |
| | | @PostMapping("/approval") |
| | | public Result<?> approval(@RequestBody EamThirdMaintenanceChangeRequest request) { |
| | | if (request == null) { |
| | | return Result.error("审æ¹ç对象ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | // æ£æ¥è¯·æ±åæ° |
| | | if (StrUtil.isBlank(request.getTaskId()) || StrUtil.isBlank(request.getDataId()) || StrUtil.isBlank(request.getInstanceId())) { |
| | | return Result.error("审æ¹ä»»å¡é误æä¸åå¨ï¼"); |
| | | } |
| | | EamThirdMaintenanceChange b = eamThirdMaintenanceChangeService.approval(request); |
| | | if (b == null) { |
| | | return Result.error("æä½å¤±è´¥ï¼"); |
| | | } |
| | | return Result.ok("æä½æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | |
| | | @ApiOperation(value = "ä¸ä¿åæ´-éè¿idæ¥è¯¢", notes = "ä¸ä¿åæ´-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | EamThirdMaintenanceChange eamThirdMaintenanceChange = eamThirdMaintenanceChangeService.getById(id); |
| | | return Result.OK(eamThirdMaintenanceChange); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param eamThirdMaintenanceChange |
| | | */ |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, EamThirdMaintenanceChange eamThirdMaintenanceChange) { |
| | | return super.exportXls(request, eamThirdMaintenanceChange, EamThirdMaintenanceChange.class, "ä¸ä¿åæ´"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, EamThirdMaintenanceChange.class); |
| | | EamThirdMaintenanceChange entity = eamThirdMaintenanceChangeService.getById(id); |
| | | if (entity == null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | try { |
| | | String json = objectMapper.writeValueAsString(entity); |
| | | JSONObject item = JSONObject.parseObject(json, Feature.OrderedField); |
| | | translateDictTextUtils.translateField("orderId", entity.getOrderId(), item, "eam_third_maintenance_order,order_num,id"); |
| | | translateDictTextUtils.translateField("applicant", entity.getApplicant(), item, "sys_user,realname,username"); |
| | | translateDictTextUtils.translateField("changeStatus", entity.getChangeStatus(), item, "third_maintenance_change_status"); |
| | | translateDictTextUtils.translateField("applyReasonType", entity.getApplyReasonType(), item, "third_maintenance_change_reason"); |
| | | translateDictTextUtils.translateField("equipmentManagerSignature", entity.getEquipmentManagerSignature(), item, "sys_user,realname,username"); |
| | | translateDictTextUtils.translateField("departManagerSignature", entity.getDepartManagerSignature(), item, "sys_user,realname,username"); |
| | | translateDictTextUtils.translateField("productionSupportSignature", entity.getProductionSupportSignature(), item, "sys_user,realname,username"); |
| | | return Result.OK(item); |
| | | } catch (JsonProcessingException e) { |
| | | return Result.error("æ°æ®è½¬è¯å¤±è´¥ï¼"); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | /**éªæ¶æ£æ¥ç»æ;å¤§ä¿®ãæ¹é éè¦å¡«åéªæ¶ç»æï¼æ¬è¿æç
§ææ¯ç¶æé´å®å·¥åç»´æ¤ï¼å
¶ä»ææªä½¿ç¨å°ï¼åªé¢çæ¤ç±»å*/ |
| | | @ApiModelProperty(value = "éªæ¶æ£æ¥ç»æ;å¤§ä¿®ãæ¹é éè¦å¡«åéªæ¶ç»æï¼æ¬è¿æç
§ææ¯ç¶æé´å®å·¥åç»´æ¤ï¼å
¶ä»ææªä½¿ç¨å°ï¼åªé¢çæ¤ç±»å") |
| | | private String acceptanceCheckResult; |
| | | /**éªæ¶æè§*/ |
| | | @ApiModelProperty(value = "éªæ¶æè§") |
| | | private String acceptanceCheckComment; |
| | | |
| | | //å表å±ç¤º |
| | | @TableField(exist = false) |
| | |
| | | private Date evaluationDate; |
| | | /**ç³è¯·åç¶æ;å¾
æäº¤ãå¾
åä½å®¤çº§é¢å¯¼å®¡æ ¸ãç产设å¤ç®¡çä¸»ç®¡å®¡æ ¸ãå¾
ä¿éé¨é¢å¯¼å®¡æ ¸ãå·²ä½åºã已宿*/ |
| | | @ApiModelProperty(value = "ç³è¯·åç¶æ;å¾
æäº¤ãå¾
åä½å®¤çº§é¢å¯¼å®¡æ ¸ãç产设å¤ç®¡çä¸»ç®¡å®¡æ ¸ãå¾
ä¿éé¨é¢å¯¼å®¡æ ¸ãå·²ä½åºã已宿") |
| | | @Dict(dicCode = "technical_status_evaluation_application_status") |
| | | private String applicationStatus; |
| | | /**ç³è¯·åä½å®¤çº§é¢å¯¼ç¾å*/ |
| | | @ApiModelProperty(value = "ç³è¯·åä½å®¤çº§é¢å¯¼ç¾å") |
| | |
| | | private Date departHeaderSignatureTime; |
| | | /**ç³è¯·åä½å®¤çº§é¢å¯¼ç¾åç»æ*/ |
| | | @ApiModelProperty(value = "ç³è¯·åä½å®¤çº§é¢å¯¼ç¾åç»æ") |
| | | @Dict(dicCode = "approved_rejected") |
| | | @Dict(dicCode = "approve_reject") |
| | | private String departHeaderSignatureResult; |
| | | /**ç³è¯·åä½å®¤çº§é¢å¯¼æè§*/ |
| | | @ApiModelProperty(value = "ç³è¯·åä½å®¤çº§é¢å¯¼æè§") |
| | |
| | | private Date productionHeaderSignatureTime; |
| | | /**ç产设å¤ç®¡ç主管ç¾åç»æ*/ |
| | | @ApiModelProperty(value = "ç产设å¤ç®¡ç主管ç¾åç»æ") |
| | | @Dict(dicCode = "approved_rejected") |
| | | @Dict(dicCode = "approve_reject") |
| | | private String productionHeaderSignatureResult; |
| | | /**ç产设å¤ç®¡ç主管æè§*/ |
| | | @ApiModelProperty(value = "ç产设å¤ç®¡ç主管æè§") |
| | |
| | | private Date productionSupportSignatureTime; |
| | | /**ç产ä¿éé¨é¢å¯¼ç¾åè§£ç»æ*/ |
| | | @ApiModelProperty(value = "ç产ä¿éé¨é¢å¯¼ç¾åè§£ç»æ") |
| | | @Dict(dicCode = "approved_rejected") |
| | | @Dict(dicCode = "approve_reject") |
| | | private String productionSupportSignatureResult; |
| | | /**ç产ä¿éé¨é¢å¯¼æè§*/ |
| | | @ApiModelProperty(value = "ç产ä¿éé¨é¢å¯¼æè§") |
| | |
| | | import org.jeecg.modules.eam.constant.MaintenanceCategoryEnum; |
| | | import org.jeecg.modules.eam.constant.OrderCreationMethodEnum; |
| | | import org.jeecg.modules.eam.entity.EamInspectionOrder; |
| | | import org.jeecg.modules.eam.entity.EamInspectionOrderDetail; |
| | | import org.jeecg.modules.eam.entity.EamMaintenanceStandard; |
| | | import org.jeecg.modules.eam.entity.EamMaintenanceStandardDetail; |
| | | import org.jeecg.modules.eam.request.EamInspectionOrderRequest; |
| | |
| | | package org.jeecg.modules.eam.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.eam.entity.EamThirdMaintenanceChange; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface EamThirdMaintenanceChangeMapper extends BaseMapper<EamThirdMaintenanceChange> { |
| | | |
| | | IPage<EamThirdMaintenanceChange> queryPageList(Page<EamThirdMaintenanceChange> page, @Param(Constants.WRAPPER) QueryWrapper<EamThirdMaintenanceChange> queryWrapper); |
| | | } |
| | |
| | | <!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.EamThirdMaintenanceChangeMapper"> |
| | | |
| | | <select id="queryPageList" resultType="org.jeecg.modules.eam.entity.EamThirdMaintenanceChange"> |
| | | SELECT |
| | | tmc.*, |
| | | e.equipment_code, |
| | | e.equipment_name, |
| | | e.equipment_model |
| | | FROM |
| | | eam_third_maintenance_change tmc |
| | | INNER JOIN eam_third_maintenance_order tmo ON tmc.order_id = tmo.id |
| | | INNER JOIN eam_equipment e ON tmo.equipment_id = e.id |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |
| | |
| | | <mapper namespace="org.jeecg.modules.eam.mapper.EamThirdMaintenanceOrderMapper"> |
| | | |
| | | <select id="queryPageList" resultType="org.jeecg.modules.eam.entity.EamThirdMaintenanceOrder"> |
| | | select wmo.*, e.equipment_code, e.equipment_name |
| | | select wmo.*, e.equipment_code, e.equipment_name, e.equipment_model |
| | | from eam_third_maintenance_order wmo |
| | | inner join eam_equipment e |
| | | on wmo.equipment_id = e.id |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.request; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: Lius |
| | | * @CreateTime: 2025-07-21 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class EamThirdMaintenanceChangeQuery { |
| | | private String equipmentId; |
| | | private String changeOrderNum; |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date applyDateBegin; |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date applyDateEnd; |
| | | |
| | | private String changeStatus; |
| | | private String column; |
| | | private String order; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.request; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecg.modules.flowable.domain.vo.FlowTaskVo; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Author: Lius |
| | | * @CreateTime: 2025-07-21 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "ä¸ä¿åæ´å¯¹è±¡", description = "ä¸ä¿åæ´") |
| | | public class EamThirdMaintenanceChangeRequest extends FlowTaskVo implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 80020193253190375L; |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @ApiModelProperty(value = "主é®") |
| | | private String id; |
| | | |
| | | /** |
| | | * å·¥åå· |
| | | */ |
| | | @ApiModelProperty(value = "å·¥åå·") |
| | | private String orderNum; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.jeecg.modules.eam.entity.EamTechnicalStatusChange; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.eam.entity.EamTechnicalStatusChangeDetail; |
| | | import org.jeecg.modules.eam.request.EamTechnicalStatusChangeQuery; |
| | | import org.jeecg.modules.eam.request.EamTechnicalStatusChangeRequest; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | EamTechnicalStatusChange approval(EamTechnicalStatusChangeRequest request); |
| | | |
| | | /** |
| | | * éªæ¶ |
| | | * @param request |
| | | * @return |
| | | */ |
| | | boolean acceptance(EamTechnicalStatusChangeDetail request); |
| | | } |
| | |
| | | package org.jeecg.modules.eam.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.eam.entity.EamThirdMaintenanceChange; |
| | | import org.jeecg.modules.eam.request.EamThirdMaintenanceChangeQuery; |
| | | import org.jeecg.modules.eam.request.EamThirdMaintenanceChangeRequest; |
| | | |
| | | /** |
| | | * @Description: ä¸ä¿åæ´ |
| | |
| | | */ |
| | | public interface IEamThirdMaintenanceChangeService extends IService<EamThirdMaintenanceChange> { |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * @param page |
| | | * @param query |
| | | * @return |
| | | */ |
| | | IPage<EamThirdMaintenanceChange> queryPageList(Page<EamThirdMaintenanceChange> page, EamThirdMaintenanceChangeQuery query); |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param request |
| | | * @return |
| | | */ |
| | | boolean saveThirdMaintenanceChange(EamThirdMaintenanceChange request); |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * @param request |
| | | * @return |
| | | */ |
| | | boolean editThirdMaintenanceChange(EamThirdMaintenanceChange request); |
| | | |
| | | /** |
| | | * æäº¤ å¼å¯æµç¨å®¡æ¹ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | boolean submit(String id); |
| | | |
| | | /** |
| | | * æµç¨å®¡æ¹ |
| | | * @param request |
| | | * @return |
| | | */ |
| | | EamThirdMaintenanceChange approval(EamThirdMaintenanceChangeRequest request); |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | Result<?> selectVoById(String id); |
| | | |
| | | /** |
| | | * æ´æ°ä¸ä¿å·¥åç¶æ |
| | | * @param orderId |
| | | * @param maintenanceStatus |
| | | * @return |
| | | */ |
| | | boolean updateMaintenanceStatus(String orderId, String maintenanceStatus); |
| | | } |
| | |
| | | resultMap.put("itemCode", weekInsDetailResultResponse.getItemCode()); |
| | | resultMap.put("itemName", weekInsDetailResultResponse.getItemName()); |
| | | resultMap.put("itemDemand", weekInsDetailResultResponse.getItemDemand()); |
| | | // 使ç¨AtomicIntegerä½ä¸ºè®¡æ°å¨ï¼ä»1å¼å§ |
| | | AtomicInteger counter = new AtomicInteger(1); |
| | | Map<Integer, EamWeekInsDetailResultResponse> collect = weekInsDetailResultResponseList |
| | | .stream() |
| | | .collect(Collectors.toMap( |
| | | // åç»é®ï¼ä½¿ç¨èªå¢åºå·ï¼ä»1å¼å§ï¼ |
| | | item -> counter.getAndIncrement(), |
| | | // åç»é®ï¼ä½¿ç¨planInspectionDateåæ®µè½å¨æ¬æç卿° |
| | | item -> { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(item.getPlanInspectionDate()); |
| | | return calendar.get(Calendar.WEEK_OF_MONTH); |
| | | }, |
| | | // å¼ï¼ç´æ¥ä½¿ç¨å½å对象 |
| | | item -> item, |
| | | // å并彿°ï¼å½åä¸åºå·æå¤ä¸ªå¯¹è±¡æ¶ï¼ç论ä¸ä¸ä¼åçï¼ï¼å¦ä½å¤ç |
| | | (existing, replacement) -> existing, // è¥æéå¤é®ï¼ä¿çå·²åå¨ç对象 |
| | | // å并彿°ï¼å½åä¸å¨æå¤ä¸ªå¯¹è±¡æ¶ï¼æ ¹æ®éæ±ä¸ä¼åçï¼ä½ä»éæä¾ï¼ |
| | | (existing, replacement) -> existing, |
| | | // æå®Mapçå
·ä½å®ç°ï¼å¯éï¼ |
| | | LinkedHashMap::new // ä¿ææå
¥é¡ºåº |
| | | )); |
| | |
| | | Map<Integer, EamWeekInsDetailUserResponse> groupMap = eamWeekInsDetailUserResponseList |
| | | .stream() |
| | | .collect(Collectors.toMap( |
| | | // åç»é®ï¼ä½¿ç¨èªå¢åºå·ï¼ä»1å¼å§ï¼ |
| | | item -> counter.getAndIncrement(), |
| | | // å¼ï¼ç´æ¥ä½¿ç¨å½å对象ï¼ä½ä¸ºåå§å¼ï¼ |
| | | // åç»é®ï¼ä½¿ç¨ planInspectionDate åæ®µè½å¨æ¬æç卿° |
| | | item -> { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(item.getPlanInspectionDate()); |
| | | return calendar.get(Calendar.WEEK_OF_MONTH); |
| | | }, |
| | | // å¼ï¼ç´æ¥ä½¿ç¨å½å对象 |
| | | item -> item, |
| | | // å并彿°ï¼å½åä¸â天âæå¤ä¸ªå¯¹è±¡æ¶ï¼å¦ä½å¤çï¼è¿é示ä¾å第ä¸ä¸ªï¼ |
| | | (existing, replacement) -> existing // è¥æéå¤é®ï¼ä¿çå·²åå¨ç对象 |
| | | // å并彿°ï¼å½åä¸å¨æå¤ä¸ªå¯¹è±¡æ¶ï¼æ ¹æ®éæ±ä¸ä¼åçï¼ |
| | | (existing, replacement) -> existing, |
| | | // ä½¿ç¨ LinkedHashMap ä¿ææå
¥é¡ºåº |
| | | LinkedHashMap::new |
| | | )); |
| | | Map<String, Object> resultMap = new LinkedHashMap<>(); |
| | | for (int i = 1; i <= 5; i++) { |
| | |
| | | import org.jeecg.common.constant.DataBaseConstant; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.common.util.TranslateDictTextUtils; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.constant.BusinessCodeConst; |
| | | import org.jeecg.modules.eam.constant.HfTemplateCategoryEnum; |
| | | import org.jeecg.modules.eam.constant.TechnicalStatusChangeOrderStatusEnum; |
| | | import org.jeecg.modules.eam.constant.TechnicalStatusEvaluationOrderChangeStatusEnum; |
| | | import org.jeecg.modules.eam.entity.EamBaseHFCode; |
| | | import org.jeecg.modules.eam.entity.EamEquipment; |
| | | import org.jeecg.modules.eam.entity.EamTechnicalStatusChange; |
| | | import org.jeecg.modules.eam.constant.*; |
| | | import org.jeecg.modules.eam.entity.*; |
| | | import org.jeecg.modules.eam.mapper.EamTechnicalStatusChangeMapper; |
| | | import org.jeecg.modules.eam.request.EamTechnicalStatusChangeQuery; |
| | | import org.jeecg.modules.eam.request.EamTechnicalStatusChangeRequest; |
| | | import org.jeecg.modules.eam.service.IEamBaseHFCodeService; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecg.modules.eam.service.IEamTechnicalStatusChangeDetailService; |
| | | import org.jeecg.modules.eam.service.IEamTechnicalStatusChangeService; |
| | | import org.jeecg.modules.eam.request.EamTechnicalStatusEvaluationOrderRequest; |
| | | import org.jeecg.modules.eam.service.*; |
| | | import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; |
| | | import org.jeecg.modules.flowable.apithird.business.service.IFlowMyBusinessService; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private IFlowTaskService flowTaskService; |
| | | @Autowired |
| | | private TranslateDictTextUtils translateDictTextUtils; |
| | | @Autowired |
| | | private IEamEquipmentExtendService equipmentExtendService; |
| | | @Autowired |
| | | private IEamTechnicalStatusEvaluationStandardService evaluationStandardService; |
| | | @Autowired |
| | | private IEamTechnicalStatusEvaluationOrderService evaluationOrderService; |
| | | |
| | | @Override |
| | | public IPage<EamTechnicalStatusChange> queryPageList(Page<EamTechnicalStatusChange> page, EamTechnicalStatusChangeQuery query) { |
| | |
| | | detail.setCreateTime(null); |
| | | detail.setUpdateBy(null); |
| | | detail.setUpdateTime(null); |
| | | detail.setChangeOrderId(order.getId()); |
| | | }); |
| | | changeDetailService.saveBatch(request.getTableDetailList()); |
| | | return true; |
| | |
| | | detail.setCreateTime(null); |
| | | detail.setUpdateBy(null); |
| | | detail.setUpdateTime(null); |
| | | detail.setChangeOrderId(entity.getId()); |
| | | }); |
| | | changeDetailService.saveBatch(request.getTableDetailList()); |
| | | return true; |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean acceptance(EamTechnicalStatusChangeDetail request) { |
| | | // è·åå½åç»å½ç¨æ· |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (user == null || StrUtil.isBlank(user.getId())) { |
| | | throw new JeecgBootException("æªè·åå°ç»å½ç¨æ·ï¼è¯·éæ°ç»å½ååè¯ï¼"); |
| | | } |
| | | EamTechnicalStatusChange order = this.getBaseMapper().selectById(request.getChangeOrderId()); |
| | | if(order == null) { |
| | | throw new JeecgBootException("åæ´å·¥åä¸åå¨ï¼è¯·å·æ°éè¯ï¼"); |
| | | } |
| | | if(!TechnicalStatusChangeOrderStatusEnum.COMPLETED.name().equals(order.getChangeStatus())) { |
| | | throw new JeecgBootException("åæ´å·¥åæªå®æï¼æ æ³æäº¤éªæ¶ï¼"); |
| | | } |
| | | TechnicalStatusChangeReasonEnum instance = TechnicalStatusChangeReasonEnum.getInstance(request.getChangeCategory()); |
| | | if(instance == null) { |
| | | throw new JeecgBootException("åæ´åå æ æï¼æä½å¤±è´¥ï¼"); |
| | | } |
| | | EamEquipment equipment = equipmentService.getById(request.getEquipmentId()); |
| | | if(equipment == null) { |
| | | throw new JeecgBootException("设å¤ä¿¡æ¯ä¸åå¨ï¼æä½å¤±è´¥ï¼"); |
| | | } |
| | | EamEquipmentExtend extend = equipmentExtendService.getById(request.getEquipmentId()); |
| | | if(extend == null) { |
| | | throw new JeecgBootException("设å¤ä¿¡æ¯ä¸åå¨ï¼æä½å¤±è´¥ï¼"); |
| | | } |
| | | switch (instance) { |
| | | case EQUIPMENT_MAJOR: |
| | | case EQUIPMENT_RETROFITTING: |
| | | case OTHER: |
| | | //设å¤å¤§ä¿®ãæ¹é ãå
¶ä»çé»è¾ |
| | | request.setAcceptanceChecker(user.getUsername()); |
| | | request.setAcceptanceCheckTime(new Date()); |
| | | changeDetailService.updateById(request); |
| | | //æ´æ°è®¾å¤ææ¯é´å®ç¶æ |
| | | equipmentExtendService.updateTechnologyParam(request.getEquipmentId(), request.getAcceptanceCheckResult(), DateUtils.localDateToDate(LocalDate.now()), null); |
| | | break; |
| | | case EQUIPMENT_RELOCATION: |
| | | //è®¾å¤æ¬è¿é»è¾ |
| | | request.setAcceptanceChecker(user.getUsername()); |
| | | request.setAcceptanceCheckTime(new Date()); |
| | | request.setAcceptanceCheckResult(null); |
| | | changeDetailService.updateById(request); |
| | | //çæææ¯ç¶æé´å®å·¥å |
| | | EamTechnicalStatusEvaluationStandard standard = evaluationStandardService.queryEnableStandard(request.getEquipmentId()); |
| | | if (standard == null) { |
| | | throw new JeecgBootException("设å¤ï¼{"+equipment.getEquipmentCode()+"}ï¼æªé
ç½®ææ¯ç¶æé´å®è§èï¼æ æ³çæææ¯é´å®å·¥åï¼"); |
| | | } |
| | | EamTechnicalStatusEvaluationOrderRequest orderRequest = new EamTechnicalStatusEvaluationOrderRequest(); |
| | | orderRequest.setEquipmentId(extend.getId()); |
| | | orderRequest.setStandardId(standard.getId()); |
| | | orderRequest.setEvaluationDate(DateUtils.localDateToDate(LocalDate.now())); |
| | | orderRequest.setFreezeOrderDate(null); |
| | | orderRequest.setOrderExpirationDate(null); |
| | | orderRequest.setCreationMethod(OrderCreationMethodEnum.AUTO.name()); |
| | | evaluationOrderService.addTechnicalStatusEvaluationOrder(orderRequest); |
| | | //æ´æ°æ©å±è¡¨ä¸ççææ è¯ |
| | | equipmentExtendService.updateTechnologyParam(equipment.getId(), null, null, CommonConstant.STATUS_1); |
| | | break; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public void afterFlowHandle(FlowMyBusiness business) { |
| | | business.getTaskNameId();//æ¥ä¸æ¥å®¡æ¹çèç¹ |
| | | business.getValues();//åç«¯ä¼ è¿æ¥çåæ° |
| | |
| | | //æ´æ°å®ä½ |
| | | this.getBaseMapper().updateById(entity); |
| | | //å¯å¨æµç¨ |
| | | flowCommonService.initActBusiness("å·¥åå·: " + entity.getApplicationOrderNum() + ";设å¤ç¼å·: " + equipment.getEquipmentCode() + ";å®è£
ä½ç½®" + equipment.getInstallationPosition(), |
| | | flowCommonService.initActBusiness("å·¥åå·: " + entity.getApplicationOrderNum() + ";设å¤ç¼å·: " + equipment.getEquipmentCode(), |
| | | entity.getId(), "IEamTechnicalStatusEvaluationApplicationService", "technical_status_evaluation_apply_process", null); |
| | | Map<String, Object> variables = new HashMap<>(); |
| | | variables.put("dataId", entity.getId()); |
| | |
| | | entity.setProductionHeaderSignatureTime(new Date()); |
| | | entity.setProductionHeaderSignatureResult(request.getProductionHeaderSignatureResult()); |
| | | entity.setProductionHeaderComment(request.getProductionHeaderComment()); |
| | | values.put("productionHeaderConfirmFlag", request.getProductionHeaderSignatureResult()); |
| | | if(BusinessCodeConst.APPROVED.equals(request.getProductionHeaderSignatureResult())) { |
| | | //éè¿ |
| | | entity.setApplicationStatus(TechnicalStatusEvaluationApplicationStatusEnum.PRODUCTION_SUPPORT_SIGNING.name()); |
| | |
| | | //æ´æ°å®ä½ |
| | | this.getBaseMapper().updateById(entity); |
| | | //å¯å¨æµç¨ |
| | | flowCommonService.initActBusiness("å·¥åå·: " + entity.getChangeOrderNum() + ";设å¤ç¼å·: " + equipment.getEquipmentCode() + ";å®è£
ä½ç½®" + equipment.getInstallationPosition(), |
| | | flowCommonService.initActBusiness("å·¥åå·: " + entity.getChangeOrderNum() + ";设å¤ç¼å·: " + equipment.getEquipmentCode(), |
| | | entity.getId(), "IEamTechnicalStatusEvaluationOrderChangeService", "evaluation_order_change_process", null); |
| | | Map<String, Object> variables = new HashMap<>(); |
| | | variables.put("dataId", entity.getId()); |
| | |
| | | this.getBaseMapper().updateById(entity); |
| | | |
| | | //å¯å¨æµç¨ |
| | | flowCommonService.initActBusiness("å·¥åå·: " + entity.getOrderNum() + ";设å¤ç¼å·: " + equipment.getEquipmentCode() + ";å®è£
ä½ç½®" + equipment.getInstallationPosition(), |
| | | flowCommonService.initActBusiness("å·¥åå·: " + entity.getOrderNum() + ";设å¤ç¼å·: " + equipment.getEquipmentCode(), |
| | | entity.getId(), "IEamTechnicalStatusEvaluationOrderService", "technical_status_evaluation_process", null); |
| | | Map<String, Object> variables = new HashMap<>(); |
| | | variables.put("dataId", entity.getId()); |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | 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.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.flowable.engine.TaskService; |
| | | import org.flowable.task.api.Task; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.constant.DataBaseConstant; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.TranslateDictTextUtils; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.constant.*; |
| | | import org.jeecg.modules.eam.entity.EamBaseHFCode; |
| | | import org.jeecg.modules.eam.entity.EamEquipment; |
| | | import org.jeecg.modules.eam.entity.EamThirdMaintenanceChange; |
| | | import org.jeecg.modules.eam.entity.EamThirdMaintenanceOrder; |
| | | import org.jeecg.modules.eam.mapper.EamThirdMaintenanceChangeMapper; |
| | | import org.jeecg.modules.eam.request.EamThirdMaintenanceChangeQuery; |
| | | import org.jeecg.modules.eam.request.EamThirdMaintenanceChangeRequest; |
| | | import org.jeecg.modules.eam.service.IEamBaseHFCodeService; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecg.modules.eam.service.IEamThirdMaintenanceChangeService; |
| | | import org.jeecg.modules.eam.service.IEamThirdMaintenanceOrderService; |
| | | import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; |
| | | import org.jeecg.modules.flowable.apithird.business.service.IFlowMyBusinessService; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCommonService; |
| | | import org.jeecg.modules.flowable.service.IFlowDefinitionService; |
| | | import org.jeecg.modules.flowable.service.IFlowTaskService; |
| | | import org.jeecg.modules.system.entity.BaseFactory; |
| | | import org.jeecg.modules.system.entity.BaseFactoryUser; |
| | | import org.jeecg.modules.system.service.IBaseFactoryService; |
| | | import org.jeecg.modules.system.service.IBaseFactoryUserService; |
| | | import org.jeecg.modules.system.service.ISysBusinessCodeRuleService; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.jeecg.modules.system.vo.UserSelector; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Description: ä¸ä¿åæ´ |
| | |
| | | @Service |
| | | public class EamThirdMaintenanceChangeServiceImpl extends ServiceImpl<EamThirdMaintenanceChangeMapper, EamThirdMaintenanceChange> implements IEamThirdMaintenanceChangeService { |
| | | |
| | | @Resource |
| | | private EamThirdMaintenanceChangeMapper eamThirdMaintenanceChangeMapper; |
| | | @Resource |
| | | private IBaseFactoryUserService baseFactoryUserService; |
| | | @Resource |
| | | private IBaseFactoryService baseFactoryService; |
| | | @Resource |
| | | private IEamThirdMaintenanceOrderService thirdMaintenanceOrderService; |
| | | @Resource |
| | | private IEamEquipmentService equipmentService; |
| | | @Resource |
| | | private ISysBusinessCodeRuleService businessCodeRuleService; |
| | | @Resource |
| | | private IEamBaseHFCodeService hfCodeService; |
| | | @Resource |
| | | private ISysUserService sysUserService; |
| | | @Resource |
| | | private FlowCommonService flowCommonService; |
| | | @Resource |
| | | private TranslateDictTextUtils translateDictTextUtils; |
| | | @Resource |
| | | private IFlowDefinitionService flowDefinitionService; |
| | | @Resource |
| | | private IFlowMyBusinessService flowMyBusinessService; |
| | | @Resource |
| | | private TaskService taskService; |
| | | @Resource |
| | | private IEamEquipmentService eamEquipmentService; |
| | | @Resource |
| | | private IFlowTaskService flowTaskService; |
| | | |
| | | @Override |
| | | public IPage<EamThirdMaintenanceChange> queryPageList(Page<EamThirdMaintenanceChange> page, EamThirdMaintenanceChangeQuery query) { |
| | | QueryWrapper<EamThirdMaintenanceChange> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("tmc.del_flag", CommonConstant.DEL_FLAG_0); |
| | | //ç¨æ·æ°æ®æé |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (sysUser == null) { |
| | | return page; |
| | | } |
| | | if (StringUtils.isNotBlank(sysUser.getEquipmentIds())) { |
| | | //éæ©äºè®¾å¤ï¼æ ¹æ®è®¾å¤idè¿æ»¤è®¾å¤ |
| | | List<String> equipArr = Arrays.asList(sysUser.getEquipmentIds().split(",")); |
| | | queryWrapper.in("e.equipment_code", equipArr); |
| | | } else { |
| | | //没æéæ©è®¾å¤ï¼æ ¹æ®ä¸å¿è¿æ»¤è®¾å¤ |
| | | List<BaseFactoryUser> baseFactoryUserList = baseFactoryUserService. |
| | | list(new LambdaQueryWrapper<BaseFactoryUser>().eq(BaseFactoryUser::getUserId, sysUser.getId())); |
| | | if (!CollectionUtils.isEmpty(baseFactoryUserList)) { |
| | | Set<String> factoryIds = baseFactoryUserList.stream().map(BaseFactoryUser::getFactoryId).collect(Collectors.toSet()); |
| | | Set<String> factoryCode = baseFactoryService.listByIds(factoryIds).stream().map(BaseFactory::getOrgCode).collect(Collectors.toSet()); |
| | | queryWrapper.in("e.factory_org_code", factoryCode); |
| | | } else { |
| | | return page; |
| | | } |
| | | } |
| | | //æ¥è¯¢æ¡ä»¶è¿æ»¤ |
| | | if (query != null) { |
| | | if (StringUtils.isNotBlank(query.getEquipmentId())) { |
| | | queryWrapper.eq("tmc.equipment_id", query.getEquipmentId()); |
| | | } |
| | | if (StringUtils.isNotBlank(query.getChangeOrderNum())) { |
| | | queryWrapper.like("tmc.order_num", query.getChangeOrderNum()); |
| | | } |
| | | if (StringUtils.isNotBlank(query.getChangeStatus())) { |
| | | queryWrapper.eq("tmc.change_status", query.getChangeStatus()); |
| | | } |
| | | if (query.getApplyDateBegin() != null && query.getApplyDateEnd() != null) { |
| | | queryWrapper.between("tmc.apply_date", query.getApplyDateBegin(), query.getApplyDateEnd()); |
| | | } |
| | | //æåº |
| | | if (StringUtils.isNotBlank(query.getColumn()) && StringUtils.isNotBlank(query.getOrder())) { |
| | | String column = query.getColumn(); |
| | | if (column.endsWith(CommonConstant.DICT_TEXT_SUFFIX)) { |
| | | column = column.substring(0, column.lastIndexOf(CommonConstant.DICT_TEXT_SUFFIX)); |
| | | } |
| | | if (DataBaseConstant.SQL_ASC.equalsIgnoreCase(query.getOrder())) { |
| | | queryWrapper.orderByAsc("tmc." + oConvertUtils.camelToUnderline(column)); |
| | | } else { |
| | | queryWrapper.orderByDesc("tmc." + oConvertUtils.camelToUnderline(column)); |
| | | } |
| | | } else { |
| | | queryWrapper.orderByDesc("tmc.create_time"); |
| | | } |
| | | } else { |
| | | queryWrapper.orderByDesc("tmc.create_time"); |
| | | } |
| | | return eamThirdMaintenanceChangeMapper.queryPageList(page, queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean saveThirdMaintenanceChange(EamThirdMaintenanceChange request) { |
| | | //æ¥è¯¢å·¥å |
| | | EamThirdMaintenanceOrder order = thirdMaintenanceOrderService.getById(request.getOrderId()); |
| | | if (order == null) { |
| | | throw new JeecgBootException("ä¸ä¿å·¥åä¸åå¨ï¼æä½å¤±è´¥ï¼"); |
| | | } |
| | | //æ¥è¯¢è®¾å¤ |
| | | EamEquipment equipment = equipmentService.getById(order.getEquipmentId()); |
| | | if (equipment == null) { |
| | | throw new JeecgBootException("设å¤ä¿¡æ¯ä¸åå¨ï¼æä½å¤±è´¥ï¼"); |
| | | } |
| | | //ç¨æ·æ°æ®æé |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (sysUser == null) { |
| | | throw new JeecgBootException("ç»å½ç¨æ·ä¿¡æ¯ä¸ºç©ºï¼æä½å¤±è´¥ï¼"); |
| | | } |
| | | String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.THIRD_MAINTENANCE_CHANGE_CODE_RULE); |
| | | request.setChangeOrderNum(codeSeq); |
| | | request.setId(null); |
| | | request.setChangeStatus(ThirdMaintenanceChangeStatusEnum.WAIT_SUBMIT.name()); |
| | | request.setDelFlag(CommonConstant.DEL_FLAG_0); |
| | | request.setApplicant(sysUser.getUsername()); |
| | | request.setApplyDate(new Date()); |
| | | request.setFactoryOrgCode(equipment.getFactoryOrgCode()); |
| | | // ä¸ä¿åæ´å·¥åHF |
| | | EamBaseHFCode eamBaseHFCode = hfCodeService.selectByCategory(HfTemplateCategoryEnum.THIRD_MAINTENANCE_CHANGE.name()); |
| | | if (eamBaseHFCode == null) { |
| | | throw new JeecgBootException("æªé
ç½®ææ¯ç¶æé´å®åæ´çHFç¼ç ï¼æ·»å 失败ï¼"); |
| | | } |
| | | request.setHfCode(eamBaseHFCode.getHfCode()); |
| | | this.getBaseMapper().insert(request); |
| | | boolean b = thirdMaintenanceOrderService.updateMaintenanceStatus(request.getOrderId(), ThirdMaintenanceStatusEnum.CHANGE.name()); |
| | | if (!b) { |
| | | throw new JeecgBootException("ä¸ä¿å·¥åç¶æåæ´å¤±è´¥ï¼æ æ³åæ´ï¼"); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean editThirdMaintenanceChange(EamThirdMaintenanceChange request) { |
| | | EamThirdMaintenanceChange entity = this.getBaseMapper().selectById(request); |
| | | if(entity == null) { |
| | | throw new JeecgBootException("ç¼è¾çæ°æ®å·²å é¤ï¼è¯·å·æ°éè¯ï¼"); |
| | | } |
| | | if(!ThirdMaintenanceChangeStatusEnum.WAIT_SUBMIT.name().equals(entity.getChangeStatus())) { |
| | | throw new JeecgBootException("åªæå¾
æäº¤ç¶ææå¯ç¼è¾ï¼"); |
| | | } |
| | | entity.setApplyReasonType(request.getApplyReasonType()); |
| | | entity.setApplyReason(request.getApplyReason()); |
| | | this.getBaseMapper().updateById(entity); |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean submit(String id) { |
| | | EamThirdMaintenanceChange entity = this.getBaseMapper().selectById(id); |
| | | if (entity == null) { |
| | | throw new JeecgBootException("è¦æäº¤çå·¥åä¸åå¨ï¼è¯·å·æ°éè¯ï¼"); |
| | | } |
| | | if (!ThirdMaintenanceChangeStatusEnum.WAIT_SUBMIT.name().equals(entity.getChangeStatus())) { |
| | | throw new JeecgBootException("该工åå·²è¿è¡è¿æäº¤ï¼"); |
| | | } |
| | | EamThirdMaintenanceOrder order = thirdMaintenanceOrderService.getById(entity.getOrderId()); |
| | | if(order == null) { |
| | | throw new JeecgBootException("è¦åæ´çä¸ä¿å·¥åä¸åå¨ï¼è¯·å·æ°éè¯ï¼"); |
| | | } |
| | | EamEquipment equipment = equipmentService.getById(order.getEquipmentId()); |
| | | if (equipment == null) { |
| | | throw new JeecgBootException("设å¤ä¸åå¨ï¼æäº¤å¤±è´¥ï¼"); |
| | | } |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if(sysUser == null || !sysUser.getUsername().equals(entity.getApplicant())) { |
| | | throw new JeecgBootException("䏿¯æ¬äººï¼ä¸è½æäº¤æ¤å·¥åï¼"); |
| | | } |
| | | entity.setChangeStatus(ThirdMaintenanceChangeStatusEnum.EQUIPMENT_MANAGER_SIGNING.name()); |
| | | //æ¥è¯¢ä¸çº§å®¡æ¹äººå |
| | | List<UserSelector> userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0011); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»ä½¿ç¨åä½ä¸»ç®¡å®¤çº§é¢å¯¼ï¼æ æ³æäº¤ï¼"); |
| | | } |
| | | List<String> userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); |
| | | //æ´æ°å®ä½ |
| | | this.getBaseMapper().updateById(entity); |
| | | //å¯å¨æµç¨ |
| | | flowCommonService.initActBusiness("å·¥åå·: " + entity.getChangeOrderNum() + ";设å¤ç¼å·: " + equipment.getEquipmentCode(), |
| | | entity.getId(), "IEamThirdMaintenanceChangeService", "third_maintenance_change", null); |
| | | Map<String, Object> variables = new HashMap<>(); |
| | | variables.put("dataId", entity.getId()); |
| | | String applyReasonTypeText = translateDictTextUtils.translateField("applyReasonType", entity.getApplyReasonType(), "third_maintenance_change_reason"); |
| | | if (StrUtil.isEmpty(applyReasonTypeText)) { |
| | | variables.put("organization", "æ°å¢ä¸ä¿å·¥ååæ´é»è®¤å¯å¨æµç¨"); |
| | | variables.put("comment", "æ°å¢ä¸ä¿å·¥ååæ´é»è®¤å¯å¨æµç¨"); |
| | | } else { |
| | | variables.put("organization", applyReasonTypeText); |
| | | variables.put("comment", applyReasonTypeText); |
| | | } |
| | | Result<?> result = flowDefinitionService.startProcessInstanceByKey("third_maintenance_change", variables); |
| | | if(result == null || !result.isSuccess()) { |
| | | throw new JeecgBootException("å¯å¨æµç¨å¤±è´¥ï¼"); |
| | | } |
| | | //æ´æ°å·¥åç¶æä¸ºåæ´ä¸ |
| | | order.setMaintenanceStatus(ThirdMaintenanceStatusEnum.CHANGE.name()); |
| | | boolean b = thirdMaintenanceOrderService.updateById(order); |
| | | if(!b) { |
| | | throw new JeecgBootException("ä¸ä¿å·¥åç¶ææ´æ°å¤±è´¥ï¼"); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public EamThirdMaintenanceChange approval(EamThirdMaintenanceChangeRequest request) { |
| | | EamThirdMaintenanceChange entity = this.getBaseMapper().selectById(request.getId()); |
| | | if (entity == null) { |
| | | throw new JeecgBootException("审æ¹çæ°æ®å·²å é¤ï¼è¯·å·æ°éè¯ï¼"); |
| | | } |
| | | EamThirdMaintenanceOrder order = thirdMaintenanceOrderService.getById(entity.getOrderId()); |
| | | if(order == null) { |
| | | throw new JeecgBootException("è¦åæ´çä¸ä¿å·¥åä¸åå¨ï¼è¯·å·æ°éè¯ï¼"); |
| | | } |
| | | // è·åå½åç»å½ç¨æ· |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (user == null || StrUtil.isBlank(user.getId())) { |
| | | throw new JeecgBootException("æªè·åå°ç»å½ç¨æ·ï¼è¯·éæ°ç»å½ååè¯ï¼"); |
| | | } |
| | | request.setAssignee(user.getUsername()); |
| | | // è·åæµç¨ä¸å¡è®°å½ |
| | | FlowMyBusiness flowMyBusiness = flowMyBusinessService.getFlowMyBusiness(request.getInstanceId(), request.getTaskId()); |
| | | if (flowMyBusiness == null) { |
| | | throw new JeecgBootException("æµç¨å®ä¾ä¸åå¨ï¼è¯·å·æ°åéè¯ï¼"); |
| | | } |
| | | |
| | | if (!isUserAuthorized(flowMyBusiness, user)) { |
| | | throw new JeecgBootException("ç¨æ·æ ææä½æ¤ä»»å¡ï¼è¯·å·æ°åéè¯ï¼"); |
| | | } |
| | | // 认é¢ä»»å¡ |
| | | if (!claimTask(flowMyBusiness.getTaskId(), user)) { |
| | | throw new JeecgBootException("ä»»å¡ä¸åå¨ã已宿æå·²è¢«ä»äººè®¤é¢ï¼"); |
| | | } |
| | | EamEquipment equipment = eamEquipmentService.getById(order.getEquipmentId()); |
| | | if (equipment == null) { |
| | | throw new JeecgBootException("设å¤ä¸åå¨ï¼è¯·æ£æ¥ï¼"); |
| | | } |
| | | |
| | | // 设置æµç¨åé |
| | | setupProcessVariables(request, order, user, equipment); |
| | | |
| | | // 宿æµç¨ä»»å¡ |
| | | Result result = flowTaskService.complete(request); |
| | | |
| | | // æ ¹æ®ä»»å¡å®æç»ææ´æ°å·¥åç¶æ |
| | | updateOrderStatus(result, request, order, user); |
| | | |
| | | //æ´æ°å·¥åä¿¡æ¯ |
| | | this.getBaseMapper().updateById(entity); |
| | | return entity; |
| | | } |
| | | |
| | | /** |
| | | * 设置æµç¨åé |
| | | */ |
| | | private void setupProcessVariables(EamThirdMaintenanceChangeRequest request, EamThirdMaintenanceOrder order, LoginUser user, EamEquipment equipment) { |
| | | |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°å·¥åç¶æ |
| | | */ |
| | | private void updateOrderStatus(Result result, EamThirdMaintenanceChangeRequest request, EamThirdMaintenanceOrder order, LoginUser user) { |
| | | |
| | | } |
| | | |
| | | private boolean isUserAuthorized(FlowMyBusiness flowMyBusiness, LoginUser user) { |
| | | List<String> todoUsers = JSON.parseArray(flowMyBusiness.getTodoUsers(), String.class); |
| | | return todoUsers != null && todoUsers.contains(user.getUsername()); |
| | | } |
| | | |
| | | private boolean claimTask(String taskId, LoginUser user) { |
| | | Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); |
| | | if (task == null) { |
| | | return false; |
| | | } |
| | | if (task.getAssignee() != null && !task.getAssignee().equals(user.getUsername())) { |
| | | return false; |
| | | } |
| | | taskService.claim(taskId, user.getUsername()); |
| | | return true; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.aspect.annotation.EquipmentHistoryLog; |
| | | import org.jeecg.modules.eam.constant.*; |
| | | import org.jeecg.modules.eam.entity.EamBaseHFCode; |
| | | import org.jeecg.modules.eam.entity.EamEquipment; |
| | | import org.jeecg.modules.eam.entity.EamThirdMaintenanceOrder; |
| | | import org.jeecg.modules.eam.entity.EamThirdMaintenanceOrderDetail; |
| | | import org.jeecg.modules.eam.entity.*; |
| | | import org.jeecg.modules.eam.mapper.EamThirdMaintenanceOrderMapper; |
| | | import org.jeecg.modules.eam.request.EamInspectionOrderRequest; |
| | | import org.jeecg.modules.eam.request.EamThirdMaintenanceQuery; |
| | | import org.jeecg.modules.eam.request.EamThirdMaintenanceRequest; |
| | | import org.jeecg.modules.eam.service.*; |
| | |
| | | return Result.ok(eamThirdMaintenanceRequestList); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean updateMaintenanceStatus(String orderId, String maintenanceStatus) { |
| | | LambdaUpdateWrapper<EamThirdMaintenanceOrder> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(EamThirdMaintenanceOrder::getId, orderId); |
| | | updateWrapper.set(EamThirdMaintenanceOrder::getMaintenanceStatus, maintenanceStatus); |
| | | updateWrapper.eq(EamThirdMaintenanceOrder::getDelFlag, CommonConstant.DEL_FLAG_0); |
| | | updateWrapper.in(EamThirdMaintenanceOrder::getMaintenanceStatus, Arrays.asList(ThirdMaintenanceStatusEnum.WAIT_MAINTENANCE.name(), ThirdMaintenanceStatusEnum.FREEZE.name())); |
| | | int update = this.getBaseMapper().update(null, updateWrapper); |
| | | return update > 0; |
| | | } |
| | | |
| | | /** |
| | | * 设置æµç¨åé |
| | | */ |