Commit 1dc95653 authored by cjl's avatar cjl
Browse files

1、修改double类型为BigDecimal

2、修复sql中大于小于少&出错的问题
parents 6abe4bc8 4afc188b
-- noinspection SqlNoDataSourceInspectionForFile
/*
Navicat MySQL Data Transfer
 
......@@ -69,8 +71,8 @@ CREATE TABLE `jsh_account` (
`Id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`Name` varchar(50) DEFAULT NULL COMMENT '名称',
`SerialNo` varchar(50) DEFAULT NULL COMMENT '编号',
`InitialAmount` double DEFAULT NULL COMMENT '期初金额',
`CurrentAmount` double DEFAULT NULL COMMENT '当前余额',
`InitialAmount` decimal(24, 6) DEFAULT NULL COMMENT '期初金额',
`CurrentAmount` decimal(24, 6) DEFAULT NULL COMMENT '当前余额',
`Remark` varchar(100) DEFAULT NULL COMMENT '备注',
`IsDefault` bit(1) DEFAULT NULL COMMENT '是否默认',
PRIMARY KEY (`Id`)
......@@ -94,8 +96,8 @@ CREATE TABLE `jsh_accounthead` (
`Type` varchar(50) DEFAULT NULL COMMENT '类型(支出/收入/收款/付款/转账)',
`OrganId` bigint(20) DEFAULT NULL COMMENT '单位Id(收款/付款单位)',
`HandsPersonId` bigint(20) DEFAULT NULL COMMENT '经手人Id',
`ChangeAmount` double DEFAULT NULL COMMENT '变动金额(优惠/收款/付款/实付)',
`TotalPrice` double DEFAULT NULL COMMENT '合计金额',
`ChangeAmount` decimal(24, 6) DEFAULT NULL COMMENT '变动金额(优惠/收款/付款/实付)',
`TotalPrice` decimal(24, 6) DEFAULT NULL COMMENT '合计金额',
`AccountId` bigint(20) DEFAULT NULL COMMENT '账户(收款/付款)',
`BillNo` varchar(50) DEFAULT NULL COMMENT '单据编号',
`BillTime` datetime DEFAULT NULL COMMENT '单据日期',
......@@ -139,7 +141,7 @@ CREATE TABLE `jsh_accountitem` (
`HeaderId` bigint(20) NOT NULL COMMENT '表头Id',
`AccountId` bigint(20) DEFAULT NULL COMMENT '账户Id',
`InOutItemId` bigint(20) DEFAULT NULL COMMENT '收支项目Id',
`EachAmount` double DEFAULT NULL COMMENT '单项金额',
`EachAmount` decimal(24, 6) DEFAULT NULL COMMENT '单项金额',
`Remark` varchar(100) DEFAULT NULL COMMENT '单据备注',
PRIMARY KEY (`Id`),
KEY `FK9F4CBAC0AAE50527` (`AccountId`),
......@@ -218,7 +220,7 @@ CREATE TABLE `jsh_asset` (
`labels` varchar(255) DEFAULT NULL COMMENT '标签:以空格为分隔符',
`status` smallint(6) DEFAULT NULL COMMENT '资产的状态:0==在库,1==在用,2==消费',
`userID` bigint(20) DEFAULT NULL COMMENT '用户ID',
`price` double DEFAULT NULL COMMENT '购买价格',
`price` decimal(24, 6) DEFAULT NULL COMMENT '购买价格',
`purchasedate` datetime DEFAULT NULL COMMENT '购买日期',
`periodofvalidity` datetime DEFAULT NULL COMMENT '有效日期',
`warrantydate` datetime DEFAULT NULL COMMENT '保修日期',
......@@ -321,8 +323,8 @@ CREATE TABLE `jsh_depot` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(20) DEFAULT NULL COMMENT '仓库名称',
`address` varchar(50) DEFAULT NULL COMMENT '仓库地址',
`warehousing` double DEFAULT NULL COMMENT '仓储费',
`truckage` double DEFAULT NULL COMMENT '搬运费',
`warehousing` decimal(24, 6) DEFAULT NULL COMMENT '仓储费',
`truckage` decimal(24, 6) DEFAULT NULL COMMENT '搬运费',
`type` int(10) DEFAULT NULL COMMENT '类型',
`sort` varchar(10) DEFAULT NULL COMMENT '排序',
`remark` varchar(100) DEFAULT NULL COMMENT '描述',
......@@ -343,6 +345,8 @@ INSERT INTO `jsh_depot` VALUES ('6', '1269520625', null, null, null, '1', '2', '
-- Table structure for `jsh_depothead`
-- ----------------------------
DROP TABLE IF EXISTS `jsh_depothead`;
-- noinspection SqlNoDataSourceInspection
CREATE TABLE `jsh_depothead` (
`Id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`Type` varchar(50) DEFAULT NULL COMMENT '类型(出库/入库)',
......@@ -356,18 +360,18 @@ CREATE TABLE `jsh_depothead` (
`OrganId` bigint(20) DEFAULT NULL COMMENT '供应商Id',
`HandsPersonId` bigint(20) DEFAULT NULL COMMENT '采购/领料-经手人Id',
`AccountId` bigint(20) DEFAULT NULL COMMENT '账户Id',
`ChangeAmount` double DEFAULT NULL COMMENT '变动金额(收款/付款)',
`ChangeAmount` decimal(24, 6) DEFAULT NULL COMMENT '变动金额(收款/付款)',
`AllocationProjectId` bigint(20) DEFAULT NULL COMMENT '调拨时,对方项目Id',
`TotalPrice` double DEFAULT NULL COMMENT '合计金额',
`TotalPrice` decimal(24, 6) DEFAULT NULL COMMENT '合计金额',
`PayType` varchar(50) DEFAULT NULL COMMENT '付款类型(现金、记账等)',
`Remark` varchar(1000) DEFAULT NULL COMMENT '备注',
`Salesman` varchar(50) DEFAULT NULL COMMENT '业务员(可以多个)',
`AccountIdList` varchar(50) DEFAULT NULL COMMENT '多账户ID列表',
`AccountMoneyList` varchar(200) DEFAULT '' COMMENT '多账户金额列表',
`Discount` double DEFAULT NULL COMMENT '优惠率',
`DiscountMoney` double DEFAULT NULL COMMENT '优惠金额',
`DiscountLastMoney` double DEFAULT NULL COMMENT '优惠后金额',
`OtherMoney` double DEFAULT NULL COMMENT '销售或采购费用合计',
`Discount` decimal(24, 6) DEFAULT NULL COMMENT '优惠率',
`DiscountMoney` decimal(24, 6) DEFAULT NULL COMMENT '优惠金额',
`DiscountLastMoney` decimal(24, 6) DEFAULT NULL COMMENT '优惠后金额',
`OtherMoney` decimal(24, 6) DEFAULT NULL COMMENT '销售或采购费用合计',
`OtherMoneyList` varchar(200) DEFAULT NULL COMMENT '销售或采购费用涉及项目Id数组(包括快递、招待等)',
`OtherMoneyItem` varchar(200) DEFAULT NULL COMMENT '销售或采购费用涉及项目(包括快递、招待等)',
`AccountDay` int(10) DEFAULT NULL COMMENT '结算天数',
......@@ -484,19 +488,19 @@ CREATE TABLE `jsh_depotitem` (
`HeaderId` bigint(20) NOT NULL COMMENT '表头Id',
`MaterialId` bigint(20) NOT NULL COMMENT '材料Id',
`MUnit` varchar(20) DEFAULT NULL COMMENT '商品计量单位',
`OperNumber` double DEFAULT NULL COMMENT '数量',
`BasicNumber` double DEFAULT NULL COMMENT '基础数量,如kg、瓶',
`UnitPrice` double DEFAULT NULL COMMENT '单价',
`TaxUnitPrice` double DEFAULT NULL COMMENT '含税单价',
`AllPrice` double DEFAULT NULL COMMENT '金额',
`OperNumber` decimal(24, 6) DEFAULT NULL COMMENT '数量',
`BasicNumber` decimal(24, 6) DEFAULT NULL COMMENT '基础数量,如kg、瓶',
`UnitPrice` decimal(24, 6) DEFAULT NULL COMMENT '单价',
`TaxUnitPrice` decimal(24, 6) DEFAULT NULL COMMENT '含税单价',
`AllPrice` decimal(24, 6) DEFAULT NULL COMMENT '金额',
`Remark` varchar(200) DEFAULT NULL COMMENT '描述',
`Img` varchar(50) DEFAULT NULL COMMENT '图片',
`Incidentals` double DEFAULT NULL COMMENT '运杂费',
`Incidentals` decimal(24, 6) DEFAULT NULL COMMENT '运杂费',
`DepotId` bigint(20) DEFAULT NULL COMMENT '仓库ID(库存是统计出来的)',
`AnotherDepotId` bigint(20) DEFAULT NULL COMMENT '调拨时,对方仓库Id',
`TaxRate` double DEFAULT NULL COMMENT '税率',
`TaxMoney` double DEFAULT NULL COMMENT '税额',
`TaxLastMoney` double DEFAULT NULL COMMENT '价税合计',
`TaxRate` decimal(24, 6) DEFAULT NULL COMMENT '税率',
`TaxMoney` decimal(24, 6) DEFAULT NULL COMMENT '税额',
`TaxLastMoney` decimal(24, 6) DEFAULT NULL COMMENT '价税合计',
`OtherField1` varchar(50) DEFAULT NULL COMMENT '自定义字段1-品名',
`OtherField2` varchar(50) DEFAULT NULL COMMENT '自定义字段2-型号',
`OtherField3` varchar(50) DEFAULT NULL COMMENT '自定义字段3-制造商',
......@@ -4885,17 +4889,17 @@ CREATE TABLE `jsh_material` (
`CategoryId` bigint(20) DEFAULT NULL COMMENT '产品类型',
`Name` varchar(50) DEFAULT NULL COMMENT '名称',
`Mfrs` varchar(50) DEFAULT NULL COMMENT '制造商',
`Packing` double DEFAULT NULL COMMENT '包装(KG/包)',
`SafetyStock` double DEFAULT NULL COMMENT '安全存量(KG)',
`Packing` decimal(24, 6) DEFAULT NULL COMMENT '包装(KG/包)',
`SafetyStock` decimal(24, 6) DEFAULT NULL COMMENT '安全存量(KG)',
`Model` varchar(50) DEFAULT NULL COMMENT '型号',
`Standard` varchar(50) DEFAULT NULL COMMENT '规格',
`Color` varchar(50) DEFAULT NULL COMMENT '颜色',
`Unit` varchar(50) DEFAULT NULL COMMENT '单位-单个',
`Remark` varchar(100) DEFAULT NULL COMMENT '备注',
`RetailPrice` double DEFAULT NULL COMMENT '零售价',
`LowPrice` double DEFAULT NULL COMMENT '最低售价',
`PresetPriceOne` double DEFAULT NULL COMMENT '预设售价一',
`PresetPriceTwo` double DEFAULT NULL COMMENT '预设售价二',
`RetailPrice` decimal(24, 6) DEFAULT NULL COMMENT '零售价',
`LowPrice` decimal(24, 6) DEFAULT NULL COMMENT '最低售价',
`PresetPriceOne` decimal(24, 6) DEFAULT NULL COMMENT '预设售价一',
`PresetPriceTwo` decimal(24, 6) DEFAULT NULL COMMENT '预设售价二',
`UnitId` bigint(20) DEFAULT NULL COMMENT '计量单位Id',
`FirstOutUnit` varchar(50) DEFAULT NULL COMMENT '首选出库单位',
`FirstInUnit` varchar(50) DEFAULT NULL COMMENT '首选入库单位',
......@@ -5028,18 +5032,18 @@ CREATE TABLE `jsh_supplier` (
`isystem` tinyint(4) DEFAULT NULL COMMENT '是否系统自带 0==系统 1==非系统',
`type` varchar(20) DEFAULT NULL COMMENT '类型',
`enabled` bit(1) DEFAULT NULL COMMENT '启用',
`AdvanceIn` double DEFAULT '0' COMMENT '预收款',
`BeginNeedGet` double DEFAULT NULL COMMENT '期初应收',
`BeginNeedPay` double DEFAULT NULL COMMENT '期初应付',
`AllNeedGet` double DEFAULT NULL COMMENT '累计应收',
`AllNeedPay` double DEFAULT NULL COMMENT '累计应付',
`AdvanceIn` decimal(24, 6) DEFAULT '0' COMMENT '预收款',
`BeginNeedGet` decimal(24, 6) DEFAULT NULL COMMENT '期初应收',
`BeginNeedPay` decimal(24, 6) DEFAULT NULL COMMENT '期初应付',
`AllNeedGet` decimal(24, 6) DEFAULT NULL COMMENT '累计应收',
`AllNeedPay` decimal(24, 6) DEFAULT NULL COMMENT '累计应付',
`fax` varchar(30) DEFAULT NULL COMMENT '传真',
`telephone` varchar(30) DEFAULT NULL COMMENT '手机',
`address` varchar(50) DEFAULT NULL COMMENT '地址',
`taxNum` varchar(50) DEFAULT NULL COMMENT '纳税人识别号',
`bankName` varchar(50) DEFAULT NULL COMMENT '开户行',
`accountNumber` varchar(50) DEFAULT NULL COMMENT '账号',
`taxRate` double DEFAULT NULL COMMENT '税率',
`taxRate` decimal(24, 6) DEFAULT NULL COMMENT '税率',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8 COMMENT='供应商/客户信息表';
 
......
......@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -94,7 +95,7 @@ public class AccountController {
public BaseResponseInfo findAccountInOutList(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("accountId") Long accountId,
@RequestParam("initialAmount") Double initialAmount,
@RequestParam("initialAmount") BigDecimal initialAmount,
HttpServletRequest request) {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
......@@ -107,8 +108,8 @@ public class AccountController {
if (null != dataList) {
for (AccountVo4InOutList aEx : dataList) {
String timeStr = aEx.getOperTime().toString();
Double balance = accountService.getAccountSum(accountId, timeStr, "date") + accountService.getAccountSumByHead(accountId, timeStr, "date")
+ accountService.getAccountSumByDetail(accountId, timeStr, "date") + accountService.getManyAccountSum(accountId, timeStr, "date") + initialAmount;
BigDecimal balance = accountService.getAccountSum(accountId, timeStr, "date").add(accountService.getAccountSumByHead(accountId, timeStr, "date"))
.add(accountService.getAccountSumByDetail(accountId, timeStr, "date")).add(accountService.getManyAccountSum(accountId, timeStr, "date")).add(initialAmount);
aEx.setBalance(balance);
dataArray.add(aEx);
}
......
......@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -69,7 +70,7 @@ public class AccountHeadController {
Map<String, Object> map = new HashMap<String, Object>();
try {
JSONObject outer = new JSONObject();
Double sum = 0.0;
BigDecimal sum = BigDecimal.ZERO;
String getS = supplierId.toString();
int i = 1;
if (supType.equals("customer")) { //客户
......@@ -78,10 +79,14 @@ public class AccountHeadController {
i = -1;
}
//收付款部分
sum = sum + (allMoney(getS, "付款", "合计",endTime) + allMoney(getS, "付款", "实际",endTime)) * i;
sum = sum - (allMoney(getS, "收款", "合计",endTime) + allMoney(getS, "收款", "实际",endTime)) * i;
sum = sum + (allMoney(getS, "收入", "合计",endTime) - allMoney(getS, "收入", "实际",endTime)) * i;
sum = sum - (allMoney(getS, "支出", "合计",endTime) - allMoney(getS, "支出", "实际",endTime)) * i;
// sum = sum + (allMoney(getS, "付款", "合计",endTime) + allMoney(getS, "付款", "实际",endTime)) * i;
sum = sum.add((allMoney(getS, "付款", "合计",endTime).add(allMoney(getS, "付款", "实际",endTime))).multiply(new BigDecimal(i)));
// sum = sum - (allMoney(getS, "收款", "合计",endTime) + allMoney(getS, "收款", "实际",endTime)) * i;
sum = sum.subtract((allMoney(getS, "收款", "合计",endTime).add(allMoney(getS, "收款", "实际",endTime))).multiply(new BigDecimal(i)));
// sum = sum + (allMoney(getS, "收入", "合计",endTime) - allMoney(getS, "收入", "实际",endTime)) * i;
sum = sum.add((allMoney(getS, "收入", "合计",endTime).subtract(allMoney(getS, "收入", "实际",endTime))).multiply(new BigDecimal(i)));
// sum = sum - (allMoney(getS, "支出", "合计",endTime) - allMoney(getS, "支出", "实际",endTime)) * i;
sum = sum.subtract((allMoney(getS, "支出", "合计",endTime).subtract(allMoney(getS, "支出", "实际",endTime))).multiply(new BigDecimal(i)));
outer.put("getAllMoney", sum);
map.put("rows", outer);
res.code = 200;
......@@ -128,11 +133,11 @@ public class AccountHeadController {
* @param endTime
* @return
*/
public Double allMoney(String getS, String type, String mode, String endTime) {
Double allMoney = 0.0;
public BigDecimal allMoney(String getS, String type, String mode, String endTime) {
BigDecimal allMoney = BigDecimal.ZERO;
try {
Integer supplierId = Integer.valueOf(getS);
Double sum = accountHeadService.findAllMoney(supplierId, type, mode, endTime);
BigDecimal sum = accountHeadService.findAllMoney(supplierId, type, mode, endTime);
if(sum != null) {
allMoney = sum;
}
......@@ -140,8 +145,8 @@ public class AccountHeadController {
e.printStackTrace();
}
//返回正数,如果负数也转为正数
if (allMoney < 0) {
allMoney = -allMoney;
if ((allMoney.compareTo(BigDecimal.ZERO))==-1) {
allMoney = allMoney.abs();
}
return allMoney;
}
......
......@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -86,8 +87,8 @@ public class AccountItemController {
item.put("AccountName", ai.getAccountName());
item.put("InOutItemId", ai.getInoutitemid());
item.put("InOutItemName", ai.getInOutItemName());
Double eachAmount = ai.getEachamount();
item.put("EachAmount", eachAmount < 0 ? 0 - eachAmount : eachAmount);
BigDecimal eachAmount = ai.getEachamount();
item.put("EachAmount", (eachAmount.compareTo(BigDecimal.ZERO))==-1 ? BigDecimal.ZERO.subtract(eachAmount): eachAmount);
item.put("Remark", ai.getRemark());
dataArray.add(item);
}
......
......@@ -17,7 +17,9 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.sql.Date;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -312,41 +314,42 @@ public class DepotHeadController {
dha.setNumber(dha.getNumber()); //单据编号
dha.setType(dha.getType()); //类型
String type = dha.getType();
Double p1 = 0.0;
Double p2 = 0.0;
BigDecimal p1 = BigDecimal.ZERO ;
BigDecimal p2 = BigDecimal.ZERO;
if (dha.getDiscountLastMoney() != null) {
p1 = dha.getDiscountLastMoney();
}
if (dha.getChangeAmount() != null) {
p2 = dha.getChangeAmount();
}
Double allPrice = 0.0;
if (p1 < 0) {
p1 = -p1;
BigDecimal allPrice = BigDecimal.ZERO;
if ((p1.compareTo(BigDecimal.ZERO))==-1) {
p1 = p1.abs();
}
if (p2 < 0) {
p2 = -p2;
if ((p2 .compareTo(BigDecimal.ZERO))==-1) {
p2 = p2.abs();
}
if (type.equals("采购入库")) {
allPrice = -(p1 - p2);
allPrice = p2 .subtract(p1);
} else if (type.equals("销售退货入库")) {
allPrice = -(p1 - p2);
allPrice = p2 .subtract(p1);
} else if (type.equals("销售出库")) {
allPrice = p1 - p2;
allPrice = p1 .subtract(p2);
} else if (type.equals("采购退货出库")) {
allPrice = p1 - p2;
allPrice = p1 .subtract(p2);
} else if (type.equals("付款")) {
allPrice = p1 + p2;
allPrice = p1.add(p2);
} else if (type.equals("收款")) {
allPrice = -(p1 + p2);
allPrice = BigDecimal.ZERO.subtract(p1.add(p2));
} else if (type.equals("收入")) {
allPrice = p1 - p2;
allPrice = p1 .subtract(p2);
} else if (type.equals("支出")) {
allPrice = -(p1 - p2);
allPrice = p2 .subtract(p1);
}
dha.setDiscountLastMoney(p1); //金额
dha.setChangeAmount(p2); //金额
dha.setAllPrice(Double.parseDouble(String.format("%.2f", allPrice * j))); //计算后的金额
DecimalFormat df = new DecimalFormat(".##");
dha.setAllPrice(new BigDecimal(df.format(allPrice .multiply(new BigDecimal(j))))); //计算后的金额
dha.setSupplierName(dha.getSupplierName()); //供应商
dha.setoTime(dha.getoTime()); //入库出库日期
resList.add(dha);
......@@ -380,7 +383,7 @@ public class DepotHeadController {
Map<String, Object> map = new HashMap<String, Object>();
try {
JSONObject outer = new JSONObject();
Double sum = 0.0;
BigDecimal sum = BigDecimal.ZERO;
String getS = supplierId.toString();
int i = 1;
if (supType.equals("customer")) { //客户
......@@ -389,10 +392,14 @@ public class DepotHeadController {
i = -1;
}
//进销部分
sum = sum - (allMoney(getS, "入库", "采购", "合计",endTime) - allMoney(getS, "入库", "采购", "实际",endTime)) * i;
sum = sum - (allMoney(getS, "入库", "销售退货", "合计",endTime) - allMoney(getS, "入库", "销售退货", "实际",endTime)) * i;
sum = sum + (allMoney(getS, "出库", "销售", "合计",endTime) - allMoney(getS, "出库", "销售", "实际",endTime)) * i;
sum = sum + (allMoney(getS, "出库", "采购退货", "合计",endTime) - allMoney(getS, "出库", "采购退货", "实际",endTime)) * i;
// sum = sum - (allMoney(getS, "入库", "采购", "合计",endTime) - allMoney(getS, "入库", "采购", "实际",endTime)) * i;
sum = sum.subtract((allMoney(getS, "入库", "采购", "合计",endTime).subtract(allMoney(getS, "入库", "采购", "实际",endTime))).multiply(new BigDecimal(i)));
// sum = sum - (allMoney(getS, "入库", "销售退货", "合计",endTime) - allMoney(getS, "入库", "销售退货", "实际",endTime)) * i;
sum = sum.subtract((allMoney(getS, "入库", "销售退货", "合计",endTime).subtract(allMoney(getS, "入库", "销售退货", "实际",endTime))).multiply(new BigDecimal(i)));
// sum = sum + (allMoney(getS, "出库", "销售", "合计",endTime) - allMoney(getS, "出库", "销售", "实际",endTime)) * i;
sum = sum.add((allMoney(getS, "出库", "销售", "合计",endTime).subtract(allMoney(getS, "出库", "销售", "实际",endTime))).multiply(new BigDecimal(i)));
// sum = sum + (allMoney(getS, "出库", "采购退货", "合计",endTime) - allMoney(getS, "出库", "采购退货", "实际",endTime)) * i;
sum = sum.add((allMoney(getS, "出库", "采购退货", "合计",endTime).subtract(allMoney(getS, "出库", "采购退货", "实际",endTime))).multiply(new BigDecimal(i)));
outer.put("getAllMoney", sum);
map.put("rows", outer);
res.code = 200;
......@@ -440,11 +447,11 @@ public class DepotHeadController {
* @param mode 合计或者金额
* @return
*/
public Double allMoney(String getS, String type, String subType, String mode, String endTime) {
Double allMoney = 0.0;
public BigDecimal allMoney(String getS, String type, String subType, String mode, String endTime) {
BigDecimal allMoney = BigDecimal.ZERO;
try {
Integer supplierId = Integer.valueOf(getS);
Double sum = depotHeadService.findAllMoney(supplierId, type, subType, mode, endTime);
BigDecimal sum = depotHeadService.findAllMoney(supplierId, type, subType, mode, endTime);
if(sum != null) {
allMoney = sum;
}
......@@ -452,8 +459,8 @@ public class DepotHeadController {
e.printStackTrace();
}
//返回正数,如果负数也转为正数
if (allMoney < 0) {
allMoney = -allMoney;
if ((allMoney.compareTo(BigDecimal.ZERO))==-1) {
allMoney = allMoney.abs();
}
return allMoney;
}
......
......@@ -15,6 +15,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -152,13 +153,13 @@ public class DepotItemController {
if (null != list) {
for (DepotItemVo4Material di : list) {
JSONObject item = new JSONObject();
double prevSum = sumNumber("入库", pid, materialId, monthTime, true) - sumNumber("出库", pid, materialId, monthTime, true);
double InSum = sumNumber("入库", pid, materialId, monthTime, false);
double OutSum = sumNumber("出库", pid, materialId, monthTime, false);
BigDecimal prevSum = sumNumber("入库", pid, materialId, monthTime, true).subtract(sumNumber("出库", pid, materialId, monthTime, true));
BigDecimal InSum = sumNumber("入库", pid, materialId, monthTime, false);
BigDecimal OutSum = sumNumber("出库", pid, materialId, monthTime, false);
item.put("MaterialId", di.getMaterialid() == null ? "" : di.getMaterialid());
item.put("MaterialName", di.getMname());
item.put("MaterialModel", di.getMmodel());
item.put("thisSum", prevSum + InSum - OutSum);
item.put("thisSum", prevSum.add(InSum).subtract(OutSum));
dataArray.add(item);
}
}
......@@ -425,12 +426,12 @@ public class DepotItemController {
if (null != dataList) {
for (DepotItemVo4WithInfoEx diEx : dataList) {
JSONObject item = new JSONObject();
Double prevSum = sumNumber("入库", pid, diEx.getMId(), monthTime, true) - sumNumber("出库", pid, diEx.getMId(), monthTime, true);
Double InSum = sumNumber("入库", pid, diEx.getMId(), monthTime, false);
Double OutSum = sumNumber("出库", pid, diEx.getMId(), monthTime, false);
Double prevPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, true) - sumPrice("出库", pid, diEx.getMId(), monthTime, true);
Double InPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, false);
Double OutPrice = sumPrice("出库", pid, diEx.getMId(), monthTime, false);
BigDecimal prevSum = sumNumber("入库", pid, diEx.getMId(), monthTime, true).subtract(sumNumber("出库", pid, diEx.getMId(), monthTime, true));
BigDecimal InSum = sumNumber("入库", pid, diEx.getMId(), monthTime, false);
BigDecimal OutSum = sumNumber("出库", pid, diEx.getMId(), monthTime, false);
BigDecimal prevPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, true).subtract(sumPrice("出库", pid, diEx.getMId(), monthTime, true));
BigDecimal InPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, false);
BigDecimal OutPrice = sumPrice("出库", pid, diEx.getMId(), monthTime, false);
item.put("MaterialName", diEx.getMName());
item.put("MaterialModel", diEx.getMColor());
//扩展信息
......@@ -438,21 +439,21 @@ public class DepotItemController {
item.put("MaterialOther", materialOther);
item.put("MaterialColor", diEx.getMColor());
item.put("MaterialUnit", diEx.getMaterialUnit());
Double unitPrice = 0.0;
if (prevSum + InSum - OutSum != 0.0) {
unitPrice = (prevPrice + InPrice - OutPrice) / (prevSum + InSum - OutSum);
BigDecimal unitPrice = BigDecimal.ZERO;
if ((prevSum .add(InSum).subtract(OutSum)).compareTo(BigDecimal.ZERO)!= 0) {
unitPrice = (prevPrice.add(InPrice).subtract(OutPrice)).divide(prevSum.add(InSum).subtract(OutSum),2, BigDecimal.ROUND_HALF_UP);
/**
* 2019-01-15通过除法算出金额后,保留两位小数
* */
DecimalFormat df = new DecimalFormat("#.00");
unitPrice= Double.parseDouble(df.format(unitPrice));
unitPrice= new BigDecimal(df.format(unitPrice));
}
item.put("UnitPrice", unitPrice);
item.put("prevSum", prevSum);
item.put("InSum", InSum);
item.put("OutSum", OutSum);
item.put("thisSum", prevSum + InSum - OutSum);
item.put("thisAllPrice", prevPrice + InPrice - OutPrice);
item.put("thisSum", prevSum.add(InSum).subtract(OutSum));
item.put("thisAllPrice", prevPrice.add(InPrice).subtract(OutPrice));
dataArray.add(item);
}
}
......@@ -486,13 +487,13 @@ public class DepotItemController {
Map<String, Object> map = new HashMap<String, Object>();
try {
List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(headIds, materialIds, null, null);
Double thisAllPrice = 0.0;
BigDecimal thisAllPrice = BigDecimal.ZERO;
if (null != dataList) {
for (DepotItemVo4WithInfoEx diEx : dataList) {
Double prevPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, true) - sumPrice("出库", pid, diEx.getMId(), monthTime, true);
Double InPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, false);
Double OutPrice = sumPrice("出库", pid, diEx.getMId(), monthTime, false);
thisAllPrice = thisAllPrice + (prevPrice + InPrice - OutPrice);
BigDecimal prevPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, true).subtract(sumPrice("出库", pid, diEx.getMId(), monthTime, true));
BigDecimal InPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, false);
BigDecimal OutPrice = sumPrice("出库", pid, diEx.getMId(), monthTime, false);
thisAllPrice = thisAllPrice .add(prevPrice.add(InPrice).subtract(OutPrice));
}
}
map.put("totalCount", thisAllPrice);
......@@ -537,10 +538,10 @@ public class DepotItemController {
if (null != dataList) {
for (DepotItemVo4WithInfoEx diEx : dataList) {
JSONObject item = new JSONObject();
Double InSum = sumNumberBuyOrSale("入库", "采购", diEx.getMId(), monthTime);
Double OutSum = sumNumberBuyOrSale("出库", "采购退货", diEx.getMId(), monthTime);
Double InSumPrice = sumPriceBuyOrSale("入库", "采购", diEx.getMId(), monthTime);
Double OutSumPrice = sumPriceBuyOrSale("出库", "采购退货", diEx.getMId(), monthTime);
BigDecimal InSum = sumNumberBuyOrSale("入库", "采购", diEx.getMId(), monthTime);
BigDecimal OutSum = sumNumberBuyOrSale("出库", "采购退货", diEx.getMId(), monthTime);
BigDecimal InSumPrice = sumPriceBuyOrSale("入库", "采购", diEx.getMId(), monthTime);
BigDecimal OutSumPrice = sumPriceBuyOrSale("出库", "采购退货", diEx.getMId(), monthTime);
item.put("MaterialName", diEx.getMName());
item.put("MaterialModel", diEx.getMModel());
//扩展信息
......@@ -597,14 +598,14 @@ public class DepotItemController {
if (null != dataList) {
for (DepotItemVo4WithInfoEx diEx : dataList) {
JSONObject item = new JSONObject();
Double OutSumRetail = sumNumberBuyOrSale("出库", "零售", diEx.getMId(), monthTime);
Double OutSum = sumNumberBuyOrSale("出库", "销售", diEx.getMId(), monthTime);
Double InSumRetail = sumNumberBuyOrSale("入库", "零售退货", diEx.getMId(), monthTime);
Double InSum = sumNumberBuyOrSale("入库", "销售退货", diEx.getMId(), monthTime);
Double OutSumRetailPrice = sumPriceBuyOrSale("出库", "零售", diEx.getMId(), monthTime);
Double OutSumPrice = sumPriceBuyOrSale("出库", "销售", diEx.getMId(), monthTime);
Double InSumRetailPrice = sumPriceBuyOrSale("入库", "零售退货", diEx.getMId(), monthTime);
Double InSumPrice = sumPriceBuyOrSale("入库", "销售退货", diEx.getMId(), monthTime);
BigDecimal OutSumRetail = sumNumberBuyOrSale("出库", "零售", diEx.getMId(), monthTime);
BigDecimal OutSum = sumNumberBuyOrSale("出库", "销售", diEx.getMId(), monthTime);
BigDecimal InSumRetail = sumNumberBuyOrSale("入库", "零售退货", diEx.getMId(), monthTime);
BigDecimal InSum = sumNumberBuyOrSale("入库", "销售退货", diEx.getMId(), monthTime);
BigDecimal OutSumRetailPrice = sumPriceBuyOrSale("出库", "零售", diEx.getMId(), monthTime);
BigDecimal OutSumPrice = sumPriceBuyOrSale("出库", "销售", diEx.getMId(), monthTime);
BigDecimal InSumRetailPrice = sumPriceBuyOrSale("入库", "零售退货", diEx.getMId(), monthTime);
BigDecimal InSumPrice = sumPriceBuyOrSale("入库", "销售退货", diEx.getMId(), monthTime);
item.put("MaterialName", diEx.getMName());
item.put("MaterialModel", diEx.getMModel());
//扩展信息
......@@ -612,10 +613,10 @@ public class DepotItemController {
item.put("MaterialOther", materialOther);
item.put("MaterialColor", diEx.getMColor());
item.put("MaterialUnit", diEx.getMaterialUnit());
item.put("OutSum", OutSumRetail + OutSum);
item.put("InSum", InSumRetail + InSum);
item.put("OutSumPrice", OutSumRetailPrice + OutSumPrice);
item.put("InSumPrice", InSumRetailPrice + InSumPrice);
item.put("OutSum", OutSumRetail.add(OutSum));
item.put("InSum", InSumRetail.add(InSum));
item.put("OutSumPrice", OutSumRetailPrice.add(OutSumPrice));
item.put("InSumPrice", InSumRetailPrice.add(InSumPrice));
dataArray.add(item);
}
}
......@@ -661,8 +662,8 @@ public class DepotItemController {
if (null != dataList) {
for (DepotItemVo4WithInfoEx diEx : dataList) {
JSONObject item = new JSONObject();
Double InSum = sumNumberGift("礼品充值", pid, diEx.getMId(), "in");
Double OutSum = sumNumberGift("礼品销售", pid, diEx.getMId(), "out");
BigDecimal InSum = sumNumberGift("礼品充值", pid, diEx.getMId(), "in");
BigDecimal OutSum = sumNumberGift("礼品销售", pid, diEx.getMId(), "out");
item.put("MaterialName", diEx.getMName());
item.put("MaterialModel", diEx.getMModel());
//扩展信息
......@@ -670,7 +671,7 @@ public class DepotItemController {
item.put("MaterialOther", materialOther);
item.put("MaterialColor", diEx.getMColor());
item.put("MaterialUnit", diEx.getMaterialUnit());
item.put("thisSum", InSum - OutSum);
item.put("thisSum", InSum.subtract(OutSum));
dataArray.add(item);
}
}
......@@ -718,23 +719,23 @@ public class DepotItemController {
if (null != dataList) {
for (DepotItemVo4WithInfoEx diEx : dataList) {
String[] objs = new String[9];
Double prevSum = sumNumber("入库", pid, diEx.getMId(), monthTime, true) - sumNumber("出库", pid, diEx.getMId(), monthTime, true);
Double InSum = sumNumber("入库", pid, diEx.getMId(), monthTime, false);
Double OutSum = sumNumber("出库", pid, diEx.getMId(), monthTime, false);
Double prevPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, true) - sumPrice("出库", pid, diEx.getMId(), monthTime, true);
Double InPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, false);
Double OutPrice = sumPrice("出库", pid, diEx.getMId(), monthTime, false);
Double unitPrice = 0.0;
if (prevSum + InSum - OutSum != 0.0) {
unitPrice = (prevPrice + InPrice - OutPrice) / (prevSum + InSum - OutSum);
BigDecimal prevSum = sumNumber("入库", pid, diEx.getMId(), monthTime, true).subtract(sumNumber("出库", pid, diEx.getMId(), monthTime, true));
BigDecimal InSum = sumNumber("入库", pid, diEx.getMId(), monthTime, false);
BigDecimal OutSum = sumNumber("出库", pid, diEx.getMId(), monthTime, false);
BigDecimal prevPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, true).subtract(sumPrice("出库", pid, diEx.getMId(), monthTime, true));
BigDecimal InPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, false);
BigDecimal OutPrice = sumPrice("出库", pid, diEx.getMId(), monthTime, false);
BigDecimal unitPrice = BigDecimal.ZERO;
if ((prevSum.add(InSum).subtract(OutSum)).compareTo(BigDecimal.ZERO) != 0) {
unitPrice = (prevPrice.add(InPrice).subtract(OutPrice)).divide(prevSum.add(InSum).subtract(OutSum),2, BigDecimal.ROUND_HALF_UP);
/**
* 2019-01-15通过除法算出金额后,保留两位小数
* */
DecimalFormat df = new DecimalFormat("#.00");
unitPrice= Double.parseDouble(df.format(unitPrice));
unitPrice= new BigDecimal(df.format(unitPrice));
}
Double thisSum = prevSum + InSum - OutSum;
Double thisAllPrice = prevPrice + InPrice - OutPrice;
BigDecimal thisSum = prevSum.add(InSum).subtract(OutSum);
BigDecimal thisAllPrice = prevPrice.add(InPrice).subtract(OutPrice);
objs[0] = diEx.getMName().toString();
objs[1] = diEx.getMModel().toString();
objs[2] = diEx.getMaterialUnit().toString();
......@@ -770,10 +771,10 @@ public class DepotItemController {
* @param isPrev
* @return
*/
public Double sumNumber(String type, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev) {
Double sumNumber = 0.0;
public BigDecimal sumNumber(String type, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev) {
BigDecimal sumNumber = BigDecimal.ZERO;
try {
Double sum = depotItemService.findByType(type, ProjectId, MId, MonthTime, isPrev);
BigDecimal sum = depotItemService.findByType(type, ProjectId, MId, MonthTime, isPrev);
if(sum != null) {
sumNumber = sum;
}
......@@ -792,10 +793,10 @@ public class DepotItemController {
* @param isPrev
* @return
*/
public Double sumPrice(String type, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev) {
Double sumPrice = 0.0;
public BigDecimal sumPrice(String type, Integer ProjectId, Long MId, String MonthTime, Boolean isPrev) {
BigDecimal sumPrice = BigDecimal.ZERO;
try {
Double sum = depotItemService.findPriceByType(type, ProjectId, MId, MonthTime, isPrev);
BigDecimal sum = depotItemService.findPriceByType(type, ProjectId, MId, MonthTime, isPrev);
if(sum != null) {
sumPrice = sum;
}
......@@ -805,11 +806,11 @@ public class DepotItemController {
return sumPrice;
}
public Double sumNumberBuyOrSale(String type, String subType, Long MId, String MonthTime) {
Double sumNumber = 0.0;
public BigDecimal sumNumberBuyOrSale(String type, String subType, Long MId, String MonthTime) {
BigDecimal sumNumber = BigDecimal.ZERO;
String sumType = "Number";
try {
Double sum = depotItemService.buyOrSale(type, subType, MId, MonthTime, sumType);
BigDecimal sum = depotItemService.buyOrSale(type, subType, MId, MonthTime, sumType);
if(sum != null) {
sumNumber = sum;
}
......@@ -819,11 +820,11 @@ public class DepotItemController {
return sumNumber;
}
public Double sumPriceBuyOrSale(String type, String subType, Long MId, String MonthTime) {
Double sumPrice = 0.0;
public BigDecimal sumPriceBuyOrSale(String type, String subType, Long MId, String MonthTime) {
BigDecimal sumPrice = BigDecimal.ZERO;
String sumType = "Price";
try {
Double sum = depotItemService.buyOrSale(type, subType, MId, MonthTime, sumType);
BigDecimal sum = depotItemService.buyOrSale(type, subType, MId, MonthTime, sumType);
if(sum != null) {
sumPrice = sum;
}
......@@ -841,12 +842,12 @@ public class DepotItemController {
* @param type
* @return
*/
public Double sumNumberGift(String subType, Integer ProjectId, Long MId, String type) {
Double sumNumber = 0.0;
public BigDecimal sumNumberGift(String subType, Integer ProjectId, Long MId, String type) {
BigDecimal sumNumber = BigDecimal.ZERO;
String allNumber = "";
try {
if (ProjectId != null) {
Double sum = depotItemService.findGiftByType(subType, ProjectId, MId, type);
BigDecimal sum = depotItemService.findGiftByType(subType, ProjectId, MId, type);
if(sum != null) {
sumNumber = sum;
}
......
......@@ -18,6 +18,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -270,19 +271,19 @@ public class MaterialController {
for (int i = 1; i < src.getRows(); i++) {
Material m = new Material();
m.setName(ExcelUtils.getContent(src, i, 0));
m.setCategoryid(1l); //根目录
m.setCategoryid(1L); //根目录
m.setModel(ExcelUtils.getContent(src, i, 2));
String safetyStock = ExcelUtils.getContent(src, i, 3);
m.setSafetystock(parseDoubleEx(safetyStock));
m.setSafetystock(parseBigDecimalEx(safetyStock));
m.setUnit(ExcelUtils.getContent(src, i, 4));
String retailprice = ExcelUtils.getContent(src, i, 5);
m.setRetailprice(parseDoubleEx(retailprice));
m.setRetailprice(parseBigDecimalEx(retailprice));
String lowPrice = ExcelUtils.getContent(src, i, 6);
m.setLowprice(parseDoubleEx(lowPrice));
m.setLowprice(parseBigDecimalEx(lowPrice));
String presetpriceone = ExcelUtils.getContent(src, i, 7);
m.setPresetpriceone(parseDoubleEx(presetpriceone));
m.setPresetpriceone(parseBigDecimalEx(presetpriceone));
String presetpricetwo = ExcelUtils.getContent(src, i, 8);
m.setPresetpricetwo(parseDoubleEx(presetpricetwo));
m.setPresetpricetwo(parseBigDecimalEx(presetpricetwo));
m.setRemark(ExcelUtils.getContent(src, i, 9));
String enabled = ExcelUtils.getContent(src, i, 10);
m.setEnabled(enabled.equals("启用")? true: false);
......@@ -299,9 +300,9 @@ public class MaterialController {
response.sendRedirect("../pages/materials/material.html");
}
public Double parseDoubleEx(String str){
public BigDecimal parseBigDecimalEx(String str){
if(!StringUtil.isEmpty(str)) {
return Double.parseDouble(str);
return new BigDecimal(str);
} else {
return null;
}
......
......@@ -18,6 +18,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -48,7 +49,7 @@ public class SupplierController {
*/
@PostMapping(value = "/updateAdvanceIn")
public String updateAdvanceIn(@RequestParam("supplierId") Long supplierId,
@RequestParam("advanceIn") Double advanceIn,
@RequestParam("advanceIn") BigDecimal advanceIn,
HttpServletRequest request) {
Map<String, Object> objectMap = new HashMap<String, Object>();
int res = supplierService.updateAdvanceIn(supplierId, advanceIn);
......@@ -396,9 +397,9 @@ public class SupplierController {
s.setContacts(ExcelUtils.getContent(src, i, 2));
s.setPhonenum(ExcelUtils.getContent(src, i, 3));
s.setEmail(ExcelUtils.getContent(src, i, 4));
s.setAdvancein(parseDoubleEx(ExcelUtils.getContent(src, i, 5)));
s.setBeginneedget(parseDoubleEx(ExcelUtils.getContent(src, i, 6)));
s.setBeginneedpay(parseDoubleEx(ExcelUtils.getContent(src, i, 7)));
s.setAdvancein(parseBigDecimalEx(ExcelUtils.getContent(src, i, 5)));
s.setBeginneedget(parseBigDecimalEx(ExcelUtils.getContent(src, i, 6)));
s.setBeginneedpay(parseBigDecimalEx(ExcelUtils.getContent(src, i, 7)));
s.setDescription(ExcelUtils.getContent(src, i, 8));
s.setFax(ExcelUtils.getContent(src, i, 9));
s.setTelephone(ExcelUtils.getContent(src, i, 10));
......@@ -406,7 +407,7 @@ public class SupplierController {
s.setTaxnum(ExcelUtils.getContent(src, i, 12));
s.setBankname(ExcelUtils.getContent(src, i, 13));
s.setAccountnumber(ExcelUtils.getContent(src, i, 14));
s.setTaxrate(parseDoubleEx(ExcelUtils.getContent(src, i, 15)));
s.setTaxrate(parseBigDecimalEx(ExcelUtils.getContent(src, i, 15)));
String enabled = ExcelUtils.getContent(src, i, 16);
s.setEnabled(enabled.equals("启用")? true: false);
s.setIsystem(Byte.parseByte("1"));
......@@ -423,9 +424,9 @@ public class SupplierController {
return null;
}
public Double parseDoubleEx(String str){
public BigDecimal parseBigDecimalEx(String str){
if(!StringUtil.isEmpty(str)) {
return Double.parseDouble(str);
return new BigDecimal(str);
} else {
return null;
}
......
package com.jsh.erp.datasource.entities;
import java.math.BigDecimal;
public class Account {
/**
* This field was generated by MyBatis Generator.
......@@ -31,7 +33,7 @@ public class Account {
*
* @mbggenerated
*/
private Double initialamount;
private BigDecimal initialamount;
/**
* This field was generated by MyBatis Generator.
......@@ -39,7 +41,7 @@ public class Account {
*
* @mbggenerated
*/
private Double currentamount;
private BigDecimal currentamount;
/**
* This field was generated by MyBatis Generator.
......@@ -137,7 +139,7 @@ public class Account {
*
* @mbggenerated
*/
public Double getInitialamount() {
public BigDecimal getInitialamount() {
return initialamount;
}
......@@ -149,7 +151,7 @@ public class Account {
*
* @mbggenerated
*/
public void setInitialamount(Double initialamount) {
public void setInitialamount(BigDecimal initialamount) {
this.initialamount = initialamount;
}
......@@ -161,7 +163,7 @@ public class Account {
*
* @mbggenerated
*/
public Double getCurrentamount() {
public BigDecimal getCurrentamount() {
return currentamount;
}
......@@ -173,7 +175,7 @@ public class Account {
*
* @mbggenerated
*/
public void setCurrentamount(Double currentamount) {
public void setCurrentamount(BigDecimal currentamount) {
this.currentamount = currentamount;
}
......
package com.jsh.erp.datasource.entities;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
......@@ -404,52 +405,52 @@ public class AccountExample {
return (Criteria) this;
}
public Criteria andInitialamountEqualTo(Double value) {
public Criteria andInitialamountEqualTo(BigDecimal value) {
addCriterion("InitialAmount =", value, "initialamount");
return (Criteria) this;
}
public Criteria andInitialamountNotEqualTo(Double value) {
public Criteria andInitialamountNotEqualTo(BigDecimal value) {
addCriterion("InitialAmount <>", value, "initialamount");
return (Criteria) this;
}
public Criteria andInitialamountGreaterThan(Double value) {
public Criteria andInitialamountGreaterThan(BigDecimal value) {
addCriterion("InitialAmount >", value, "initialamount");
return (Criteria) this;
}
public Criteria andInitialamountGreaterThanOrEqualTo(Double value) {
public Criteria andInitialamountGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("InitialAmount >=", value, "initialamount");
return (Criteria) this;
}
public Criteria andInitialamountLessThan(Double value) {
public Criteria andInitialamountLessThan(BigDecimal value) {
addCriterion("InitialAmount <", value, "initialamount");
return (Criteria) this;
}
public Criteria andInitialamountLessThanOrEqualTo(Double value) {
public Criteria andInitialamountLessThanOrEqualTo(BigDecimal value) {
addCriterion("InitialAmount <=", value, "initialamount");
return (Criteria) this;
}
public Criteria andInitialamountIn(List<Double> values) {
public Criteria andInitialamountIn(List<BigDecimal> values) {
addCriterion("InitialAmount in", values, "initialamount");
return (Criteria) this;
}
public Criteria andInitialamountNotIn(List<Double> values) {
public Criteria andInitialamountNotIn(List<BigDecimal> values) {
addCriterion("InitialAmount not in", values, "initialamount");
return (Criteria) this;
}
public Criteria andInitialamountBetween(Double value1, Double value2) {
public Criteria andInitialamountBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("InitialAmount between", value1, value2, "initialamount");
return (Criteria) this;
}
public Criteria andInitialamountNotBetween(Double value1, Double value2) {
public Criteria andInitialamountNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("InitialAmount not between", value1, value2, "initialamount");
return (Criteria) this;
}
......@@ -464,52 +465,52 @@ public class AccountExample {
return (Criteria) this;
}
public Criteria andCurrentamountEqualTo(Double value) {
public Criteria andCurrentamountEqualTo(BigDecimal value) {
addCriterion("CurrentAmount =", value, "currentamount");
return (Criteria) this;
}
public Criteria andCurrentamountNotEqualTo(Double value) {
public Criteria andCurrentamountNotEqualTo(BigDecimal value) {
addCriterion("CurrentAmount <>", value, "currentamount");
return (Criteria) this;
}
public Criteria andCurrentamountGreaterThan(Double value) {
public Criteria andCurrentamountGreaterThan(BigDecimal value) {
addCriterion("CurrentAmount >", value, "currentamount");
return (Criteria) this;
}
public Criteria andCurrentamountGreaterThanOrEqualTo(Double value) {
public Criteria andCurrentamountGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("CurrentAmount >=", value, "currentamount");
return (Criteria) this;
}
public Criteria andCurrentamountLessThan(Double value) {
public Criteria andCurrentamountLessThan(BigDecimal value) {
addCriterion("CurrentAmount <", value, "currentamount");
return (Criteria) this;
}
public Criteria andCurrentamountLessThanOrEqualTo(Double value) {
public Criteria andCurrentamountLessThanOrEqualTo(BigDecimal value) {
addCriterion("CurrentAmount <=", value, "currentamount");
return (Criteria) this;
}
public Criteria andCurrentamountIn(List<Double> values) {
public Criteria andCurrentamountIn(List<BigDecimal> values) {
addCriterion("CurrentAmount in", values, "currentamount");
return (Criteria) this;
}
public Criteria andCurrentamountNotIn(List<Double> values) {
public Criteria andCurrentamountNotIn(List<BigDecimal> values) {
addCriterion("CurrentAmount not in", values, "currentamount");
return (Criteria) this;
}
public Criteria andCurrentamountBetween(Double value1, Double value2) {
public Criteria andCurrentamountBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("CurrentAmount between", value1, value2, "currentamount");
return (Criteria) this;
}
public Criteria andCurrentamountNotBetween(Double value1, Double value2) {
public Criteria andCurrentamountNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("CurrentAmount not between", value1, value2, "currentamount");
return (Criteria) this;
}
......
package com.jsh.erp.datasource.entities;
import java.math.BigDecimal;
import java.util.Date;
public class AccountHead {
......@@ -41,7 +42,7 @@ public class AccountHead {
*
* @mbggenerated
*/
private Double changeamount;
private BigDecimal changeamount;
/**
* This field was generated by MyBatis Generator.
......@@ -49,7 +50,7 @@ public class AccountHead {
*
* @mbggenerated
*/
private Double totalprice;
private BigDecimal totalprice;
/**
* This field was generated by MyBatis Generator.
......@@ -187,7 +188,7 @@ public class AccountHead {
*
* @mbggenerated
*/
public Double getChangeamount() {
public BigDecimal getChangeamount() {
return changeamount;
}
......@@ -199,7 +200,7 @@ public class AccountHead {
*
* @mbggenerated
*/
public void setChangeamount(Double changeamount) {
public void setChangeamount(BigDecimal changeamount) {
this.changeamount = changeamount;
}
......@@ -211,7 +212,7 @@ public class AccountHead {
*
* @mbggenerated
*/
public Double getTotalprice() {
public BigDecimal getTotalprice() {
return totalprice;
}
......@@ -223,7 +224,7 @@ public class AccountHead {
*
* @mbggenerated
*/
public void setTotalprice(Double totalprice) {
public void setTotalprice(BigDecimal totalprice) {
this.totalprice = totalprice;
}
......
package com.jsh.erp.datasource.entities;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -455,52 +456,52 @@ public class AccountHeadExample {
return (Criteria) this;
}
public Criteria andChangeamountEqualTo(Double value) {
public Criteria andChangeamountEqualTo(BigDecimal value) {
addCriterion("ChangeAmount =", value, "changeamount");
return (Criteria) this;
}
public Criteria andChangeamountNotEqualTo(Double value) {
public Criteria andChangeamountNotEqualTo(BigDecimal value) {
addCriterion("ChangeAmount <>", value, "changeamount");
return (Criteria) this;
}
public Criteria andChangeamountGreaterThan(Double value) {
public Criteria andChangeamountGreaterThan(BigDecimal value) {
addCriterion("ChangeAmount >", value, "changeamount");
return (Criteria) this;
}
public Criteria andChangeamountGreaterThanOrEqualTo(Double value) {
public Criteria andChangeamountGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("ChangeAmount >=", value, "changeamount");
return (Criteria) this;
}
public Criteria andChangeamountLessThan(Double value) {
public Criteria andChangeamountLessThan(BigDecimal value) {
addCriterion("ChangeAmount <", value, "changeamount");
return (Criteria) this;
}
public Criteria andChangeamountLessThanOrEqualTo(Double value) {
public Criteria andChangeamountLessThanOrEqualTo(BigDecimal value) {
addCriterion("ChangeAmount <=", value, "changeamount");
return (Criteria) this;
}
public Criteria andChangeamountIn(List<Double> values) {
public Criteria andChangeamountIn(List<BigDecimal> values) {
addCriterion("ChangeAmount in", values, "changeamount");
return (Criteria) this;
}
public Criteria andChangeamountNotIn(List<Double> values) {
public Criteria andChangeamountNotIn(List<BigDecimal> values) {
addCriterion("ChangeAmount not in", values, "changeamount");
return (Criteria) this;
}
public Criteria andChangeamountBetween(Double value1, Double value2) {
public Criteria andChangeamountBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("ChangeAmount between", value1, value2, "changeamount");
return (Criteria) this;
}
public Criteria andChangeamountNotBetween(Double value1, Double value2) {
public Criteria andChangeamountNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("ChangeAmount not between", value1, value2, "changeamount");
return (Criteria) this;
}
......@@ -515,52 +516,52 @@ public class AccountHeadExample {
return (Criteria) this;
}
public Criteria andTotalpriceEqualTo(Double value) {
public Criteria andTotalpriceEqualTo(BigDecimal value) {
addCriterion("TotalPrice =", value, "totalprice");
return (Criteria) this;
}
public Criteria andTotalpriceNotEqualTo(Double value) {
public Criteria andTotalpriceNotEqualTo(BigDecimal value) {
addCriterion("TotalPrice <>", value, "totalprice");
return (Criteria) this;
}
public Criteria andTotalpriceGreaterThan(Double value) {
public Criteria andTotalpriceGreaterThan(BigDecimal value) {
addCriterion("TotalPrice >", value, "totalprice");
return (Criteria) this;
}
public Criteria andTotalpriceGreaterThanOrEqualTo(Double value) {
public Criteria andTotalpriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("TotalPrice >=", value, "totalprice");
return (Criteria) this;
}
public Criteria andTotalpriceLessThan(Double value) {
public Criteria andTotalpriceLessThan(BigDecimal value) {
addCriterion("TotalPrice <", value, "totalprice");
return (Criteria) this;
}
public Criteria andTotalpriceLessThanOrEqualTo(Double value) {
public Criteria andTotalpriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("TotalPrice <=", value, "totalprice");
return (Criteria) this;
}
public Criteria andTotalpriceIn(List<Double> values) {
public Criteria andTotalpriceIn(List<BigDecimal> values) {
addCriterion("TotalPrice in", values, "totalprice");
return (Criteria) this;
}
public Criteria andTotalpriceNotIn(List<Double> values) {
public Criteria andTotalpriceNotIn(List<BigDecimal> values) {
addCriterion("TotalPrice not in", values, "totalprice");
return (Criteria) this;
}
public Criteria andTotalpriceBetween(Double value1, Double value2) {
public Criteria andTotalpriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("TotalPrice between", value1, value2, "totalprice");
return (Criteria) this;
}
public Criteria andTotalpriceNotBetween(Double value1, Double value2) {
public Criteria andTotalpriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("TotalPrice not between", value1, value2, "totalprice");
return (Criteria) this;
}
......
package com.jsh.erp.datasource.entities;
import java.math.BigDecimal;
import java.util.Date;
public class AccountHeadVo4ListEx {
......@@ -12,9 +13,9 @@ public class AccountHeadVo4ListEx {
private Long handspersonid;
private Double changeamount;
private BigDecimal changeamount;
private Double totalprice;
private BigDecimal totalprice;
private Long accountid;
......@@ -62,19 +63,19 @@ public class AccountHeadVo4ListEx {
this.handspersonid = handspersonid;
}
public Double getChangeamount() {
public BigDecimal getChangeamount() {
return changeamount;
}
public void setChangeamount(Double changeamount) {
public void setChangeamount(BigDecimal changeamount) {
this.changeamount = changeamount;
}
public Double getTotalprice() {
public BigDecimal getTotalprice() {
return totalprice;
}
public void setTotalprice(Double totalprice) {
public void setTotalprice(BigDecimal totalprice) {
this.totalprice = totalprice;
}
......
package com.jsh.erp.datasource.entities;
import java.math.BigDecimal;
public class AccountItem {
/**
* This field was generated by MyBatis Generator.
......@@ -39,7 +41,7 @@ public class AccountItem {
*
* @mbggenerated
*/
private Double eachamount;
private BigDecimal eachamount;
/**
* This field was generated by MyBatis Generator.
......@@ -153,7 +155,7 @@ public class AccountItem {
*
* @mbggenerated
*/
public Double getEachamount() {
public BigDecimal getEachamount() {
return eachamount;
}
......@@ -165,7 +167,7 @@ public class AccountItem {
*
* @mbggenerated
*/
public void setEachamount(Double eachamount) {
public void setEachamount(BigDecimal eachamount) {
this.eachamount = eachamount;
}
......
package com.jsh.erp.datasource.entities;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
......@@ -444,52 +445,52 @@ public class AccountItemExample {
return (Criteria) this;
}
public Criteria andEachamountEqualTo(Double value) {
public Criteria andEachamountEqualTo(BigDecimal value) {
addCriterion("EachAmount =", value, "eachamount");
return (Criteria) this;
}
public Criteria andEachamountNotEqualTo(Double value) {
public Criteria andEachamountNotEqualTo(BigDecimal value) {
addCriterion("EachAmount <>", value, "eachamount");
return (Criteria) this;
}
public Criteria andEachamountGreaterThan(Double value) {
public Criteria andEachamountGreaterThan(BigDecimal value) {
addCriterion("EachAmount >", value, "eachamount");
return (Criteria) this;
}
public Criteria andEachamountGreaterThanOrEqualTo(Double value) {
public Criteria andEachamountGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("EachAmount >=", value, "eachamount");
return (Criteria) this;
}
public Criteria andEachamountLessThan(Double value) {
public Criteria andEachamountLessThan(BigDecimal value) {
addCriterion("EachAmount <", value, "eachamount");
return (Criteria) this;
}
public Criteria andEachamountLessThanOrEqualTo(Double value) {
public Criteria andEachamountLessThanOrEqualTo(BigDecimal value) {
addCriterion("EachAmount <=", value, "eachamount");
return (Criteria) this;
}
public Criteria andEachamountIn(List<Double> values) {
public Criteria andEachamountIn(List<BigDecimal> values) {
addCriterion("EachAmount in", values, "eachamount");
return (Criteria) this;
}
public Criteria andEachamountNotIn(List<Double> values) {
public Criteria andEachamountNotIn(List<BigDecimal> values) {
addCriterion("EachAmount not in", values, "eachamount");
return (Criteria) this;
}
public Criteria andEachamountBetween(Double value1, Double value2) {
public Criteria andEachamountBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("EachAmount between", value1, value2, "eachamount");
return (Criteria) this;
}
public Criteria andEachamountNotBetween(Double value1, Double value2) {
public Criteria andEachamountNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("EachAmount not between", value1, value2, "eachamount");
return (Criteria) this;
}
......
package com.jsh.erp.datasource.entities;
import java.math.BigDecimal;
import java.util.Date;
public class Asset {
......@@ -57,7 +58,7 @@ public class Asset {
*
* @mbggenerated
*/
private Double price;
private BigDecimal price;
/**
* This field was generated by MyBatis Generator.
......@@ -307,7 +308,7 @@ public class Asset {
*
* @mbggenerated
*/
public Double getPrice() {
public BigDecimal getPrice() {
return price;
}
......@@ -319,7 +320,7 @@ public class Asset {
*
* @mbggenerated
*/
public void setPrice(Double price) {
public void setPrice(BigDecimal price) {
this.price = price;
}
......
package com.jsh.erp.datasource.entities;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -585,52 +586,52 @@ public class AssetExample {
return (Criteria) this;
}
public Criteria andPriceEqualTo(Double value) {
public Criteria andPriceEqualTo(BigDecimal value) {
addCriterion("price =", value, "price");
return (Criteria) this;
}
public Criteria andPriceNotEqualTo(Double value) {
public Criteria andPriceNotEqualTo(BigDecimal value) {
addCriterion("price <>", value, "price");
return (Criteria) this;
}
public Criteria andPriceGreaterThan(Double value) {
public Criteria andPriceGreaterThan(BigDecimal value) {
addCriterion("price >", value, "price");
return (Criteria) this;
}
public Criteria andPriceGreaterThanOrEqualTo(Double value) {
public Criteria andPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("price >=", value, "price");
return (Criteria) this;
}
public Criteria andPriceLessThan(Double value) {
public Criteria andPriceLessThan(BigDecimal value) {
addCriterion("price <", value, "price");
return (Criteria) this;
}
public Criteria andPriceLessThanOrEqualTo(Double value) {
public Criteria andPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("price <=", value, "price");
return (Criteria) this;
}
public Criteria andPriceIn(List<Double> values) {
public Criteria andPriceIn(List<BigDecimal> values) {
addCriterion("price in", values, "price");
return (Criteria) this;
}
public Criteria andPriceNotIn(List<Double> values) {
public Criteria andPriceNotIn(List<BigDecimal> values) {
addCriterion("price not in", values, "price");
return (Criteria) this;
}
public Criteria andPriceBetween(Double value1, Double value2) {
public Criteria andPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("price between", value1, value2, "price");
return (Criteria) this;
}
public Criteria andPriceNotBetween(Double value1, Double value2) {
public Criteria andPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("price not between", value1, value2, "price");
return (Criteria) this;
}
......
package com.jsh.erp.datasource.entities;
import java.math.BigDecimal;
public class Depot {
/**
* This field was generated by MyBatis Generator.
......@@ -31,7 +33,7 @@ public class Depot {
*
* @mbggenerated
*/
private Double warehousing;
private BigDecimal warehousing;
/**
* This field was generated by MyBatis Generator.
......@@ -39,7 +41,7 @@ public class Depot {
*
* @mbggenerated
*/
private Double truckage;
private BigDecimal truckage;
/**
* This field was generated by MyBatis Generator.
......@@ -145,7 +147,7 @@ public class Depot {
*
* @mbggenerated
*/
public Double getWarehousing() {
public BigDecimal getWarehousing() {
return warehousing;
}
......@@ -157,7 +159,7 @@ public class Depot {
*
* @mbggenerated
*/
public void setWarehousing(Double warehousing) {
public void setWarehousing(BigDecimal warehousing) {
this.warehousing = warehousing;
}
......@@ -169,7 +171,7 @@ public class Depot {
*
* @mbggenerated
*/
public Double getTruckage() {
public BigDecimal getTruckage() {
return truckage;
}
......@@ -181,7 +183,7 @@ public class Depot {
*
* @mbggenerated
*/
public void setTruckage(Double truckage) {
public void setTruckage(BigDecimal truckage) {
this.truckage = truckage;
}
......
package com.jsh.erp.datasource.entities;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
......@@ -404,52 +405,52 @@ public class DepotExample {
return (Criteria) this;
}
public Criteria andWarehousingEqualTo(Double value) {
public Criteria andWarehousingEqualTo(BigDecimal value) {
addCriterion("warehousing =", value, "warehousing");
return (Criteria) this;
}
public Criteria andWarehousingNotEqualTo(Double value) {
public Criteria andWarehousingNotEqualTo(BigDecimal value) {
addCriterion("warehousing <>", value, "warehousing");
return (Criteria) this;
}
public Criteria andWarehousingGreaterThan(Double value) {
public Criteria andWarehousingGreaterThan(BigDecimal value) {
addCriterion("warehousing >", value, "warehousing");
return (Criteria) this;
}
public Criteria andWarehousingGreaterThanOrEqualTo(Double value) {
public Criteria andWarehousingGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("warehousing >=", value, "warehousing");
return (Criteria) this;
}
public Criteria andWarehousingLessThan(Double value) {
public Criteria andWarehousingLessThan(BigDecimal value) {
addCriterion("warehousing <", value, "warehousing");
return (Criteria) this;
}
public Criteria andWarehousingLessThanOrEqualTo(Double value) {
public Criteria andWarehousingLessThanOrEqualTo(BigDecimal value) {
addCriterion("warehousing <=", value, "warehousing");
return (Criteria) this;
}
public Criteria andWarehousingIn(List<Double> values) {
public Criteria andWarehousingIn(List<BigDecimal> values) {
addCriterion("warehousing in", values, "warehousing");
return (Criteria) this;
}
public Criteria andWarehousingNotIn(List<Double> values) {
public Criteria andWarehousingNotIn(List<BigDecimal> values) {
addCriterion("warehousing not in", values, "warehousing");
return (Criteria) this;
}
public Criteria andWarehousingBetween(Double value1, Double value2) {
public Criteria andWarehousingBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("warehousing between", value1, value2, "warehousing");
return (Criteria) this;
}
public Criteria andWarehousingNotBetween(Double value1, Double value2) {
public Criteria andWarehousingNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("warehousing not between", value1, value2, "warehousing");
return (Criteria) this;
}
......@@ -464,52 +465,52 @@ public class DepotExample {
return (Criteria) this;
}
public Criteria andTruckageEqualTo(Double value) {
public Criteria andTruckageEqualTo(BigDecimal value) {
addCriterion("truckage =", value, "truckage");
return (Criteria) this;
}
public Criteria andTruckageNotEqualTo(Double value) {
public Criteria andTruckageNotEqualTo(BigDecimal value) {
addCriterion("truckage <>", value, "truckage");
return (Criteria) this;
}
public Criteria andTruckageGreaterThan(Double value) {
public Criteria andTruckageGreaterThan(BigDecimal value) {
addCriterion("truckage >", value, "truckage");
return (Criteria) this;
}
public Criteria andTruckageGreaterThanOrEqualTo(Double value) {
public Criteria andTruckageGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("truckage >=", value, "truckage");
return (Criteria) this;
}
public Criteria andTruckageLessThan(Double value) {
public Criteria andTruckageLessThan(BigDecimal value) {
addCriterion("truckage <", value, "truckage");
return (Criteria) this;
}
public Criteria andTruckageLessThanOrEqualTo(Double value) {
public Criteria andTruckageLessThanOrEqualTo(BigDecimal value) {
addCriterion("truckage <=", value, "truckage");
return (Criteria) this;
}
public Criteria andTruckageIn(List<Double> values) {
public Criteria andTruckageIn(List<BigDecimal> values) {
addCriterion("truckage in", values, "truckage");
return (Criteria) this;
}
public Criteria andTruckageNotIn(List<Double> values) {
public Criteria andTruckageNotIn(List<BigDecimal> values) {
addCriterion("truckage not in", values, "truckage");
return (Criteria) this;
}
public Criteria andTruckageBetween(Double value1, Double value2) {
public Criteria andTruckageBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("truckage between", value1, value2, "truckage");
return (Criteria) this;
}
public Criteria andTruckageNotBetween(Double value1, Double value2) {
public Criteria andTruckageNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("truckage not between", value1, value2, "truckage");
return (Criteria) this;
}
......
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