Commit d9bd5723 by kangxiaoshan

大后台更新

parent 33e33b10
...@@ -200,9 +200,9 @@ public class ContractController { ...@@ -200,9 +200,9 @@ public class ContractController {
Contract contract1 = service.create(loginAccount, contract); Contract contract1 = service.create(loginAccount, contract);
NewUserLogThread userlog = new NewUserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), contract1.getContractCode(), "新建合同","",contract1.toString(), request, platform); NewUserLogThread userlog = new NewUserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), contract1.getContractCode(), "新建合同","",contract1.toString(), request, platform);
userlog.start(); userlog.start();
//
ContractSendEmailThread email = new ContractSendEmailThread(contract); // ContractSendEmailThread email = new ContractSendEmailThread(contract);
email.start(); // email.start();
return ResultModel.OK(contract1); return ResultModel.OK(contract1);
} }
...@@ -281,9 +281,9 @@ public class ContractController { ...@@ -281,9 +281,9 @@ public class ContractController {
@RequestMapping(value = "code/all", method = RequestMethod.GET) @RequestMapping(value = "code/all", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ResultModel contractCodeAll( @PathVariable String platform) { public ResultModel contractCodeAll( @PathVariable String platform,String contractId) {
return ResultModel.OK(service.contractCodeAll(platform)); return ResultModel.OK(service.contractCodeAll(platform,contractId));
} }
......
...@@ -55,7 +55,7 @@ public class Contract { ...@@ -55,7 +55,7 @@ public class Contract {
/** /**
* 新增字段 20190427 * 新增字段 20190427
*/ */
private Long discountFlow; // 优惠流量 // private Long discountFlow; // 优惠流量
private Long discountTimeLong; // 优惠时长 private Long discountTimeLong; // 优惠时长
private BigDecimal rebateMoney; //回款金额 private BigDecimal rebateMoney; //回款金额
...@@ -355,13 +355,13 @@ public class Contract { ...@@ -355,13 +355,13 @@ public class Contract {
this.createName = createName; this.createName = createName;
} }
public Long getDiscountFlow() { // public Long getDiscountFlow() {
return discountFlow; // return discountFlow;
} // }
//
public void setDiscountFlow(Long discountFlow) { // public void setDiscountFlow(Long discountFlow) {
this.discountFlow = discountFlow; // this.discountFlow = discountFlow;
} // }
public Long getDiscountTimeLong() { public Long getDiscountTimeLong() {
return discountTimeLong; return discountTimeLong;
......
...@@ -12,6 +12,12 @@ import java.util.List; ...@@ -12,6 +12,12 @@ import java.util.List;
*/ */
public interface ContractRelationRepository extends JpaRepository<ContractRelation, Long> { public interface ContractRelationRepository extends JpaRepository<ContractRelation, Long> {
@Query(value = "select relation_id from contract_relation where main_contract = ?1",nativeQuery = true) @Query(value = "select relation_id id from contract_relation where main_contract = ?1 union all select main_contract id from contract_relation where relation_id = ?1",nativeQuery = true)
List<Long> findRelationIds(String contractId); List<Long> findRelationIds(String contractId);
@Query(value = "select * from contract_relation where main_contract = ?1 and relation_id = ?2 and platform = ?3",nativeQuery = true)
ContractRelation findByRelationData(Long mainContract, Long relationId, String platform);
@Query(value = "select * from contract_relation where main_contract = ?1 ",nativeQuery = true)
List<ContractRelation> findRelationIdsMain(String contractId);
} }
...@@ -7,6 +7,7 @@ import org.springframework.data.jpa.repository.Query; ...@@ -7,6 +7,7 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigInteger; import java.math.BigInteger;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -19,10 +20,10 @@ public interface ContractRepository extends JpaRepository<Contract, Long> { ...@@ -19,10 +20,10 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query(value="select count(*) from contract where email = ?1 and platform = ?2",nativeQuery=true) @Query(value="select count(*) from contract where email = ?1 and platform = ?2",nativeQuery=true)
BigInteger countNumByEmail(String email, String platfrom); BigInteger countNumByEmail(String email, String platfrom);
@Query(value="select * from contract where start_date >= ?1 and start_date <= ?2 and platform = ?3 order by ds desc",nativeQuery=true) @Query(value="select * from contract where start_date >= ?1 and start_date <= ?2 and platform = ?3 and status!='del' order by ds desc",nativeQuery=true)
List<Contract> findByDs(String startDate, String endDate, String platfrom); List<Contract> findByDs(String startDate, String endDate, String platfrom);
@Query(value="select * from contract where start_date >= ?1 and start_date <= ?2 and platform = ?3 and create_account in ?4 order by ds desc",nativeQuery=true) @Query(value="select * from contract where start_date >= ?1 and start_date <= ?2 and platform = ?3 and create_account in ?4 and status!='del' order by ds desc",nativeQuery=true)
List<Contract> findByDsAndRoile(String startDate, String endDate, String platfrom, List<Long> userids); List<Contract> findByDsAndRoile(String startDate, String endDate, String platfrom, List<Long> userids);
@Query(value="select * from contract where contract_code = ?1",nativeQuery=true) @Query(value="select * from contract where contract_code = ?1",nativeQuery=true)
...@@ -52,15 +53,19 @@ public interface ContractRepository extends JpaRepository<Contract, Long> { ...@@ -52,15 +53,19 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query(value = "select count(*) from contract where my_body_code = ?1",nativeQuery = true) @Query(value = "select count(*) from contract where my_body_code = ?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 and c.contractCode is not null and c.contractCode <> 'null'") @Query(value = "select new map( c.id as id, c.contractCode as contractCode ) from Contract c where c.platform in ?1 and c.contractCode is not null and c.contractCode <> 'null'")
List<Map> contractCodePlatform(String platform); List<Map> contractCodePlatform(List<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);
@Query(value="select * from contract where start_date >= ?1 and start_date <= ?2 and platform = ?3 and id in ?4 order by ds desc",nativeQuery=true) @Query(value="select * from contract where start_date >= ?1 and start_date <= ?2 and platform in ?3 and id in ?4 and status!='del' order by ds desc",nativeQuery=true)
List<Contract> findByDsRelation(String startDate, String endDate, String platform, List<Long> contractIds); List<Contract> findByDsRelation(String startDate, String endDate, List<String> platform, List<Long> contractIds);
@Query(value="select * from contract where start_date >= ?1 and start_date <= ?2 and platform = ?3 and create_account in ?4 and id in ?5 order by ds desc",nativeQuery=true) @Query(value="select * from contract where start_date >= ?1 and start_date <= ?2 and platform in ?3 and create_account in ?4 and id in ?5 and status!='del' order by ds desc",nativeQuery=true)
List<Contract> findByDsAndRoileRelation(String startDate, String endDate, String platform, List<Long> create_account, List<Long> contractIds); List<Contract> findByDsAndRoileRelation(String startDate, String endDate, List<String> platform, List<Long> create_account, List<Long> contractIds);
@Query(value = "select new map( c.id as id, c.contractCode as contractCode ) from Contract c where c.platform in ?1 and c.contractCode is not null and c.contractCode <> 'null' ")
List<Contract> contractCodePlatformNot(List<String> plats, List<Long> ids);
} }
...@@ -53,9 +53,9 @@ public interface ContractService { ...@@ -53,9 +53,9 @@ public interface ContractService {
List<TradeType> getTradeData(String platform); List<TradeType> getTradeData(String platform);
List<Map> contractCodeAll(String platform); List<Map> contractCodeAll(String platform, String contractId);
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); Contract contractStatusUpdate(String platform, String contractId, String status);
} }
\ No newline at end of file
...@@ -2,7 +2,6 @@ package tkio.task; ...@@ -2,7 +2,6 @@ package tkio.task;
import common.model.Account4Web; import common.model.Account4Web;
import common.repository.Account4WebRepository; import common.repository.Account4WebRepository;
import common.task.SyncAppDataTask;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
......
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