增加-预付款充值和消费的功能
This commit is contained in:
@@ -158,6 +158,56 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
||||
new Timestamp(System.currentTimeMillis())
|
||||
, tipType, "更新供应商ID为 "+ model.getSupplierID() + " " + tipMsg + "!", "更新供应商" + tipMsg));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新供应商-只更新预付款,其余用原来的值
|
||||
* @return
|
||||
*/
|
||||
public void updateAdvanceIn()
|
||||
{
|
||||
Boolean flag = false;
|
||||
try
|
||||
{
|
||||
Supplier supplier = supplierService.get(model.getSupplierID());
|
||||
supplier.setContacts(supplier.getContacts());
|
||||
supplier.setType(supplier.getType());
|
||||
supplier.setDescription(supplier.getDescription());
|
||||
supplier.setEmail(supplier.getEmail());
|
||||
supplier.setAdvanceIn(supplier.getAdvanceIn() + model.getAdvanceIn()); //增加预收款的金额,可能增加的是负值
|
||||
supplier.setBeginNeedGet(supplier.getBeginNeedGet());
|
||||
supplier.setBeginNeedPay(supplier.getBeginNeedPay());
|
||||
supplier.setIsystem((short)1);
|
||||
supplier.setPhonenum(supplier.getPhonenum());
|
||||
supplier.setSupplier(supplier.getSupplier());
|
||||
supplier.setEnabled(supplier.getEnabled());
|
||||
supplierService.update(supplier);
|
||||
|
||||
flag = true;
|
||||
tipMsg = "成功";
|
||||
tipType = 0;
|
||||
}
|
||||
catch (DataAccessException e)
|
||||
{
|
||||
Log.errorFileSync(">>>>>>>>>>>>>修改供应商ID为 : " + model.getSupplierID() + "信息失败", e);
|
||||
flag = false;
|
||||
tipMsg = "失败";
|
||||
tipType = 1;
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
toClient(flag.toString());
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
Log.errorFileSync(">>>>>>>>>>>>修改供应商回写客户端结果异常", e);
|
||||
}
|
||||
}
|
||||
logService.create(new Logdetails(getUser(), "更新供应商预付款", model.getClientIp(),
|
||||
new Timestamp(System.currentTimeMillis())
|
||||
, tipType, "更新供应商ID为 "+ model.getSupplierID() + " " + tipMsg + "!", "更新供应商" + tipMsg));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除指定ID供应商
|
||||
@@ -244,6 +294,7 @@ public class SupplierAction extends BaseAction<SupplierModel>
|
||||
item.put("contacts",supplier.getContacts());
|
||||
item.put("phonenum", supplier.getPhonenum());
|
||||
item.put("email", supplier.getEmail());
|
||||
item.put("AdvanceIn",supplier.getAdvanceIn());
|
||||
item.put("BeginNeedGet",supplier.getBeginNeedGet());
|
||||
item.put("BeginNeedPay",supplier.getBeginNeedPay());
|
||||
item.put("isystem", supplier.getIsystem() == (short)0?"是":"否");
|
||||
|
||||
@@ -92,6 +92,7 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel>
|
||||
depotHead.setChangeAmount(model.getChangeAmount());
|
||||
if(model.getAllocationProjectId()!=null){depotHead.setAllocationProjectId(new Depot(model.getAllocationProjectId()));}
|
||||
depotHead.setTotalPrice(model.getTotalPrice());
|
||||
depotHead.setPayType(model.getPayType());
|
||||
depotHead.setRemark(model.getRemark());
|
||||
depotHeadService.create(depotHead);
|
||||
|
||||
@@ -181,7 +182,8 @@ public class DepotHeadAction extends BaseAction<DepotHeadModel>
|
||||
if(model.getAccountId()!=null){depotHead.setAccountId(new Account(model.getAccountId()));}
|
||||
depotHead.setChangeAmount(model.getChangeAmount());
|
||||
if(model.getAllocationProjectId()!=null){depotHead.setAllocationProjectId(new Depot(model.getAllocationProjectId()));}
|
||||
depotHead.setTotalPrice(model.getTotalPrice());
|
||||
depotHead.setTotalPrice(model.getTotalPrice());
|
||||
depotHead.setPayType(model.getPayType());
|
||||
depotHead.setRemark(model.getRemark());
|
||||
depotHeadService.update(depotHead);
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@ package com.jsh.dao.basic;
|
||||
|
||||
import com.jsh.base.BaseDAO;
|
||||
import com.jsh.model.po.Supplier;
|
||||
import com.jsh.util.PageUtil;
|
||||
import com.jsh.util.SearchConditionUtil;
|
||||
import org.hibernate.Query;
|
||||
|
||||
public class SupplierDAO extends BaseDAO<Supplier> implements SupplierIDAO
|
||||
{
|
||||
@@ -14,6 +17,5 @@ public class SupplierDAO extends BaseDAO<Supplier> implements SupplierIDAO
|
||||
{
|
||||
return Supplier.class;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,5 +5,4 @@ import com.jsh.model.po.Supplier;
|
||||
|
||||
public interface SupplierIDAO extends BaseIDAO<Supplier>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ public class DepotHead implements java.io.Serializable
|
||||
private Double ChangeAmount;
|
||||
private Depot AllocationProjectId;
|
||||
private Double TotalPrice;
|
||||
private String PayType;
|
||||
private String Remark;
|
||||
|
||||
public DepotHead()
|
||||
@@ -34,7 +35,7 @@ public class DepotHead implements java.io.Serializable
|
||||
public DepotHead(String type, String subType, Depot projectId,
|
||||
String number, String operPersonName, Timestamp createTime,
|
||||
Timestamp operTime, Supplier organId, Person handsPersonId,
|
||||
Account accountId, Double changeAmount, Depot allocationProjectId, Double totalPrice, String remark) {
|
||||
Account accountId, Double changeAmount, Depot allocationProjectId, Double totalPrice,String payType, String remark) {
|
||||
super();
|
||||
Type = type;
|
||||
SubType = subType;
|
||||
@@ -49,6 +50,7 @@ public class DepotHead implements java.io.Serializable
|
||||
ChangeAmount = changeAmount;
|
||||
AllocationProjectId = allocationProjectId;
|
||||
TotalPrice = totalPrice;
|
||||
PayType = payType;
|
||||
Remark = remark;
|
||||
}
|
||||
|
||||
@@ -164,6 +166,14 @@ public class DepotHead implements java.io.Serializable
|
||||
TotalPrice = totalPrice;
|
||||
}
|
||||
|
||||
public String getPayType() {
|
||||
return PayType;
|
||||
}
|
||||
|
||||
public void setPayType(String payType) {
|
||||
PayType = payType;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return Remark;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ public class Supplier implements java.io.Serializable
|
||||
private String contacts;
|
||||
private String phonenum;
|
||||
private String email;
|
||||
private Double advanceIn;
|
||||
private Double BeginNeedGet;
|
||||
private Double BeginNeedPay;
|
||||
private Double AllNeedGet;
|
||||
@@ -28,7 +29,7 @@ public class Supplier implements java.io.Serializable
|
||||
}
|
||||
|
||||
public Supplier(String supplier, String type, String contacts, String phonenum,
|
||||
String email, Short isystem, String description, Boolean enabled,
|
||||
String email, Short isystem, String description, Boolean enabled, Double advanceIn,
|
||||
Double beginNeedGet,Double beginNeedPay,Double allNeedGet,Double allNeedPay) {
|
||||
super();
|
||||
this.supplier = supplier;
|
||||
@@ -43,6 +44,7 @@ public class Supplier implements java.io.Serializable
|
||||
this.isystem = isystem;
|
||||
this.description = description;
|
||||
this.enabled = enabled;
|
||||
this.advanceIn = advanceIn;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
@@ -158,6 +160,13 @@ public class Supplier implements java.io.Serializable
|
||||
|
||||
public void setEnabled(Boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Double getAdvanceIn() {
|
||||
return advanceIn;
|
||||
}
|
||||
|
||||
public void setAdvanceIn(Double advanceIn) {
|
||||
this.advanceIn = advanceIn;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,12 +31,17 @@ public class SupplierModel implements Serializable
|
||||
/**
|
||||
* 电子邮箱
|
||||
*/
|
||||
private String email = "";
|
||||
|
||||
/**
|
||||
* 期初应收
|
||||
private String email = "";
|
||||
|
||||
/**
|
||||
* 预付款
|
||||
*/
|
||||
private Double BeginNeedGet;
|
||||
private Double AdvanceIn;
|
||||
|
||||
/**
|
||||
* 期初应收
|
||||
*/
|
||||
private Double BeginNeedGet;
|
||||
|
||||
/**
|
||||
* 期初应付
|
||||
@@ -135,6 +140,14 @@ public class SupplierModel implements Serializable
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public Double getAdvanceIn() {
|
||||
return AdvanceIn;
|
||||
}
|
||||
|
||||
public void setAdvanceIn(Double advanceIn) {
|
||||
AdvanceIn = advanceIn;
|
||||
}
|
||||
|
||||
public void setBeginNeedGet(Double beginNeedGet)
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@ public class DepotHeadModel implements Serializable
|
||||
private Double ChangeAmount;
|
||||
private Long AllocationProjectId;
|
||||
private Double TotalPrice;
|
||||
private String PayType = "";
|
||||
private String Remark = "";
|
||||
|
||||
private String BeginTime; //查询开始时间
|
||||
@@ -158,6 +159,14 @@ public class DepotHeadModel implements Serializable
|
||||
TotalPrice = totalPrice;
|
||||
}
|
||||
|
||||
public String getPayType() {
|
||||
return PayType;
|
||||
}
|
||||
|
||||
public void setPayType(String payType) {
|
||||
PayType = payType;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return Remark;
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@ import com.jsh.model.po.Supplier;
|
||||
|
||||
public interface SupplierIService extends BaseIService<Supplier>
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.jsh.service.basic;
|
||||
import com.jsh.base.BaseService;
|
||||
import com.jsh.dao.basic.SupplierIDAO;
|
||||
import com.jsh.model.po.Supplier;
|
||||
import com.jsh.util.JshException;
|
||||
|
||||
public class SupplierService extends BaseService<Supplier> implements SupplierIService
|
||||
{
|
||||
@@ -22,4 +23,5 @@ public class SupplierService extends BaseService<Supplier> implements SupplierIS
|
||||
{
|
||||
return Supplier.class;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user