forked from angelo/java-retail-app
## 商品管理添加上传盒数字段;
This commit is contained in:
parent
0f4b362a4b
commit
0d88669404
|
@ -36,8 +36,6 @@ import com.hzs.sale.wares.param.WaresDetailParams;
|
|||
import com.hzs.sale.wares.param.*;
|
||||
import com.hzs.sale.wares.service.*;
|
||||
import com.hzs.sale.wares.vo.*;
|
||||
import com.hzs.system.base.ICurrencyServiceApi;
|
||||
import com.hzs.system.base.dto.CurrencyDTO;
|
||||
import com.hzs.system.config.IRangeServiceApi;
|
||||
import com.hzs.system.sys.dto.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -57,8 +55,6 @@ import java.util.stream.Collectors;
|
|||
@RequestMapping("/manage/wares")
|
||||
public class BdWaresController extends BaseController {
|
||||
|
||||
@DubboReference
|
||||
ICurrencyServiceApi iCurrencyServiceApi;
|
||||
@DubboReference
|
||||
IRangeServiceApi iRangeServiceApi;
|
||||
|
||||
|
@ -116,8 +112,6 @@ public class BdWaresController extends BaseController {
|
|||
startPage();
|
||||
List<WaresVo> resultList = iBdWaresService.selectByWaresInfo(waresParams);
|
||||
if (CollectionUtil.isNotEmpty(resultList)) {
|
||||
R<CurrencyDTO> currencyDto = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry());
|
||||
|
||||
resultList.parallelStream().forEach(waresVo -> {
|
||||
WaresAuthorityVo waresAuthorityVo = iBdWaresService.getWaresAuthorityFirst(waresVo.getPkWares());
|
||||
if (waresAuthorityVo != null) {
|
||||
|
@ -131,10 +125,6 @@ public class BdWaresController extends BaseController {
|
|||
if (waresVo.getIsMakerGift() != null) {
|
||||
waresVo.setIsMakerGiftVal(EWaresType.getEnumByValue(waresVo.getIsMakerGift()).getLabel());
|
||||
}
|
||||
if (null != waresVo.getMakerIncome()) {
|
||||
// 处理发起人收益
|
||||
waresVo.setMakerIncome(waresVo.getMakerIncome().multiply(currencyDto.getData().getInExchangeRate()));
|
||||
}
|
||||
});
|
||||
}
|
||||
return getDataTable(resultList);
|
||||
|
@ -151,7 +141,6 @@ public class BdWaresController extends BaseController {
|
|||
|
||||
List<WaresVo> resultList = iBdWaresService.selectByWaresInfo(waresParams);
|
||||
if (CollectionUtil.isNotEmpty(resultList)) {
|
||||
R<CurrencyDTO> currencyDto = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry());
|
||||
// 获取需要翻译的枚举翻译
|
||||
Map<String, String> transactionMap = iTransactionCommonService.exportEnumTransaction(ESpecialArea.values(), EYesNo.values(), ESupplyWay.values(), EPresaleStatus.values());
|
||||
|
||||
|
@ -188,10 +177,6 @@ public class BdWaresController extends BaseController {
|
|||
waresVo.setIsMakerGiftVal(EWaresType.getEnumByValue(waresVo.getIsMakerGift()).getLabel());
|
||||
}
|
||||
}
|
||||
if (null != waresVo.getMakerIncome()) {
|
||||
// 处理发起人收益
|
||||
waresVo.setMakerIncome(waresVo.getMakerIncome().multiply(currencyDto.getData().getInExchangeRate()));
|
||||
}
|
||||
});
|
||||
}
|
||||
ExcelUtil<WaresVo> util = new ExcelUtil<>(WaresVo.class);
|
||||
|
@ -320,7 +305,6 @@ public class BdWaresController extends BaseController {
|
|||
if (!isPutOn) {
|
||||
return AjaxResult.error("产品规格至少有一个上架");
|
||||
}
|
||||
// wares.setSort(0);
|
||||
iBdWaresService.saveWares(wares, userTokenService.getLoginUser());
|
||||
return AjaxResult.success(wares.getWaresCode());
|
||||
}
|
||||
|
@ -450,8 +434,6 @@ public class BdWaresController extends BaseController {
|
|||
return AjaxResult.error("规格图片必传");
|
||||
}
|
||||
}
|
||||
|
||||
// waresParams.setSort(0);
|
||||
iBdWaresService.updateWares(waresParams, userTokenService.getLoginUser());
|
||||
return AjaxResult.success(waresParams.getWaresCode());
|
||||
}
|
||||
|
@ -535,10 +517,7 @@ public class BdWaresController extends BaseController {
|
|||
waresParams.setSortStatus(wares.getSortStatus());
|
||||
waresParams.setSystemType(waresExtend.getSystemType());
|
||||
waresParams.setAreaIncome(wares.getAreaIncome());
|
||||
if (waresExtend.getMakerIncome() != null) {
|
||||
R<CurrencyDTO> currencyDto = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry());
|
||||
waresParams.setMakerIncome(waresExtend.getMakerIncome().multiply(currencyDto.getData().getInExchangeRate()));
|
||||
}
|
||||
waresParams.setBoxNum(wares.getBoxNum());
|
||||
|
||||
BdAreaClassify parentAreaClassify = areaClassifyService.getAreaClassify(wares.getPkAreaClassify());
|
||||
if (parentAreaClassify != null) {
|
||||
|
|
|
@ -394,11 +394,6 @@ public class WaresParams implements Serializable {
|
|||
*/
|
||||
private Integer sortStatus;
|
||||
|
||||
/**
|
||||
* 发起人收益(目前复购使用)
|
||||
*/
|
||||
private BigDecimal makerIncome;
|
||||
|
||||
/**
|
||||
* 系统类型(2=新零售,3=美业)
|
||||
*/
|
||||
|
@ -414,4 +409,9 @@ public class WaresParams implements Serializable {
|
|||
*/
|
||||
private BigDecimal areaIncome;
|
||||
|
||||
/**
|
||||
* 商品上传盒数
|
||||
*/
|
||||
private BigDecimal boxNum;
|
||||
|
||||
}
|
||||
|
|
|
@ -111,9 +111,7 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
// 设置 wares 对象的值
|
||||
BdWares wares = BeanUtil.copyProperties(waresParams, BdWares.class);
|
||||
wares.setPkId(waresParams.getWaresId());
|
||||
R<Integer> transaction = transactionServiceApi.createTransaction(user.getDataCountry(), ETransactionKey.SPEC, waresParams.getWaresName(), EYesNo.NO, EYesNo.NO);
|
||||
wares.setWaresCode(waresParams.getWaresCode());
|
||||
wares.setPkTransaction(transaction.getData());
|
||||
wares.setPkCreator(user.getUserId());
|
||||
wares.setPkCountry(user.getDataCountry());
|
||||
wares.setSystemType(user.getSystemType());
|
||||
|
@ -127,14 +125,6 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
this.save(wares);
|
||||
// 商品拓展表
|
||||
BdWaresExtend waresExtend = BeanUtil.copyProperties(waresParams, BdWaresExtend.class);
|
||||
// 存入要转化美金
|
||||
if (!waresParams.getSpecialArea().equals(ESpecialArea.REPURCHASE_AREA.getValue())) {
|
||||
waresParams.setMakerIncome(BigDecimal.ZERO);
|
||||
}
|
||||
if (null != waresParams.getMakerIncome()) {
|
||||
R<CurrencyDTO> currencyDto = currencyServiceApi.getCurrency(user.getDataCountry());
|
||||
waresExtend.setMakerIncome(waresParams.getMakerIncome().divide(currencyDto.getData().getInExchangeRate(), 6, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
// 处理系统类型
|
||||
waresExtend.setSystemType(user.getSystemType());
|
||||
waresExtend.setPkWares(wares.getPkId());
|
||||
|
@ -539,8 +529,6 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
public void updateWares(WaresParams waresParams, LoginUser user) {
|
||||
BdWares wares = BeanUtil.copyProperties(waresParams, BdWares.class);
|
||||
wares.setPkId(waresParams.getWaresId());
|
||||
R<Integer> transaction = transactionServiceApi.createTransaction(user.getDataCountry(), ETransactionKey.SPEC, waresParams.getWaresName(), EYesNo.NO, EYesNo.NO);
|
||||
wares.setPkTransaction(transaction.getData());
|
||||
if (waresParams.getIsPutOn().equals(EYesNo.YES.getIntValue())) {
|
||||
wares.setListingTime(DateUtils.currentDateTime());
|
||||
}
|
||||
|
@ -554,14 +542,6 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
|
||||
// 商品拓展表
|
||||
BdWaresExtend waresExtend = BeanUtil.copyProperties(waresParams, BdWaresExtend.class);
|
||||
// 存入要转化美金
|
||||
if (!waresParams.getSpecialArea().equals(ESpecialArea.REPURCHASE_AREA.getValue())) {
|
||||
waresParams.setMakerIncome(BigDecimal.ZERO);
|
||||
}
|
||||
if (null != waresParams.getMakerIncome()) {
|
||||
R<CurrencyDTO> currencyDto = currencyServiceApi.getCurrency(user.getDataCountry());
|
||||
waresExtend.setMakerIncome(waresParams.getMakerIncome().divide(currencyDto.getData().getInExchangeRate(), 6, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
// 处理系统类型
|
||||
waresExtend.setSystemType(user.getSystemType());
|
||||
waresExtend.setPkWares(wares.getPkId());
|
||||
|
|
|
@ -11,13 +11,6 @@ import java.math.BigDecimal;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: yuhui
|
||||
* @Time: 2022/11/9 11:02
|
||||
* @Classname: WaresVo
|
||||
* @PackageName: com.hzs.sale.wares.vo
|
||||
*/
|
||||
@Data
|
||||
public class WaresVo {
|
||||
|
||||
|
@ -65,14 +58,6 @@ public class WaresVo {
|
|||
@BigDecimalFormat("#0.0000")
|
||||
private BigDecimal waresAchieve;
|
||||
|
||||
|
||||
/**
|
||||
* 发起人收益(目前复购使用)
|
||||
*/
|
||||
@Excel(name = "发起人收益(¥)", scale = 2)
|
||||
@BigDecimalFormat
|
||||
private BigDecimal makerIncome;
|
||||
|
||||
/**
|
||||
* 支付比例名称
|
||||
*/
|
||||
|
|
|
@ -114,7 +114,6 @@
|
|||
<result column="IS_MAKER_GIFT" property="isMakerGift"/>
|
||||
<result column="EDIT_FLAG" property="editFlag"/>
|
||||
<result column="WARES_CODE" property="waresCode"/>
|
||||
<result column="MAKER_INCOME" property="makerIncome"/>
|
||||
<result column="ITEM_PK_STOREHOUSE" property="pkStorehouse"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
@ -125,7 +124,6 @@
|
|||
<result column="CREATOR_CODE" property="creatorCode"/>
|
||||
<result column="PK_SETTLE_COUNTRY" property="pkSettleCountry"/>
|
||||
<result column="PK_CENTER_CODE" property="pkCenterCode"/>
|
||||
<result column="PK_STORE_LEVEL" property="pkStoreLevel"/>
|
||||
<result column="IN_EXCHANGE_RATE" property="inExchangeRate"/>
|
||||
<result column="PK_CORP" property="pkCorp"/>
|
||||
<collection property="orderWaresExtList" ofType="com.hzs.common.domain.sale.ext.SaOrderWaresExt">
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
<result column="PK_SPECIAL_CURRENCY" property="pkSpecialCurrency"/>
|
||||
<result column="SYSTEM_TYPE" property="systemType"/>
|
||||
<result column="AREA_INCOME" property="areaIncome"/>
|
||||
<result column="BOX_NUM" property="boxNum"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="resultMap" type="com.hzs.sale.wares.vo.WaresVo">
|
||||
|
@ -81,7 +82,6 @@
|
|||
<result column="SORT_STATUS" property="sortStatus"/>
|
||||
<result column="IS_MAKER_GIFT" property="isMakerGift"/>
|
||||
<result column="TEMP_NAME" property="tempName"/>
|
||||
<result column="MAKER_INCOME" property="makerIncome"/>
|
||||
<result column="SYSTEM_TYPE" property="systemType"/>
|
||||
<result column="WARES_STATUS" property="waresStatus"/>
|
||||
<result column="WARES_APPROVER" property="waresApprover"/>
|
||||
|
|
|
@ -222,4 +222,10 @@ public class BdWares extends BaseEntity {
|
|||
@TableField("AREA_INCOME")
|
||||
private BigDecimal areaIncome;
|
||||
|
||||
/**
|
||||
* 商品上传盒数
|
||||
*/
|
||||
@TableField("BOX_NUM")
|
||||
private BigDecimal boxNum;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue