奖惩流程接口修改, 增加返回参数
This commit is contained in:
parent
2ecac1a3f6
commit
d14a0bd598
@ -22,8 +22,8 @@ public class SfFactoryInfoPageReqVO extends PageParam {
|
|||||||
@Schema(description = "工厂简称", example = "王五")
|
@Schema(description = "工厂简称", example = "王五")
|
||||||
private String shortName;
|
private String shortName;
|
||||||
|
|
||||||
@Schema(description = "工厂代号")
|
@Schema(description = "工厂类型")
|
||||||
private String code;
|
private String type;
|
||||||
|
|
||||||
@Schema(description = "工厂简介", example = "你猜")
|
@Schema(description = "工厂简介", example = "你猜")
|
||||||
private String description;
|
private String description;
|
||||||
|
@ -26,9 +26,9 @@ public class SfFactoryInfoRespVO {
|
|||||||
@ExcelProperty("工厂简称")
|
@ExcelProperty("工厂简称")
|
||||||
private String shortName;
|
private String shortName;
|
||||||
|
|
||||||
@Schema(description = "工厂代号")
|
@Schema(description = "工厂类型")
|
||||||
@ExcelProperty("工厂代号")
|
@ExcelProperty("工厂类型")
|
||||||
private String code;
|
private String type;
|
||||||
|
|
||||||
@Schema(description = "工厂简介", example = "你猜")
|
@Schema(description = "工厂简介", example = "你猜")
|
||||||
@ExcelProperty("工厂简介")
|
@ExcelProperty("工厂简介")
|
||||||
|
@ -22,8 +22,8 @@ public class SfFactoryInfoSaveReqVO {
|
|||||||
@NotEmpty(message = "工厂简称不能为空")
|
@NotEmpty(message = "工厂简称不能为空")
|
||||||
private String shortName;
|
private String shortName;
|
||||||
|
|
||||||
@Schema(description = "工厂代号")
|
@Schema(description = "工厂类型")
|
||||||
private String code;
|
private String type;
|
||||||
|
|
||||||
@Schema(description = "工厂简介", example = "你猜")
|
@Schema(description = "工厂简介", example = "你猜")
|
||||||
private String description;
|
private String description;
|
||||||
|
@ -22,8 +22,8 @@ public class FactoryInfoPageReqVO extends PageParam {
|
|||||||
@Schema(description = "工厂简称", example = "第一工厂")
|
@Schema(description = "工厂简称", example = "第一工厂")
|
||||||
private String shortName;
|
private String shortName;
|
||||||
|
|
||||||
@Schema(description = "工厂代码", example = "10000")
|
@Schema(description = "工厂类型", example = "1")
|
||||||
private String code;
|
private String type;
|
||||||
|
|
||||||
@Schema(description = "状态", example = "1")
|
@Schema(description = "状态", example = "1")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
@ -28,9 +28,9 @@ public class FactoryInfoRespVO {
|
|||||||
@ExcelProperty("工厂简称")
|
@ExcelProperty("工厂简称")
|
||||||
private String shortName;
|
private String shortName;
|
||||||
|
|
||||||
@Schema(description = "工厂代码", requiredMode = Schema.RequiredMode.REQUIRED, example = "10000")
|
@Schema(description = "工厂类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
@ExcelProperty("工厂代码")
|
@ExcelProperty("工厂类型")
|
||||||
private String code;
|
private String type;
|
||||||
|
|
||||||
@Schema(description = "工厂简介", example = "这是一个工厂简介")
|
@Schema(description = "工厂简介", example = "这是一个工厂简介")
|
||||||
@ExcelProperty("工厂简介")
|
@ExcelProperty("工厂简介")
|
||||||
@ -61,4 +61,6 @@ public class FactoryInfoRespVO {
|
|||||||
@ExcelProperty("创建时间")
|
@ExcelProperty("创建时间")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "负责人编号", example = "126")
|
||||||
|
private Long leaderUserId;
|
||||||
}
|
}
|
@ -22,9 +22,9 @@ public class FactoryInfoSaveReqVO {
|
|||||||
@NotEmpty(message = "工厂简称不能为空")
|
@NotEmpty(message = "工厂简称不能为空")
|
||||||
private String shortName;
|
private String shortName;
|
||||||
|
|
||||||
@Schema(description = "工厂代码", requiredMode = Schema.RequiredMode.REQUIRED, example = "10000")
|
@Schema(description = "工厂类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
@NotEmpty(message = "工厂代码不能为空")
|
@NotEmpty(message = "工厂类型不能为空")
|
||||||
private String code;
|
private String type;
|
||||||
|
|
||||||
@Schema(description = "工厂简介", example = "这是一个工厂简介")
|
@Schema(description = "工厂简介", example = "这是一个工厂简介")
|
||||||
private String description;
|
private String description;
|
||||||
@ -70,4 +70,6 @@ public class FactoryInfoSaveReqVO {
|
|||||||
@NotNull(message = "状态不能为空")
|
@NotNull(message = "状态不能为空")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "负责人编号", example = "126")
|
||||||
|
private Long leaderUserId;
|
||||||
}
|
}
|
@ -16,7 +16,6 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
|||||||
* @author 艾楷
|
* @author 艾楷
|
||||||
*/
|
*/
|
||||||
@TableName("sf_factory_info")
|
@TableName("sf_factory_info")
|
||||||
@KeySequence("sf_factory_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
@ -39,9 +38,9 @@ public class SfFactoryInfoDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
private String shortName;
|
private String shortName;
|
||||||
/**
|
/**
|
||||||
* 工厂代号
|
* 工厂类型
|
||||||
*/
|
*/
|
||||||
private String code;
|
private String type;
|
||||||
/**
|
/**
|
||||||
* 工厂简介
|
* 工厂简介
|
||||||
*/
|
*/
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryinfo;
|
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 cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
@ -15,7 +16,6 @@ import java.math.BigDecimal;
|
|||||||
* @author 姚君
|
* @author 姚君
|
||||||
*/
|
*/
|
||||||
@TableName("sf_factory_info")
|
@TableName("sf_factory_info")
|
||||||
@KeySequence("sf_factory_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
@ -47,9 +47,9 @@ public class FactoryInfoDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
private String shortName;
|
private String shortName;
|
||||||
/**
|
/**
|
||||||
* 工厂代码
|
* 工厂类型
|
||||||
*/
|
*/
|
||||||
private String code;
|
private String type;
|
||||||
/**
|
/**
|
||||||
* 工厂简介
|
* 工厂简介
|
||||||
*/
|
*/
|
||||||
@ -104,7 +104,7 @@ public class FactoryInfoDO extends BaseDO {
|
|||||||
/**
|
/**
|
||||||
* 状态
|
* 状态
|
||||||
* <p>
|
* <p>
|
||||||
* 枚举 {@link TODO common_status 对应的类}
|
* 枚举 {@link CommonStatusEnum 枚举类}
|
||||||
*/
|
*/
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ public interface SfFactoryInfoMapper extends BaseMapperX<SfFactoryInfoDO> {
|
|||||||
return selectPage(reqVO, new LambdaQueryWrapperX<SfFactoryInfoDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<SfFactoryInfoDO>()
|
||||||
.likeIfPresent(SfFactoryInfoDO::getFullName, reqVO.getFullName())
|
.likeIfPresent(SfFactoryInfoDO::getFullName, reqVO.getFullName())
|
||||||
.likeIfPresent(SfFactoryInfoDO::getShortName, reqVO.getShortName())
|
.likeIfPresent(SfFactoryInfoDO::getShortName, reqVO.getShortName())
|
||||||
.eqIfPresent(SfFactoryInfoDO::getCode, reqVO.getCode())
|
.eqIfPresent(SfFactoryInfoDO::getType, reqVO.getType())
|
||||||
.eqIfPresent(SfFactoryInfoDO::getDescription, reqVO.getDescription())
|
.eqIfPresent(SfFactoryInfoDO::getDescription, reqVO.getDescription())
|
||||||
.eqIfPresent(SfFactoryInfoDO::getProvinceId, reqVO.getProvinceId())
|
.eqIfPresent(SfFactoryInfoDO::getProvinceId, reqVO.getProvinceId())
|
||||||
.likeIfPresent(SfFactoryInfoDO::getProvinceName, reqVO.getProvinceName())
|
.likeIfPresent(SfFactoryInfoDO::getProvinceName, reqVO.getProvinceName())
|
||||||
|
@ -23,7 +23,7 @@ public interface FactoryInfoMapper extends BaseMapperX<FactoryInfoDO> {
|
|||||||
return selectPage(reqVO, new LambdaQueryWrapperX<FactoryInfoDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<FactoryInfoDO>()
|
||||||
.likeIfPresent(FactoryInfoDO::getName, reqVO.getName())
|
.likeIfPresent(FactoryInfoDO::getName, reqVO.getName())
|
||||||
.likeIfPresent(FactoryInfoDO::getShortName, reqVO.getShortName())
|
.likeIfPresent(FactoryInfoDO::getShortName, reqVO.getShortName())
|
||||||
.likeIfPresent(FactoryInfoDO::getCode, reqVO.getCode())
|
.likeIfPresent(FactoryInfoDO::getType, reqVO.getType())
|
||||||
.eqIfPresent(FactoryInfoDO::getStatus, reqVO.getStatus())
|
.eqIfPresent(FactoryInfoDO::getStatus, reqVO.getStatus())
|
||||||
.betweenIfPresent(FactoryInfoDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(FactoryInfoDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.orderByDesc(FactoryInfoDO::getSort));
|
.orderByDesc(FactoryInfoDO::getSort));
|
||||||
|
@ -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.controller.admin.screendata.factory.vo.ProvincesDataRespVO;
|
||||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryinfo.FactoryInfoDO;
|
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.smartfactory.dal.mysql.factoryinfo.FactoryInfoMapper;
|
||||||
|
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
@ -36,11 +37,18 @@ public class FactoryInfoServiceImpl implements FactoryInfoService {
|
|||||||
@Resource
|
@Resource
|
||||||
private FactoryInfoMapper factoryInfoMapper;
|
private FactoryInfoMapper factoryInfoMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DeptApi deptApi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createFactoryInfo(FactoryInfoSaveReqVO createReqVO) {
|
public Long createFactoryInfo(FactoryInfoSaveReqVO createReqVO) {
|
||||||
// 插入
|
// 插入
|
||||||
FactoryInfoDO factoryInfo = BeanUtils.toBean(createReqVO, FactoryInfoDO.class);
|
FactoryInfoDO factoryInfo = BeanUtils.toBean(createReqVO, FactoryInfoDO.class);
|
||||||
factoryInfoMapper.insert(factoryInfo);
|
factoryInfoMapper.insert(factoryInfo);
|
||||||
|
|
||||||
|
//同步插入对应 生产部的下级部门
|
||||||
|
|
||||||
|
|
||||||
// 返回
|
// 返回
|
||||||
return factoryInfo.getId();
|
return factoryInfo.getId();
|
||||||
}
|
}
|
||||||
@ -132,5 +140,4 @@ public class FactoryInfoServiceImpl implements FactoryInfoService {
|
|||||||
public String getWeatherCodeByFactoryId(Long factoryId, String areaCode) {
|
public String getWeatherCodeByFactoryId(Long factoryId, String areaCode) {
|
||||||
return factoryInfoMapper.getWeatherCodeByFactoryId(factoryId, areaCode);
|
return factoryInfoMapper.getWeatherCodeByFactoryId(factoryId, areaCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -112,7 +112,7 @@ public class FactoryInfoServiceImplTest extends BaseDbUnitTest {
|
|||||||
FactoryInfoDO dbFactoryInfo = randomPojo(FactoryInfoDO.class, o -> { // 等会查询到
|
FactoryInfoDO dbFactoryInfo = randomPojo(FactoryInfoDO.class, o -> { // 等会查询到
|
||||||
o.setName(null);
|
o.setName(null);
|
||||||
o.setShortName(null);
|
o.setShortName(null);
|
||||||
o.setCode(null);
|
o.setType(null);
|
||||||
o.setStatus(null);
|
o.setStatus(null);
|
||||||
o.setCreateTime(null);
|
o.setCreateTime(null);
|
||||||
});
|
});
|
||||||
@ -122,7 +122,7 @@ public class FactoryInfoServiceImplTest extends BaseDbUnitTest {
|
|||||||
// 测试 shortName 不匹配
|
// 测试 shortName 不匹配
|
||||||
factoryInfoMapper.insert(cloneIgnoreId(dbFactoryInfo, o -> o.setShortName(null)));
|
factoryInfoMapper.insert(cloneIgnoreId(dbFactoryInfo, o -> o.setShortName(null)));
|
||||||
// 测试 code 不匹配
|
// 测试 code 不匹配
|
||||||
factoryInfoMapper.insert(cloneIgnoreId(dbFactoryInfo, o -> o.setCode(null)));
|
factoryInfoMapper.insert(cloneIgnoreId(dbFactoryInfo, o -> o.setType(null)));
|
||||||
// 测试 status 不匹配
|
// 测试 status 不匹配
|
||||||
factoryInfoMapper.insert(cloneIgnoreId(dbFactoryInfo, o -> o.setStatus(null)));
|
factoryInfoMapper.insert(cloneIgnoreId(dbFactoryInfo, o -> o.setStatus(null)));
|
||||||
// 测试 createTime 不匹配
|
// 测试 createTime 不匹配
|
||||||
@ -131,7 +131,7 @@ public class FactoryInfoServiceImplTest extends BaseDbUnitTest {
|
|||||||
FactoryInfoPageReqVO reqVO = new FactoryInfoPageReqVO();
|
FactoryInfoPageReqVO reqVO = new FactoryInfoPageReqVO();
|
||||||
reqVO.setName(null);
|
reqVO.setName(null);
|
||||||
reqVO.setShortName(null);
|
reqVO.setShortName(null);
|
||||||
reqVO.setCode(null);
|
reqVO.setType(null);
|
||||||
reqVO.setStatus(null);
|
reqVO.setStatus(null);
|
||||||
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
|
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user