奖惩流程接口修改, 增加返回参数

This commit is contained in:
furongxin 2024-05-09 10:12:27 +08:00
parent 2ecac1a3f6
commit d14a0bd598
12 changed files with 38 additions and 28 deletions

View File

@ -22,8 +22,8 @@ public class SfFactoryInfoPageReqVO extends PageParam {
@Schema(description = "工厂简称", example = "王五")
private String shortName;
@Schema(description = "工厂代号")
private String code;
@Schema(description = "工厂类型")
private String type;
@Schema(description = "工厂简介", example = "你猜")
private String description;

View File

@ -26,9 +26,9 @@ public class SfFactoryInfoRespVO {
@ExcelProperty("工厂简称")
private String shortName;
@Schema(description = "工厂代号")
@ExcelProperty("工厂代号")
private String code;
@Schema(description = "工厂类型")
@ExcelProperty("工厂类型")
private String type;
@Schema(description = "工厂简介", example = "你猜")
@ExcelProperty("工厂简介")

View File

@ -22,8 +22,8 @@ public class SfFactoryInfoSaveReqVO {
@NotEmpty(message = "工厂简称不能为空")
private String shortName;
@Schema(description = "工厂代号")
private String code;
@Schema(description = "工厂类型")
private String type;
@Schema(description = "工厂简介", example = "你猜")
private String description;

View File

@ -22,8 +22,8 @@ public class FactoryInfoPageReqVO extends PageParam {
@Schema(description = "工厂简称", example = "第一工厂")
private String shortName;
@Schema(description = "工厂代码", example = "10000")
private String code;
@Schema(description = "工厂类型", example = "1")
private String type;
@Schema(description = "状态", example = "1")
private Integer status;

View File

@ -28,9 +28,9 @@ public class FactoryInfoRespVO {
@ExcelProperty("工厂简称")
private String shortName;
@Schema(description = "工厂代码", requiredMode = Schema.RequiredMode.REQUIRED, example = "10000")
@ExcelProperty("工厂代码")
private String code;
@Schema(description = "工厂类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty("工厂类型")
private String type;
@Schema(description = "工厂简介", example = "这是一个工厂简介")
@ExcelProperty("工厂简介")
@ -61,4 +61,6 @@ public class FactoryInfoRespVO {
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "负责人编号", example = "126")
private Long leaderUserId;
}

View File

@ -22,9 +22,9 @@ public class FactoryInfoSaveReqVO {
@NotEmpty(message = "工厂简称不能为空")
private String shortName;
@Schema(description = "工厂代码", requiredMode = Schema.RequiredMode.REQUIRED, example = "10000")
@NotEmpty(message = "工厂代码不能为空")
private String code;
@Schema(description = "工厂类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotEmpty(message = "工厂类型不能为空")
private String type;
@Schema(description = "工厂简介", example = "这是一个工厂简介")
private String description;
@ -70,4 +70,6 @@ public class FactoryInfoSaveReqVO {
@NotNull(message = "状态不能为空")
private Integer status;
@Schema(description = "负责人编号", example = "126")
private Long leaderUserId;
}

View File

@ -16,7 +16,6 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
* @author 艾楷
*/
@TableName("sf_factory_info")
@KeySequence("sf_factory_info_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ -39,9 +38,9 @@ public class SfFactoryInfoDO extends BaseDO {
*/
private String shortName;
/**
* 工厂代号
* 工厂类型
*/
private String code;
private String type;
/**
* 工厂简介
*/

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryinfo;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
@ -15,7 +16,6 @@ import java.math.BigDecimal;
* @author 姚君
*/
@TableName("sf_factory_info")
@KeySequence("sf_factory_info_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ -47,9 +47,9 @@ public class FactoryInfoDO extends BaseDO {
*/
private String shortName;
/**
* 工厂代码
* 工厂类型
*/
private String code;
private String type;
/**
* 工厂简介
*/
@ -104,7 +104,7 @@ public class FactoryInfoDO extends BaseDO {
/**
* 状态
* <p>
* 枚举 {@link TODO common_status 对应的}
* 枚举 {@link CommonStatusEnum 枚举}
*/
private Integer status;

View File

@ -19,7 +19,7 @@ public interface SfFactoryInfoMapper extends BaseMapperX<SfFactoryInfoDO> {
return selectPage(reqVO, new LambdaQueryWrapperX<SfFactoryInfoDO>()
.likeIfPresent(SfFactoryInfoDO::getFullName, reqVO.getFullName())
.likeIfPresent(SfFactoryInfoDO::getShortName, reqVO.getShortName())
.eqIfPresent(SfFactoryInfoDO::getCode, reqVO.getCode())
.eqIfPresent(SfFactoryInfoDO::getType, reqVO.getType())
.eqIfPresent(SfFactoryInfoDO::getDescription, reqVO.getDescription())
.eqIfPresent(SfFactoryInfoDO::getProvinceId, reqVO.getProvinceId())
.likeIfPresent(SfFactoryInfoDO::getProvinceName, reqVO.getProvinceName())

View File

@ -23,7 +23,7 @@ public interface FactoryInfoMapper extends BaseMapperX<FactoryInfoDO> {
return selectPage(reqVO, new LambdaQueryWrapperX<FactoryInfoDO>()
.likeIfPresent(FactoryInfoDO::getName, reqVO.getName())
.likeIfPresent(FactoryInfoDO::getShortName, reqVO.getShortName())
.likeIfPresent(FactoryInfoDO::getCode, reqVO.getCode())
.likeIfPresent(FactoryInfoDO::getType, reqVO.getType())
.eqIfPresent(FactoryInfoDO::getStatus, reqVO.getStatus())
.betweenIfPresent(FactoryInfoDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(FactoryInfoDO::getSort));

View File

@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.ProvincesDataRespVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryinfo.FactoryInfoDO;
import cn.iocoder.yudao.module.smartfactory.dal.mysql.factoryinfo.FactoryInfoMapper;
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
@ -36,11 +37,18 @@ public class FactoryInfoServiceImpl implements FactoryInfoService {
@Resource
private FactoryInfoMapper factoryInfoMapper;
@Resource
private DeptApi deptApi;
@Override
public Long createFactoryInfo(FactoryInfoSaveReqVO createReqVO) {
// 插入
FactoryInfoDO factoryInfo = BeanUtils.toBean(createReqVO, FactoryInfoDO.class);
factoryInfoMapper.insert(factoryInfo);
//同步插入对应 生产部的下级部门
// 返回
return factoryInfo.getId();
}
@ -132,5 +140,4 @@ public class FactoryInfoServiceImpl implements FactoryInfoService {
public String getWeatherCodeByFactoryId(Long factoryId, String areaCode) {
return factoryInfoMapper.getWeatherCodeByFactoryId(factoryId, areaCode);
}
}

View File

@ -112,7 +112,7 @@ public class FactoryInfoServiceImplTest extends BaseDbUnitTest {
FactoryInfoDO dbFactoryInfo = randomPojo(FactoryInfoDO.class, o -> { // 等会查询到
o.setName(null);
o.setShortName(null);
o.setCode(null);
o.setType(null);
o.setStatus(null);
o.setCreateTime(null);
});
@ -122,7 +122,7 @@ public class FactoryInfoServiceImplTest extends BaseDbUnitTest {
// 测试 shortName 不匹配
factoryInfoMapper.insert(cloneIgnoreId(dbFactoryInfo, o -> o.setShortName(null)));
// 测试 code 不匹配
factoryInfoMapper.insert(cloneIgnoreId(dbFactoryInfo, o -> o.setCode(null)));
factoryInfoMapper.insert(cloneIgnoreId(dbFactoryInfo, o -> o.setType(null)));
// 测试 status 不匹配
factoryInfoMapper.insert(cloneIgnoreId(dbFactoryInfo, o -> o.setStatus(null)));
// 测试 createTime 不匹配
@ -131,7 +131,7 @@ public class FactoryInfoServiceImplTest extends BaseDbUnitTest {
FactoryInfoPageReqVO reqVO = new FactoryInfoPageReqVO();
reqVO.setName(null);
reqVO.setShortName(null);
reqVO.setCode(null);
reqVO.setType(null);
reqVO.setStatus(null);
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));