Commit d837b831 by kangxiaoshan

大后台

parent a0f98c4c
package common.controller;
import common.model.Contract;
import common.model.ContractChange;
import common.model.ContractMoney;
import common.model.User;
import common.model.*;
import common.service.ContractService;
import common.task.ContractSendEmailThread;
import dic.ContractStatusEnum;
......@@ -200,7 +197,6 @@ public class ContractController {
Contract contract1 = service.create(loginAccount, contract);
NewUserLogThread userlog = new NewUserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), contract1.getContractCode(), "新建合同","",contract1.toString(), request, platform);
userlog.start();
//
// ContractSendEmailThread email = new ContractSendEmailThread(contract);
// email.start();
return ResultModel.OK(contract1);
......@@ -226,13 +222,23 @@ public class ContractController {
@RequestMapping(value = "change", method = RequestMethod.POST)
@ResponseBody
public ResultModel change(@CurrentAccount User loginAccount, @RequestBody ContractChange contract, HttpServletRequest request, @PathVariable String platform) {
Contract contract1 = service.change(loginAccount, contract);
public ResultModel change(@CurrentAccount User loginAccount,
@RequestBody FlowChange flowChange,
@RequestBody ContractChange contract, HttpServletRequest request, @PathVariable String platform) {
Contract contract1 = service.change(loginAccount, contract,flowChange);
NewUserLogThread userlog = new NewUserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), contract1.getContractCode(), "修改套餐","",contract1.toString(), request, platform);
userlog.start();
return ResultModel.OK(contract1);
}
/**
*
* @param loginAccount
* @param startDate
* @param endDate
* @param code
* @return
*/
@RequestMapping(value = "find/pay", method = RequestMethod.GET)
@ResponseBody
public ResultModel findPay(@CurrentAccount User loginAccount, @RequestParam String startDate,
......@@ -295,6 +301,14 @@ public class ContractController {
}
@RequestMapping(value = "codecheck", method = RequestMethod.GET)
@ResponseBody
public ResultModel codeCheck( @PathVariable String platform,String contractCode) {
return ResultModel.OK(service.contractCodeCheck(platform,contractCode));
}
}
......@@ -43,7 +43,7 @@ public class Contract {
private String type;
private Long priceName;
private Boolean old;
private Long extraFlow;
private Long extraFlow; // 优惠流量
private Long modifyAccount;
private Long createAccount;// 创建人id
......
......@@ -18,6 +18,7 @@ public class ContractChange {
private String ds;
private String type;
private String content;
private String marke; //备注
private Long level;
private Long money;
private Long user;
......@@ -167,4 +168,12 @@ public class ContractChange {
public void setLevelName(String levelName) {
this.levelName = levelName;
}
public String getMarke() {
return marke;
}
public void setMarke(String marke) {
this.marke = marke;
}
}
package common.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.util.Date;
@Entity
public class FlowChange {
private Long id;
private Long discountTimeLong; // 优惠时长
private Long discountFlow; // 优惠时长
private Long modifyUser;
private String modifyUname;
private String addDate;
private Date addTime;
private int DelFlag;
private String marke; //备注
private String contractCode;
private String email;
private String company;
public FlowChange() {
}
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getDiscountTimeLong() {
return discountTimeLong;
}
public void setDiscountTimeLong(Long discountTimeLong) {
this.discountTimeLong = discountTimeLong;
}
public Long getDiscountFlow() {
return discountFlow;
}
public void setDiscountFlow(Long discountFlow) {
this.discountFlow = discountFlow;
}
public Long getModifyUser() {
return modifyUser;
}
public void setModifyUser(Long modifyUser) {
this.modifyUser = modifyUser;
}
public String getModifyUname() {
return modifyUname;
}
public void setModifyUname(String modifyUname) {
this.modifyUname = modifyUname;
}
public String getAddDate() {
return addDate;
}
public void setAddDate(String addDate) {
this.addDate = addDate;
}
public Date getAddTime() {
return addTime;
}
public void setAddTime(Date addTime) {
this.addTime = addTime;
}
public int getDelFlag() {
return DelFlag;
}
public void setDelFlag(int delFlag) {
DelFlag = delFlag;
}
public String getContractCode() {
return contractCode;
}
public void setContractCode(String contractCode) {
this.contractCode = contractCode;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public String getMarke() {
return marke;
}
public void setMarke(String marke) {
this.marke = marke;
}
@Override
public String toString() {
return "FlowChange{" +
"id=" + id +
", discountTimeLong=" + discountTimeLong +
", discountFlow=" + discountFlow +
", modifyUser=" + modifyUser +
", modifyUname='" + modifyUname + '\'' +
", addDate='" + addDate + '\'' +
", addTime=" + addTime +
", DelFlag=" + DelFlag +
'}';
}
}
package common.repository;
import common.model.FlowChange;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
public interface FlowChangeRepository extends JpaRepository<FlowChange, Long> {
@Query(value = "",nativeQuery = true)
List<FlowChange> findByDs(String startDate, String endDate, String code);
}
......@@ -37,7 +37,7 @@ public interface ContractService {
ContractMoney pay(User loginUser, ContractMoney resource);
Contract change(User loginUser, ContractChange resource);
Contract change(User loginUser, ContractChange resource, FlowChange flowChange);
List<ContractMoney> findPay(String startDate, String endDate, String code);
......@@ -58,4 +58,6 @@ public interface ContractService {
// List<Contract> findAllContract(User loginAccount, String startDate, String endDate, String platform, String contractId);
Contract contractStatusUpdate(String platform, String contractId, String status);
Map contractCodeCheck(String platform, String contractCode);
}
\ 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