Commit d86e028f by kangxiaoshan

大后台

parent 1db9dcb0
...@@ -14,6 +14,7 @@ import org.springframework.http.HttpStatus; ...@@ -14,6 +14,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import security.annotation.CurrentAccount; import security.annotation.CurrentAccount;
import util.NewUserLogThread; import util.NewUserLogThread;
...@@ -74,7 +75,7 @@ public class ContractController { ...@@ -74,7 +75,7 @@ public class ContractController {
if(ValidateUtil.isValid(contractList)){ if(ValidateUtil.isValid(contractList)){
for (Contract c : contractList){ for (Contract c : contractList){
sb.append(c.getDs()).append(",").append(c.getContractCode()).append(",").append(c.getEmail()).append(",").append(c.getCustomerBody()).append(",").append(c.getSaleName()).append(",") sb.append(c.getDs()).append(",").append(c.getContractCode()).append(",").append(c.getEmail()).append(",").append(c.getCustomerBody()).append(",").append(c.getSaleName()).append(",")
.append(c.getStartDate()).append(",").append(c.getEndDate()).append(",").append(c.getPriceLevelName()).append(",").append(c.getMoney()).append(",").append(c.getRebateMoney()).append(",") .append(c.getStartDate()).append(",").append(c.getEndDate()).append(",").append(c.getPriceLevelName()).append(",").append(c.getMoney()).append(",").append(c.getPayMoney()).append(",")
.append(CONTRACT_STATUS.get(c.getStatus())).append("\r\n"); .append(CONTRACT_STATUS.get(c.getStatus())).append("\r\n");
} }
} }
...@@ -208,6 +209,7 @@ public class ContractController { ...@@ -208,6 +209,7 @@ public class ContractController {
Contract contract1 = service.update(loginAccount, contract); Contract contract1 = service.update(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();
return ResultModel.OK(contract1); return ResultModel.OK(contract1);
} }
...@@ -223,9 +225,8 @@ public class ContractController { ...@@ -223,9 +225,8 @@ public class ContractController {
@RequestMapping(value = "change", method = RequestMethod.POST) @RequestMapping(value = "change", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public ResultModel change(@CurrentAccount User loginAccount, public ResultModel change(@CurrentAccount User loginAccount,
@RequestBody FlowChange flowChange,
@RequestBody ContractChange contract, HttpServletRequest request, @PathVariable String platform) { @RequestBody ContractChange contract, HttpServletRequest request, @PathVariable String platform) {
Contract contract1 = service.change(loginAccount, contract,flowChange); Contract contract1 = service.change(loginAccount, contract,null);
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();
return ResultModel.OK(contract1); return ResultModel.OK(contract1);
...@@ -288,7 +289,6 @@ public class ContractController { ...@@ -288,7 +289,6 @@ public class ContractController {
@RequestMapping(value = "trade", method = RequestMethod.GET) @RequestMapping(value = "trade", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ResultModel baseCreate( @PathVariable String platform) { public ResultModel baseCreate( @PathVariable String platform) {
return ResultModel.OK(service.getTradeData(platform)); return ResultModel.OK(service.getTradeData(platform));
} }
...@@ -317,6 +317,20 @@ public class ContractController { ...@@ -317,6 +317,20 @@ public class ContractController {
} }
/**
* 删除记录
* @param platform
* @param
* @return
*/
@RequestMapping(value = "change/del", method = RequestMethod.GET)
@ResponseBody
public ResultModel changesDel( @PathVariable String platform,String id,String type) {
return ResultModel.OK(service.changesDel(platform,id,type));
}
} }
...@@ -35,7 +35,7 @@ public class Contract { ...@@ -35,7 +35,7 @@ public class Contract {
private String status; private String status;
private String saleName; private String saleName;
private Long payMoney; private Long payMoney; // 回款金额
private Long invoice; // 开票次数 private Long invoice; // 开票次数
private BigDecimal invoiceMoney; // 发票金额 private BigDecimal invoiceMoney; // 发票金额
private String createName; // 创建人NAME private String createName; // 创建人NAME
...@@ -57,16 +57,21 @@ public class Contract { ...@@ -57,16 +57,21 @@ public class Contract {
*/ */
// private Long discountFlow; // 优惠流量 // private Long discountFlow; // 优惠流量
private Long discountTimeLong; // 优惠时长 private Long discountTimeLong; // 优惠时长
private BigDecimal rebateMoney; //回款金额 // private BigDecimal rebateMoney; //回款金额
private String customerShort;// 客户简称 private String customerShort;// 客户简称
private String customerThird;// 三方客户 private String customerThird;// 三方客户
private int tradeType; // 行业id private int tradeType; // 行业id
private Long relationContract;// 关联合同id private Long relationContract;// 关联合同id
// private String createrName; // 录入人
private String relationCode;// 关联合同编号 private String relationCode;// 关联合同编号
private String hasDiscount;// 是否有优惠 private String hasDiscount;// 是否有优惠
private String erroMessage;
@Id @Id
...@@ -259,9 +264,9 @@ public class Contract { ...@@ -259,9 +264,9 @@ public class Contract {
return invoice; return invoice;
} }
public BigDecimal getRebateMoney() { // public BigDecimal getRebateMoney() {
return rebateMoney; // return rebateMoney;
} // }
public BigDecimal getInvoiceMoney() { public BigDecimal getInvoiceMoney() {
return invoiceMoney; return invoiceMoney;
...@@ -271,9 +276,9 @@ public class Contract { ...@@ -271,9 +276,9 @@ public class Contract {
this.invoiceMoney = invoiceMoney; this.invoiceMoney = invoiceMoney;
} }
public void setRebateMoney(BigDecimal rebateMoney) { // public void setRebateMoney(BigDecimal rebateMoney) {
this.rebateMoney = rebateMoney; // this.rebateMoney = rebateMoney;
} // }
public void setInvoice(Long invoice) { public void setInvoice(Long invoice) {
this.invoice = invoice; this.invoice = invoice;
...@@ -343,6 +348,15 @@ public class Contract { ...@@ -343,6 +348,15 @@ public class Contract {
this.hasDiscount = hasDiscount; this.hasDiscount = hasDiscount;
} }
@Transient
public String getErroMessage() {
return erroMessage;
}
public void setErroMessage(String erroMessage) {
this.erroMessage = erroMessage;
}
public void setPriceLevelName(String priceLevelName) { public void setPriceLevelName(String priceLevelName) {
this.priceLevelName = priceLevelName; this.priceLevelName = priceLevelName;
} }
......
package common.model; package common.model;
import javax.persistence.Entity; import javax.persistence.*;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.Date; import java.util.Date;
/** /**
...@@ -30,6 +27,10 @@ public class ContractChange { ...@@ -30,6 +27,10 @@ public class ContractChange {
private Long createAccount; private Long createAccount;
private Date modifyTime; private Date modifyTime;
private Date createTime; private Date createTime;
private int delFlag = 0;
private Long extraFlow; // 优惠流量
private Long discountTimeLong; // 优惠时长
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
...@@ -176,4 +177,30 @@ public class ContractChange { ...@@ -176,4 +177,30 @@ public class ContractChange {
public void setMarke(String marke) { public void setMarke(String marke) {
this.marke = marke; this.marke = marke;
} }
public int getDelFlag() {
return delFlag;
}
public void setDelFlag(int delFlag) {
this.delFlag = delFlag;
}
@Transient
public Long getExtraFlow() {
return extraFlow;
}
public void setExtraFlow(Long extraFlow) {
this.extraFlow = extraFlow;
}
@Transient
public Long getDiscountTimeLong() {
return discountTimeLong;
}
public void setDiscountTimeLong(Long discountTimeLong) {
this.discountTimeLong = discountTimeLong;
}
} }
...@@ -25,6 +25,7 @@ public class ContractMoney { ...@@ -25,6 +25,7 @@ public class ContractMoney {
private Long createAccount; private Long createAccount;
private Date modifyTime; private Date modifyTime;
private Date createTime; private Date createTime;
private int delFlag = 0;
@Id @Id
@GeneratedValue @GeneratedValue
...@@ -139,4 +140,12 @@ public class ContractMoney { ...@@ -139,4 +140,12 @@ public class ContractMoney {
public void setPlatform(String platform) { public void setPlatform(String platform) {
this.platform = platform; this.platform = platform;
} }
public int getDelFlag() {
return delFlag;
}
public void setDelFlag(int delFlag) {
this.delFlag = delFlag;
}
} }
...@@ -13,8 +13,8 @@ public class FlowChange { ...@@ -13,8 +13,8 @@ public class FlowChange {
private Long discountTimeLong; // 优惠时长 private Long discountTimeLong; // 优惠时长
private Long discountFlow; // 优惠时长 private Long discountFlow; // 优惠时长
private Long modifyUser; private Long modifyUser;
private String modifyUname; private String modifyUname;//操作人
private String addDate; private String addDate; // ds
private Date addTime; private Date addTime;
private int DelFlag; private int DelFlag;
private String marke; //备注 private String marke; //备注
......
...@@ -13,7 +13,7 @@ import java.util.List; ...@@ -13,7 +13,7 @@ import java.util.List;
@Transactional @Transactional
public interface ContractChangeRepository extends JpaRepository<ContractChange, Long> { public interface ContractChangeRepository extends JpaRepository<ContractChange, Long> {
@Query(value="select * from contract_change where ds >= ?1 and ds <= ?2 and contract_code = ?3 order by ds desc",nativeQuery=true) @Query(value="select * from contract_change where ds >= ?1 and ds <= ?2 and contract_code = ?3 and del_flag is not true order by ds desc",nativeQuery=true)
List<ContractChange> findByDs(String startDate, String endDate, String code); List<ContractChange> findByDs(String startDate, String endDate, String code);
@Query(value="SELECT * from contract_change where platform = ?1 and email = ?2 and ds >= ?3 and ds <= ?4 order by ds desc",nativeQuery=true) @Query(value="SELECT * from contract_change where platform = ?1 and email = ?2 and ds >= ?3 and ds <= ?4 order by ds desc",nativeQuery=true)
......
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
@Transactional @Transactional
public interface ContractMoneyRepository extends JpaRepository<ContractMoney, Long> { public interface ContractMoneyRepository extends JpaRepository<ContractMoney, Long> {
@Query(value="select * from contract_money where ds >= ?1 and ds <= ?2 and contract_code = ?3 order by ds desc",nativeQuery=true) @Query(value="select * from contract_money where ds >= ?1 and ds <= ?2 and contract_code = ?3 and del_flag is not true order by ds desc",nativeQuery=true)
List<ContractMoney> findByDs(String startDate, String endDate, String code); List<ContractMoney> findByDs(String startDate, String endDate, String code);
@Query(value="select * from contract_money where ds >= ?1 and ds <= ?2 and platform = ?3 order by ds desc",nativeQuery=true) @Query(value="select * from contract_money where ds >= ?1 and ds <= ?2 and platform = ?3 order by ds desc",nativeQuery=true)
......
...@@ -8,6 +8,6 @@ import java.util.List; ...@@ -8,6 +8,6 @@ import java.util.List;
public interface FlowChangeRepository extends JpaRepository<FlowChange, Long> { public interface FlowChangeRepository extends JpaRepository<FlowChange, Long> {
@Query(value = "select * from flow_change where contract_code= 1? and add_date >=2? and add_date <= 3?",nativeQuery = true) @Query(value = "select * from flow_change where contract_code= ?3 and add_date >=?1 and add_date <= ?2 and del_flag is not true order by add_date desc",nativeQuery = true)
List<FlowChange> findByAddDate(String startDate, String endDate, String code); List<FlowChange> findByAddDate(String startDate, String endDate, String code);
} }
...@@ -62,4 +62,6 @@ public interface ContractService { ...@@ -62,4 +62,6 @@ public interface ContractService {
Map contractCodeCheck(String platform, String contractCode); Map contractCodeCheck(String platform, String contractCode);
List<FlowChange> findflowChange(String startDate, String endDate, String code); List<FlowChange> findflowChange(String startDate, String endDate, String code);
Object changesDel(String platform, String id, String type);
} }
\ No newline at end of file
...@@ -39,6 +39,12 @@ public class ResultModel { ...@@ -39,6 +39,12 @@ public class ResultModel {
this.content = ""; this.content = "";
} }
public ResultModel(String erro) {
this.code = ResultStatus.FAILED.getCode();
this.message = erro;
this.content = "";
}
public ResultModel(ResultStatus status, Object content) { public ResultModel(ResultStatus status, Object content) {
this.code = status.getCode(); this.code = status.getCode();
this.message = status.getMessage(); this.message = status.getMessage();
...@@ -57,6 +63,10 @@ public class ResultModel { ...@@ -57,6 +63,10 @@ public class ResultModel {
return new ResultModel(error); return new ResultModel(error);
} }
public static ResultModel ERROR(String errorMessage) {
return new ResultModel(errorMessage);
}
public int getCode() { public int getCode() {
return code; return code;
} }
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</filter-mapping> </filter-mapping>
<welcome-file-list> <welcome-file-list>
<welcome-file>/system/index.html</welcome-file> <welcome-file>/index.html</welcome-file>
</welcome-file-list> </welcome-file-list>
</web-app> </web-app>
\ No newline at end of file
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