后台-gyp_计量单位管理
This commit is contained in:
parent
c6cf0580f7
commit
b9cf66a178
|
|
@ -0,0 +1,84 @@
|
|||
package com.bonus.canteen.core.drp.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bonus.canteen.core.drp.dto.ConversionUnitDTO;
|
||||
import com.bonus.canteen.core.drp.dto.DrpUnitAddDTO;
|
||||
import com.bonus.canteen.core.drp.dto.DrpUnitEditDTO;
|
||||
import com.bonus.canteen.core.drp.dto.DrpUnitPageDTO;
|
||||
import com.bonus.canteen.core.drp.service.DrpUnitService;
|
||||
import com.bonus.canteen.core.drp.vo.DrpUnitPageVO;
|
||||
import com.bonus.canteen.core.secure.filter.annotation.RequiresAuthentication;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.houqin.encrypt.RequiresGuest;
|
||||
import com.bonus.common.houqin.utils.LeRequest;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@RestController
|
||||
@RequestMapping({"/api/v1/drpunit"})
|
||||
@Api(
|
||||
value = "gyp_计量单位管理",
|
||||
tags = {"gyp_计量单位管理"}
|
||||
)
|
||||
public class DrpUnitController {
|
||||
private static final Logger log = LoggerFactory.getLogger(DrpUnitController.class);
|
||||
@Resource
|
||||
@Lazy
|
||||
private DrpUnitService drpUnitService;
|
||||
|
||||
@RequiresPermissions({"drp:unit:insert"})
|
||||
@PostMapping({"/add"})
|
||||
@RequiresAuthentication
|
||||
@ApiOperation("新增计量单位")
|
||||
public AjaxResult addDrpUnit(@RequestBody @Valid LeRequest<DrpUnitAddDTO> leRequest) {
|
||||
DrpUnitAddDTO content = (DrpUnitAddDTO)leRequest.getContent();
|
||||
this.drpUnitService.addDrpUnit(content);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping({"/page"})
|
||||
@RequiresAuthentication
|
||||
@ApiOperation("分页获取计量单位")
|
||||
public AjaxResult getDrpUnitPage(@RequestBody LeRequest<DrpUnitPageDTO> leRequest) {
|
||||
DrpUnitPageDTO content = (DrpUnitPageDTO)leRequest.getContent();
|
||||
Page<DrpUnitPageVO> resultPage = this.drpUnitService.getDrpUnitPage(content);
|
||||
return AjaxResult.success(resultPage);
|
||||
}
|
||||
|
||||
@RequiresPermissions({"drp:unit:update"})
|
||||
@PostMapping({"/edit"})
|
||||
@RequiresAuthentication
|
||||
@ApiOperation("修改计量单位")
|
||||
public AjaxResult editDrpUnit(@RequestBody @Valid LeRequest<DrpUnitEditDTO> leRequest) {
|
||||
DrpUnitEditDTO content = (DrpUnitEditDTO)leRequest.getContent();
|
||||
this.drpUnitService.editDrpUnit(content);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@RequiresPermissions({"drp:unit:delete"})
|
||||
@PostMapping({"/remove/{unitId}"})
|
||||
@RequiresGuest
|
||||
@ApiOperation("删除计量单位")
|
||||
public AjaxResult removeByUnitId(@PathVariable Long unitId) {
|
||||
this.drpUnitService.removeByUnitId(unitId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping({"/conversion/unit"})
|
||||
@RequiresGuest
|
||||
@ApiOperation("等价换算计量单位")
|
||||
public AjaxResult conversionUnit(@RequestBody @Valid LeRequest<ConversionUnitDTO> request) {
|
||||
ConversionUnitDTO content = (ConversionUnitDTO)request.getContent();
|
||||
BigDecimal bigDecimal = this.drpUnitService.conversionUnit(content);
|
||||
return AjaxResult.success(bigDecimal);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.bonus.canteen.core.drp.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@ApiModel
|
||||
public class ConversionUnitDTO {
|
||||
@ApiModelProperty("原单位")
|
||||
private @NotNull(
|
||||
message = "原单位不能为空!"
|
||||
) Long oldUnitId;
|
||||
@ApiModelProperty("原单位数量")
|
||||
private @NotNull(
|
||||
message = "原单位数量不能为空!"
|
||||
) BigDecimal number;
|
||||
@ApiModelProperty("新单位")
|
||||
private @NotNull(
|
||||
message = "新单位不能为空!"
|
||||
) Long newUntiId;
|
||||
|
||||
public Long getOldUnitId() {
|
||||
return this.oldUnitId;
|
||||
}
|
||||
|
||||
public BigDecimal getNumber() {
|
||||
return this.number;
|
||||
}
|
||||
|
||||
public Long getNewUntiId() {
|
||||
return this.newUntiId;
|
||||
}
|
||||
|
||||
public void setOldUnitId(final Long oldUnitId) {
|
||||
this.oldUnitId = oldUnitId;
|
||||
}
|
||||
|
||||
public void setNumber(final BigDecimal number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public void setNewUntiId(final Long newUntiId) {
|
||||
this.newUntiId = newUntiId;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.bonus.canteen.core.drp.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class DrpUnitAddDTO {
|
||||
@ApiModelProperty("计量单位名称")
|
||||
private @NotBlank(
|
||||
message = "计量单位名称不能为空 ^_^"
|
||||
) String unitName;
|
||||
@ApiModelProperty("换算比率(换算成?g)")
|
||||
private @NotNull(
|
||||
message = "换算比率不能为空 ^_^"
|
||||
) BigDecimal rate;
|
||||
@ApiModelProperty("单位类型(1-按份,2-称重)")
|
||||
private Integer weighType;
|
||||
@ApiModelProperty("区域ID")
|
||||
private Long areaId;
|
||||
|
||||
public String getUnitName() {
|
||||
return this.unitName;
|
||||
}
|
||||
|
||||
public BigDecimal getRate() {
|
||||
return this.rate;
|
||||
}
|
||||
|
||||
public Integer getWeighType() {
|
||||
return this.weighType;
|
||||
}
|
||||
|
||||
public Long getAreaId() {
|
||||
return this.areaId;
|
||||
}
|
||||
|
||||
public void setUnitName(final String unitName) {
|
||||
this.unitName = unitName;
|
||||
}
|
||||
|
||||
public void setRate(final BigDecimal rate) {
|
||||
this.rate = rate;
|
||||
}
|
||||
|
||||
public void setWeighType(final Integer weighType) {
|
||||
this.weighType = weighType;
|
||||
}
|
||||
|
||||
public void setAreaId(final Long areaId) {
|
||||
this.areaId = areaId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.bonus.canteen.core.drp.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class DrpUnitEditDTO {
|
||||
@ApiModelProperty("计量单位id")
|
||||
private @NotNull(
|
||||
message = "计量单位id为空!"
|
||||
) Long unitId;
|
||||
@ApiModelProperty("计量单位名称")
|
||||
private @NotNull(
|
||||
message = "单位名称不能为空!"
|
||||
) String unitName;
|
||||
@ApiModelProperty("换算比率(换算成?g)")
|
||||
private BigDecimal rate;
|
||||
@ApiModelProperty("区域ID")
|
||||
private Long areaId;
|
||||
|
||||
public Long getUnitId() {
|
||||
return this.unitId;
|
||||
}
|
||||
|
||||
public String getUnitName() {
|
||||
return this.unitName;
|
||||
}
|
||||
|
||||
public BigDecimal getRate() {
|
||||
return this.rate;
|
||||
}
|
||||
|
||||
public Long getAreaId() {
|
||||
return this.areaId;
|
||||
}
|
||||
|
||||
public void setUnitId(final Long unitId) {
|
||||
this.unitId = unitId;
|
||||
}
|
||||
|
||||
public void setUnitName(final String unitName) {
|
||||
this.unitName = unitName;
|
||||
}
|
||||
|
||||
public void setRate(final BigDecimal rate) {
|
||||
this.rate = rate;
|
||||
}
|
||||
|
||||
public void setAreaId(final Long areaId) {
|
||||
this.areaId = areaId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.bonus.canteen.core.drp.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel
|
||||
public class DrpUnitListDTO {
|
||||
@ApiModelProperty("单位类型(1-按份,2-称重)")
|
||||
private Integer weighType;
|
||||
@ApiModelProperty("区域id")
|
||||
private Long areaId;
|
||||
private List<Long> areaAuth;
|
||||
|
||||
public Integer getWeighType() {
|
||||
return this.weighType;
|
||||
}
|
||||
|
||||
public Long getAreaId() {
|
||||
return this.areaId;
|
||||
}
|
||||
|
||||
public List<Long> getAreaAuth() {
|
||||
return this.areaAuth;
|
||||
}
|
||||
|
||||
public void setWeighType(final Integer weighType) {
|
||||
this.weighType = weighType;
|
||||
}
|
||||
|
||||
public void setAreaId(final Long areaId) {
|
||||
this.areaId = areaId;
|
||||
}
|
||||
|
||||
public void setAreaAuth(final List<Long> areaAuth) {
|
||||
this.areaAuth = areaAuth;
|
||||
}
|
||||
}
|
||||
|
|
@ -2,9 +2,12 @@ package com.bonus.canteen.core.drp.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bonus.canteen.core.drp.dto.DrpUnitListDTO;
|
||||
import com.bonus.canteen.core.drp.dto.DrpUnitPageDTO;
|
||||
import com.bonus.canteen.core.drp.model.DrpUnit;
|
||||
import com.bonus.canteen.core.drp.po.DrpUnitModel;
|
||||
import com.bonus.canteen.core.drp.vo.DrpListUnitVO;
|
||||
import com.bonus.canteen.core.drp.vo.DrpUnitListVO;
|
||||
import com.bonus.canteen.core.drp.vo.DrpUnitPageVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -14,18 +17,18 @@ import java.util.List;
|
|||
|
||||
@Mapper
|
||||
public interface DrpUnitMapper extends BaseMapper<DrpUnit> {
|
||||
// Page<DrpUnitPageVO> selectAllList(Page<DrpUnitPageVO> page, @Param("content") DrpUnitPageDTO content, @Param("delFlag") Integer delFlag);
|
||||
Page<DrpUnitPageVO> selectAllList(Page<DrpUnitPageVO> page, @Param("content") DrpUnitPageDTO content, @Param("delFlag") Integer delFlag);
|
||||
|
||||
@Select({"select unit_id,unit_name,rate from drp_unit where unit_id = #{unitId}"})
|
||||
DrpUnitModel getUnit(@Param("unitId") Long unitId);
|
||||
|
||||
// @Select({"select unit_id, unit_name, rate, weigh_type from drp_unit where del_flag = #{delFlag}"})
|
||||
// List<DrpListUnitVO> selectUnitListAndroid(Integer delFlag);
|
||||
//
|
||||
// @Select({"select unit_id from drp_unit where unit_name = #{unitName} and del_flag = 2"})
|
||||
// Long getUnitIdByName(String unitName);
|
||||
//
|
||||
// List<DrpUnitListVO> listUnitAll(@Param("content") DrpUnitListDTO content, @Param("delFlag") Integer delFlag);
|
||||
//
|
||||
@Select({"select unit_id, unit_name, rate, weigh_type from drp_unit where del_flag = #{delFlag}"})
|
||||
List<DrpListUnitVO> selectUnitListAndroid(Integer delFlag);
|
||||
|
||||
@Select({"select unit_id from drp_unit where unit_name = #{unitName} and del_flag = 2"})
|
||||
Long getUnitIdByName(String unitName);
|
||||
|
||||
List<DrpUnitListVO> listUnitAll(@Param("content") DrpUnitListDTO content, @Param("delFlag") Integer delFlag);
|
||||
|
||||
Long getUnitIdByNameAndArea(@Param("unitName") String unitName, @Param("areaId") Long areaId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package com.bonus.canteen.core.drp.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bonus.canteen.core.drp.dto.*;
|
||||
import com.bonus.canteen.core.drp.model.DrpUnit;
|
||||
import com.bonus.canteen.core.drp.vo.DrpUnitListVO;
|
||||
import com.bonus.canteen.core.drp.vo.DrpUnitPageVO;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
public interface DrpUnitService extends IService<DrpUnit> {
|
||||
void addDrpUnit(DrpUnitAddDTO content);
|
||||
|
||||
Page<DrpUnitPageVO> getDrpUnitPage(DrpUnitPageDTO content);
|
||||
|
||||
void editDrpUnit(DrpUnitEditDTO content);
|
||||
|
||||
void removeByUnitId(Long unitId);
|
||||
|
||||
BigDecimal conversionUnit(ConversionUnitDTO content);
|
||||
|
||||
List<DrpUnitListVO> listUnitAll(DrpUnitListDTO content);
|
||||
}
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
package com.bonus.canteen.core.drp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bonus.canteen.core.drp.api.DrpAuthorityApi;
|
||||
import com.bonus.canteen.core.drp.dto.*;
|
||||
import com.bonus.canteen.core.drp.mapper.DrpUnitMapper;
|
||||
import com.bonus.canteen.core.drp.model.DrpUnit;
|
||||
import com.bonus.canteen.core.drp.service.DrpUnitService;
|
||||
import com.bonus.canteen.core.drp.vo.DrpUnitListVO;
|
||||
import com.bonus.canteen.core.drp.vo.DrpUnitPageVO;
|
||||
import com.bonus.canteen.core.menu.entity.MenuMaterial;
|
||||
import com.bonus.canteen.core.menu.mapper.MenuMaterialMapper;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.houqin.constant.DelFlagEnum;
|
||||
import com.bonus.common.houqin.i18n.I18n;
|
||||
import com.bonus.common.houqin.utils.id.Id;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class DrpUnitServiceImpl extends ServiceImpl<DrpUnitMapper, DrpUnit> implements DrpUnitService {
|
||||
private static final Logger log = LoggerFactory.getLogger(DrpUnitServiceImpl.class);
|
||||
@Resource
|
||||
@Lazy
|
||||
private MenuMaterialMapper menuMaterialMapper;
|
||||
@Resource
|
||||
@Lazy
|
||||
private DrpAuthorityApi drpAuthorityApi;
|
||||
|
||||
@Override
|
||||
public void addDrpUnit(DrpUnitAddDTO content) {
|
||||
if (!ObjectUtil.equals(content.getUnitName(), "斤") && !ObjectUtil.equals(content.getUnitName(), "公斤")) {
|
||||
List<DrpUnit> unitList = this.baseMapper.selectList(Wrappers.lambdaQuery(DrpUnit.class)
|
||||
.eq(DrpUnit::getUnitName, content.getUnitName()).and((i) -> {
|
||||
(i.eq(content.getAreaId() != null, DrpUnit::getAreaId, content.getAreaId())).or()
|
||||
.isNull(DrpUnit::getAreaId);
|
||||
}).isNull(content.getAreaId() == null, DrpUnit::getAreaId)
|
||||
.eq(DrpUnit::getDelFlag, DelFlagEnum.DEL_FALSE.key()));
|
||||
if (!CollUtil.isEmpty(unitList)) {
|
||||
log.info("***[库存中心_基础配置]_新增计量单位_新增的计量单位已存在************");
|
||||
throw new ServiceException("drp.unit-name-repeat-add");
|
||||
} else if ("KG".equals(content.getUnitName().toUpperCase())) {
|
||||
throw new ServiceException("drp.unit-kg-is-exist");
|
||||
} else {
|
||||
String username = SecurityUtils.getUsername();
|
||||
DrpUnit unit = new DrpUnit();
|
||||
BeanUtil.copyProperties(content, unit, new String[0]);
|
||||
unit.setUnitId(Id.next());
|
||||
unit.setCrby(username);
|
||||
this.baseMapper.insert(unit);
|
||||
}
|
||||
} else {
|
||||
throw new ServiceException("公斤与斤不可新增");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<DrpUnitPageVO> getDrpUnitPage(DrpUnitPageDTO content) {
|
||||
content.setAreaAuth(this.drpAuthorityApi.listAreaAuth());
|
||||
Page<DrpUnitPageVO> page = new Page(content.getCurrent(), content.getSize());
|
||||
return this.baseMapper.selectAllList(page, content, DelFlagEnum.DEL_FALSE.key());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editDrpUnit(DrpUnitEditDTO content) {
|
||||
if (!content.getUnitName().equals("公斤") && !content.getUnitName().equals("斤")) {
|
||||
List<DrpUnit> unitList = this.baseMapper.selectList(Wrappers.lambdaQuery(DrpUnit.class).eq(DrpUnit::getUnitName, content.getUnitName())
|
||||
.and((i) -> {
|
||||
(i.eq(content.getAreaId() != null, DrpUnit::getAreaId, content.getAreaId())).or()
|
||||
.isNull(DrpUnit::getAreaId);
|
||||
}).isNull(content.getAreaId() == null, DrpUnit::getAreaId)
|
||||
.eq(DrpUnit::getDelFlag, DelFlagEnum.DEL_FALSE.key())
|
||||
.ne(DrpUnit::getUnitId, content.getUnitId()));
|
||||
if (!CollUtil.isEmpty(unitList)) {
|
||||
log.info("***[库存中心_基础配置]_修改计量单位_修改的计量单位已存在************");
|
||||
throw new ServiceException("drp.unit-name-repeat-update");
|
||||
} else {
|
||||
String username = SecurityUtils.getUsername();
|
||||
DrpUnit unit = new DrpUnit();
|
||||
BeanUtil.copyProperties(content, unit, new String[0]);
|
||||
unit.setUpby(username);
|
||||
this.baseMapper.update(unit,Wrappers.lambdaQuery(DrpUnit.class).eq(DrpUnit::getUnitId, content.getUnitId()));
|
||||
}
|
||||
} else {
|
||||
throw new ServiceException("drp.kg-not-edit");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeByUnitId(Long unitId) {
|
||||
if (ObjectUtil.isEmpty(unitId)) {
|
||||
log.info("***[库存中心_基础配置]_删除计量单位信息_传入的计量单位id为空************");
|
||||
throw new ServiceException(I18n.getMessage("drp.select-delete-unit", new Object[0]));
|
||||
} else {
|
||||
DrpUnit drpUnit = this.baseMapper.selectOne(Wrappers.lambdaQuery(DrpUnit.class)
|
||||
.eq(DrpUnit::getUnitId, unitId)
|
||||
.select(DrpUnit::getUnitName));
|
||||
if (!drpUnit.getUnitName().equals("公斤") && !drpUnit.getUnitName().equals("斤")) {
|
||||
Long checkMaterialUnit = this.menuMaterialMapper.selectCount(Wrappers.lambdaQuery(MenuMaterial.class)
|
||||
.eq(MenuMaterial::getUnitId, unitId)
|
||||
.eq(MenuMaterial::getDelFlag, DelFlagEnum.DEL_FALSE.key()));
|
||||
if (checkMaterialUnit > 0L) {
|
||||
throw new ServiceException("drp.unit-in-material-is-use");
|
||||
} else {
|
||||
this.baseMapper.update(null, Wrappers.lambdaUpdate(DrpUnit.class)
|
||||
.eq(DrpUnit::getUnitId, unitId)
|
||||
.set(DrpUnit::getDelFlag, DelFlagEnum.DEL_TRUE.key()));
|
||||
}
|
||||
} else {
|
||||
throw new ServiceException("drp.kg-not-delete");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal conversionUnit(ConversionUnitDTO content) {
|
||||
DrpUnit oldUnit = this.baseMapper.selectOne(Wrappers.lambdaQuery(DrpUnit.class)
|
||||
.eq(DrpUnit::getUnitId, content.getOldUnitId()));
|
||||
DrpUnit newUnit = this.baseMapper.selectOne(Wrappers.lambdaQuery(DrpUnit.class)
|
||||
.eq(DrpUnit::getUnitId, content.getNewUntiId()));
|
||||
BigDecimal oldRate = oldUnit.getRate();
|
||||
BigDecimal newRate = newUnit.getRate();
|
||||
return content.getNumber().multiply(oldRate).divide(newRate, 10, RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DrpUnitListVO> listUnitAll(DrpUnitListDTO content) {
|
||||
List<Long> areaAuth = this.drpAuthorityApi.listAreaAuth();
|
||||
content.setAreaAuth(areaAuth);
|
||||
return this.baseMapper.listUnitAll(content, DelFlagEnum.DEL_FALSE.key());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.bonus.canteen.core.drp.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@ApiModel("计量单位信息")
|
||||
public class DrpListUnitVO {
|
||||
@ApiModelProperty("计量单位id")
|
||||
private Long unitId;
|
||||
@ApiModelProperty("计量单位名称")
|
||||
private String unitName;
|
||||
@ApiModelProperty("换算比率(换算成?g)")
|
||||
private BigDecimal rate;
|
||||
@ApiModelProperty("单位类型(1-按份,2-称重)")
|
||||
private Integer weighType;
|
||||
|
||||
public Long getUnitId() {
|
||||
return this.unitId;
|
||||
}
|
||||
|
||||
public String getUnitName() {
|
||||
return this.unitName;
|
||||
}
|
||||
|
||||
public BigDecimal getRate() {
|
||||
return this.rate;
|
||||
}
|
||||
|
||||
public Integer getWeighType() {
|
||||
return this.weighType;
|
||||
}
|
||||
|
||||
public void setUnitId(final Long unitId) {
|
||||
this.unitId = unitId;
|
||||
}
|
||||
|
||||
public void setUnitName(final String unitName) {
|
||||
this.unitName = unitName;
|
||||
}
|
||||
|
||||
public void setRate(final BigDecimal rate) {
|
||||
this.rate = rate;
|
||||
}
|
||||
|
||||
public void setWeighType(final Integer weighType) {
|
||||
this.weighType = weighType;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue