Commit 3f152851 by kangxiaoshan

大后台更新

parent 83f8e98d
...@@ -174,6 +174,8 @@ ...@@ -174,6 +174,8 @@
<default.datasource.username>trackingio</default.datasource.username> <default.datasource.username>trackingio</default.datasource.username>
<default.datasource.password>trackingio</default.datasource.password> <default.datasource.password>trackingio</default.datasource.password>
<office.url> <office.url>
jdbc:mysql://track.cma5jkozme68.rds.cn-north-1.amazonaws.com.cn:3306/office?characterEncoding=utf-8 jdbc:mysql://track.cma5jkozme68.rds.cn-north-1.amazonaws.com.cn:3306/office?characterEncoding=utf-8
</office.url> </office.url>
...@@ -186,6 +188,7 @@ ...@@ -186,6 +188,7 @@
<tkio.username>trackingio</tkio.username> <tkio.username>trackingio</tkio.username>
<tkio.password>trackingio</tkio.password> <tkio.password>trackingio</tkio.password>
<track.url> <track.url>
jdbc:mysql://track.cma5jkozme68.rds.cn-north-1.amazonaws.com.cn:3306/track?characterEncoding=utf-8 jdbc:mysql://track.cma5jkozme68.rds.cn-north-1.amazonaws.com.cn:3306/track?characterEncoding=utf-8
</track.url> </track.url>
......
...@@ -129,6 +129,10 @@ public class ADIAccountServiceImpl implements ADIAccountService { ...@@ -129,6 +129,10 @@ public class ADIAccountServiceImpl implements ADIAccountService {
@Override @Override
public void updateAccount(Contract contract) { public void updateAccount(Contract contract) {
//暂时 注释改代码
if(true) return ;
ADIUser adiUser = findOne(contract.getEmail()); ADIUser adiUser = findOne(contract.getEmail());
if(null != adiUser){ if(null != adiUser){
String url = u + "adi/api/user/web/update"; String url = u + "adi/api/user/web/update";
......
...@@ -285,6 +285,14 @@ public class ContractController { ...@@ -285,6 +285,14 @@ public class ContractController {
} }
@RequestMapping(value = "setstaus", method = RequestMethod.GET)
@ResponseBody
public ResultModel contractStatusUpdate( @PathVariable String platform,String contractId,String status) {
return ResultModel.OK(service.contractStatusUpdate(platform,contractId,status));
}
} }
...@@ -38,7 +38,7 @@ public class Contract { ...@@ -38,7 +38,7 @@ public class Contract {
private Long payMoney; private Long payMoney;
private Long invoice; // 开票次数 private Long invoice; // 开票次数
private String invoiceMoney; // 发票金额 private String invoiceMoney; // 发票金额
private String createName; private String createName; // 创建人NAME
//合同类型 主套餐 or 增值套餐 //合同类型 主套餐 or 增值套餐
private String type; private String type;
private Long priceName; private Long priceName;
...@@ -46,7 +46,7 @@ public class Contract { ...@@ -46,7 +46,7 @@ public class Contract {
private Long extraFlow; private Long extraFlow;
private Long modifyAccount; private Long modifyAccount;
private Long createAccount; private Long createAccount;// 创建人id
private Date modifyTime; private Date modifyTime;
private Date createTime; private Date createTime;
private String ds; private String ds;
......
...@@ -52,8 +52,8 @@ public interface ContractRepository extends JpaRepository<Contract, Long> { ...@@ -52,8 +52,8 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query(value = "select count(*) from contract where platform = ?1",nativeQuery = true) @Query(value = "select count(*) from contract where platform = ?1",nativeQuery = true)
BigInteger findcountContract(String platform); BigInteger findcountContract(String platform);
@Query(value = "select new map( c.id as id, c.contractCode as contractCode ) from Contract c where c.platform = ?1") @Query(value = "select new map( c.id as id, c.contractCode as contractCode ) from Contract c where c.platform = ?1 and c.contractCode is not null and c.contractCode <> 'null'")
Map contractCodePlatform(String platform); List<Map> contractCodePlatform(String platform);
@Query(value = "select * from contract where platform = ?1 and contract_code = ?2",nativeQuery = true) @Query(value = "select * from contract where platform = ?1 and contract_code = ?2",nativeQuery = true)
Contract findByCodePlatform(String contractCode, String platform); Contract findByCodePlatform(String contractCode, String platform);
......
...@@ -53,7 +53,9 @@ public interface ContractService { ...@@ -53,7 +53,9 @@ public interface ContractService {
List<TradeType> getTradeData(String platform); List<TradeType> getTradeData(String platform);
Map contractCodeAll(String platform); List<Map> contractCodeAll(String platform);
List<Contract> findAllContract(User loginAccount, String startDate, String endDate, String platform, String contractId); List<Contract> findAllContract(User loginAccount, String startDate, String endDate, String platform, String contractId);
Contract contractStatusUpdate(String platform, String contractId, String status);
} }
\ No newline at end of file
...@@ -41,6 +41,14 @@ import java.util.*; ...@@ -41,6 +41,14 @@ import java.util.*;
@Service @Service
public class ContractServiceImpl implements ContractService{ public class ContractServiceImpl implements ContractService{
private static final Map<String,String> CONTRACT_TYPE = new HashMap(){{
put("0","首次签约");
put("1","续约");
put("2","合同变更");
}};
@Autowired @Autowired
ContractRepository contractRepository; ContractRepository contractRepository;
@Autowired @Autowired
...@@ -176,7 +184,7 @@ public class ContractServiceImpl implements ContractService{ ...@@ -176,7 +184,7 @@ public class ContractServiceImpl implements ContractService{
BigInteger countContract = contractRepository.findcountContract(platform); BigInteger countContract = contractRepository.findcountContract(platform);
String lastCode = ""; String lastCode;
int codeInt = countContract.intValue(); int codeInt = countContract.intValue();
...@@ -185,7 +193,7 @@ public class ContractServiceImpl implements ContractService{ ...@@ -185,7 +193,7 @@ public class ContractServiceImpl implements ContractService{
} else { } else {
lastCode = "" + (codeInt + 1); lastCode = "" + (codeInt + 1);
} }
return (company + "-" + platform + "-" + DateUtil.getDays2(0) + "-" + lastCode).toUpperCase(); return (code + "-" + platform + "-" + DateUtil.getDays2(0) + "-" + lastCode).toUpperCase();
} }
@Override @Override
...@@ -273,11 +281,11 @@ public class ContractServiceImpl implements ContractService{ ...@@ -273,11 +281,11 @@ public class ContractServiceImpl implements ContractService{
} }
// 老的逻辑 // 老的逻辑
String contractCode = getContractCode(resource.getMyBodyCode()); // String contractCode = getContractCode(resource.getMyBodyCode());
//
if(!contractCode.equals(resource.getContractCode())){ // if(!contractCode.equals(resource.getContractCode())){
resource.setContractCode(contractCode); // resource.setContractCode(contractCode);
} // }
resource.setPayMoney(0L); resource.setPayMoney(0L);
resource.setInvoice(0L); resource.setInvoice(0L);
...@@ -309,16 +317,16 @@ public class ContractServiceImpl implements ContractService{ ...@@ -309,16 +317,16 @@ public class ContractServiceImpl implements ContractService{
resource.setDs(DateUtil.getBeforeDays(0)); resource.setDs(DateUtil.getBeforeDays(0));
resource.setStatus("wait"); resource.setStatus("wait");
} }
Double rebat = null; // Double rebat = null;
if(null != resource.getPriceLevel()){ // if(null != resource.getPriceLevel()){
rebat = getRebat(resource.getProduct(), resource.getPriceLevel().intValue(), resource.getMoney()); // rebat = getRebat(resource.getProduct(), resource.getPriceLevel().intValue(), resource.getMoney());
}else{ // }else{
rebat = getRebat(resource.getProduct(), 0, resource.getMoney()); // rebat = getRebat(resource.getProduct(), 0, resource.getMoney());
} // }
//
BigDecimal bg = new BigDecimal(rebat); // BigDecimal bg = new BigDecimal(rebat);
double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); // double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
resource.setRebate(f1); // resource.setRebate(f1);
if(null != loginUser) { if(null != loginUser) {
resource.setCreateAccount(loginUser.getId()); resource.setCreateAccount(loginUser.getId());
...@@ -598,6 +606,24 @@ public class ContractServiceImpl implements ContractService{ ...@@ -598,6 +606,24 @@ public class ContractServiceImpl implements ContractService{
} }
@Override @Override
public Contract contractStatusUpdate(String platform, String contractId, String status) {
if(StringUtils.isEmpty(contractId)){
return null;
}
Contract contract = contractRepository.findOne(Long.parseLong(contractId));
if(ContractStatusEnum.CANCEL.getKey().equals(status)){
contract.setStatus(status);
}else{
contract.setStatus(ContractStatusEnum.DELETE.getKey());
}
return contractRepository.save(contract);
}
@Override
public Contract findOne(String code) { public Contract findOne(String code) {
List<Contract> result = new ArrayList<>(); List<Contract> result = new ArrayList<>();
...@@ -825,7 +851,7 @@ public class ContractServiceImpl implements ContractService{ ...@@ -825,7 +851,7 @@ public class ContractServiceImpl implements ContractService{
} }
@Override @Override
public Map contractCodeAll(String platform) { public List<Map> contractCodeAll(String platform) {
return contractRepository.contractCodePlatform(platform); return contractRepository.contractCodePlatform(platform);
} }
......
...@@ -9,7 +9,8 @@ public enum ContractStatusEnum { ...@@ -9,7 +9,8 @@ public enum ContractStatusEnum {
WAIT("wait","未执行"), WAIT("wait","未执行"),
EXECUTING("executing", "执行中"), EXECUTING("executing", "执行中"),
CANCEL("cancel", "作废"), CANCEL("cancel", "作废"),
END("end", "已结束"); END("end", "已结束"),
DELETE("del", "已删除");
private String key; private String key;
private String value; private String value;
......
...@@ -24,6 +24,11 @@ public class AccountServiceImpl implements AccountService { ...@@ -24,6 +24,11 @@ public class AccountServiceImpl implements AccountService {
AccountRepository accountRepository; AccountRepository accountRepository;
@Override @Override
public Account update(Contract contract) { public Account update(Contract contract) {
//暂时 注释改代码
if(true) return null;
Account account = accountRepository.findByEmail(contract.getEmail()); Account account = accountRepository.findByEmail(contract.getEmail());
String today = DateUtil.getBeforeDays(0); String today = DateUtil.getBeforeDays(0);
Date pubDate = DateUtil.getDate(contract.getStartDate()); Date pubDate = DateUtil.getDate(contract.getStartDate());
......
...@@ -397,10 +397,8 @@ public class TkioAccountServiceImpl implements TkioAccountService { ...@@ -397,10 +397,8 @@ public class TkioAccountServiceImpl implements TkioAccountService {
re.setRemindStatus(true); re.setRemindStatus(true);
re.setDs(DateUtil.getBeforeDays(0)); re.setDs(DateUtil.getBeforeDays(0));
reminderRepository.save(re); reminderRepository.save(re);
return paymentRepository.save(resource); return paymentRepository.save(resource);
} }
@Override @Override
......
...@@ -25,6 +25,9 @@ public class AccountIOServiceImpl implements AccountIOService { ...@@ -25,6 +25,9 @@ public class AccountIOServiceImpl implements AccountIOService {
IOAccountRepository accountRepository; IOAccountRepository accountRepository;
@Override @Override
public Account update(Contract contract) { public Account update(Contract contract) {
//暂时 注释改代码
if(true) return null;
Account account = accountRepository.findByEmail(contract.getEmail()); Account account = accountRepository.findByEmail(contract.getEmail());
String today = DateUtil.getBeforeDays(0); String today = DateUtil.getBeforeDays(0);
Date pubDate = DateUtil.getDate(contract.getStartDate()); Date pubDate = DateUtil.getDate(contract.getStartDate());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment