提交代码

dev-discount
胡锐 3 years ago
parent 8853512488
commit 1945eb4eb1
  1. 8
      hai-bweb/src/main/java/com/bweb/controller/HighTyAgentPriceController.java
  2. 2
      hai-service/src/main/java/com/hai/service/HighTyAgentService.java
  3. 2
      hai-service/src/main/java/com/hai/service/HighTySalesmanService.java
  4. 6
      hai-service/src/main/java/com/hai/service/impl/HighTyAgentServiceImpl.java
  5. 12
      hai-service/src/main/java/com/hai/service/impl/HighTySalesmanServiceImpl.java

@ -13,6 +13,7 @@ import com.hai.model.ResponseData;
import com.hai.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -123,12 +124,7 @@ public class HighTyAgentPriceController {
// 价格
HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(station.getId(), price.getOilNo().toString());
if (priceRate == null) {
HighGasDiscountOilPrice oilNo = gasDiscountOilPriceService.getDetailByOilNo(price.getOilNo().toString());
if (oilNo == null) {
oilPriceMap.put("priceRate", 0);
} else {
oilPriceMap.put("priceRate", oilNo.getPriceRate());
}
oilPriceMap.put("priceRate", MapUtils.getLong(oilPriceMap, "lowPrice"));
} else {
oilPriceMap.put("priceRate", priceRate.getPriceRate());
}

@ -21,7 +21,7 @@ public interface HighTyAgentService {
* 增加代理商
* @param tyAgent
*/
void addAgent(HighTyAgent tyAgent);
void addAgent(HighTyAgent tyAgent) throws Exception;
/**
* 修改代理商

@ -20,7 +20,7 @@ public interface HighTySalesmanService {
* 增加业务员
* @param tySalesman
*/
void addSalesman(HighTySalesman tySalesman);
void addSalesman(HighTySalesman tySalesman) throws Exception;
/**
* 修改业务员

@ -52,8 +52,7 @@ public class HighTyAgentServiceImpl implements HighTyAgentService {
@Override
@Transactional(rollbackFor=Exception.class,propagation= Propagation.REQUIRES_NEW)
public void addAgent(HighTyAgent tyAgent) {
try {
public void addAgent(HighTyAgent tyAgent) throws Exception {
if (secUserService.findByPhone(tyAgent.getAgentPhone()) != null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "手机号已存在,请更换");
}
@ -72,9 +71,6 @@ public class HighTyAgentServiceImpl implements HighTyAgentService {
secUser.setCreateTime(new Date());
secUser.setUpdateTime(new Date());
secUserService.addUser(secUser);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override

@ -52,10 +52,10 @@ public class HighTySalesmanServiceImpl implements HighTySalesmanService {
}
@Override
public void addSalesman(HighTySalesman tySalesman) {
try {
if (secUserService.findByPhone(tySalesman.getSalesmanPhone()) != null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "手机号已存在,请更换");
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void addSalesman(HighTySalesman tySalesman) throws Exception {
if (secUserService.findByLoginName(tySalesman.getSalesmanPhone()) != null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "在系统中此联系电话已存在,请更换");
}
editTySalesman(tySalesman);
@ -71,12 +71,10 @@ public class HighTySalesmanServiceImpl implements HighTySalesmanService {
secUser.setCreateTime(new Date());
secUser.setUpdateTime(new Date());
secUserService.addUser(secUser);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void updateSalesman(HighTySalesman tySalesman) {
// 查询账户
SecUser account = secUserService.getMainAccount(UserObjectTypeEnum.type7.getType(), tySalesman.getId());

Loading…
Cancel
Save