Commit a73907ae by lzxry

Merge branch '1608_from_1619'

parents 7cfb3ab5 1e35b579
......@@ -148,7 +148,7 @@
<!--<report.url>http://localhost:9010</report.url>-->
<report.url>http://10.3.20.41:11010</report.url>
<report.url>http://10.3.20.41:9010</report.url>
<import.temp.url>http://10.3.20.41:9001</import.temp.url>
<contract.uppath></contract.uppath>
<!--Redis setting-->
......
......@@ -5,7 +5,7 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
//@Entity
public class AuthDic {
private Long id;
......@@ -14,8 +14,8 @@ public class AuthDic {
private int type;
@Id
@GeneratedValue
//@Id
//@GeneratedValue
public Long getId() {
return id;
}
......
package common.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
/**
* @author liyin
* @description
* @date
*/
@Entity
public class BarrioCity {
private Long id;
private String name;
private Long parentId;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
}
package common.model;
import java.util.List;
/**
* @author liyin
* @description
* @date
*/
public class BarrioCityVO {
private BarrioCity parentCity;
private List<BarrioCity> cities;
public BarrioCity getParentCity() {
return parentCity;
}
public void setParentCity(BarrioCity parentCity) {
this.parentCity = parentCity;
}
public List<BarrioCity> getCities() {
return cities;
}
public void setCitys(List<BarrioCity> cities) {
this.cities = cities;
}
}
......@@ -63,9 +63,13 @@ public class Contract {
private Long incomeExcludingTax; //不含税收入 (*100的结果)
private Long intervaIncomeShare;//区间分摊收入(*100的结果)
private Long incomeShareAll;//分摊总收入(*100的结果)
private Long incomeGross;//累计总收入(*100的结果)合同自开始至选择的结束日期(分摊收入+调整金额)
private Integer shareSign;//标记是否计算分摊收入 1 计算 0 不计算
private String searchName;
private List<String> customBodyNames;
......@@ -86,6 +90,13 @@ public class Contract {
private String erroMessage;
private String tradeName;
private Long barrioId;//行政区域id
private String barrioName;//行政区域名称
private String belongGroup;//隶属集团
private Double trackFlow;//流量,tkio的
private Double unitPrice;//单价,tkio
private Double clickFlow;//区间点击数,tkio
@Id
@GeneratedValue
......@@ -501,32 +512,20 @@ public class Contract {
this.adjustmentFundForm = adjustmentFundForm;
}
public Long getBarrioId() {
return barrioId;
}
@Override
public String toString() {
return "Contract{" +
"id=" + id +
", product='" + product + '\'' +
", myBodyName='" + myBodyName + '\'' +
", myBodyCode='" + myBodyCode + '\'' +
", customerBody='" + customerBody + '\'' +
", email='" + email + '\'' +
", contractCode='" + contractCode + '\'' +
", contractType='" + contractType + '\'' +
", startDate='" + startDate + '\'' +
", endDate='" + endDate + '\'' +
", priceLevel=" + priceLevel +
", money=" + money +
", rebate=" + rebate +
", sale=" + sale +
", platform='" + platform + '\'' +
", status='" + status + '\'' +
", modifyAccount=" + modifyAccount +
", createAccount=" + createAccount +
", modifyTime=" + modifyTime +
", createTime=" + createTime +
", ds='" + ds + '\'' +
'}';
public void setBarrioId(Long barrioId) {
this.barrioId = barrioId;
}
public String getBelongGroup() {
return belongGroup;
}
public void setBelongGroup(String belongGroup) {
this.belongGroup = belongGroup;
}
public Integer getBackStatus() {
......@@ -563,4 +562,109 @@ public class Contract {
public void setShareSign(Integer shareSign) {
this.shareSign = shareSign;
}
@Transient
public String getBarrioName() {
return barrioName;
}
public void setBarrioName(String barrioName) {
this.barrioName = barrioName;
}
public Double getTrackFlow() {
return trackFlow;
}
public void setTrackFlow(Double trackFlow) {
this.trackFlow = trackFlow;
}
@Transient
public Double getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(Double unitPrice) {
this.unitPrice = unitPrice;
}
@Transient
public Double getClickFlow() {
return clickFlow;
}
public void setClickFlow(Double clickFlow) {
this.clickFlow = clickFlow;
}
@Transient
public Long getIncomeGross() {
return incomeGross;
}
public void setIncomeGross(Long incomeGross) {
this.incomeGross = incomeGross;
}
@Override
public String toString() {
return "Contract{" +
"id=" + id +
", product='" + product + '\'' +
", myBodyName='" + myBodyName + '\'' +
", myBodyCode='" + myBodyCode + '\'' +
", customerBody='" + customerBody + '\'' +
", email='" + email + '\'' +
", contractCode='" + contractCode + '\'' +
", codeNum=" + codeNum +
", contractType='" + contractType + '\'' +
", startDate='" + startDate + '\'' +
", endDate='" + endDate + '\'' +
", priceLevel=" + priceLevel +
", priceLevelName='" + priceLevelName + '\'' +
", money=" + money +
", rebate=" + rebate +
", sale=" + sale +
", platform='" + platform + '\'' +
", status='" + status + '\'' +
", saleName='" + saleName + '\'' +
", payMoney=" + payMoney +
", backStatus=" + backStatus +
", invoice=" + invoice +
", invoiceMoney=" + invoiceMoney +
", createName='" + createName + '\'' +
", type='" + type + '\'' +
", priceName=" + priceName +
", old=" + old +
", extraFlow=" + extraFlow +
", modifyAccount=" + modifyAccount +
", createAccount=" + createAccount +
", modifyTime=" + modifyTime +
", createTime=" + createTime +
", ds='" + ds + '\'' +
", virtual=" + virtual +
", firstBackId=" + firstBackId +
", adjustmentFund=" + adjustmentFund +
", adjustmentFundForm='" + adjustmentFundForm + '\'' +
", intervalUseDays=" + intervalUseDays +
", incomeExcludingTax=" + incomeExcludingTax +
", intervaIncomeShare=" + intervaIncomeShare +
", incomeShareAll=" + incomeShareAll +
", shareSign=" + shareSign +
", searchName='" + searchName + '\'' +
", customBodyNames=" + customBodyNames +
", discountTimeLong=" + discountTimeLong +
", customerShort='" + customerShort + '\'' +
", customerThird='" + customerThird + '\'' +
", tradeType=" + tradeType +
", relationContract=" + relationContract +
", relationCode='" + relationCode + '\'' +
", hasDiscount='" + hasDiscount + '\'' +
", typeId='" + typeId + '\'' +
", erroMessage='" + erroMessage + '\'' +
", tradeName='" + tradeName + '\'' +
", barrioId=" + barrioId +
", belongGroup='" + belongGroup + '\'' +
'}';
}
}
package common.repository;
import common.model.BarrioCity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Transactional
public interface BarrioCityRepository extends JpaRepository<BarrioCity, Long> {
@Query(value = "select * from barrio_city where parent_id = ?1",nativeQuery = true)
List<BarrioCity> findByParentId(long parentId);
}
......@@ -99,22 +99,22 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query(value = "select contract_code,my_body_code,sale,platform from contract where contract_code in ?1", nativeQuery = true)
List<Object[]> findByContractCode(List<String> codesList);
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and status!='del' and share_sign <> 0 ", nativeQuery = true)
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and status!='del' and (share_sign = 1 or share_sign is null) ", nativeQuery = true)
List<Contract> findShareContranctByDate3(String startDate, String endDate, String platform);
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and my_body_code = ?4 and status!='del' and share_sign <> 0 ", nativeQuery = true)
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and my_body_code = ?4 and status!='del' and (share_sign = 1 or share_sign is null) ", nativeQuery = true)
List<Contract> findShareContranctByDate2(String startDate, String endDate, String platform, String bodyCode);
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and (my_body_name like %?4% or customer_body like %?4% or contract_code like %?4%) and status!='del' and share_sign <> 0 ", nativeQuery = true)
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and (my_body_name like %?4% or customer_body like %?4% or contract_code like %?4%) and status!='del' and (share_sign = 1 or share_sign is null) ", nativeQuery = true)
List<Contract> findShareContranctByDateSerche(String startDate, String endDate, String platform, String serchName);
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and my_body_code = ?4 and (my_body_name like %?5% or customer_body like %?5% or contract_code like %?5%) and status!='del' and share_sign <> 0 ", nativeQuery = true)
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and my_body_code = ?4 and (my_body_name like %?5% or customer_body like %?5% or contract_code like %?5%) and status!='del' and (share_sign = 1 or share_sign is null) ", nativeQuery = true)
List<Contract> findShareContranctByDate1(String startDate, String endDate, String platform, String bodyCode, String serchName);
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and (my_body_name like %?4% or customer_body like %?4% or contract_code like %?5%) and my_body_code in ?5 and status!='del' and share_sign <> 0 ", nativeQuery = true)
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and (my_body_name like %?4% or customer_body like %?4% or contract_code like %?5%) and my_body_code in ?5 and status!='del' and (share_sign = 1 or share_sign is null) ", nativeQuery = true)
List<Contract> findShareContranctByDateSercheFinace(String startDate, String endDate, String platform, String serchName, List<String> financeBodies);
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and my_body_code in ?4 and status!='del' and share_sign <> 0 ", nativeQuery = true)
@Query(value = "select * from contract where ((start_date <= ?1 and end_date >= ?1) or (start_date <= ?2 and end_date >= ?2) or (start_date >= ?1 and end_date <= ?2) or (start_date <= ?1 and end_date >= ?2)) and platform=?3 and my_body_code in ?4 and status!='del' and (share_sign = 1 or share_sign is null) ", nativeQuery = true)
List<Contract> findShareContranctByDateFinace(String startDate, String endDate, String platform, List<String> financeBodies);
@Query(value = "select contract_code from contract where customer_body =?1 and contract_code <> ?2 and status in ('backfirst','normal','late') limit 3 ", nativeQuery = true)
......
......@@ -77,4 +77,5 @@ public interface ContractService {
ResultModel uploadBatchInfo(MultipartFile file, String platform);
Object getBarrioCities();
}
\ No newline at end of file
......@@ -18,4 +18,7 @@ public interface AppRepository extends JpaRepository<App, Long> {
@Query(value = "select appkey from app where account in ?1", nativeQuery = true)
List<String> findAppkeys(List<Long> accountId);
@Query(value = "select appkey from app where account in ?1 and is_debug is not true", nativeQuery = true)
List<String> findAppkeysNotDebug(List<Long> accountId);
}
package util;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import java.util.HashMap;
import java.util.Map;
/**
* @author liyin
* @description
* @date
*/
public class ContractBranchUtil {
private static Map<String,String> map = new HashMap<>();
static {
map.put("dmp", "type_one");
map.put("fake", "type_one");
map.put("adi", "type_one");
map.put("ads", "type_one");
map.put("abtest", "type_one");
map.put("tkio", "type_two");
}
public static String getValue(String key){
return map.get(key);
}
}
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