Commit 5e05f53a authored by 季圣华's avatar 季圣华
Browse files

更新后端代码

parent b9bc613c
......@@ -5,6 +5,9 @@ public class Depot implements java.io.Serializable
{
private Long id;
private String name;
private String address;
private Double warehousing;
private Double truckage;
private Integer type;
private String sort;
private String remark;
......@@ -19,9 +22,12 @@ public class Depot implements java.io.Serializable
this.id = id ;
}
public Depot(String name,Integer type, String sort, String remark)
public Depot(String name, String address, Double warehousing, Double truckage, Integer type, String sort, String remark)
{
this.name = name;
this.address = address;
this.warehousing = warehousing;
this.truckage = truckage;
this.type = type;
this.sort = sort;
this.remark = remark;
......@@ -43,6 +49,30 @@ public class Depot implements java.io.Serializable
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public Double getWarehousing() {
return warehousing;
}
public void setWarehousing(Double warehousing) {
this.warehousing = warehousing;
}
public Double getTruckage() {
return truckage;
}
public void setTruckage(Double truckage) {
this.truckage = truckage;
}
public Integer getType() {
return type;
}
......
......@@ -9,17 +9,29 @@ public class DepotHead implements java.io.Serializable
private String Type;
private String SubType;
private Depot ProjectId;
private String DefaultNumber;
private String Number;
private String OperPersonName;
private Timestamp CreateTime;
private Timestamp OperTime;
private Supplier OrganId;
private Person HandsPersonId;
private String Salesman; //业务员(可以多个)[2][3]
private Account AccountId;
private Double ChangeAmount;
private String AccountIdList; //多账户ID列表 [2][3]
private String AccountMoneyList; //多账户金额列表 [{"[2]",22},{"[3]",33}]
private Double Discount; //优惠率 0.10
private Double DiscountMoney; //优惠金额 10
private Double DiscountLastMoney; //优惠后金额 90
private Double OtherMoney; //销售或采购费用 100
private String OtherMoneyList; //销售或采购费用涉及项目Id数组(包括快递、招待等)[2][3]
private String OtherMoneyItem; //销售费用涉及项目(包括快递、招待等) [{"[2]",22},{"[3]",33}]
private Integer AccountDay; //结算天数
private Depot AllocationProjectId;
private Double TotalPrice;
private String PayType;
private Boolean Status = false; //单据状态
private String Remark;
public DepotHead()
......@@ -32,25 +44,36 @@ public class DepotHead implements java.io.Serializable
this.Id = Id ;
}
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 payType, String remark) {
public DepotHead(String type, String subType, Depot projectId, String defaultNumber, String number, String operPersonName, Timestamp createTime,
Timestamp operTime, Supplier organId, Person handsPersonId, String salesman, String accountIdList,String accountMoneyList,
Double discount, Double discountMoney,Double discountLastMoney, Double otherMoney, String otherMoneyItem,Integer accountDay,
Account accountId, Double changeAmount, Depot allocationProjectId, Double totalPrice,String payType, Boolean status, String remark) {
super();
Type = type;
SubType = subType;
ProjectId = projectId;
DefaultNumber = defaultNumber;
Number = number;
OperPersonName = operPersonName;
CreateTime = createTime;
OperTime = operTime;
OrganId = organId;
HandsPersonId = handsPersonId;
Salesman= salesman;
AccountIdList= accountIdList;
AccountMoneyList= accountMoneyList;
Discount= discount;
DiscountMoney = discountMoney;
DiscountLastMoney = discountLastMoney;
OtherMoney = otherMoney;
OtherMoneyItem = otherMoneyItem;
AccountDay = accountDay;
AccountId = accountId;
ChangeAmount = changeAmount;
AllocationProjectId = allocationProjectId;
TotalPrice = totalPrice;
PayType = payType;
Status = status;
Remark = remark;
}
......@@ -86,6 +109,14 @@ public class DepotHead implements java.io.Serializable
ProjectId = projectId;
}
public String getDefaultNumber() {
return DefaultNumber;
}
public void setDefaultNumber(String defaultNumber) {
DefaultNumber = defaultNumber;
}
public String getNumber() {
return Number;
}
......@@ -181,4 +212,92 @@ public class DepotHead implements java.io.Serializable
public void setRemark(String remark) {
Remark = remark;
}
public String getSalesman() {
return Salesman;
}
public void setSalesman(String salesman) {
Salesman = salesman;
}
public String getAccountIdList() {
return AccountIdList;
}
public void setAccountIdList(String accountIdList) {
AccountIdList = accountIdList;
}
public String getAccountMoneyList() {
return AccountMoneyList;
}
public void setAccountMoneyList(String accountMoneyList) {
AccountMoneyList = accountMoneyList;
}
public Double getDiscount() {
return Discount;
}
public void setDiscount(Double discount) {
Discount = discount;
}
public Double getDiscountMoney() {
return DiscountMoney;
}
public void setDiscountMoney(Double discountMoney) {
DiscountMoney = discountMoney;
}
public Double getDiscountLastMoney() {
return DiscountLastMoney;
}
public void setDiscountLastMoney(Double discountLastMoney) {
DiscountLastMoney = discountLastMoney;
}
public Double getOtherMoney() {
return OtherMoney;
}
public void setOtherMoney(Double otherMoney) {
OtherMoney = otherMoney;
}
public String getOtherMoneyList() {
return OtherMoneyList;
}
public void setOtherMoneyList(String otherMoneyList) {
OtherMoneyList = otherMoneyList;
}
public String getOtherMoneyItem() {
return OtherMoneyItem;
}
public void setOtherMoneyItem(String otherMoneyItem) {
OtherMoneyItem = otherMoneyItem;
}
public Integer getAccountDay() {
return AccountDay;
}
public void setAccountDay(Integer accountDay) {
AccountDay = accountDay;
}
public Boolean getStatus() {
return Status;
}
public void setStatus(Boolean status) {
Status = status;
}
}
\ No newline at end of file
......@@ -6,11 +6,25 @@ public class DepotItem implements java.io.Serializable
private Long Id;
private DepotHead HeaderId;
private Material MaterialId;
private String MUnit; //计量单位
private Double OperNumber;
private Double BasicNumber;
private Double UnitPrice;
private Double TaxUnitPrice; //含税单价
private Double AllPrice;
private String Remark;
private String Img;
private Depot DepotId; //仓库ID
private Depot AnotherDepotId; //对方仓库Id
private Double TaxRate; //税率
private Double TaxMoney; //税额
private Double TaxLastMoney; //价税合计
private String OtherField1; //自定义字段1-品名
private String OtherField2; //自定义字段2-型号
private String OtherField3; //自定义字段3-制造商
private String OtherField4; //自定义字段4
private String OtherField5; //自定义字段5
public DepotItem()
{
......@@ -22,17 +36,31 @@ public class DepotItem implements java.io.Serializable
this.Id = Id ;
}
public DepotItem(DepotHead headerId, Material materialId,
Double operNumber, Double unitPrice, Double allPrice,
String remark, String img) {
public DepotItem(DepotHead headerId, Material materialId, String mUnit,
Double operNumber, Double basicNumber, Double unitPrice, Double taxUnitPrice, Double allPrice, String remark, String img,
Depot depotId, Depot anotherDepotId, Double taxRate, Double taxMoney, Double taxLastMoney,
String otherField1, String otherField2, String otherField3, String otherField4, String otherField5) {
super();
HeaderId = headerId;
MaterialId = materialId;
MUnit = mUnit;
OperNumber = operNumber;
BasicNumber = basicNumber;
UnitPrice = unitPrice;
TaxUnitPrice = taxUnitPrice;
AllPrice = allPrice;
Remark = remark;
Img = img;
DepotId = depotId;
AnotherDepotId = anotherDepotId;
TaxRate = taxRate;
TaxMoney = taxMoney;
TaxLastMoney = taxLastMoney;
OtherField1 = otherField1;
OtherField2 = otherField2;
OtherField3 = otherField3;
OtherField4 = otherField4;
OtherField5 = otherField5;
}
public Long getId() {
......@@ -59,6 +87,22 @@ public class DepotItem implements java.io.Serializable
MaterialId = materialId;
}
public String getMUnit() {
return MUnit;
}
public void setMUnit(String MUnit) {
this.MUnit = MUnit;
}
public Double getTaxUnitPrice() {
return TaxUnitPrice;
}
public void setTaxUnitPrice(Double taxUnitPrice) {
TaxUnitPrice = taxUnitPrice;
}
public Double getOperNumber() {
return OperNumber;
}
......@@ -67,6 +111,14 @@ public class DepotItem implements java.io.Serializable
OperNumber = operNumber;
}
public Double getBasicNumber() {
return BasicNumber;
}
public void setBasicNumber(Double basicNumber) {
BasicNumber = basicNumber;
}
public Double getUnitPrice() {
return UnitPrice;
}
......@@ -99,5 +151,83 @@ public class DepotItem implements java.io.Serializable
Img = img;
}
public Depot getDepotId() {
return DepotId;
}
public void setDepotId(Depot depotId) {
DepotId = depotId;
}
public Depot getAnotherDepotId() {
return AnotherDepotId;
}
public void setAnotherDepotId(Depot anotherDepotId) {
AnotherDepotId = anotherDepotId;
}
public Double getTaxRate() {
return TaxRate;
}
public void setTaxRate(Double taxRate) {
TaxRate = taxRate;
}
public Double getTaxMoney() {
return TaxMoney;
}
public void setTaxMoney(Double taxMoney) {
TaxMoney = taxMoney;
}
public Double getTaxLastMoney() {
return TaxLastMoney;
}
public void setTaxLastMoney(Double taxLastMoney) {
TaxLastMoney = taxLastMoney;
}
public String getOtherField1() {
return OtherField1;
}
public void setOtherField1(String otherField1) {
OtherField1 = otherField1;
}
public String getOtherField2() {
return OtherField2;
}
public void setOtherField2(String otherField2) {
OtherField2 = otherField2;
}
public String getOtherField3() {
return OtherField3;
}
public void setOtherField3(String otherField3) {
OtherField3 = otherField3;
}
public String getOtherField4() {
return OtherField4;
}
public void setOtherField4(String otherField4) {
OtherField4 = otherField4;
}
public String getOtherField5() {
return OtherField5;
}
public void setOtherField5(String otherField5) {
OtherField5 = otherField5;
}
}
......@@ -12,6 +12,7 @@ public class Functions implements java.io.Serializable
private String Sort;
private Boolean Enabled;
private String Type;
private String PushBtn;
public Functions()
{
......@@ -90,4 +91,11 @@ public class Functions implements java.io.Serializable
Type = type;
}
public String getPushBtn() {
return PushBtn;
}
public void setPushBtn(String pushBtn) {
PushBtn = pushBtn;
}
}
\ No newline at end of file
package com.jsh.model.po;
import java.util.Map;
@SuppressWarnings("serial")
public class Material implements java.io.Serializable
{
private Long Id;
private MaterialCategory materialCategory;
private String Name;
private String Mfrs;
private Double Packing;
private Double SafetyStock;
private String Model;
private String Standard;
private String Color;
......@@ -14,7 +19,25 @@ public class Material implements java.io.Serializable
private Double LowPrice;
private Double PresetPriceOne;
private Double PresetPriceTwo;
private Unit UnitId;
private String FirstOutUnit;
private String FirstInUnit;
private String PriceStrategy;
private String Remark;
private Boolean Enabled;
//----------以下属性导入exel表格使用--------------------
/**
* 类型 right--正确 warn--警告 wrong--错误
*/
private Map<Integer,String> cellInfo;
/**
* 行号
*/
private Integer rowLineNum;
private String safetyStockStr;
public Material()
{
......@@ -26,13 +49,16 @@ public class Material implements java.io.Serializable
this.Id = Id;
}
public Material(MaterialCategory materialCategory, String name,
String model, String standard, String color, String unit, String remark,
Double retailPrice, Double lowPrice, Double presetPriceOne, Double presetPriceTwo)
{
public Material(MaterialCategory materialCategory, String name, String mfrs, Double packing,
Double safetyStock, String model, String standard, String color, String unit, String remark,
Double retailPrice, Double lowPrice, Double presetPriceOne, Double presetPriceTwo,
Unit unitId, String firstOutUnit, String firstInUnit, String priceStrategy, Boolean enabled) {
super();
this.materialCategory = materialCategory;
Name = name;
Mfrs = mfrs;
Packing = packing;
SafetyStock = safetyStock;
Model = model;
Standard = standard;
Color = color;
......@@ -42,6 +68,11 @@ public class Material implements java.io.Serializable
PresetPriceOne = presetPriceOne;
PresetPriceTwo = presetPriceTwo;
Remark = remark;
UnitId = unitId;
FirstOutUnit = firstOutUnit;
FirstInUnit = firstInUnit;
PriceStrategy = priceStrategy;
Enabled = enabled;
}
public Long getId()
......@@ -102,13 +133,11 @@ public class Material implements java.io.Serializable
Color = color;
}
public String getUnit()
{
public String getUnit() {
return Unit;
}
public void setUnit(String unit)
{
public void setUnit(String unit) {
Unit = unit;
}
......@@ -162,4 +191,91 @@ public class Material implements java.io.Serializable
Remark = remark;
}
public String getMfrs() {
return Mfrs;
}
public void setMfrs(String mfrs) {
Mfrs = mfrs;
}
public Double getPacking() {
return Packing;
}
public void setPacking(Double packing) {
Packing = packing;
}
public Double getSafetyStock() {
return SafetyStock;
}
public void setSafetyStock(Double safetyStock) {
SafetyStock = safetyStock;
}
public Unit getUnitId() {
return UnitId;
}
public void setUnitId(Unit unitId) {
UnitId = unitId;
}
public String getFirstOutUnit() {
return FirstOutUnit;
}
public void setFirstOutUnit(String firstOutUnit) {
FirstOutUnit = firstOutUnit;
}
public String getFirstInUnit() {
return FirstInUnit;
}
public void setFirstInUnit(String firstInUnit) {
FirstInUnit = firstInUnit;
}
public String getPriceStrategy() {
return PriceStrategy;
}
public void setPriceStrategy(String priceStrategy) {
PriceStrategy = priceStrategy;
}
public Boolean getEnabled() {
return Enabled;
}
public void setEnabled(Boolean enabled) {
Enabled = enabled;
}
public Map<Integer, String> getCellInfo() {
return cellInfo;
}
public void setCellInfo(Map<Integer, String> cellInfo) {
this.cellInfo = cellInfo;
}
public Integer getRowLineNum() {
return rowLineNum;
}
public void setRowLineNum(Integer rowLineNum) {
this.rowLineNum = rowLineNum;
}
public String getSafetyStockStr() {
return safetyStockStr;
}
public void setSafetyStockStr(String safetyStockStr) {
this.safetyStockStr = safetyStockStr;
}
}
package com.jsh.model.po;
import java.util.Map;
@SuppressWarnings("serial")
public class Supplier implements java.io.Serializable
{
private Long id;
private String supplier;
private String type;
private String contacts;
private String phonenum;
private String email;
private Double advanceIn;
private Double BeginNeedGet;
private Double BeginNeedPay;
private Double AllNeedGet;
private Double AllNeedPay;
private Short isystem;
private String description;
private Boolean enabled;
private Long id =0l;
private String supplier = "";
private String type = "";
private String contacts = "";
private String phonenum = "";
private String fax = "";
private String telephone = "";
private String email = "";
private String address = "";
private Double advanceIn = 0d;
private String taxNum = "";
private String bankName = "";
private String accountNumber = "";
private Double taxRate = 0d;
private Double BeginNeedGet = 0d;
private Double BeginNeedPay = 0d;
private Double AllNeedGet = 0d;
private Double AllNeedPay = 0d;
private Short isystem = 1;
private String description = "";
private Boolean enabled = true;
//----------以下属性导入exel表格使用--------------------
/**
* 类型 right--正确 warn--警告 wrong--错误
*/
private Map<Integer,String> cellInfo;
/**
* 行号
*/
private Integer rowLineNum;
private String advanceInStr;
private String beginNeedGetStr;
private String beginNeedPayStr;
private String taxRateStr;
private String enabledStr;
public Supplier()
{
......@@ -29,13 +60,17 @@ 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, Double advanceIn,
String fax,String telephone, String email, String address, Short isystem, String description,
Boolean enabled, Double advanceIn, String taxNum,String bankName,String accountNumber, Double taxRate,
Double beginNeedGet,Double beginNeedPay,Double allNeedGet,Double allNeedPay) {
super();
this.supplier = supplier;
this.type = type;
this.contacts = contacts;
this.phonenum = phonenum;
this.fax = fax;
this.telephone = telephone;
this.address = address;
this.email = email;
this.BeginNeedGet = beginNeedGet;
this.BeginNeedPay = beginNeedPay;
......@@ -45,6 +80,10 @@ public class Supplier implements java.io.Serializable
this.description = description;
this.enabled = enabled;
this.advanceIn = advanceIn;
this.taxNum = taxNum;
this.bankName = bankName;
this.accountNumber = accountNumber;
this.taxRate = taxRate;
}
public Long getId()
......@@ -169,4 +208,116 @@ public class Supplier implements java.io.Serializable
public void setAdvanceIn(Double advanceIn) {
this.advanceIn = advanceIn;
}
public String getFax() {
return fax;
}
public void setFax(String fax) {
this.fax = fax;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getTaxNum() {
return taxNum;
}
public void setTaxNum(String taxNum) {
this.taxNum = taxNum;
}
public String getBankName() {
return bankName;
}
public void setBankName(String bankName) {
this.bankName = bankName;
}
public String getAccountNumber() {
return accountNumber;
}
public void setAccountNumber(String accountNumber) {
this.accountNumber = accountNumber;
}
public Double getTaxRate() {
return taxRate;
}
public void setTaxRate(Double taxRate) {
this.taxRate = taxRate;
}
public Map<Integer, String> getCellInfo() {
return cellInfo;
}
public void setCellInfo(Map<Integer, String> cellInfo) {
this.cellInfo = cellInfo;
}
public Integer getRowLineNum() {
return rowLineNum;
}
public void setRowLineNum(Integer rowLineNum) {
this.rowLineNum = rowLineNum;
}
public String getAdvanceInStr() {
return advanceInStr;
}
public void setAdvanceInStr(String advanceInStr) {
this.advanceInStr = advanceInStr;
}
public String getBeginNeedGetStr() {
return beginNeedGetStr;
}
public void setBeginNeedGetStr(String beginNeedGetStr) {
this.beginNeedGetStr = beginNeedGetStr;
}
public String getBeginNeedPayStr() {
return beginNeedPayStr;
}
public void setBeginNeedPayStr(String beginNeedPayStr) {
this.beginNeedPayStr = beginNeedPayStr;
}
public String getTaxRateStr() {
return taxRateStr;
}
public void setTaxRateStr(String taxRateStr) {
this.taxRateStr = taxRateStr;
}
public String getEnabledStr() {
return enabledStr;
}
public void setEnabledStr(String enabledStr) {
this.enabledStr = enabledStr;
}
}
package com.jsh.model.po;
@SuppressWarnings("serial")
public class Unit implements java.io.Serializable
{
private Long id;
private String UName;
public Unit()
{
}
public Unit(Long id) {
this.id = id;
}
public Unit(String UName)
{
this.UName = UName;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUName() {
return UName;
}
public void setUName(String UName) {
this.UName = UName;
}
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ public class UserBusiness implements java.io.Serializable
private String Type;
private String KeyId;
private String Value;
private String BtnStr;
public UserBusiness()
{
......@@ -45,5 +46,11 @@ public class UserBusiness implements java.io.Serializable
Value = value;
}
public String getBtnStr() {
return BtnStr;
}
public void setBtnStr(String btnStr) {
BtnStr = btnStr;
}
}
\ No newline at end of file
......@@ -13,6 +13,10 @@ public class DepotModel implements Serializable
*/
private String name = "";
private String address = ""; //仓库地址
private Double warehousing; //仓储费
private Double truckage; //搬运费
/**
* 排序
*/
......@@ -79,6 +83,30 @@ public class DepotModel implements Serializable
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public Double getWarehousing() {
return warehousing;
}
public void setWarehousing(Double warehousing) {
this.warehousing = warehousing;
}
public Double getTruckage() {
return truckage;
}
public void setTruckage(Double truckage) {
this.truckage = truckage;
}
public Integer getType() {
return type;
}
......
......@@ -40,6 +40,10 @@ public class FunctionsModel implements Serializable
* 类型
*/
private String Type = "";
/**
* 功能按钮
*/
private String PushBtn = "";
/**
* 拥有的功能列表
*/
......@@ -215,5 +219,11 @@ public class FunctionsModel implements Serializable
this.hasFunctions = hasFunctions;
}
public String getPushBtn() {
return PushBtn;
}
public void setPushBtn(String pushBtn) {
PushBtn = pushBtn;
}
}
package com.jsh.model.vo.basic;
import java.io.File;
import java.io.InputStream;
import java.io.Serializable;
@SuppressWarnings("serial")
......@@ -9,7 +11,7 @@ public class SupplierModel implements Serializable
/**======开始接受页面参数=================**/
/**
* 供应商名称
* 名称
*/
private String supplier = "";
......@@ -63,6 +65,23 @@ public class SupplierModel implements Serializable
*/
private String description = "";
private String fax = "";
private String telephone = "";
private String address = "";
private String taxNum = "";
private String bankName = "";
private String accountNumber = "";
private Double taxRate;
private String UBType = ""; //UBType,UserBusiness类型
private String UBKeyId = ""; //UBKeyId,UserBusiness关键id
/**
* 导入excel文件
*/
private File supplierFile;
/**
* 启用
*/
......@@ -92,6 +111,9 @@ public class SupplierModel implements Serializable
* 用户IP,用户记录操作日志
*/
private String clientIp = "";
private String browserType = ""; //浏览器类型
private String fileName = ""; //文件名称
private InputStream excelStream; //输入流,导出excel文件
public SupplierShowModel getShowModel() {
return showModel;
......@@ -245,6 +267,107 @@ public class SupplierModel implements Serializable
this.clientIp = clientIp;
}
public String getFax() {
return fax;
}
public void setFax(String fax) {
this.fax = fax;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getTaxNum() {
return taxNum;
}
public void setTaxNum(String taxNum) {
this.taxNum = taxNum;
}
public String getBankName() {
return bankName;
}
public void setBankName(String bankName) {
this.bankName = bankName;
}
public String getAccountNumber() {
return accountNumber;
}
public void setAccountNumber(String accountNumber) {
this.accountNumber = accountNumber;
}
public Double getTaxRate() {
return taxRate;
}
public void setTaxRate(Double taxRate) {
this.taxRate = taxRate;
}
public String getUBType() {
return UBType;
}
public void setUBType(String UBType) {
this.UBType = UBType;
}
public String getUBKeyId() {
return UBKeyId;
}
public void setUBKeyId(String UBKeyId) {
this.UBKeyId = UBKeyId;
}
public String getBrowserType() {
return browserType;
}
public void setBrowserType(String browserType) {
this.browserType = browserType;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public InputStream getExcelStream() {
return excelStream;
}
public void setExcelStream(InputStream excelStream) {
this.excelStream = excelStream;
}
public File getSupplierFile() {
return supplierFile;
}
public void setSupplierFile(File supplierFile) {
this.supplierFile = supplierFile;
}
}
package com.jsh.model.vo.basic;
import java.io.Serializable;
@SuppressWarnings("serial")
public class UnitModel implements Serializable
{
private DepotShowModel showModel = new DepotShowModel();
/**======开始接受页面参数=================**/
/**
* 名称
*/
private String UName = "";
/**
* ID
*/
private Long unitID = 0l;
/**
* IDs 批量操作使用
*/
private String unitIDs = "";
/**
* 每页显示的个数
*/
private int pageSize = 10;
/**
* 当前页码
*/
private int pageNo = 1;
/**
* 用户IP,用户记录操作日志
*/
private String clientIp = "";
public DepotShowModel getShowModel() {
return showModel;
}
public void setShowModel(DepotShowModel showModel) {
this.showModel = showModel;
}
public String getUName() {
return UName;
}
public void setUName(String UName) {
this.UName = UName;
}
public Long getUnitID() {
return unitID;
}
public void setUnitID(Long unitID) {
this.unitID = unitID;
}
public String getUnitIDs() {
return unitIDs;
}
public void setUnitIDs(String unitIDs) {
this.unitIDs = unitIDs;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getPageNo() {
return pageNo;
}
public void setPageNo(int pageNo) {
this.pageNo = pageNo;
}
public String getClientIp() {
return clientIp;
}
public void setClientIp(String clientIp) {
this.clientIp = clientIp;
}
}
package com.jsh.model.vo.basic;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@SuppressWarnings("serial")
public class UnitShowModel implements Serializable
{
/**
* 提示信息
*/
private String msgTip = "";
/**
* 系统数据
*/
@SuppressWarnings("rawtypes")
private Map<String,List> map = new HashMap<String,List>();
public String getMsgTip()
{
return msgTip;
}
public void setMsgTip(String msgTip)
{
this.msgTip = msgTip;
}
@SuppressWarnings("rawtypes")
public Map<String, List> getMap() {
return map;
}
@SuppressWarnings("rawtypes")
public void setMap(Map<String, List> map) {
this.map = map;
}
}
......@@ -23,6 +23,8 @@ public class UserBusinessModel implements Serializable
*/
private String Value = "";
private String BtnStr = "";
/**
* 分类ID
*/
......@@ -120,4 +122,11 @@ public class UserBusinessModel implements Serializable
this.clientIp = clientIp;
}
public String getBtnStr() {
return BtnStr;
}
public void setBtnStr(String btnStr) {
BtnStr = btnStr;
}
}
......@@ -12,6 +12,7 @@ public class DepotHeadModel implements Serializable
private String SubType = "";
private Long ProjectId;
private String DepotIds = "";
private String DefaultNumber = "";
private String Number = "";
private String OperPersonName = "";
private String OperTime;
......@@ -24,6 +25,18 @@ public class DepotHeadModel implements Serializable
private String PayType = "";
private String Remark = "";
private String Salesman;
private String AccountIdList;
private String AccountMoneyList;
private Double Discount;
private Double DiscountMoney;
private Double DiscountLastMoney;
private Double OtherMoney;
private String OtherMoneyList;
private String OtherMoneyItem;
private Integer AccountDay;
private Boolean Status = false; //单据状态
private String BeginTime; //查询开始时间
private String EndTime; //查询结束时间
private String MonthTime; //查询月份
......@@ -95,6 +108,14 @@ public class DepotHeadModel implements Serializable
DepotIds = depotIds;
}
public String getDefaultNumber() {
return DefaultNumber;
}
public void setDefaultNumber(String defaultNumber) {
DefaultNumber = defaultNumber;
}
public String getNumber() {
return Number;
}
......@@ -255,5 +276,91 @@ public class DepotHeadModel implements Serializable
this.supplierId = supplierId;
}
public String getSalesman() {
return Salesman;
}
public void setSalesman(String salesman) {
Salesman = salesman;
}
public String getAccountIdList() {
return AccountIdList;
}
public void setAccountIdList(String accountIdList) {
AccountIdList = accountIdList;
}
public String getAccountMoneyList() {
return AccountMoneyList;
}
public void setAccountMoneyList(String accountMoneyList) {
AccountMoneyList = accountMoneyList;
}
public Double getDiscount() {
return Discount;
}
public void setDiscount(Double discount) {
Discount = discount;
}
public Double getDiscountMoney() {
return DiscountMoney;
}
public void setDiscountMoney(Double discountMoney) {
DiscountMoney = discountMoney;
}
public Double getDiscountLastMoney() {
return DiscountLastMoney;
}
public void setDiscountLastMoney(Double discountLastMoney) {
DiscountLastMoney = discountLastMoney;
}
public Double getOtherMoney() {
return OtherMoney;
}
public void setOtherMoney(Double otherMoney) {
OtherMoney = otherMoney;
}
public String getOtherMoneyList() {
return OtherMoneyList;
}
public void setOtherMoneyList(String otherMoneyList) {
OtherMoneyList = otherMoneyList;
}
public String getOtherMoneyItem() {
return OtherMoneyItem;
}
public void setOtherMoneyItem(String otherMoneyItem) {
OtherMoneyItem = otherMoneyItem;
}
public Integer getAccountDay() {
return AccountDay;
}
public void setAccountDay(Integer accountDay) {
AccountDay = accountDay;
}
public Boolean getStatus() {
return Status;
}
public void setStatus(Boolean status) {
Status = status;
}
}
......@@ -11,12 +11,26 @@ public class DepotItemModel implements Serializable
/**======开始接受页面参数=================**/
private Long HeaderId;
private Long MaterialId;
private String MUnit; //计量单位
private Double OperNumber;
private Double BasicNumber;
private Double UnitPrice;
private Double TaxUnitPrice; //含税单价
private Double AllPrice;
private String Remark = "";
private String Img = "";
private Long DepotId;
private Long AnotherDepotId;
private Double TaxRate;
private Double TaxMoney;
private Double TaxLastMoney;
private String OtherField1;
private String OtherField2;
private String OtherField3;
private String OtherField4;
private String OtherField5;
private String Inserted = ""; //json插入记录
private String Deleted = ""; //json删除记录
private String Updated = ""; //json修改记录
......@@ -85,6 +99,22 @@ public class DepotItemModel implements Serializable
MaterialId = materialId;
}
public String getMUnit() {
return MUnit;
}
public void setMUnit(String MUnit) {
this.MUnit = MUnit;
}
public Double getTaxUnitPrice() {
return TaxUnitPrice;
}
public void setTaxUnitPrice(Double taxUnitPrice) {
TaxUnitPrice = taxUnitPrice;
}
public Double getOperNumber() {
return OperNumber;
}
......@@ -93,6 +123,14 @@ public class DepotItemModel implements Serializable
OperNumber = operNumber;
}
public Double getBasicNumber() {
return BasicNumber;
}
public void setBasicNumber(Double basicNumber) {
BasicNumber = basicNumber;
}
public Double getUnitPrice() {
return UnitPrice;
}
......@@ -244,4 +282,84 @@ public class DepotItemModel implements Serializable
public void setExcelStream(InputStream excelStream) {
this.excelStream = excelStream;
}
public Long getDepotId() {
return DepotId;
}
public void setDepotId(Long depotId) {
DepotId = depotId;
}
public Long getAnotherDepotId() {
return AnotherDepotId;
}
public void setAnotherDepotId(Long anotherDepotId) {
AnotherDepotId = anotherDepotId;
}
public Double getTaxRate() {
return TaxRate;
}
public void setTaxRate(Double taxRate) {
TaxRate = taxRate;
}
public Double getTaxMoney() {
return TaxMoney;
}
public void setTaxMoney(Double taxMoney) {
TaxMoney = taxMoney;
}
public Double getTaxLastMoney() {
return TaxLastMoney;
}
public void setTaxLastMoney(Double taxLastMoney) {
TaxLastMoney = taxLastMoney;
}
public String getOtherField1() {
return OtherField1;
}
public void setOtherField1(String otherField1) {
OtherField1 = otherField1;
}
public String getOtherField2() {
return OtherField2;
}
public void setOtherField2(String otherField2) {
OtherField2 = otherField2;
}
public String getOtherField3() {
return OtherField3;
}
public void setOtherField3(String otherField3) {
OtherField3 = otherField3;
}
public String getOtherField4() {
return OtherField4;
}
public void setOtherField4(String otherField4) {
OtherField4 = otherField4;
}
public String getOtherField5() {
return OtherField5;
}
public void setOtherField5(String otherField5) {
OtherField5 = otherField5;
}
}
package com.jsh.model.vo.materials;
import java.io.File;
import java.io.InputStream;
import java.io.Serializable;
@SuppressWarnings("serial")
......@@ -13,6 +15,11 @@ public class MaterialModel implements Serializable
*/
private String Name = "";
private String Mfrs = ""; //制造商
private Double Packing; //包装(KG/包)
private Double SafetyStock; //安全存量(KG)
/**
* 型号
*/
......@@ -58,6 +65,18 @@ public class MaterialModel implements Serializable
*/
private String Remark = "";
private Long UnitId;
private String FirstOutUnit;
private String FirstInUnit;
private String PriceStrategy;
/**
* 导入excel文件
*/
private File materialFile;
private Boolean Enabled = true; //是否启用
/**
* CategoryId
*/
......@@ -93,6 +112,10 @@ public class MaterialModel implements Serializable
*/
private String clientIp = "";
private String browserType = ""; //浏览器类型
private String fileName = ""; //文件名称
private InputStream excelStream; //输入流,导出excel文件
public MaterialShowModel getShowModel() {
return showModel;
}
......@@ -109,6 +132,30 @@ public class MaterialModel implements Serializable
Name = name;
}
public String getMfrs() {
return Mfrs;
}
public void setMfrs(String mfrs) {
Mfrs = mfrs;
}
public Double getPacking() {
return Packing;
}
public void setPacking(Double packing) {
Packing = packing;
}
public Double getSafetyStock() {
return SafetyStock;
}
public void setSafetyStock(Double safetyStock) {
SafetyStock = safetyStock;
}
public String getModel() {
return Model;
}
......@@ -245,4 +292,75 @@ public class MaterialModel implements Serializable
CategoryIds = categoryIds;
}
public Long getUnitId() {
return UnitId;
}
public void setUnitId(Long unitId) {
UnitId = unitId;
}
public String getFirstOutUnit() {
return FirstOutUnit;
}
public void setFirstOutUnit(String firstOutUnit) {
FirstOutUnit = firstOutUnit;
}
public String getFirstInUnit() {
return FirstInUnit;
}
public void setFirstInUnit(String firstInUnit) {
FirstInUnit = firstInUnit;
}
public String getPriceStrategy() {
return PriceStrategy;
}
public void setPriceStrategy(String priceStrategy) {
PriceStrategy = priceStrategy;
}
public Boolean getEnabled() {
return Enabled;
}
public void setEnabled(Boolean enabled) {
Enabled = enabled;
}
public String getBrowserType() {
return browserType;
}
public void setBrowserType(String browserType) {
this.browserType = browserType;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public InputStream getExcelStream() {
return excelStream;
}
public void setExcelStream(InputStream excelStream) {
this.excelStream = excelStream;
}
public File getMaterialFile() {
return materialFile;
}
public void setMaterialFile(File materialFile) {
this.materialFile = materialFile;
}
}
......@@ -2,8 +2,17 @@ package com.jsh.service.basic;
import com.jsh.base.BaseIService;
import com.jsh.model.po.Supplier;
import com.jsh.util.JshException;
import com.jsh.util.PageUtil;
import java.io.File;
import java.io.InputStream;
public interface SupplierIService extends BaseIService<Supplier>
{
public void batchSetEnable(Boolean enable,String supplierIDs);
public InputStream exmportExcel(String isAllPage,PageUtil<Supplier> pageUtil)throws JshException;
public InputStream importExcel(File assetFile)throws JshException;
}
package com.jsh.service.basic;
import com.jsh.base.BaseService;
import com.jsh.base.Log;
import com.jsh.dao.basic.SupplierIDAO;
import com.jsh.dao.basic.UserBusinessIDAO;
import com.jsh.model.po.Supplier;
import com.jsh.util.JshException;
import com.jsh.util.*;
import jxl.Workbook;
import jxl.format.Colour;
import jxl.write.*;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import java.io.*;
import java.lang.Boolean;
import java.util.*;
public class SupplierService extends BaseService<Supplier> implements SupplierIService
{
@SuppressWarnings("unused")
private SupplierIDAO supplierDao;
@SuppressWarnings("unused")
private UserBusinessIDAO userBusinessDao;
public void setSupplierDao(SupplierIDAO supplierDao)
{
this.supplierDao = supplierDao;
}
/**
* 设置映射基类
* @return
......@@ -24,4 +35,425 @@ public class SupplierService extends BaseService<Supplier> implements SupplierIS
return Supplier.class;
}
public void setSupplierDao(SupplierIDAO supplierDao)
{
this.supplierDao = supplierDao;
}
public void setUserBusinessDao(UserBusinessIDAO userBusinessDao) {
this.userBusinessDao = userBusinessDao;
}
public void batchSetEnable(Boolean enable,String supplierIDs){
supplierDao.batchSetEnable(enable, supplierIDs);
}
/**
* 初始化加载所有系统基础数据
*/
@SuppressWarnings({"rawtypes"})
private static Map<String,List> mapData = new HashMap<String, List>();
/**
* 错误的表格数据
*/
private static List<Supplier> wrongData = new ArrayList<Supplier>();
/**
* 导出Excel表格
*/
@Override
public InputStream exmportExcel(String isAllPage, PageUtil<Supplier> pageUtil)throws JshException
{
try
{
//将OutputStream转化为InputStream
ByteArrayOutputStream out = new ByteArrayOutputStream();
putDataOnOutputStream(out, pageUtil.getPageList());
return new ByteArrayInputStream(out.toByteArray());
}
catch (Exception e)
{
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>>>>>导出信息为excel表格异常", e);
throw new JshException("导出信息为excel表格异常",e);
}
}
/**
* 生成excel表格
* @param os
*/
@SuppressWarnings("deprecation")
private void putDataOnOutputStream(OutputStream os, List<Supplier> dataList) {
WritableWorkbook workbook = null;
try {
workbook = Workbook.createWorkbook(os);
WritableSheet sheet = workbook.createSheet("信息报表", 0);
//增加列头
String[] colunmName = {"名称","类型","联系人","电话","电子邮箱","预收款","期初应收","期初应付","备注","传真","手机","地址","纳税人识别号","开户行","账号","税率","状态"};
for(int i = 0 ;i < colunmName.length;i ++) {
sheet.setColumnView(i, 10);
sheet.addCell(new Label(i, 0, colunmName[i]));
}
if (null != dataList && dataList.size() > 0) {
int i = 1;
for (Supplier supplier: dataList){
int j = 0;
Map<Integer,String> cellInfo = supplier.getCellInfo();
sheet.addCell(new Label(j++,i, supplier.getSupplier()));
sheet.addCell(new Label(j++,i, supplier.getType()));
sheet.addCell(new Label(j++,i, supplier.getContacts() == null ?"": supplier.getContacts()));
sheet.addCell(new Label(j++,i, supplier.getPhonenum() == null ?"": supplier.getPhonenum()));
sheet.addCell(new Label(j++,i, supplier.getEmail() == null ?"": supplier.getEmail()));
sheet.addCell(getLabelInfo(cellInfo,j++,i, supplier.getAdvanceIn() == null ?"": supplier.getAdvanceIn().toString(),supplier));
sheet.addCell(getLabelInfo(cellInfo,j++,i, supplier.getBeginNeedGet() == null ?"": supplier.getBeginNeedGet().toString(),supplier));
sheet.addCell(getLabelInfo(cellInfo,j++,i, supplier.getBeginNeedPay() == null ?"": supplier.getBeginNeedPay().toString(),supplier));
sheet.addCell(new Label(j++,i, supplier.getDescription() == null ?"": supplier.getDescription()));
sheet.addCell(new Label(j++,i, supplier.getFax() == null ?"": supplier.getFax()));
sheet.addCell(new Label(j++,i, supplier.getTelephone() == null ?"": supplier.getTelephone()));
sheet.addCell(new Label(j++,i, supplier.getAddress() == null ?"": supplier.getAddress()));
sheet.addCell(new Label(j++,i, supplier.getTaxNum() == null ?"": supplier.getTaxNum()));
sheet.addCell(new Label(j++,i, supplier.getBankName() == null ?"": supplier.getBankName()));
sheet.addCell(new Label(j++,i, supplier.getAccountNumber() == null ?"": supplier.getAccountNumber()));
sheet.addCell(getLabelInfo(cellInfo,j++,i, supplier.getTaxRate() == null ?"": supplier.getTaxRate().toString(),supplier));
sheet.addCell(new Label(j++,i, supplier.getEnabled()?"启用":"禁用"));
i++;
}
}
workbook.write();
workbook.close();
}
catch (Exception e) {
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>>>>>导出信息为excel表格异常", e);
}
}
/**
* 根据错误信息进行提示--excel表格背景设置为红色,表示导入信息有误
* @param cellInfo
* @param cellNum
* @param columnNum
* @param value
* @return
*/
private Label getLabelInfo(Map<Integer,String> cellInfo,int cellNum,int columnNum,String value,Supplier supplier)
{
Label label = null;
//设置背景颜色
WritableCellFormat cellFormat = new WritableCellFormat();
try
{
cellFormat.setBackground(Colour.RED);
}
catch (WriteException e)
{
Log.errorFileSync(">>>>>>>>>>>>>>>>>>>>>设置单元格背景颜色错误", e);
}
if(null == cellInfo || cellInfo.size() == 0) {
label = new Label(cellNum, columnNum, value);
}
else {
//表示此单元格有错误
if(cellInfo.containsKey(cellNum)) {
if(cellNum == SupplierConstants.BusinessForExcel.EXCEL_ADVANCE_IN) {
label = new Label(cellNum, columnNum, supplier.getAdvanceInStr(), cellFormat);
}
else if(cellNum == SupplierConstants.BusinessForExcel.EXCEL_BEGIN_NEED_GET) {
label = new Label(cellNum, columnNum, supplier.getBeginNeedGetStr(), cellFormat);
}
else if(cellNum == SupplierConstants.BusinessForExcel.EXCEL_BEGIN_NEED_PAY) {
label = new Label(cellNum, columnNum, supplier.getBeginNeedPayStr(), cellFormat);
}
else if(cellNum == SupplierConstants.BusinessForExcel.EXCEL_TAX_RATE) {
label = new Label(cellNum, columnNum, supplier.getTaxRateStr(), cellFormat);
}
}
else{
label = new Label(cellNum, columnNum, value);
}
}
return label;
}
@Override
public InputStream importExcel(File assetFile) throws JshException {
//全局变量--每次调用前需要清空数据
mapData.clear();
//2、解析文件成资产数据
parseFile(assetFile);
if(null != wrongData && wrongData.size()>0) {
//将OutputStream转化为InputStream
ByteArrayOutputStream out = new ByteArrayOutputStream();
putDataOnOutputStream(out,wrongData);
return new ByteArrayInputStream(out.toByteArray());
}
else{
return null;
}
}
/**
* 解析excel表格
* @param assetFile
*/
@SuppressWarnings("unchecked")
private void parseFile(File assetFile) {
//每次调用前清空
wrongData.clear();
int totalRow = 0;
try {
//创建对Excel工作簿文件的引用
HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(assetFile));
//创建对工作表的引用,获取第一个工作表的内容
HSSFSheet sheet = workbook.getSheetAt(0);
/**
* =====================================
* 1、此处要增加文件的验证,如果不是资产文件需要进行特殊的处理,13列
* 2、文件内容为空处理
* 3、如果是修改过的文件内容
*/
Iterator<Row> itsheet = sheet.rowIterator();
while(itsheet.hasNext()) {
//获取当前行数据
Row row = itsheet.next();
//获取一行有多少单元格
// System.out.println(row.getLastCellNum());
//excel表格第几行数据 从1开始 0 是表头
int rowNum = row.getRowNum();
/**
* 表头跳过不读
*/
if(SupplierConstants.BusinessForExcel.EXCEL_TABLE_HEAD == rowNum)
continue;
//开始处理excel表格内容 --每行数据读取,同时统计总共行数
totalRow ++;
//获取excel表格的每格数据内容
Iterator<Cell> it = row.cellIterator();
//资产子类型--添加了一些excel表格数据
Supplier supplier = new Supplier();
//保存每个单元格错误类型
Map<Integer,String> cellType = new HashMap<Integer,String>();
Boolean hasBeginNeedGet = false; //是否存在期初应付
//设置列号
supplier.setRowLineNum(rowNum);
Cell cell = null;
//判断列号--从零开始
int cellIndex = 0;
while(it.hasNext()) {
//获取每个单元格对象
cell = it.next();
//获取列号
cellIndex = cell.getColumnIndex();
//设置此单元格为字符串类型
cell.setCellType(Cell.CELL_TYPE_STRING);
Log.infoFileSync("==================excel表格中第" + totalRow + "行的第 " + cellIndex + "列的值为" + cell.getStringCellValue());
//每行中数据顺序 "名称","类型","联系人","电话","电子邮箱","预收款","期初应收","期初应付","备注","传真","手机","地址","纳税人识别号","开户行","账号","税率"
switch(cellIndex) {
case SupplierConstants.BusinessForExcel.EXCEL_SUPPLIER :
String supplierName = cell.getStringCellValue();
if(null == supplierName || "".equals(supplierName)) {
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(名称)信息");
break;
}
supplier.setSupplier(supplierName);
break;
case SupplierConstants.BusinessForExcel.EXCEL_TYPE :
String type = cell.getStringCellValue();
if(null == type || "".equals(type)) {
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(类型)信息");
break;
}
supplier.setType(type);
break;
case SupplierConstants.BusinessForExcel.EXCEL_CONTACTS:
String contacts = cell.getStringCellValue();
if(null == contacts || "".equals(contacts)) {
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(联系人)信息");
break;
}
supplier.setContacts(contacts);
break;
case SupplierConstants.BusinessForExcel.EXCEL_PHONE_NUM :
String phoneNum = cell.getStringCellValue();
if(null == phoneNum || "".equals(phoneNum)) {
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(电话)信息");
break;
}
supplier.setPhonenum(phoneNum);
break;
case SupplierConstants.BusinessForExcel.EXCEL_EMAIL :
String email = cell.getStringCellValue();
if(null == email || "".equals(email)) {
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(电子邮箱)信息");
break;
}
supplier.setEmail(email);
break;
case SupplierConstants.BusinessForExcel.EXCEL_ADVANCE_IN :
String advanceIn = cell.getStringCellValue();
if(null == advanceIn || "".equals(advanceIn)) {
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(预收款)信息");
break;
}
if(Tools.checkStrIsNum(advanceIn)) {
supplier.setAdvanceIn(Double.parseDouble(advanceIn));
}
else{
Log.errorFileSync(">>>>>>>>>>>>>>>>>(预收款)不是数字格式");
cellType.put(cellIndex, "wrong");
supplier.setAdvanceIn(0.00d);
supplier.setAdvanceInStr(advanceIn);
}
break;
case SupplierConstants.BusinessForExcel.EXCEL_BEGIN_NEED_GET :
String beginNeedGet = cell.getStringCellValue();
if(null == beginNeedGet || "".equals(beginNeedGet)) {
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(期初应收)信息");
break;
}
if(Tools.checkStrIsNum(beginNeedGet) && Double.parseDouble(beginNeedGet)>=0) {
if(Double.parseDouble(beginNeedGet)>0) {
hasBeginNeedGet = true; //存在期初应付信息
}
supplier.setBeginNeedGet(Double.parseDouble(beginNeedGet));
}
else{
Log.errorFileSync(">>>>>>>>>>>>>>>>>(期初应收)不是数字格式");
cellType.put(cellIndex, "wrong");
supplier.setBeginNeedGet(0.00d);
supplier.setBeginNeedGetStr(beginNeedGet);
}
break;
case SupplierConstants.BusinessForExcel.EXCEL_BEGIN_NEED_PAY :
String beginNeedPay = cell.getStringCellValue();
if(null == beginNeedPay || "".equals(beginNeedPay)) {
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(期初应付)信息");
break;
}
if(Tools.checkStrIsNum(beginNeedPay) && Double.parseDouble(beginNeedPay)>=0) {
if(hasBeginNeedGet){ //同时存在不允许
Log.errorFileSync(">>>>>>>>>>>>>>>>>(期初应付)和期初应收不能同时存在");
cellType.put(cellIndex, "wrong");
supplier.setBeginNeedPay(0.00d);
supplier.setBeginNeedPayStr(beginNeedPay);
}
else {
supplier.setBeginNeedPay(Double.parseDouble(beginNeedPay));
}
}
else{
Log.errorFileSync(">>>>>>>>>>>>>>>>>(期初应付)不是数字格式");
cellType.put(cellIndex, "wrong");
supplier.setBeginNeedPay(0.00d);
supplier.setBeginNeedPayStr(beginNeedPay);
}
break;
case SupplierConstants.BusinessForExcel.EXCEL_DESCRIPTION :
String description = cell.getStringCellValue();
if(null == description || "".equals(description)) {
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(备注)信息");
break;
}
supplier.setDescription(description);
break;
case SupplierConstants.BusinessForExcel.EXCEL_FAX :
String fax = cell.getStringCellValue();
if(null == fax || "".equals(fax)) {
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(传真)信息");
break;
}
supplier.setFax(fax);
break;
case SupplierConstants.BusinessForExcel.EXCEL_TELEPHONE :
String telephone = cell.getStringCellValue();
if(null == telephone || "".equals(telephone)) {
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(手机)信息");
break;
}
supplier.setTelephone(telephone);
break;
case SupplierConstants.BusinessForExcel.EXCEL_ADDRESS :
String address = cell.getStringCellValue();
if(null == address || "".equals(address)) {
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(地址)信息");
break;
}
supplier.setAddress(address);
break;
case SupplierConstants.BusinessForExcel.EXCEL_TAX_NUM :
String taxNum = cell.getStringCellValue();
if(null == taxNum || "".equals(taxNum)) {
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(纳税人识别号)信息");
break;
}
supplier.setTaxNum(taxNum);
break;
case SupplierConstants.BusinessForExcel.EXCEL_BANK_NAME :
String bankName = cell.getStringCellValue();
if(null == bankName || "".equals(bankName)) {
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(开户行)信息");
break;
}
supplier.setBankName(bankName);
break;
case SupplierConstants.BusinessForExcel.EXCEL_ACCOUNT_NUMBER :
String accountNumber = cell.getStringCellValue();
if(null == accountNumber || "".equals(accountNumber)) {
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(账号)信息");
break;
}
supplier.setAccountNumber(accountNumber);
break;
case SupplierConstants.BusinessForExcel.EXCEL_TAX_RATE :
String taxRate = cell.getStringCellValue();
if(null == taxRate || "".equals(taxRate)) {
Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(税率)信息");
break;
}
if(Tools.checkStrIsNum(taxRate)) {
supplier.setTaxRate(Double.parseDouble(taxRate));
}
else{
Log.errorFileSync(">>>>>>>>>>>>>>>>>(税率)不是数字格式");
cellType.put(cellIndex, "wrong");
supplier.setTaxRate(0.00d);
supplier.setTaxRateStr(taxRate);
}
break;
}
}
supplier.setCellInfo(cellType);
Log.infoFileSync(totalRow + "行总共有" + cellIndex + "列");
//判断完成后增加数据
if((null!=cellType && cellType.size() >0) || supplier.getSupplier() == null) {
wrongData.add(supplier);
}
else {
supplier.setEnabled(true);
supplier.setIsystem((short)1);
supplierDao.save(supplier);
}
}
}
catch (FileNotFoundException e)
{
Log.errorFileSync(">>>>>>>>>>>>>>>>>>读取excel文件异常:找不到指定文件!",e);
}
catch (IOException e)
{
Log.errorFileSync(">>>>>>>>>>>>>>>>>>读取excel文件异常,请确认文件格式是否正确 !",e);
}
Log.infoFileSync("===================excel表格总共有 " + totalRow + " 条记录!");
}
}
Supports Markdown
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