提交代码

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

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

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

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

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

Loading…
Cancel
Save