将系统参数表的金额审核启用标记字段改为强审核标记字段

This commit is contained in:
季圣华
2023-03-17 23:05:03 +08:00
parent 234ac15087
commit e9098efcd2
16 changed files with 162 additions and 276 deletions

View File

@@ -108,19 +108,19 @@ public class AccountService {
JshException.readFail(logger, e);
}
String timeStr = Tools.getCurrentMonth();
Boolean apprFlag = systemConfigService.getAmountApprovalFlag();
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
if (null != list && null !=timeStr) {
for (AccountVo4List al : list) {
DecimalFormat df = new DecimalFormat(".##");
BigDecimal thisMonthAmount = getAccountSum(al.getId(), timeStr, "month", apprFlag).add(getAccountSumByHead(al.getId(), timeStr, "month", apprFlag))
.add(getAccountSumByDetail(al.getId(), timeStr, "month", apprFlag)).add(getManyAccountSum(al.getId(), timeStr, "month", apprFlag));
BigDecimal thisMonthAmount = getAccountSum(al.getId(), timeStr, "month", forceFlag).add(getAccountSumByHead(al.getId(), timeStr, "month", forceFlag))
.add(getAccountSumByDetail(al.getId(), timeStr, "month", forceFlag)).add(getManyAccountSum(al.getId(), timeStr, "month", forceFlag));
String thisMonthAmountFmt = "0";
if ((thisMonthAmount.compareTo(BigDecimal.ZERO))!=0) {
thisMonthAmountFmt = df.format(thisMonthAmount);
}
al.setThisMonthAmount(thisMonthAmountFmt); //本月发生额
BigDecimal currentAmount = getAccountSum(al.getId(), "", "month", apprFlag).add(getAccountSumByHead(al.getId(), "", "month", apprFlag))
.add(getAccountSumByDetail(al.getId(), "", "month", apprFlag)).add(getManyAccountSum(al.getId(), "", "month", apprFlag)) .add(al.getInitialAmount()) ;
BigDecimal currentAmount = getAccountSum(al.getId(), "", "month", forceFlag).add(getAccountSumByHead(al.getId(), "", "month", forceFlag))
.add(getAccountSumByDetail(al.getId(), "", "month", forceFlag)).add(getManyAccountSum(al.getId(), "", "month", forceFlag)) .add(al.getInitialAmount()) ;
al.setCurrentAmount(currentAmount);
resList.add(al);
}
@@ -279,7 +279,7 @@ public class AccountService {
* @param id
* @return
*/
public BigDecimal getAccountSum(Long id, String timeStr, String type, Boolean apprFlag) throws Exception{
public BigDecimal getAccountSum(Long id, String timeStr, String type, Boolean forceFlag) throws Exception{
BigDecimal accountSum = BigDecimal.ZERO;
try {
DepotHeadExample example = new DepotHeadExample();
@@ -302,7 +302,7 @@ public class AccountService {
}
List<DepotHead> dataList=null;
try{
if(apprFlag) {
if(forceFlag) {
criteria.andStatusEqualTo("1");
}
dataList = depotHeadMapper.selectByExample(example);
@@ -328,7 +328,7 @@ public class AccountService {
* @param id
* @return
*/
public BigDecimal getAccountSumByHead(Long id, String timeStr, String type, Boolean apprFlag) throws Exception{
public BigDecimal getAccountSumByHead(Long id, String timeStr, String type, Boolean forceFlag) throws Exception{
BigDecimal accountSum = BigDecimal.ZERO;
try {
AccountHeadExample example = new AccountHeadExample();
@@ -352,7 +352,7 @@ public class AccountService {
}
List<AccountHead> dataList=null;
try{
if(apprFlag) {
if(forceFlag) {
criteria.andStatusEqualTo("1");
}
dataList = accountHeadMapper.selectByExample(example);
@@ -378,7 +378,7 @@ public class AccountService {
* @param id
* @return
*/
public BigDecimal getAccountSumByDetail(Long id, String timeStr, String type, Boolean apprFlag)throws Exception {
public BigDecimal getAccountSumByDetail(Long id, String timeStr, String type, Boolean forceFlag)throws Exception {
BigDecimal accountSum =BigDecimal.ZERO ;
try {
AccountHeadExample example = new AccountHeadExample();
@@ -397,7 +397,7 @@ public class AccountService {
}
List<AccountHead> dataList=null;
try{
if(apprFlag) {
if(forceFlag) {
criteria.andStatusEqualTo("1");
}
dataList = accountHeadMapper.selectByExample(example);
@@ -441,7 +441,7 @@ public class AccountService {
* @param id
* @return
*/
public BigDecimal getManyAccountSum(Long id, String timeStr, String type, Boolean apprFlag)throws Exception {
public BigDecimal getManyAccountSum(Long id, String timeStr, String type, Boolean forceFlag)throws Exception {
BigDecimal accountSum = BigDecimal.ZERO;
try {
DepotHeadExample example = new DepotHeadExample();
@@ -465,7 +465,7 @@ public class AccountService {
}
List<DepotHead> dataList=null;
try{
if(apprFlag) {
if(forceFlag) {
criteria.andStatusEqualTo("1");
}
dataList = depotHeadMapper.selectByExample(example);
@@ -570,13 +570,13 @@ public class AccountService {
String timeStr = Tools.getCurrentMonth();
BigDecimal allMonthAmount = BigDecimal.ZERO;
BigDecimal allCurrentAmount = BigDecimal.ZERO;
Boolean apprFlag = systemConfigService.getAmountApprovalFlag();
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
if (null != list && null !=timeStr) {
for (Account a : list) {
BigDecimal monthAmount = getAccountSum(a.getId(), timeStr, "month", apprFlag).add(getAccountSumByHead(a.getId(), timeStr, "month", apprFlag))
.add(getAccountSumByDetail(a.getId(), timeStr, "month", apprFlag)).add(getManyAccountSum(a.getId(), timeStr, "month", apprFlag));
BigDecimal currentAmount = getAccountSum(a.getId(), "", "month", apprFlag).add(getAccountSumByHead(a.getId(), "", "month", apprFlag))
.add(getAccountSumByDetail(a.getId(), "", "month", apprFlag)).add(getManyAccountSum(a.getId(), "", "month", apprFlag)).add(a.getInitialAmount());
BigDecimal monthAmount = getAccountSum(a.getId(), timeStr, "month", forceFlag).add(getAccountSumByHead(a.getId(), timeStr, "month", forceFlag))
.add(getAccountSumByDetail(a.getId(), timeStr, "month", forceFlag)).add(getManyAccountSum(a.getId(), timeStr, "month", forceFlag));
BigDecimal currentAmount = getAccountSum(a.getId(), "", "month", forceFlag).add(getAccountSumByHead(a.getId(), "", "month", forceFlag))
.add(getAccountSumByDetail(a.getId(), "", "month", forceFlag)).add(getManyAccountSum(a.getId(), "", "month", forceFlag)).add(a.getInitialAmount());
allMonthAmount = allMonthAmount.add(monthAmount);
allCurrentAmount = allCurrentAmount.add(currentAmount);
}

View File

@@ -564,7 +564,7 @@ public class DepotHeadService {
example.createCriteria().andIdIn(dhIds);
result = depotHeadMapper.updateByExampleSelective(depotHead, example);
//更新当前库存
if(systemConfigService.getStockApprovalFlag()) {
if(systemConfigService.getForceApprovalFlag()) {
for(Long dhId: dhIds) {
List<DepotItem> list = depotItemService.getListByHeaderId(dhId);
for (DepotItem depotItem : list) {
@@ -595,11 +595,11 @@ public class DepotHeadService {
}
public List<DepotHeadVo4InDetail> findInOutDetail(String beginTime, String endTime, String type, String [] creatorArray,
String [] organArray, Boolean amountApprovalFlag, String materialParam, List<Long> depotList, Integer oId, String number,
String [] organArray, Boolean forceFlag, String materialParam, List<Long> depotList, Integer oId, String number,
String remark, Integer offset, Integer rows) throws Exception{
List<DepotHeadVo4InDetail> list = null;
try{
list =depotHeadMapperEx.findInOutDetail(beginTime, endTime, type, creatorArray, organArray, amountApprovalFlag, materialParam, depotList, oId, number, remark, offset, rows);
list =depotHeadMapperEx.findInOutDetail(beginTime, endTime, type, creatorArray, organArray, forceFlag, materialParam, depotList, oId, number, remark, offset, rows);
}catch(Exception e){
JshException.readFail(logger, e);
}
@@ -607,25 +607,25 @@ public class DepotHeadService {
}
public int findInOutDetailCount(String beginTime, String endTime, String type, String [] creatorArray,
String [] organArray, Boolean amountApprovalFlag, String materialParam, List<Long> depotList, Integer oId, String number,
String [] organArray, Boolean forceFlag, String materialParam, List<Long> depotList, Integer oId, String number,
String remark) throws Exception{
int result = 0;
try{
result =depotHeadMapperEx.findInOutDetailCount(beginTime, endTime, type, creatorArray, organArray, amountApprovalFlag, materialParam, depotList, oId, number, remark);
result =depotHeadMapperEx.findInOutDetailCount(beginTime, endTime, type, creatorArray, organArray, forceFlag, materialParam, depotList, oId, number, remark);
}catch(Exception e){
JshException.readFail(logger, e);
}
return result;
}
public List<DepotHeadVo4InOutMCount> findInOutMaterialCount(String beginTime, String endTime, String type, Boolean amountApprovalFlag, String materialParam,
public List<DepotHeadVo4InOutMCount> findInOutMaterialCount(String beginTime, String endTime, String type, Boolean forceFlag, String materialParam,
List<Long> depotList, Integer oId, String roleType, Integer offset, Integer rows)throws Exception {
List<DepotHeadVo4InOutMCount> list = null;
try{
String [] creatorArray = getCreatorArray(roleType);
String subType = "出库".equals(type)? "销售" : "";
String [] organArray = getOrganArray(subType, "");
list =depotHeadMapperEx.findInOutMaterialCount(beginTime, endTime, type, amountApprovalFlag, materialParam, depotList, oId,
list =depotHeadMapperEx.findInOutMaterialCount(beginTime, endTime, type, forceFlag, materialParam, depotList, oId,
creatorArray, organArray, offset, rows);
}catch(Exception e){
JshException.readFail(logger, e);
@@ -633,14 +633,14 @@ public class DepotHeadService {
return list;
}
public int findInOutMaterialCountTotal(String beginTime, String endTime, String type, Boolean amountApprovalFlag, String materialParam,
public int findInOutMaterialCountTotal(String beginTime, String endTime, String type, Boolean forceFlag, String materialParam,
List<Long> depotList, Integer oId, String roleType)throws Exception {
int result = 0;
try{
String [] creatorArray = getCreatorArray(roleType);
String subType = "出库".equals(type)? "销售" : "";
String [] organArray = getOrganArray(subType, "");
result =depotHeadMapperEx.findInOutMaterialCountTotal(beginTime, endTime, type, amountApprovalFlag, materialParam, depotList, oId,
result =depotHeadMapperEx.findInOutMaterialCountTotal(beginTime, endTime, type, forceFlag, materialParam, depotList, oId,
creatorArray, organArray);
}catch(Exception e){
JshException.readFail(logger, e);
@@ -649,11 +649,11 @@ public class DepotHeadService {
}
public List<DepotHeadVo4InDetail> findAllocationDetail(String beginTime, String endTime, String subType, String number,
String [] creatorArray, Boolean amountApprovalFlag, String materialParam, List<Long> depotList, List<Long> depotFList,
String [] creatorArray, Boolean forceFlag, String materialParam, List<Long> depotList, List<Long> depotFList,
String remark, Integer offset, Integer rows) throws Exception{
List<DepotHeadVo4InDetail> list = null;
try{
list =depotHeadMapperEx.findAllocationDetail(beginTime, endTime, subType, number, creatorArray, amountApprovalFlag,
list =depotHeadMapperEx.findAllocationDetail(beginTime, endTime, subType, number, creatorArray, forceFlag,
materialParam, depotList, depotFList, remark, offset, rows);
}catch(Exception e){
JshException.readFail(logger, e);
@@ -662,11 +662,11 @@ public class DepotHeadService {
}
public int findAllocationDetailCount(String beginTime, String endTime, String subType, String number,
String [] creatorArray, Boolean amountApprovalFlag, String materialParam, List<Long> depotList, List<Long> depotFList,
String [] creatorArray, Boolean forceFlag, String materialParam, List<Long> depotList, List<Long> depotFList,
String remark) throws Exception{
int result = 0;
try{
result =depotHeadMapperEx.findAllocationDetailCount(beginTime, endTime, subType, number, creatorArray, amountApprovalFlag,
result =depotHeadMapperEx.findAllocationDetailCount(beginTime, endTime, subType, number, creatorArray, forceFlag,
materialParam, depotList, depotFList, remark);
}catch(Exception e){
JshException.readFail(logger, e);
@@ -1208,14 +1208,14 @@ public class DepotHeadService {
public BigDecimal getBuyAndSaleBasicStatistics(String type, String subType, Integer hasSupplier,
String beginTime, String endTime, String[] creatorArray) throws Exception {
Boolean amountApprovalFlag = systemConfigService.getAmountApprovalFlag();
return depotHeadMapperEx.getBuyAndSaleBasicStatistics(type, subType, hasSupplier, beginTime, endTime, creatorArray, amountApprovalFlag);
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
return depotHeadMapperEx.getBuyAndSaleBasicStatistics(type, subType, hasSupplier, beginTime, endTime, creatorArray, forceFlag);
}
public BigDecimal getBuyAndSaleRetailStatistics(String type, String subType,
String beginTime, String endTime, String[] creatorArray) throws Exception {
Boolean amountApprovalFlag = systemConfigService.getAmountApprovalFlag();
return depotHeadMapperEx.getBuyAndSaleRetailStatistics(type, subType, beginTime, endTime, creatorArray, amountApprovalFlag).abs();
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
return depotHeadMapperEx.getBuyAndSaleRetailStatistics(type, subType, beginTime, endTime, creatorArray, forceFlag).abs();
}
public DepotHead getDepotHead(String number)throws Exception {

View File

@@ -318,10 +318,10 @@ public class DepotItemService {
}
public List<DepotItemVo4WithInfoEx> getListWithBugOrSale(String materialParam, String billType,
String beginTime, String endTime, String[] creatorArray, String [] organArray, List<Long> depotList, Boolean amountApprovalFlag, Integer offset, Integer rows)throws Exception {
String beginTime, String endTime, String[] creatorArray, String [] organArray, List<Long> depotList, Boolean forceFlag, Integer offset, Integer rows)throws Exception {
List<DepotItemVo4WithInfoEx> list =null;
try{
list = depotItemMapperEx.getListWithBugOrSale(materialParam, billType, beginTime, endTime, creatorArray, organArray, depotList, amountApprovalFlag, offset, rows);
list = depotItemMapperEx.getListWithBugOrSale(materialParam, billType, beginTime, endTime, creatorArray, organArray, depotList, forceFlag, offset, rows);
}catch(Exception e){
JshException.readFail(logger, e);
}
@@ -329,10 +329,10 @@ public class DepotItemService {
}
public int getListWithBugOrSaleCount(String materialParam, String billType,
String beginTime, String endTime, String[] creatorArray, String [] organArray, List<Long> depotList, Boolean amountApprovalFlag)throws Exception {
String beginTime, String endTime, String[] creatorArray, String [] organArray, List<Long> depotList, Boolean forceFlag)throws Exception {
int result=0;
try{
result = depotItemMapperEx.getListWithBugOrSaleCount(materialParam, billType, beginTime, endTime, creatorArray, organArray, depotList, amountApprovalFlag);
result = depotItemMapperEx.getListWithBugOrSaleCount(materialParam, billType, beginTime, endTime, creatorArray, organArray, depotList, forceFlag);
}catch(Exception e){
JshException.readFail(logger, e);
}
@@ -367,10 +367,10 @@ public class DepotItemService {
BigDecimal result= BigDecimal.ZERO;
try{
String [] creatorArray = depotHeadService.getCreatorArray(roleType);
Boolean amountApprovalFlag = systemConfigService.getAmountApprovalFlag();
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
String beginTime = Tools.firstDayOfMonth(month) + BusinessConstants.DAY_FIRST_TIME;
String endTime = Tools.lastDayOfMonth(month) + BusinessConstants.DAY_LAST_TIME;
result = depotItemMapperEx.inOrOutPrice(type, subType, beginTime, endTime, creatorArray, amountApprovalFlag);
result = depotItemMapperEx.inOrOutPrice(type, subType, beginTime, endTime, creatorArray, forceFlag);
}catch(Exception e){
JshException.readFail(logger, e);
}
@@ -389,10 +389,10 @@ public class DepotItemService {
BigDecimal result= BigDecimal.ZERO;
try{
String [] creatorArray = depotHeadService.getCreatorArray(roleType);
Boolean amountApprovalFlag = systemConfigService.getAmountApprovalFlag();
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
String beginTime = Tools.firstDayOfMonth(month) + BusinessConstants.DAY_FIRST_TIME;
String endTime = Tools.lastDayOfMonth(month) + BusinessConstants.DAY_LAST_TIME;
result = depotItemMapperEx.inOrOutRetailPrice(type, subType, beginTime, endTime, creatorArray, amountApprovalFlag);
result = depotItemMapperEx.inOrOutRetailPrice(type, subType, beginTime, endTime, creatorArray, forceFlag);
result = result.abs();
}catch(Exception e){
JshException.readFail(logger, e);
@@ -874,9 +874,9 @@ public class DepotItemService {
*/
public BigDecimal getSkuStockByParam(Long depotId, Long meId, String beginTime, String endTime) throws Exception {
//获取库存审核开关
Boolean stockApprovalFlag = systemConfigService.getStockApprovalFlag();
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
List<Long> depotList = depotService.parseDepotList(depotId);
DepotItemVo4Stock stockObj = depotItemMapperEx.getSkuStockByParamWithDepotList(depotList, meId, stockApprovalFlag, beginTime, endTime);
DepotItemVo4Stock stockObj = depotItemMapperEx.getSkuStockByParamWithDepotList(depotList, meId, forceFlag, beginTime, endTime);
BigDecimal stockSum = BigDecimal.ZERO;
if(stockObj!=null) {
BigDecimal inTotal = stockObj.getInTotal();
@@ -916,12 +916,12 @@ public class DepotItemService {
*/
public BigDecimal getStockByParamWithDepotList(List<Long> depotList, Long mId, String beginTime, String endTime) throws Exception {
//获取库存审核开关
Boolean stockApprovalFlag = systemConfigService.getStockApprovalFlag();
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
//初始库存
BigDecimal initStock = materialService.getInitStockByMidAndDepotList(depotList, mId);
//盘点复盘后数量的变动
BigDecimal stockCheckSum = depotItemMapperEx.getStockCheckSumByDepotList(depotList, mId, stockApprovalFlag, beginTime, endTime);
DepotItemVo4Stock stockObj = depotItemMapperEx.getStockByParamWithDepotList(depotList, mId, stockApprovalFlag, beginTime, endTime);
BigDecimal stockCheckSum = depotItemMapperEx.getStockCheckSumByDepotList(depotList, mId, forceFlag, beginTime, endTime);
DepotItemVo4Stock stockObj = depotItemMapperEx.getStockByParamWithDepotList(depotList, mId, forceFlag, beginTime, endTime);
BigDecimal stockSum = BigDecimal.ZERO;
if(stockObj!=null) {
BigDecimal inTotal = stockObj.getInTotal();
@@ -948,13 +948,13 @@ public class DepotItemService {
*/
public Map<String, BigDecimal> getIntervalMapByParamWithDepotList(List<Long> depotList, Long mId, String beginTime, String endTime) throws Exception {
//获取库存审核开关
Boolean stockApprovalFlag = systemConfigService.getStockApprovalFlag();
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
Map<String,BigDecimal> intervalMap = new HashMap<>();
BigDecimal inSum = BigDecimal.ZERO;
BigDecimal outSum = BigDecimal.ZERO;
//盘点复盘后数量的变动
BigDecimal stockCheckSum = depotItemMapperEx.getStockCheckSumByDepotList(depotList, mId, stockApprovalFlag, beginTime, endTime);
DepotItemVo4Stock stockObj = depotItemMapperEx.getStockByParamWithDepotList(depotList, mId, stockApprovalFlag, beginTime, endTime);
BigDecimal stockCheckSum = depotItemMapperEx.getStockCheckSumByDepotList(depotList, mId, forceFlag, beginTime, endTime);
DepotItemVo4Stock stockObj = depotItemMapperEx.getStockByParamWithDepotList(depotList, mId, forceFlag, beginTime, endTime);
if(stockObj!=null) {
BigDecimal inTotal = stockObj.getInTotal();
BigDecimal transfInTotal = stockObj.getTransfInTotal();

View File

@@ -201,37 +201,20 @@ public class SystemConfigService {
}
/**
* 获取金额审核开关
* 获取审核开关
* @return
* @throws Exception
*/
public boolean getAmountApprovalFlag() throws Exception {
boolean amountApprovalFlag = false;
public boolean getForceApprovalFlag() throws Exception {
boolean forceApprovalFlag = false;
List<SystemConfig> list = getSystemConfig();
if(list.size()>0) {
String flag = list.get(0).getAmountApprovalFlag();
String flag = list.get(0).getForceApprovalFlag();
if(("1").equals(flag)) {
amountApprovalFlag = true;
forceApprovalFlag = true;
}
}
return amountApprovalFlag;
}
/**
* 获取库存审核开关
* @return
* @throws Exception
*/
public boolean getStockApprovalFlag() throws Exception {
boolean amountApprovalFlag = false;
List<SystemConfig> list = getSystemConfig();
if(list.size()>0) {
String flag = list.get(0).getStockApprovalFlag();
if(("1").equals(flag)) {
amountApprovalFlag = true;
}
}
return amountApprovalFlag;
return forceApprovalFlag;
}
/**