Commit 84943631 authored by 季圣华's avatar 季圣华
Browse files

增加负库存的开关

parent a0e61fa8
......@@ -1009,6 +1009,7 @@ CREATE TABLE `jsh_systemconfig` (
`company_post_code` varchar(20) DEFAULT NULL COMMENT '公司邮编',
`depot_flag` varchar(1) DEFAULT '0' COMMENT '仓库启用标记,0未启用,1启用',
`customer_flag` varchar(1) DEFAULT '0' COMMENT '客户启用标记,0未启用,1启用',
`minus_stock_flag` varchar(1) DEFAULT '0' COMMENT '负库存启用标记,0未启用,1启用',
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
`delete_Flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
PRIMARY KEY (`id`)
......@@ -1017,9 +1018,9 @@ CREATE TABLE `jsh_systemconfig` (
-- ----------------------------
-- Records of jsh_systemconfig
-- ----------------------------
INSERT INTO `jsh_systemconfig` VALUES ('7', '南通jshERP公司', '张三', '南通市通州区某某路', '0513-10101010', '0513-18181818', '226300', '0', '0', null, '0');
INSERT INTO `jsh_systemconfig` VALUES ('8', '公司123', '', '', '', '', '', '0', '0', '117', '0');
INSERT INTO `jsh_systemconfig` VALUES ('9', '公司1', '小军', '', '', '', '', '0', '0', '63', '0');
INSERT INTO `jsh_systemconfig` VALUES ('7', '南通jshERP公司', '张三', '南通市通州区某某路', '0513-10101010', '0513-18181818', '226300', '0', '0', '0', null, '0');
INSERT INTO `jsh_systemconfig` VALUES ('8', '公司123', '', '', '', '', '', '0', '0', '0', '117', '0');
INSERT INTO `jsh_systemconfig` VALUES ('9', '公司1', '小军', '', '', '', '', '0', '0', '0', '63', '0');
-- ----------------------------
-- Table structure for jsh_tenant
......
......@@ -784,4 +784,10 @@ alter table jsh_material drop PresetPriceOne;
alter table jsh_material drop PresetPriceTwo;
alter table jsh_material drop FirstOutUnit;
alter table jsh_material drop FirstInUnit;
alter table jsh_material drop PriceStrategy;
\ No newline at end of file
alter table jsh_material drop PriceStrategy;
-- ----------------------------
-- 时间:2020年6月18日
-- 增加负库存的启用标记
-- ----------------------------
alter table jsh_systemconfig add minus_stock_flag varchar(1) DEFAULT '0' COMMENT '负库存启用标记,0未启用,1启用' after customer_flag;
\ No newline at end of file
......@@ -43,55 +43,62 @@
<table>
<tr>
<td>公司名称</td>
<td style="padding:5px">
<td style="padding:5px 10px">
<input name="companyName" id="companyName" class="easyui-textbox"
data-options="required:true,validType:'length[2,15]'" style="width: 220px;"/>
</td>
</tr>
<tr>
<td>联系人</td>
<td style="padding:5px">
<td style="padding:5px 10px">
<input name="companyContacts" id="companyContacts" class="easyui-textbox" style="width: 220px;"/>
</td>
</tr>
<tr>
<td>公司地址</td>
<td style="padding:5px">
<td style="padding:5px 10px">
<input name="companyAddress" id="companyAddress" class="easyui-textbox" style="width: 220px;"/>
</td>
</tr>
<tr>
<td>公司电话</td>
<td style="padding:5px">
<td style="padding:5px 10px">
<input name="companyTel" id="companyTel" class="easyui-textbox" style="width: 220px;"/>
</td>
</tr>
<tr>
<td>公司传真</td>
<td style="padding:5px">
<td style="padding:5px 10px">
<input name="companyFax" id="companyFax" class="easyui-textbox" style="width: 220px;"/>
</td>
</tr>
<tr>
<td>公司邮编</td>
<td style="padding:5px">
<td style="padding:5px 10px">
<input name="companyPostCode" id="companyPostCode" class="easyui-textbox" style="width: 220px;"/>
</td>
</tr>
<tr>
<td>仓库权限</td>
<td style="padding:5px;text-align:center;">
<td style="padding:5px 10px;text-align:left;">
<input name="depotFlag" id="depotFlag" type="checkbox" style="width: 20px;height: 20px" title="勾选后需要到用户列表配置"/>
(勾选后需要到用户列表配置)
</td>
</tr>
<tr>
<td>客户权限</td>
<td style="padding:5px;text-align:center;">
<td style="padding:5px 10px;text-align:left;">
<input name="customerFlag" id="customerFlag" type="checkbox" style="width: 20px;height: 20px" title="勾选后需要到用户列表配置"/>
(勾选后需要到用户列表配置)
</td>
</tr>
<tr>
<td>负库存</td>
<td style="padding:5px 10px;text-align:left;">
<input name="minusStockFlag" id="minusStockFlag" type="checkbox" style="width: 20px;height: 20px" title="勾选后支持负库存,批次商品除外"/>
(勾选后支持负库存,批次商品除外)
</td>
</tr>
</table>
</form>
</div>
......@@ -151,13 +158,19 @@
{title: '公司传真', field: 'companyFax', width: 120, align: "center"},
{title: '公司邮编', field: 'companyPostCode', width: 80, align: "center"},
{
title: '仓库开关', field: 'depotFlag', width: 80, align: "center",
title: '仓库权限', field: 'depotFlag', width: 80, align: "center",
formatter: function (value) {
return parseFlag(value);
}
},
{
title: '客户权限', field: 'customerFlag', width: 80, align: "center",
formatter: function (value) {
return parseFlag(value);
}
},
{
title: '客户开关', field: 'customerFlag', width: 80, align: "center",
title: '负库存', field: 'minusStockFlag', width: 80, align: "center",
formatter: function (value) {
return parseFlag(value);
}
......@@ -360,6 +373,7 @@
var infoObj = $("#systemConfigFM").serializeObject();
infoObj.depotFlag = $("#depotFlag").is(':checked')?"1":"0";
infoObj.customerFlag = $("#customerFlag").is(':checked')?"1":"0";
infoObj.minusStockFlag = $("#minusStockFlag").is(':checked')?"1":"0";
$.ajax({
url: url,
type: "post",
......@@ -401,6 +415,7 @@
systemConfigId = res.id;
$("#depotFlag").attr("checked", res.depotFlag == '1' ? true : false);
$("#customerFlag").attr("checked", res.customerFlag == '1' ? true : false);
$("#minusStockFlag").attr("checked", res.minusStockFlag == '1' ? true : false);
url = '/systemConfig/update?id=' + res.id;
}
......
package com.jsh.erp.datasource.entities;
public class SystemConfig {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.id
*
* @mbggenerated
*/
private Long id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.company_name
*
* @mbggenerated
*/
private String companyName;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.company_contacts
*
* @mbggenerated
*/
private String companyContacts;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.company_address
*
* @mbggenerated
*/
private String companyAddress;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.company_tel
*
* @mbggenerated
*/
private String companyTel;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.company_fax
*
* @mbggenerated
*/
private String companyFax;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.company_post_code
*
* @mbggenerated
*/
private String companyPostCode;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.depot_flag
*
* @mbggenerated
*/
private String depotFlag;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.customer_flag
*
* @mbggenerated
*/
private String customerFlag;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.tenant_id
*
* @mbggenerated
*/
private String minusStockFlag;
private Long tenantId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.delete_Flag
*
* @mbggenerated
*/
private String deleteFlag;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.id
*
* @return the value of jsh_systemconfig.id
*
* @mbggenerated
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.id
*
* @param id the value for jsh_systemconfig.id
*
* @mbggenerated
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.company_name
*
* @return the value of jsh_systemconfig.company_name
*
* @mbggenerated
*/
public String getCompanyName() {
return companyName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.company_name
*
* @param companyName the value for jsh_systemconfig.company_name
*
* @mbggenerated
*/
public void setCompanyName(String companyName) {
this.companyName = companyName == null ? null : companyName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.company_contacts
*
* @return the value of jsh_systemconfig.company_contacts
*
* @mbggenerated
*/
public String getCompanyContacts() {
return companyContacts;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.company_contacts
*
* @param companyContacts the value for jsh_systemconfig.company_contacts
*
* @mbggenerated
*/
public void setCompanyContacts(String companyContacts) {
this.companyContacts = companyContacts == null ? null : companyContacts.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.company_address
*
* @return the value of jsh_systemconfig.company_address
*
* @mbggenerated
*/
public String getCompanyAddress() {
return companyAddress;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.company_address
*
* @param companyAddress the value for jsh_systemconfig.company_address
*
* @mbggenerated
*/
public void setCompanyAddress(String companyAddress) {
this.companyAddress = companyAddress == null ? null : companyAddress.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.company_tel
*
* @return the value of jsh_systemconfig.company_tel
*
* @mbggenerated
*/
public String getCompanyTel() {
return companyTel;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.company_tel
*
* @param companyTel the value for jsh_systemconfig.company_tel
*
* @mbggenerated
*/
public void setCompanyTel(String companyTel) {
this.companyTel = companyTel == null ? null : companyTel.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.company_fax
*
* @return the value of jsh_systemconfig.company_fax
*
* @mbggenerated
*/
public String getCompanyFax() {
return companyFax;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.company_fax
*
* @param companyFax the value for jsh_systemconfig.company_fax
*
* @mbggenerated
*/
public void setCompanyFax(String companyFax) {
this.companyFax = companyFax == null ? null : companyFax.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.company_post_code
*
* @return the value of jsh_systemconfig.company_post_code
*
* @mbggenerated
*/
public String getCompanyPostCode() {
return companyPostCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.company_post_code
*
* @param companyPostCode the value for jsh_systemconfig.company_post_code
*
* @mbggenerated
*/
public void setCompanyPostCode(String companyPostCode) {
this.companyPostCode = companyPostCode == null ? null : companyPostCode.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.depot_flag
*
* @return the value of jsh_systemconfig.depot_flag
*
* @mbggenerated
*/
public String getDepotFlag() {
return depotFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.depot_flag
*
* @param depotFlag the value for jsh_systemconfig.depot_flag
*
* @mbggenerated
*/
public void setDepotFlag(String depotFlag) {
this.depotFlag = depotFlag == null ? null : depotFlag.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.customer_flag
*
* @return the value of jsh_systemconfig.customer_flag
*
* @mbggenerated
*/
public String getCustomerFlag() {
return customerFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.customer_flag
*
* @param customerFlag the value for jsh_systemconfig.customer_flag
*
* @mbggenerated
*/
public void setCustomerFlag(String customerFlag) {
this.customerFlag = customerFlag == null ? null : customerFlag.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.tenant_id
*
* @return the value of jsh_systemconfig.tenant_id
*
* @mbggenerated
*/
public String getMinusStockFlag() {
return minusStockFlag;
}
public void setMinusStockFlag(String minusStockFlag) {
this.minusStockFlag = minusStockFlag == null ? null : minusStockFlag.trim();
}
public Long getTenantId() {
return tenantId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.tenant_id
*
* @param tenantId the value for jsh_systemconfig.tenant_id
*
* @mbggenerated
*/
public void setTenantId(Long tenantId) {
this.tenantId = tenantId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.delete_Flag
*
* @return the value of jsh_systemconfig.delete_Flag
*
* @mbggenerated
*/
public String getDeleteFlag() {
return deleteFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.delete_Flag
*
* @param deleteFlag the value for jsh_systemconfig.delete_Flag
*
* @mbggenerated
*/
public void setDeleteFlag(String deleteFlag) {
this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim();
}
......
......@@ -4,118 +4,46 @@ import java.util.ArrayList;
import java.util.List;
public class SystemConfigExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public SystemConfigExample() {
oredCriteria = new ArrayList<Criteria>();
oredCriteria = new ArrayList<>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
......@@ -124,41 +52,23 @@ public class SystemConfigExample {
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
criteria = new ArrayList<>();
}
public boolean isValid() {
......@@ -814,6 +724,76 @@ public class SystemConfigExample {
return (Criteria) this;
}
public Criteria andMinusStockFlagIsNull() {
addCriterion("minus_stock_flag is null");
return (Criteria) this;
}
public Criteria andMinusStockFlagIsNotNull() {
addCriterion("minus_stock_flag is not null");
return (Criteria) this;
}
public Criteria andMinusStockFlagEqualTo(String value) {
addCriterion("minus_stock_flag =", value, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagNotEqualTo(String value) {
addCriterion("minus_stock_flag <>", value, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagGreaterThan(String value) {
addCriterion("minus_stock_flag >", value, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagGreaterThanOrEqualTo(String value) {
addCriterion("minus_stock_flag >=", value, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagLessThan(String value) {
addCriterion("minus_stock_flag <", value, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagLessThanOrEqualTo(String value) {
addCriterion("minus_stock_flag <=", value, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagLike(String value) {
addCriterion("minus_stock_flag like", value, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagNotLike(String value) {
addCriterion("minus_stock_flag not like", value, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagIn(List<String> values) {
addCriterion("minus_stock_flag in", values, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagNotIn(List<String> values) {
addCriterion("minus_stock_flag not in", values, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagBetween(String value1, String value2) {
addCriterion("minus_stock_flag between", value1, value2, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagNotBetween(String value1, String value2) {
addCriterion("minus_stock_flag not between", value1, value2, "minusStockFlag");
return (Criteria) this;
}
public Criteria andTenantIdIsNull() {
addCriterion("tenant_id is null");
return (Criteria) this;
......@@ -945,25 +925,12 @@ public class SystemConfigExample {
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table jsh_systemconfig
*
* @mbggenerated do_not_delete_during_merge
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public static class Criterion {
private String condition;
......
......@@ -6,91 +6,25 @@ import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SystemConfigMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int countByExample(SystemConfigExample example);
long countByExample(SystemConfigExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int deleteByExample(SystemConfigExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int insert(SystemConfig record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int insertSelective(SystemConfig record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
List<SystemConfig> selectByExample(SystemConfigExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
SystemConfig selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int updateByExampleSelective(@Param("record") SystemConfig record, @Param("example") SystemConfigExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int updateByExample(@Param("record") SystemConfig record, @Param("example") SystemConfigExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int updateByPrimaryKeySelective(SystemConfig record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int updateByPrimaryKey(SystemConfig record);
}
\ No newline at end of file
......@@ -17,6 +17,7 @@ import com.jsh.erp.service.MaterialExtend.MaterialExtendService;
import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.material.MaterialService;
import com.jsh.erp.service.serialNumber.SerialNumberService;
import com.jsh.erp.service.systemConfig.SystemConfigService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.QueryUtils;
import com.jsh.erp.utils.StringUtil;
......@@ -60,6 +61,8 @@ public class DepotItemService {
@Resource
private UserService userService;
@Resource
private SystemConfigService systemConfigService;
@Resource
private LogService logService;
public DepotItem getDepotItem(long id)throws Exception {
......@@ -429,7 +432,7 @@ public class DepotItemService {
}
BigDecimal stock = getStockByParam(depotItem.getDepotid(),depotItem.getMaterialid(),null,null,tenantId);
BigDecimal thisBasicNumber = depotItem.getBasicnumber()==null?BigDecimal.ZERO:depotItem.getBasicnumber();
if(stock.compareTo(thisBasicNumber)<0){
if(systemConfigService.getMinusStockFlag() == false && stock.compareTo(thisBasicNumber)<0){
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE,
String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName()));
}
......@@ -558,7 +561,7 @@ public class DepotItemService {
if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){
BigDecimal stock = getStockByParam(depotItem.getDepotid(),depotItem.getMaterialid(),null,null,tenantId);
BigDecimal thisBasicNumber = depotItem.getBasicnumber()==null?BigDecimal.ZERO:depotItem.getBasicnumber();
if(stock.compareTo(thisBasicNumber)<0){
if(systemConfigService.getMinusStockFlag() == false && stock.compareTo(thisBasicNumber)<0){
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE,
String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName()));
}
......
......@@ -199,4 +199,21 @@ public class SystemConfigService {
}
return customerFlag;
}
/**
* 获取负库存开关
* @return
* @throws Exception
*/
public boolean getMinusStockFlag() throws Exception {
boolean minusStockFlag = false;
List<SystemConfig> list = getSystemConfig();
if(list.size()>0) {
String flag = list.get(0).getMinusStockFlag();
if(("1").equals(flag)) {
minusStockFlag = true;
}
}
return minusStockFlag;
}
}
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