|
@@ -1,5 +1,6 @@
|
|
|
package com.pj.tb_goods_demand;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -7,6 +8,7 @@ import com.pj.common.core.exception.ServiceException;
|
|
|
import com.pj.current.dto.APPLoginUserInfo;
|
|
|
import com.pj.current.satoken.StpAPPUserUtil;
|
|
|
import com.pj.enummj.DeleteStatus;
|
|
|
+import com.pj.enummj.OrderStatus;
|
|
|
import com.pj.tb_goods_demand.vo.GoodsDemandVo;
|
|
|
import com.pj.utils.so.SoMap;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -32,8 +34,18 @@ public class TbGoodsDemandService extends ServiceImpl<TbGoodsDemandMapper, TbGoo
|
|
|
@Autowired
|
|
|
private MethodGoodsDemandService methodGoodsDemandService;
|
|
|
|
|
|
- /** 增 */
|
|
|
+ /** 二级市场收购商发布需求 */
|
|
|
void add(TbGoodsDemand t){
|
|
|
+ //获取并判断当前登陆人
|
|
|
+ APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
|
+ if(appLoginInfo == null || appLoginInfo.getLoginId() == null)
|
|
|
+ throw new ServiceException("当前登录账号信息已失效!");
|
|
|
+ //设置基本状态
|
|
|
+ t.setIsOrders(0); // 0= 未被下单
|
|
|
+ t.setCreateBy(appLoginInfo.getLoginId());
|
|
|
+ t.setCreateName(appLoginInfo.getLoginName());
|
|
|
+ t.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode());
|
|
|
+ t.setCreateTime(new Date());
|
|
|
save(t);
|
|
|
}
|
|
|
|
|
@@ -44,6 +56,14 @@ public class TbGoodsDemandService extends ServiceImpl<TbGoodsDemandMapper, TbGoo
|
|
|
|
|
|
/** 改 */
|
|
|
void update(TbGoodsDemand t){
|
|
|
+ //获取并判断当前登陆人
|
|
|
+ APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
|
+ if(appLoginInfo == null || appLoginInfo.getLoginId() == null)
|
|
|
+ throw new ServiceException("当前登录账号信息已失效!");
|
|
|
+ //执行修改
|
|
|
+ t.setUpdateBy(appLoginInfo.getLoginId());
|
|
|
+ t.setUpdateName(appLoginInfo.getLoginName());
|
|
|
+ t.setUpdateTime(new Date());
|
|
|
updateById(t);
|
|
|
|
|
|
}
|
|
@@ -58,7 +78,7 @@ public class TbGoodsDemandService extends ServiceImpl<TbGoodsDemandMapper, TbGoo
|
|
|
return tbGoodsDemandMapper.getList(so);
|
|
|
}
|
|
|
|
|
|
- /** app端:专供给一级市场查看的需求列表 */
|
|
|
+ /** app端:专供给二级市场查看的需求列表 */
|
|
|
List<TbGoodsDemand> getAppList(SoMap so,Integer isOrders) {
|
|
|
so.put("isOrders",isOrders);
|
|
|
so.put("sortType",10); //根据日期降序
|