cuikaidong
2025-05-20 80f4ce8b76ad73f826fff2eed82a7acdebceca04
借出归还-审批流程增加
已修改3个文件
78 ■■■■■ 文件已修改
db/数据库产品化设计.pdma.json 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamEquipmentLeanOut.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentLeanOutServiceImpl.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
db/Êý¾Ý¿â²úÆ·»¯Éè¼Æ.pdma.json
@@ -4,7 +4,7 @@
  "avatar": "",
  "version": "4.9.2",
  "createdTime": "2025-3-10 16:38:19",
  "updatedTime": "2025-5-19 17:03:40",
  "updatedTime": "2025-5-20 17:13:15",
  "dbConns": [],
  "profile": {
    "default": {
@@ -12193,6 +12193,24 @@
          "extProps": {},
          "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
          "id": "FC0C30BA-AA78-41F8-A683-B7D2562934F1"
        },
        {
          "defKey": "return_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": "5177F684-EFAD-42F4-B1BC-50E1E312B58C"
        }
      ],
      "correlations": [],
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamEquipmentLeanOut.java
@@ -119,6 +119,10 @@
    @Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
    private String remark;
    /**备注*/
    @Excel(name = "归还备注", width = 15)
    @ApiModelProperty(value = "归还备注")
    private String returnComment;
    //列表展示
    @TableField(exist = false)
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentLeanOutServiceImpl.java
@@ -17,7 +17,6 @@
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.eam.constant.AssetStatusEnum;
import org.jeecg.modules.eam.constant.EquipmentLeanOutStatusEnum;
import org.jeecg.modules.eam.constant.EquipmentMaintenanceStatus;
import org.jeecg.modules.eam.entity.EamEquipment;
import org.jeecg.modules.eam.entity.EamEquipmentLeanOut;
import org.jeecg.modules.eam.mapper.EamEquipmentLeanOutMapper;
@@ -30,7 +29,6 @@
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.service.IMdcProductionService;
import org.jeecg.modules.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -238,10 +236,43 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public EamEquipmentLeanOut approval(EamEquipmentLeanOut request) {
        // TODO
        return null;
    public EamEquipmentLeanOut approval(EamEquipmentLeanOut eamEquipmentLeanOut) {
        try {
            // æ£€æŸ¥è¯·æ±‚参数
            if (!isValidRequest(eamEquipmentLeanOut)) {
                throw new JeecgBootException("非法参数");
            }
            if (EquipmentLeanOutStatusEnum.WAIT_APPROVAL.name().equals(eamEquipmentLeanOut.getLeanStatus())) {
                eamEquipmentLeanOut.setLeanStatus(EquipmentLeanOutStatusEnum.WAIT_RETURN.name());
                // å¾…归还
            } else if (EquipmentLeanOutStatusEnum.WAIT_RETURN.name().equals(eamEquipmentLeanOut.getLeanStatus())) {
                // å¾…确认
                eamEquipmentLeanOut.setLeanStatus(EquipmentLeanOutStatusEnum.WAIT_CONFIRM.name());
            } else if (EquipmentLeanOutStatusEnum.WAIT_CONFIRM.name().equals(eamEquipmentLeanOut.getLeanStatus())) {
                // å·²å®Œæˆ
                eamEquipmentLeanOut.setLeanStatus(EquipmentLeanOutStatusEnum.COMPLETE.name());
            }
            // èŽ·å–å½“å‰ç™»å½•ç”¨æˆ·
            LoginUser sysUser = getCurrentUser();
            if (sysUser == null || StrUtil.isBlank(sysUser.getId())) {
                throw new JeecgBootException("账号不存在");
            }
            // å®¡æ‰¹äºº
            eamEquipmentLeanOut.setApprovalUser(sysUser.getUsername());
            //检查设备
            EamEquipment equipment = eamEquipmentService.getById(eamEquipmentLeanOut.getEquipmentId());
            if (equipment == null) {
                throw new JeecgBootException("设备不存在!");
            }
            eamEquipmentLeanOut.setLeanPerson(sysUser.getUsername());
            this.updateById(eamEquipmentLeanOut);
            // èŽ·å–æµç¨‹ä¸šåŠ¡è®°å½•
            return eamEquipmentLeanOut;
        } catch (Exception e) {
            throw new JeecgBootException("操作失败:" + e.getMessage());
        }
    }
    @Override
    public void afterFlowHandle(FlowMyBusiness business) {
@@ -250,6 +281,19 @@
        business.getActStatus();
    }
    private boolean isValidRequest(EamEquipmentLeanOut request) {
        return StrUtil.isNotBlank(request.getCode()) && StrUtil.isNotBlank(request.getEquipmentId());
    }
    private LoginUser getCurrentUser() {
        try {
            return (LoginUser) SecurityUtils.getSubject().getPrincipal();
        } catch (Exception e) {
            return null;
        }
    }
    @Override
    public Object getBusinessDataById(String dataId) {
        return this.getById(dataId);