dev-discount
袁野 4 years ago
parent 18f92b4839
commit cdb9f2ea5e
  1. 66
      hai-bweb/src/main/java/com/bweb/controller/HighAgentController.java
  2. 10
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  3. 1
      hai-service/src/main/java/com/hai/common/exception/ErrorCode.java
  4. 10
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  5. 15
      hai-service/src/main/java/com/hai/service/HighAgentService.java
  6. 9
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  7. 14
      hai-service/src/main/java/com/hai/service/impl/HighAgentServiceImpl.java
  8. 2
      hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java
  9. 23
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java

@ -11,6 +11,7 @@ import com.hai.model.HighAgentModel;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.HighAgentService;
import com.hai.service.SecUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
@ -45,6 +46,9 @@ public class HighAgentController {
@Resource
private HighAgentService highAgentService;
@Resource
private SecUserService secUserService;
@RequestMapping(value = "/insertAgent", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "新增代理商")
@ -54,53 +58,33 @@ public class HighAgentController {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (userInfoModel.getMerchant() == null) {
log.error("HighMerchantController -> insertMerchantStore() error!","该主角色没有权限");
log.error("HighMerchantController -> insertAgent() error!","该主角色没有权限");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
}
// if (
// StringUtils.isBlank(highAgentModel.getSecUser().getPassword())
// || StringUtils.isBlank(highAgentModel.getSecUser().getUserName())
// || StringUtils.isBlank(highAgentModel.getSecUser().getUserName())
//
// )
if (highAgentModel.getId() == null
|| StringUtils.isBlank(highAgentModel.getAgentName())
|| StringUtils.isBlank(highAgentModel.getAgentAddress())
|| StringUtils.isBlank(highAgentModel.getAgentUser())
|| StringUtils.isBlank(highAgentModel.getAgentPhone())
|| StringUtils.isBlank(highAgentModel.getSecUser().getPassword())
|| StringUtils.isBlank(highAgentModel.getSecUser().getTelephone())
) {
log.error("HighMerchantController -> insertAgent() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 校验账号手机号是否存在
if (secUserService.findByPhone(highAgentModel.getSecUser().getTelephone()) != null) {
log.error("HighMerchantStoreController --> insertAgent() error!", "联系方式已被使用");
throw ErrorHelp.genException(SysCode.System, ErrorCode.TEL_EXISTED, "");
}
if (highAgentService.findByAgentName(highAgentModel.getAgentName())) {
log.error("HighMerchantStoreController --> insertAgent() error!", "代理商名称已存在");
throw ErrorHelp.genException(SysCode.System, ErrorCode.AGENT_NAME, "");
}
// if (highAgentModel.getAgentAddress() == null
// || StringUtils.isBlank(highMerchantStore.getStoreKey())
// || StringUtils.isBlank(highMerchantStore.getSecUser().getPassword())
// || StringUtils.isBlank(highMerchantStore.getSecUser().getTelephone())
// ) {
// log.error("HighMerchantStoreController -> insertMerchantStore() error!","参数错误");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
// }
//
// // 校验账户手机号
// if (!MemberValidateUtil.validatePhone(highMerchantStore.getSecUser().getTelephone())) {
// log.error("HighMerchantStoreController --> insertMerchantStore() error!", "请输入正确的电话号码");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.PHONE_NUM_IS_ERROR, "");
// }
//
// // 校验账号手机号是否存在
// if (secUserService.findByPhone(highMerchantStore.getSecUser().getTelephone()) != null) {
// log.error("HighMerchantStoreController --> insertMerchantStore() error!", "电话号码已被使用");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.PHONE_NUM_EXISTED, "");
// }
// if (
// reqBody.getId() == null
// ) {
// throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
// }
//
// HighUser highUser = highUserService.findByUserId(reqBody.getId());
//
// if (highUser == null) {
// log.error("HighUserController --> updateUser() error!");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_USER_ERROR, "");
// }
//
// highUserService.updateUser(reqBody);
return ResponseMsgUtil.success("新增成功");

@ -101,9 +101,9 @@ public class HighOrderController {
@ResponseBody
@ApiOperation(value = "获取用户订单")
public ResponseData getOrderList(
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "orderStatus", required = false) Integer orderStatus,
@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "phone", required = false) String phone,
@RequestParam(name = "memPhone", required = false) String memPhone,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize,
HttpServletRequest request) {
@ -124,12 +124,12 @@ public class HighOrderController {
if (userInfoModel.getSecRole().getRoleType() == 3) {
map.put("storeId" , userInfoModel.getMerchantStore().getId());
}
map.put("status", status);
map.put("orderStatus", orderStatus);
map.put("orderNo", orderNo);
map.put("phone", phone);
map.put("memPhone", memPhone);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highOrderService.getOrderList(map)));
return ResponseMsgUtil.success(new PageInfo<>(highOrderService.getOrderBList(map)));
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);

@ -104,6 +104,7 @@ public enum ErrorCode {
COUPON_CODE_STATUS("2122","卡券码状态错误"),
COUPON_CODE_OVERDUE("2122","卡券码已过期"),
COUPON_CODE_NAME("2123","卡券名称已存在"),
AGENT_NAME("2124","代理商名称已存在"),
STATUS_ERROR("3000","状态错误"),
ADD_DATA_ERROR("3001","增加数据失败"),

@ -55,11 +55,11 @@ public interface HighOrderMapperExt {
"<if test='map.companyId != null'> AND company_id = #{map.companyId} </if>",
"<if test='map.merchantId != null'> AND merchant_id = #{map.merchantId} </if>",
"<if test='map.storeId != null'> AND store_id = #{map.storeId} </if>",
"<if test='map.mem_phone != null'> AND mem_phone = #{map.memName} </if>",
"<if test='map.order_no != null'> AND order_no = #{map.orderNo} </if>",
"<if test='map.pay_model != null'> AND pay_model = #{map.payModel} </if>",
"<if test='map.pay_type != null'> AND pay_type = #{map.payType} </if>",
"<if test='map.order_status != null'> AND order_status = #{map.orderStatus} </if>",
"<if test='map.memPhone != null'> AND mem_phone = #{map.memPhone} </if>",
"<if test='map.orderNo != null'> AND order_no = #{map.orderNo} </if>",
"<if test='map.payModel != null'> AND pay_model = #{map.payModel} </if>",
"<if test='map.payType != null'> AND pay_type = #{map.payType} </if>",
"<if test='map.orderStatus != null'> AND order_status = #{map.orderStatus} </if>",
" order by create_time desc ",
"</script>"
})

@ -32,12 +32,23 @@ public interface HighAgentService {
* @Description: 查询代理商信息详情
* @Date: 2021/03/09 10:23
* @author: Sum1Dream
* @param: agentMsgId 代理商信息id
* @param: agentId 代理商信息id
* @return: HighUser
*/
HighAgent findByAgentMsgId(Long agentMsgId);
HighAgent findByAgentMsgId(Long agentId);
/**
*
* @Title: findByAgentName
* @Description: 查询代理商名称查询详情
* @Date: 2021/03/09 10:23
* @author: Sum1Dream
* @param: agentName 代理商名称
* @return: HighUser
*/
Boolean findByAgentName(String agentName);
/**
*
* @Title: updateUser

@ -70,12 +70,19 @@ public interface HighOrderService {
**/
HighOrder getOrderByOrderNo(String orderNo);
/**
* @Author 袁野
* @Description 查询订单列表
* @Date 2021/3/26 23:06
**/
List<HighOrderData> getOrderBList(Map<String,Object> map);
/**
* @Author 胡锐
* @Description 查询订单列表
* @Date 2021/3/26 23:06
**/
List<HighOrderData> getOrderList(Map<String,Object> map);
List<HighOrder> getOrderList(Map<String,Object> map);
/**
* @Author 胡锐

@ -44,12 +44,22 @@ public class HighAgentServiceImpl implements HighAgentService {
}
@Override
public void updateAgentMsg(HighAgent highAgent) {
public Boolean findByAgentName(String agentName) {
HighAgentExample example = new HighAgentExample();
HighAgentExample.Criteria criteria = example.createCriteria();
criteria.andAgentNameEqualTo(agentName);
return highAgentMapper.selectByExample(example).size() == 0;
}
@Override
public void insertAgentMsg(HighAgent highAgent) {
public void updateAgentMsg(HighAgent highAgent) {
highAgentMapper.updateByPrimaryKey(highAgent);
}
@Override
public void insertAgentMsg(HighAgent highAgent) {
highAgentMapper.insert(highAgent);
}
}

@ -17,7 +17,6 @@ import com.hai.service.HighMerchantStoreService;
import com.hai.service.SecUserService;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.gavaghan.geodesy.GeodeticCalculator;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
@ -30,7 +29,6 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static com.hai.common.utils.CoordCommonUtil.getDistance;
@Service("highMerchantStoreService")
public class HighMerchantStoreServiceImpl implements HighMerchantStoreService {

@ -259,11 +259,32 @@ public class HighOrderServiceImpl implements HighOrderService {
}
@Override
public List<HighOrderData> getOrderList(Map<String, Object> map) {
public List<HighOrderData> getOrderBList(Map<String, Object> map) {
return highOrderMapperExt.selectOrderDataList(map);
}
@Override
public List<HighOrder> getOrderList(Map<String, Object> map) {
HighOrderExample example = new HighOrderExample();
HighOrderExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map, "memId") != null) {
criteria.andMemIdEqualTo(MapUtils.getLong(map, "memId"));
}
if (MapUtils.getInteger(map, "status") != null) {
criteria.andOrderStatusEqualTo(MapUtils.getInteger(map, "status"));
}
if (MapUtils.getString(map, "orderNo") != null) {
criteria.andOrderNoEqualTo(MapUtils.getString(map, "orderNo"));
}
example.setOrderByClause("create_time desc");
return highOrderMapper.selectByExample(example);
}
@Override
public List<HighOrder> getCloseOrder() {
return highOrderMapperExt.getCloseOrder();

Loading…
Cancel
Save