|
@@ -71,52 +71,6 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
|
|
|
@Autowired
|
|
|
private AdminInterface adminInterface;
|
|
|
|
|
|
- /** app端: 生成一级市场订单 */
|
|
|
- void appAdd(TbOrder t){
|
|
|
- //获取当前登陆人
|
|
|
- APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
|
- if(appLoginInfo == null || appLoginInfo.getLoginId() == null)
|
|
|
- throw new RuntimeException("当前登录账号信息已失效!");
|
|
|
- //判断当前是否已接单
|
|
|
- LambdaQueryWrapper<TbOrder> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- queryWrapper.eq(TbOrder::getCreateTime,sdf.format(new Date()));
|
|
|
- queryWrapper.eq(TbOrder::getDeleteStatus,DeleteStatus.DELETE_STATUS_ON.getCode());
|
|
|
- List<TbOrder> tbOrderList = tbOrderMapper.selectList(queryWrapper);
|
|
|
- if(tbOrderList.size() != 0)throw new ServiceException("你 " + tbOrderList.get(0).getCreateTime() + " 已完成下单,请勿继续操作!");
|
|
|
-
|
|
|
-
|
|
|
- //判断基本状态
|
|
|
- Integer enterpriseConfirm = t.getEnterpriseConfirm(); //一级市场商户确认(0=待确认,1=是,2=否)
|
|
|
- String buyUserType = t.getBuyUserType(); //购买用户类型只能是2
|
|
|
- Integer peopleConfirm = t.getPeopleConfirmStatus();//边民确认[0=待确认,1=全部确认,2=部分边民确认]
|
|
|
- String pick = t.getPick(); //是否接单[0=待接单,1=已接单]
|
|
|
-
|
|
|
- if(enterpriseConfirm != 1)throw new ServiceException("商户确认状态异常!");
|
|
|
- if(!buyUserType.equals(UserType.USER_TYPE_GROUP_LEADER.getCode() + ""))throw new ServiceException("登录用户身份异常!");
|
|
|
- if(peopleConfirm != 1)throw new ServiceException("边民确认状态异常");
|
|
|
- if(!pick.equals("1"))throw new ServiceException("接单状态状态异常");
|
|
|
-
|
|
|
- //设置购买的互市组信息
|
|
|
- Long fk = appLoginInfo.getFk();
|
|
|
- TbPeople tbPeople = tbPeopleMapper.selectById(fk);
|
|
|
- if(tbPeople == null)throw new ServiceException("边民信息异常!");
|
|
|
- t.setGroupId(tbPeople.getGroupId());
|
|
|
-
|
|
|
- //设置基本属性
|
|
|
- t.setApply(ApplyStatus.APPLY_STATUS_ZERO.getCode()); // 申报状态
|
|
|
- t.setTradeStatus(TradeStatus.TRADE_STATUS_ZERO.getCode()); //支付状态
|
|
|
- t.setPickTime(new Date()); // 接单时间
|
|
|
- t.setSend(0); // 发货状态 默认 0=未发货
|
|
|
- t.setFinishStatus(0); // 完成状态 默认 0=未完成
|
|
|
- //设置公共属性
|
|
|
- t.setCreateBy(appLoginInfo.getLoginId());
|
|
|
- t.setCreateName(appLoginInfo.getLoginName());
|
|
|
- t.setCreateTime(new Date());
|
|
|
- t.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode());
|
|
|
- save(t);
|
|
|
- }
|
|
|
-
|
|
|
/** 删 */
|
|
|
void delete(Long id){
|
|
|
removeById(id);
|
|
@@ -184,35 +138,15 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
|
|
|
/**
|
|
|
* 查集合 - 根据条件(参数为空时代表忽略指定条件)
|
|
|
* APP专用 与该订单相关的任何人员能看
|
|
|
- * @param orderStatus 订单状态,非必填 不传查询所有 , 0=待商家确认,1=申报中,2=已完成,3=已取消
|
|
|
* @param so
|
|
|
* @return
|
|
|
*/
|
|
|
- List<TbOrder> getAPPList(SoMap so,Integer orderStatus) {
|
|
|
+ List<TbOrder> getAPPList(SoMap so) {
|
|
|
//获取登录用户,登录的用户也许边民,互市组组长,一级市场商家
|
|
|
APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
|
- if(appLoginInfo == null || appLoginInfo.getLoginId() == null)
|
|
|
- throw new RuntimeException("当前登录账号信息已失效!");
|
|
|
- Integer userType = appLoginInfo.getUserType();
|
|
|
- //匹配case
|
|
|
- if(orderStatus != null){
|
|
|
- switch (orderStatus){
|
|
|
- case 0:
|
|
|
- so.put("enterpriseConfirm",0);
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- so.put("apply",0);
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- so.put("finishStatus",1);
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- so.put("cancelPeople",1);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
//与订单相关的人能看
|
|
|
- List<TbOrder> tbOrderList = methodOrderService.checkType(userType,appLoginInfo.getFk(),so);
|
|
|
+ List<TbOrder> tbOrderList = methodOrderService.checkType(appLoginInfo.getUserType(),appLoginInfo.getFk(),so);
|
|
|
return tbOrderList;
|
|
|
}
|
|
|
|