Commit 97caee98 by manxiaoqiang

合同

parent 70849a07
package common.controller;
import common.model.Contract;
import common.model.Menu;
import common.model.User;
import common.model.*;
import common.service.ContractService;
import common.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -74,4 +72,42 @@ public class ContractController {
public ResultModel create(@CurrentAccount User loginAccount, @RequestBody Contract contract) {
return ResultModel.OK(service.create(loginAccount, contract));
}
@RequestMapping(value = "update", method = RequestMethod.PUT)
@ResponseBody
public ResultModel update(@CurrentAccount User loginAccount, @RequestBody Contract contract) {
return ResultModel.OK(service.update(loginAccount, contract));
}
@RequestMapping(value = "pay", method = RequestMethod.POST)
@ResponseBody
public ResultModel pay(@CurrentAccount User loginAccount, @RequestBody ContractMoney contract) {
return ResultModel.OK(service.pay(loginAccount, contract));
}
@RequestMapping(value = "change", method = RequestMethod.POST)
@ResponseBody
public ResultModel change(@CurrentAccount User loginAccount, @RequestBody ContractChange contract) {
return ResultModel.OK(service.change(loginAccount, contract));
}
@RequestMapping(value = "find/pay", method = RequestMethod.GET)
@ResponseBody
public ResultModel findPay(@CurrentAccount User loginAccount, @RequestParam String startDate,
@RequestParam String endDate, @RequestParam String code) {
return ResultModel.OK(service.findPay(startDate, endDate, code));
}
@RequestMapping(value = "find/change", method = RequestMethod.GET)
@ResponseBody
public ResultModel findChange(@CurrentAccount User loginAccount, @RequestParam String startDate,
@RequestParam String endDate, @RequestParam String code) {
return ResultModel.OK(service.findChange(startDate, endDate, code));
}
@RequestMapping(value = "update/pay", method = RequestMethod.PUT)
@ResponseBody
public ResultModel updatePay(@CurrentAccount User loginAccount, @RequestBody ContractMoney contract) {
return ResultModel.OK(service.updatePay(loginAccount, contract));
}
}
......@@ -30,6 +30,8 @@ public class Contract {
private String saleName;
private String priceLevelName;
private Long payMoney;
private Long invoice;
private String createName;
private Long modifyAccount;
private Long createAccount;
......@@ -215,6 +217,14 @@ public class Contract {
this.payMoney = payMoney;
}
public Long getInvoice() {
return invoice;
}
public void setInvoice(Long invoice) {
this.invoice = invoice;
}
@Transient
public String getSaleName() {
return saleName;
......@@ -232,6 +242,14 @@ public class Contract {
this.priceLevelName = priceLevelName;
}
public String getCreateName() {
return createName;
}
public void setCreateName(String createName) {
this.createName = createName;
}
@Override
public String toString() {
return "Contract{" +
......
package common.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.util.Date;
/**
* Created by mxq on 2018/1/18.
*/
@Entity
public class ContractChange {
private Long id;
private String contractCode;
private String email;
private String company;
private String ds;
private String type;
private String content;
private Long level;
private Long money;
private Long user;
private String createName;
private Long modifyAccount;
private Long createAccount;
private Date modifyTime;
private Date createTime;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getDs() {
return ds;
}
public void setDs(String ds) {
this.ds = ds;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Long getUser() {
return user;
}
public void setUser(Long user) {
this.user = user;
}
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 Long getModifyAccount() {
return modifyAccount;
}
public void setModifyAccount(Long modifyAccount) {
this.modifyAccount = modifyAccount;
}
public Long getCreateAccount() {
return createAccount;
}
public void setCreateAccount(Long createAccount) {
this.createAccount = createAccount;
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Long getLevel() {
return level;
}
public void setLevel(Long level) {
this.level = level;
}
public Long getMoney() {
return money;
}
public void setMoney(Long money) {
this.money = money;
}
public String getCreateName() {
return createName;
}
public void setCreateName(String createName) {
this.createName = createName;
}
}
package common.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.util.Date;
/**
* Created by mxq on 2018/1/18.
*/
@Entity
public class ContractMoney {
private Long id;
private String contractCode;
private String email;
private String company;
private String ds;
private String type;
private Long money;
private Long user;
private String createName;
private Long modifyAccount;
private Long createAccount;
private Date modifyTime;
private Date createTime;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getContractCode() {
return contractCode;
}
public void setContractCode(String contractCode) {
this.contractCode = contractCode;
}
public String getDs() {
return ds;
}
public void setDs(String ds) {
this.ds = ds;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Long getMoney() {
return money;
}
public void setMoney(Long money) {
this.money = money;
}
public Long getUser() {
return user;
}
public void setUser(Long user) {
this.user = user;
}
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 Long getModifyAccount() {
return modifyAccount;
}
public void setModifyAccount(Long modifyAccount) {
this.modifyAccount = modifyAccount;
}
public Long getCreateAccount() {
return createAccount;
}
public void setCreateAccount(Long createAccount) {
this.createAccount = createAccount;
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getCreateName() {
return createName;
}
public void setCreateName(String createName) {
this.createName = createName;
}
}
package common.repository;
import common.model.Contract;
import common.model.ContractChange;
import common.model.ContractMoney;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigInteger;
import java.util.List;
@Transactional
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)
List<ContractChange> findByDs(String startDate, String endDate, String code);
}
package common.repository;
import common.model.Contract;
import common.model.ContractChange;
import common.model.ContractMoney;
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 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)
List<ContractMoney> findByDs(String startDate, String endDate, String code);
}
......@@ -20,4 +20,7 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query(value="select * from contract where ds >= ?1 and ds <= ?2 order by ds desc",nativeQuery=true)
List<Contract> findByDs(String startDate, String endDate);
@Query(value="select * from contract where contract_code = ?1",nativeQuery=true)
Contract findByCode(String contract_code);
}
package common.service;
import common.model.Contract;
import common.model.ContractBody;
import common.model.User;
import common.model.*;
import tkio.model.PackageType;
import java.util.List;
......@@ -31,4 +29,13 @@ public interface ContractService {
List<Contract> findAll(String startDate, String endDate);
ContractMoney pay(User loginUser, ContractMoney resource);
Contract change(User loginUser, ContractChange resource);
List<ContractMoney> findPay(String startDate, String endDate, String code);
List<ContractChange> findChange(String startDate, String endDate, String code);
Contract updatePay(User loginUser, ContractMoney resource);
}
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