修改区域公司

dev-discount
袁野 2 years ago
parent 92a013893c
commit 51ba4959cc
  1. 40
      hai-bweb/src/main/java/com/bweb/controller/BsDistributionUserRelController.java
  2. 30
      hai-bweb/src/main/java/com/bweb/controller/HighUserController.java
  3. 1
      hai-cweb/src/main/java/com/cweb/controller/WechatController.java
  4. 10
      hai-service/src/main/java/com/hai/entity/HighOrder.java
  5. 11
      hai-service/src/main/java/com/hai/service/BsDistributionUserRelService.java
  6. 18
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  7. 12
      hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java
  8. 27
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java

@ -2,10 +2,13 @@ package com.bweb.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
import com.hai.service.BsDistributionUserRelService;
import com.hai.service.HighOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
@ -18,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
@ -32,6 +36,9 @@ public class BsDistributionUserRelController {
@Autowired
private UserCenter userCenter;
@Resource
private HighOrderService highOrderService;
@Resource
private BsDistributionUserRelService bsDistributionUserRelService;
@ -115,4 +122,37 @@ public class BsDistributionUserRelController {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/agentUserList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询代理商用户")
public ResponseData agentUserList() {
try {
return ResponseMsgUtil.success(bsDistributionUserRelService.agentUserList());
} catch (Exception e) {
log.error("HighOrderController --> getOrderById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/orderListByAgentId", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "B端查询代理商订单")
public ResponseData orderListByAgentId(@RequestParam(name = "agentId", required = false) Long agentId,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
Map<String , Object> map = new HashMap<>();
map.put("agentId" , agentId);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highOrderService.orderListByAgentId(map)));
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -165,4 +165,34 @@ public class HighUserController {
}
}
@RequestMapping(value = "/setUpAgent", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "设置代理商")
public ResponseData setUpAgent(@RequestParam(value = "userId" , required = true) Long userId) {
try {
HighUser highUser = highUserService.findByUserId(userId);
if (highUser == null) {
log.error("HighUserController --> forbiddenUser() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_USER_ERROR, "");
}
if (highUser.getIsAgent() == null || !highUser.getIsAgent()) {
highUser.setIsAgent(true);
} else {
highUser.setIsAgent(false);
}
highUserService.updateUser(highUser);
return ResponseMsgUtil.success("设置成功");
} catch (Exception e) {
log.error("BsPositionController --> addPosition() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -331,4 +331,5 @@ public class WechatController {
return ResponseMsgUtil.exception(e);
}
}
}

@ -250,6 +250,16 @@ public class HighOrder implements Serializable {
private String goodsTypeName;
private String agentName;
public String getAgentName() {
return agentName;
}
public void setAgentName(String agentName) {
this.agentName = agentName;
}
public String getTime() {
return time;
}

@ -3,6 +3,7 @@ package com.hai.service;
import com.alibaba.fastjson.JSONObject;
import com.hai.entity.BsDistributionRebate;
import com.hai.entity.BsDistributionUserRel;
import com.hai.entity.HighUser;
import java.util.List;
import java.util.Map;
@ -117,4 +118,14 @@ public interface BsDistributionUserRelService {
*/
List<BsDistributionRebate> getDistributionIntegralList(Map<String , Object> map);
/**
* @Author Sum1Dream
* @name agentUserList.java
* @Description // 查询代理商用户
* @Date 15:21 2022/8/19
* @Param []
* @return java.util.List<com.hai.entity.HighUser>
*/
List<HighUser> agentUserList();
}

@ -563,6 +563,24 @@ public interface HighOrderService {
*/
JSONObject orderSource(Integer goodsType , Long goodsId , String orderNo , Long companyId);
/**
* @Author Sum1Dream
* @name promoteOrderList.java
* @Description // 根据渠道商编码查询订单
* @Date 16:10 2022/8/19
* @Param [java.lang.Long]
* @return java.util.List<com.hai.entity.HighOrder>
*/
List<HighOrder> promoteOrderList(Long identificationCode) throws Exception;
/**
* @Author Sum1Dream
* @name orderListByAgentId.java
* @Description // B端查询代理商订单
* @Date 16:11 2022/8/19
* @Param [java.util.Map<java.lang.String,java.lang.Object>]
* @return java.util.List<com.hai.entity.HighOrder>
*/
List<HighOrder> orderListByAgentId(Map<String , Object> map) throws Exception;
}

@ -5,6 +5,7 @@ import com.hai.common.utils.DateUtil;
import com.hai.common.utils.TelApiUtil;
import com.hai.dao.BsDistributionRebateMapper;
import com.hai.dao.BsDistributionUserRelMapper;
import com.hai.dao.HighUserMapper;
import com.hai.entity.*;
import com.hai.service.*;
import org.apache.commons.collections4.MapUtils;
@ -38,6 +39,8 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe
@Resource
private CommonService commonService;
@Resource
private HighUserMapper highUserMapper;
@Override
public void insertDistributionRebate(Long userId, Long popularizeUserId , String regionId) {
@ -291,4 +294,13 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe
example.setOrderByClause("create_time desc");
return bsDistributionRebateMapper.selectByExample(example);
}
@Override
public List<HighUser> agentUserList() {
HighUserExample example = new HighUserExample();
example.createCriteria().andIsAgentEqualTo(true).andStatusEqualTo(1);
return highUserMapper.selectByExample(example);
}
}

@ -3072,4 +3072,31 @@ public class HighOrderServiceImpl implements HighOrderService {
return list;
}
@Override
public List<HighOrder> orderListByAgentId(Map<String, Object> map) throws Exception {
HighOrderExample example = new HighOrderExample();
HighOrderExample.Criteria criteria = example.createCriteria();
criteria.andOrderStatusEqualTo(3);
if (MapUtils.getLong(map , "agentId") != null) {
criteria.andIdentificationCodeEqualTo(MapUtils.getLong(map , "agentId"));
} else {
criteria.andIdentificationCodeIsNotNull();
}
List<HighOrder> list = highOrderMapper.selectByExample(example);
for (HighOrder order : list) {
HighUser user = highUserService.findByUserId(order.getIdentificationCode());
order.setTime(DateUtil.date2String(order.getCreateTime() , "MM月dd日 HH:mm"));
List<HighChildOrder> childOrder = getChildOrderByOrder(order.getId());
order.setGoodsTypeName("购买:" + GoodsType.getNameByType(childOrder.get(0).getGoodsType()));
order.setAgentName(user.getName());
}
return list;
}
}

Loading…
Cancel
Save