Merge remote-tracking branch 'origin/2.0-dev' into 2.0-dev

new-dev
袁野 1 year ago
parent 2951172df3
commit 6038b9973b
  1. 3
      hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java
  2. 3
      hai-cweb/src/main/java/com/cweb/controller/CommonController.java
  3. 3
      hai-service/src/main/java/com/hai/dao/HighTyAgentOilStationMapperExt.java
  4. 131
      hai-service/src/main/java/com/hai/model/TyAgentOilStationModel.java
  5. 14
      hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java
  6. 3
      hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java
  7. 2
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  8. 62
      hai-service/src/main/java/com/hai/service/HighStoreUserService.java
  9. 103
      hai-service/src/main/java/com/hai/service/impl/HighStoreUserServiceImpl.java
  10. 4
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java
  11. 2
      hai-user/src/main/java/com/web/controller/LoginController.java

@ -128,6 +128,9 @@ public class HighMerchantStoreController {
if (highMerchantStore.getType().equals(1) && StringUtils.isBlank(highMerchantStore.getStoreLogo())) {
highMerchantStore.setStoreLogo(CommonSysConst.getSysConfig().getGasDefaultOilStationImg());
}
if (highMerchantStore.getSourceType() == 7) {
highMerchantStore.setStoreLogo(CommonSysConst.getSysConfig().getFileUrl() + highMerchantStore.getStoreLogo());
}
highMerchantStore.setCreateTime(new Date());
highMerchantStore.setUpdateTime(new Date());
highMerchantStore.setStatus(1); // 状态:0:删除,1:正常

@ -517,7 +517,8 @@ public class CommonController {
JSONObject object = new JSONObject();
object.put("userLeve" , highUserService.findUserLevel(userId));
object.put("userLeve" , new JSONObject());
// object.put("userLeve" , highUserService.findUserLevel(userId));
object.put("price" , commonService.findSecConfigByType("LEVEL_PRICE").getCodeValue());
return ResponseMsgUtil.success(object);

@ -30,7 +30,8 @@ public interface HighTyAgentOilStationMapperExt {
" b.ty_salesman_id tySalesmanId," +
" b.ty_salesman_name tySalesmanName," +
" b.oil_station_id oilStationId," +
" b.oil_station_name oilStationName" +
" b.oil_station_name oilStationName," +
" a.source_type sourceType" +
" from high_merchant_store a" +
" LEFT JOIN high_ty_agent_oil_station b on a.id = b.oil_station_id and b.`status` = 1" +
" where a.type = 1 and a.`status` = 1" +

@ -1,5 +1,8 @@
package com.hai.model;
import lombok.Data;
@Data
public class TyAgentOilStationModel {
private Long storeId;
@ -15,135 +18,9 @@ public class TyAgentOilStationModel {
private Long tyAgentId;
private String tyAgentName;
private Long tySalesmanId;
private Integer sourceType;
private String tySalesmanName;
private Long oilStationId;
private String oilStationName;
public Long getTyAgentOilStationId() {
return tyAgentOilStationId;
}
public void setTyAgentOilStationId(Long tyAgentOilStationId) {
this.tyAgentOilStationId = tyAgentOilStationId;
}
public Long getStoreId() {
return storeId;
}
public void setStoreId(Long storeId) {
this.storeId = storeId;
}
public Long getRegionId() {
return regionId;
}
public void setRegionId(Long regionId) {
this.regionId = regionId;
}
public String getRegionName() {
return regionName;
}
public void setRegionName(String regionName) {
this.regionName = regionName;
}
public String getStoreLogo() {
return storeLogo;
}
public void setStoreLogo(String storeLogo) {
this.storeLogo = storeLogo;
}
public String getStoreKey() {
return storeKey;
}
public void setStoreKey(String storeKey) {
this.storeKey = storeKey;
}
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public Long getOrganizationId() {
return organizationId;
}
public void setOrganizationId(Long organizationId) {
this.organizationId = organizationId;
}
public String getOrganizationName() {
return organizationName;
}
public void setOrganizationName(String organizationName) {
this.organizationName = organizationName;
}
public Long getTyAgentId() {
return tyAgentId;
}
public void setTyAgentId(Long tyAgentId) {
this.tyAgentId = tyAgentId;
}
public String getTyAgentName() {
return tyAgentName;
}
public void setTyAgentName(String tyAgentName) {
this.tyAgentName = tyAgentName;
}
public Long getTySalesmanId() {
return tySalesmanId;
}
public void setTySalesmanId(Long tySalesmanId) {
this.tySalesmanId = tySalesmanId;
}
public String getTySalesmanName() {
return tySalesmanName;
}
public void setTySalesmanName(String tySalesmanName) {
this.tySalesmanName = tySalesmanName;
}
public Long getOilStationId() {
return oilStationId;
}
public void setOilStationId(Long oilStationId) {
this.oilStationId = oilStationId;
}
public String getOilStationName() {
return oilStationName;
}
public void setOilStationName(String oilStationName) {
this.oilStationName = oilStationName;
}
}

@ -575,8 +575,18 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
gasOrderService.addGasOrder(gasOrder);
if (store.getSourceType() == 7 ){
SecConfig secConfig = secConfigService.findByCodeType(store.getId().toString());
if (secConfig == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "系统维护中,请联系工作人员!");
}
BigDecimal price = gasOrder.getGasRefuelPrice().multiply(new BigDecimal(secConfig.getCodeValue())).divide(new BigDecimal(100));
HighOilCardOrder oilCardOrder = new HighOilCardOrder();
oilCardOrder.setPrice(priceModel.getPayPrice());
oilCardOrder.setPrice(price);
oilCardOrder.setCardNo(createOrderChild.getOilCardNo());
oilCardOrder.setOrderNo(createOrderModel.getOrderNo());
oilCardOrder.setThirdOrderNo("HF" + OrderUtil.generateOrderNo());
@ -606,7 +616,7 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
log.error("HighOrderController --> addOrder() error!", "");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "库存数量不足");
}
if (discountPackage.getPurchaseNum() < discountPackageActualService.userPurchaseByUserId(createOrderChild.getMemId().intValue(), discountPackage.getId())) {
if (discountPackage.getPurchaseNum() <= discountPackageActualService.userPurchaseByUserId(createOrderChild.getMemId().intValue(), discountPackage.getId())) {
log.error("HighOrderController --> addOrder() error!", "");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "超过购买限制");
}

@ -131,6 +131,9 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
@Resource
private GroupCodeService groupCodeService;
@Resource
private SecConfigService secConfigService;
@Override
public HighOrder orderPaySuccessHandle(String orderNo, OrderPayType payType, String paySerialNo, BigDecimal payRealPrice, HighUserCard userCard, Map<String,Object> other) {

@ -168,7 +168,7 @@ public class OrderServiceImpl implements OrderService {
BsDistributionUserRel popularizeUser = bsDistributionUserRelService.findDistributionUserRel(mapUser);
if (popularizeUser != null && createOrderModel.getMemId() != null) {
order.setPromoteCode(popularizeUser.getAgentId().toString());
order.setPromoteCode(popularizeUser.getAgentId()==null ? "暂无" : "" + popularizeUser.getAgentId());
}
}

@ -0,0 +1,62 @@
package com.hai.service;
import com.hai.entity.HighChildOrder;
import com.hai.entity.HighOrder;
import com.hai.entity.HighStoreUser;
import java.util.List;
import java.util.Map;
/**
* @serviceName .java
* @author Sum1Dream
* @version 1.0.0
* @Description // 门店用户绑定
* @createTime 10:29 2023/11/27
**/
public interface HighStoreUserService {
/**
* @Author Sum1Dream
* @Name insertStoreUser
* @Description // 新增
* @Date 10:37 2023/11/27
* @Param storeUser
* @return void
*/
void insertStoreUser(HighStoreUser storeUser);
/**
* @Author Sum1Dream
* @Name updateStoreUser
* @Description // 更新
* @Date 10:37 2023/11/27
* @Param storeUser
* @return void
*/
void updateStoreUser(HighStoreUser storeUser);
/**
* @Author Sum1Dream
* @Name findStoreUser
* @Description // 查询详情
* @Date 10:37 2023/11/27
* @Param map
* @return com.hai.entity.HighStoreUser
*/
HighStoreUser findStoreUser(Map<String , Object> map);
/**
* @Author Sum1Dream
* @Name getStoreUserList
* @Description // 查询列表
* @Date 10:37 2023/11/27
* @Param map
* @return java.util.List<com.hai.entity.HighStoreUser>
*/
List<HighStoreUser> getStoreUserList(Map<String , Object> map);
void storeUserRel(Long userId, Long storeId);
}

@ -0,0 +1,103 @@
package com.hai.service.impl;
import com.hai.dao.HighStoreUserMapper;
import com.hai.entity.HighMerchantStore;
import com.hai.entity.HighStoreUser;
import com.hai.entity.HighStoreUserExample;
import com.hai.entity.HighUser;
import com.hai.service.HighMerchantStoreService;
import com.hai.service.HighStoreUserService;
import com.hai.service.HighUserService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service("highStoreUserService")
public class HighStoreUserServiceImpl implements HighStoreUserService {
@Resource
private HighStoreUserMapper highStoreUserMapper;
@Resource
private HighMerchantStoreService highMerchantStoreService;
@Resource
private HighUserService highUserService;
@Override
public void insertStoreUser(HighStoreUser storeUser) {
highStoreUserMapper.insert(storeUser);
}
@Override
public void updateStoreUser(HighStoreUser storeUser) {
highStoreUserMapper.updateByPrimaryKey(storeUser);
}
@Override
public HighStoreUser findStoreUser(Map<String, Object> map) {
HighStoreUserExample example = new HighStoreUserExample();
HighStoreUserExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map, "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map, "userId"));
}
List<HighStoreUser> list = highStoreUserMapper.selectByExample(example);
if (!list.isEmpty()) {
return list.get(0);
}
return null;
}
@Override
public List<HighStoreUser> getStoreUserList(Map<String, Object> map) {
HighStoreUserExample example = new HighStoreUserExample();
HighStoreUserExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map, "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map, "userId"));
}
if (MapUtils.getLong(map, "storeId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map, "storeId"));
}
return highStoreUserMapper.selectByExample(example);
}
@Override
public void storeUserRel(Long userId, Long storeId) {
Map<String , Object> map = new HashMap<>();
map.put("userId" , userId);
HighStoreUser storeUser = findStoreUser(map);
if (storeUser == null) {
HighMerchantStore merchantStore = highMerchantStoreService.getMerchantStoreById(storeId);
HighUser highUser = highUserService.findByUserId(userId);
if (merchantStore != null && highUser != null) {
storeUser = new HighStoreUser();
storeUser.setStoreName(merchantStore.getStoreName());
storeUser.setStoreId(storeId);
storeUser.setUserPhone(highUser.getPhone());
storeUser.setUserName(highUser.getName());
storeUser.setCreateTime(new Date());
storeUser.setUpdateTime(new Date());
storeUser.setStatus(1);
insertStoreUser(storeUser);
}
}
}
}

@ -82,6 +82,9 @@ public class HighUserServiceImpl implements HighUserService {
@Resource
private HighUserLoginLogMapper userLoginLogMapper;
@Resource
private HighStoreUserService highStoreUserService;
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW, timeout = 30, rollbackFor = Exception.class)
public SessionObject loginAndRegister(LoginPlatform platform,String phone, Long popularizeUserId, Map<String, Object> other,HttpServletRequest request, HttpServletResponse response) throws Exception {
@ -126,6 +129,7 @@ public class HighUserServiceImpl implements HighUserService {
}
SecRegion region = commonService.getRegionsByName(loginLog.getProvinceName());
// highStoreUserService.storeUserRel(user.getId() , MapUtils.getLong(other, "storeId"));
// distributionUserRelService.insertDistributionRebate(user.getId(), popularizeUserId, "500000");
if (region != null) {
// 绑定推广关联关系

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save