|
@@ -7,9 +7,11 @@ import java.time.format.DateTimeFormatter;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
+import cn.dev33.satoken.stp.StpUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.pj.api.client.admin.AdminInterface;
|
|
|
import com.pj.api.dto.AppUserDto;
|
|
|
+import com.pj.current.dto.APPLoginUserInfo;
|
|
|
import com.pj.current.dto.PCLoginUserInfo;
|
|
|
import com.pj.current.satoken.StpAPPUserUtil;
|
|
|
import com.pj.current.satoken.StpUserUtil;
|
|
@@ -21,6 +23,8 @@ import com.pj.tb_goods.TbGoods;
|
|
|
import com.pj.tb_goods.TbGoodsMapper;
|
|
|
import com.pj.tb_goods_transit.param.JudgeTransitParam;
|
|
|
import com.pj.tb_goods_transit.param.TransactionGoodsParam;
|
|
|
+import com.pj.tb_trade_area.TbTradeArea;
|
|
|
+import com.pj.tb_trade_area.TbTradeAreaMapper;
|
|
|
import com.pj.utils.so.SoMap;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFRow;
|
|
@@ -56,6 +60,9 @@ public class TbGoodsTransitService extends ServiceImpl<TbGoodsTransitMapper, TbG
|
|
|
private TbGoodsMapper tbGoodsMapper;
|
|
|
@Autowired
|
|
|
private AdminInterface adminInterface;
|
|
|
+ /** 互市区mapper */
|
|
|
+ @Autowired
|
|
|
+ private TbTradeAreaMapper tbTradeAreaMapper;
|
|
|
|
|
|
/** 增 */
|
|
|
void add(TbGoodsTransit t){
|
|
@@ -145,10 +152,14 @@ public class TbGoodsTransitService extends ServiceImpl<TbGoodsTransitMapper, TbG
|
|
|
//查询监管产品
|
|
|
TbGoods tbGoods = tbGoodsMapper.selectById(id);
|
|
|
if(tbGoods == null)throw new RuntimeException("该产品暂未录入监管列表!");
|
|
|
+ //查询互市区
|
|
|
+ TbTradeArea tbTradeArea = tbTradeAreaMapper.selectById(transactionGoodsParam.getTradeAreaId());
|
|
|
+ if(tbTradeArea == null)throw new RuntimeException("互市区不存在!");
|
|
|
//执行保存
|
|
|
TbGoodsTransit tbGoodsTransit = new TbGoodsTransit();
|
|
|
BeanUtils.copyProperties(transactionGoodsParam,tbGoodsTransit);
|
|
|
//获取并保存当前商品基本信息
|
|
|
+ tbGoodsTransit.setTradeAreaName(tbTradeArea.getName());
|
|
|
tbGoodsTransit.setGoodsName(tbGoods.getName());
|
|
|
tbGoodsTransit.setDescription(tbGoods.getRemark());
|
|
|
tbGoodsTransit.setPlaceOrigin(tbGoods.getSource());
|
|
@@ -171,15 +182,15 @@ public class TbGoodsTransitService extends ServiceImpl<TbGoodsTransitMapper, TbG
|
|
|
/** app端 - 商户自行选择上架/下架商品 */
|
|
|
boolean UpOrDownGoods(Long goodsTransitId , Integer goodsStatus){
|
|
|
//获取当前登陆人
|
|
|
- PCLoginUserInfo pcLoginInfo = StpUserUtil.getPCLoginInfo();
|
|
|
- if(pcLoginInfo == null)throw new RuntimeException("当前登陆人不存在!");
|
|
|
+ APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
|
+ if(appLoginInfo == null)throw new RuntimeException("当前登陆人不存在!");
|
|
|
TbGoodsTransit tbGoodsTransit = tbGoodsTransitMapper.selectById(goodsTransitId);
|
|
|
if(tbGoodsTransit == null)throw new RuntimeException("该商品状态异常或不存在!");
|
|
|
- tbGoodsTransit.setGoodsStatus(goodsStatus == null? 0 : 1);
|
|
|
+ tbGoodsTransit.setGoodsStatus(goodsStatus == null? 0 : goodsStatus);
|
|
|
//设置基本属性
|
|
|
tbGoodsTransit.setUpdateTime(new Date());
|
|
|
- tbGoodsTransit.setUpdateBy(pcLoginInfo.getLoginId() + "");
|
|
|
- tbGoodsTransit.setUpdateName(pcLoginInfo.getLoginName());
|
|
|
+ tbGoodsTransit.setUpdateBy(appLoginInfo.getLoginId() + "");
|
|
|
+ tbGoodsTransit.setUpdateName(appLoginInfo.getLoginName());
|
|
|
//执行保存
|
|
|
int updateById = tbGoodsTransitMapper.updateById(tbGoodsTransit);
|
|
|
if(updateById == 1)return true;
|