This commit is contained in:
lijiaqi 2024-09-10 16:03:28 +08:00
parent 3dc6c5390b
commit 5c2a59c66f
5 changed files with 107 additions and 2 deletions

View File

@ -0,0 +1,30 @@
package cn.workde.module.drone.coding.controller;
import cn.workde.core.constant.GrapeConst;
import cn.workde.module.drone.coding.service.RuleService;
import cn.workde.module.upms.controller._BaseController;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;
/**
* 规则管理表(Rule)表控制层
*
* @author makejava
* @since 2024-09-10 14:32:56
*/
@Tag(name = "规则管理")
@RestController
@RequestMapping(value = GrapeConst.API + "/rule")
public class RuleController extends _BaseController {
/**
* 服务对象
*/
@Resource
private RuleService ruleService;
}

View File

@ -0,0 +1,34 @@
package cn.workde.module.drone.coding.entity;
import java.util.Date;
import cn.workde.core.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* 规则管理表(Rule)表实体类
*
* @author makejava
* @since 2024-09-10 14:32:57
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "dss_drone_coding_rule")
public class Rule extends BaseEntity {
@Schema(description = "规则编码")
private String ruleCode;
@Schema(description = "规则名称")
private String ruleName;
@Schema(description = "规则描述")
private String ruleDescription;
}

View File

@ -0,0 +1,18 @@
package cn.workde.module.drone.coding.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.workde.module.drone.coding.entity.Rule;
import com.github.yulichang.base.MPJBaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 规则管理表(Rule)表数据库访问层
*
* @author makejava
* @since 2024-09-10 14:32:56
*/
@Mapper
public interface RuleMapper extends MPJBaseMapper<Rule> {
}

View File

@ -147,7 +147,7 @@ public class BatchesService extends BaseService<BatchesMapper, Batches> {
continue;
}
attributeDTO.setMfcId(attributeValue.getMfcId());
attributeDTO.setBatchesId(null);
attributeDTO.setBatchesId(batchesId);
attributeDTO.setAttributeId(attributeValue.getAttributeId());
attributeDTO.setAttributeValue(attributeValue.getAttributeValue());
//不是锁定的属性 看备份表是否有该属性 有则覆盖
@ -159,7 +159,7 @@ public class BatchesService extends BaseService<BatchesMapper, Batches> {
.eq(AttributeValueBackup::getAttributeClassificationId, attributeValue.getAttributeClassificationId())
);
if (ObjUtil.isNotNull(value)) {
attributeValue.setAttributeValue(value.getAttributeValue());
attributeDTO.setAttributeValue(value.getAttributeValue());
}
}
attributeDtoList.add(attributeDTO);
@ -201,6 +201,9 @@ public class BatchesService extends BaseService<BatchesMapper, Batches> {
}
attributeValues.add(value);
}
if (CollUtil.isEmpty(attributeValues)) {
return Result.success("操作成功");
}
boolean flag = attributeValueBackupService.saveOrUpdateBatch(attributeValues);
return flag ? Result.success("操作成功") : Result.fail("操作失败");
}

View File

@ -0,0 +1,20 @@
package cn.workde.module.drone.coding.service;
import cn.workde.core.base.BaseService;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.workde.module.drone.coding.mapper.RuleMapper;
import cn.workde.module.drone.coding.entity.Rule;
import org.springframework.stereotype.Service;
/**
* 规则管理表(Rule)表服务实现类
*
* @author makejava
* @since 2024-09-10 14:32:57
*/
@Service("ruleService")
public class RuleService extends BaseService<RuleMapper, Rule> {
}