|
@@ -120,6 +120,10 @@ public class SecondHandServiceImpl implements SecondHandService {
|
|
|
@Override
|
|
|
public ResponseJson<SecondDetailVo> getSecondHandDetail(Integer userId, Integer productId) {
|
|
|
SecondDetailVo second = secondHandMapper.getSecondHandDetail(productId);
|
|
|
+ Integer type = null == second.getSecondHandType() ? 0 : second.getSecondHandType();
|
|
|
+ List<Integer> ids = secondHandMapper.getNewAddProductIds(type);
|
|
|
+ Integer newFlag = ids.contains(second.getProductId()) ? 1 : 0;
|
|
|
+ second.setNewAdded(newFlag.toString());
|
|
|
// 商品可见度:3:所有人可见,2:普通机构可见,1:会员机构可见,4:仅医美机构可见
|
|
|
Integer visibility = second.getVisibility();
|
|
|
if (null != userId && userId > 0) {
|
|
@@ -397,30 +401,32 @@ public class SecondHandServiceImpl implements SecondHandService {
|
|
|
}
|
|
|
|
|
|
private ResponseJson saveSecondHandProduct(SecondDto secondDto) {
|
|
|
- //根据银行卡判断是否注册过特殊二手供应商,有则挂在之前的供应商名下,否则注册新供应商
|
|
|
- Integer shopId = secondHandMapper.findSecondShop(secondDto.getCardNumber());
|
|
|
- if (null == shopId || shopId <= 0) {
|
|
|
- //保存为特殊二手供应商
|
|
|
- ShopVo shopVo = new ShopVo();
|
|
|
- //1个人,2公司
|
|
|
- String name = 1 == secondDto.getPublishIdentity() ? secondDto.getContactName() : secondDto.getCompanyName();
|
|
|
- shopVo.setName(name);
|
|
|
- shopVo.setLinkMan(secondDto.getContactName());
|
|
|
- shopVo.setContractMobile(secondDto.getContactMobile());
|
|
|
- shopVo.setCardNumber(secondDto.getCardNumber());
|
|
|
- if (secondDto.getBanOfDeposit() != null) {
|
|
|
- shopVo.setBanOfDeposit(secondDto.getBanOfDeposit());
|
|
|
- }
|
|
|
- if (secondDto.getAccountName() != null) {
|
|
|
- shopVo.setAccountName(secondDto.getAccountName());
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 当前版本二手商品作为黄页性质,不参与交易,shopId不需要
|
|
|
+ //根据银行卡判断是否注册过特殊二手供应商,有则挂在之前的供应商名下,否则注册新供应商
|
|
|
+ Integer shopId = secondHandMapper.findSecondShop(secondDto.getCardNumber());
|
|
|
+ if (null == shopId || shopId <= 0) {
|
|
|
+ //保存为特殊二手供应商
|
|
|
+ ShopVo shopVo = new ShopVo();
|
|
|
+ //1个人,2公司
|
|
|
+ String name = 1 == secondDto.getPublishIdentity() ? secondDto.getContactName() : secondDto.getCompanyName();
|
|
|
+ shopVo.setName(name);
|
|
|
+ shopVo.setLinkMan(secondDto.getContactName());
|
|
|
+ shopVo.setContractMobile(secondDto.getContactMobile());
|
|
|
+ shopVo.setCardNumber(secondDto.getCardNumber());
|
|
|
+ if (secondDto.getBanOfDeposit() != null) {
|
|
|
+ shopVo.setBanOfDeposit(secondDto.getBanOfDeposit());
|
|
|
+ }
|
|
|
+ if (secondDto.getAccountName() != null) {
|
|
|
+ shopVo.setAccountName(secondDto.getAccountName());
|
|
|
+ }
|
|
|
|
|
|
- if (secondDto.getAccountType() != null) {
|
|
|
- shopVo.setAccountType(secondDto.getAccountType());
|
|
|
- }
|
|
|
- secondHandMapper.insertShop(shopVo);
|
|
|
- shopId = shopVo.getShopId();
|
|
|
- }
|
|
|
+ if (secondDto.getAccountType() != null) {
|
|
|
+ shopVo.setAccountType(secondDto.getAccountType());
|
|
|
+ }
|
|
|
+ secondHandMapper.insertShop(shopVo);
|
|
|
+ shopId = shopVo.getShopId();
|
|
|
+ }*/
|
|
|
// 设置日期时间格式
|
|
|
Date date = new Date();
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
@@ -437,7 +443,7 @@ public class SecondHandServiceImpl implements SecondHandService {
|
|
|
product.setProductCategory(2);
|
|
|
product.setPreferredFlag(0);
|
|
|
// 默认发布到二手供应商
|
|
|
- product.setShopId(shopId);
|
|
|
+ product.setShopId(0);
|
|
|
product.setSellNumber(secondDto.getStock());
|
|
|
product.setHasSkuFlag(1);
|
|
|
// 商品状态默认待审核
|
|
@@ -516,6 +522,7 @@ public class SecondHandServiceImpl implements SecondHandService {
|
|
|
} else {
|
|
|
secondPo.setPublisher(secondDto.getContactName());
|
|
|
}
|
|
|
+ secondPo.setUserId(secondDto.getUserId());
|
|
|
secondPo.setSecondHandType(secondDto.getSecondHandType());
|
|
|
secondPo.setInstrumentType(secondDto.getInstrumentType());
|
|
|
secondPo.setFixedYears(secondDto.getFixedYears());
|