增加仓库和客户配置开关(完成1阶段)

This commit is contained in:
季圣华
2019-08-04 00:54:53 +08:00
parent d1c720b27f
commit 63e20b12ca
9 changed files with 342 additions and 38 deletions

View File

@@ -1684,3 +1684,10 @@ INSERT INTO `jsh_tenant` VALUES ('13', '63', 'jsh', '20', '2000', null);
-- 删除函数
-- ----------------------------
DROP FUNCTION IF EXISTS `_nextval`;
-- ----------------------------
-- 时间2019年8月1日
-- 增加仓库和客户的启用标记
-- ----------------------------
alter table jsh_systemconfig add customer_flag varchar(1) DEFAULT '0' COMMENT '客户启用标记0未启用1启用' after company_post_code;
alter table jsh_systemconfig add depot_flag varchar(1) DEFAULT '0' COMMENT '仓库启用标记0未启用1启用' after company_post_code;

View File

@@ -1700,6 +1700,8 @@ CREATE TABLE `jsh_systemconfig` (
`company_tel` varchar(20) DEFAULT NULL COMMENT '公司电话',
`company_fax` varchar(20) DEFAULT NULL COMMENT '公司传真',
`company_post_code` varchar(20) DEFAULT NULL COMMENT '公司邮编',
`depot_flag` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '仓库启用标记0未启用1启用' ,
`customer_flag` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL 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`)

View File

@@ -73,6 +73,39 @@
}
}
/**
* 获取公司信息
*/
function getSystemConfig() {
var info = null;
$.ajax({
type:"get",
url: "/systemConfig/list",
dataType: "json",
data: ({
currentPage: 1,
pageSize: 100
}),
async: false,
success: function (res) {
if (res && res.code === 200) {
if(res.data && res.data.page) {
var array = res.data.page.rows;
if(array.length > 0) {
info = array[0];
}
}
}
},
//此处添加错误处理
error:function() {
$.messager.alert('查询失败','查询系统配置信息异常,请稍后再试!','error');
return;
}
});
return info;
}
/**
* js生成唯一ID值 32位值随机值
* @returns 生成的字符串

View File

@@ -6,35 +6,11 @@ function CreateFormPage(strPrintName, printDatagrid) {
var getMonth= $("#searchMonth").val();
var listTitle = $("#tablePanel").prev().text();
listTitle = listTitle.replace("列表","");
var config = getSystemConfig();
var companyName = "";
//加载公司信息
$.ajax({
type:"get",
url: "/systemConfig/list",
dataType: "json",
data: ({
currentPage: 1,
pageSize: 100
}),
async: false,
success: function (res) {
if (res && res.code === 200) {
if(res.data && res.data.page) {
var array = res.data.page.rows;
if(array.length > 0) {
var info = array[0];
companyName = info.companyName;
}
}
}
},
//此处添加错误处理
error:function() {
$.messager.alert('查询失败','查询系统配置信息异常,请稍后再试!','error');
return;
}
});
if(config) {
companyName = config.companyName;
}
var tableString = '<div class="div-title">' + companyName + "-" + listTitle + '\n</div>';
if(beginDate && endDate) {
tableString+='\n<div class="div-time">日期:' + beginDate + ' 至 ' + endDate + ' \n</div>';

View File

@@ -70,6 +70,14 @@
<label id="companyPostCodeLabel">公司邮编&nbsp;&nbsp;</label>
<input name="companyPostCode" id="companyPostCode" style="width: 220px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px">
<label id="depotFlagLabel">仓库开关&nbsp;&nbsp;</label>
<input name="depotFlag" id="depotFlag" type="checkbox" style="width: 220px;height: 20px"/>
</div>
<div class="fitem" style="padding:5px">
<label id="customerFlagLabel">客户开关&nbsp;&nbsp;</label>
<input name="customerFlag" id="customerFlag" type="checkbox" style="width: 220px;height: 20px"/>
</div>
</form>
</div>
<div id="dlg-buttons">
@@ -86,6 +94,16 @@
//初始化表格数据
function initTableData() {
function parseFlag(value) {
var flagName = "";
if (value =="1") {
flagName = "<span style='color:green'>启用</span>";
}
else {
flagName = "<span style='color:red'>关闭</span>";
}
return flagName;
}
$('#tableData').datagrid({
height: heightInfo,
nowrap: false,
@@ -108,11 +126,24 @@
{title: '公司电话', field: 'companyTel', width: 120, align: "center"},
{title: '公司传真', field: 'companyFax', width: 120, align: "center"},
{title: '公司邮编', field: 'companyPostCode', 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: 'op', width: 160, formatter: function (value, rec) {
var str = '';
var rowInfo = rec.id + 'AaBb' + rec.companyName + 'AaBb' + rec.companyContacts + 'AaBb' + rec.companyAddress
+ 'AaBb' + rec.companyTel + 'AaBb' + rec.companyFax + 'AaBb' + rec.companyPostCode;
+ 'AaBb' + rec.companyTel + 'AaBb' + rec.companyFax + 'AaBb' + rec.companyPostCode
+ 'AaBb' + rec.depotFlag + 'AaBb' + rec.customerFlag;
str += '<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editSystemConfig(\'' + rowInfo + '\');"/>&nbsp;<a onclick="editSystemConfig(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a>&nbsp;&nbsp;';
str += '<img src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteSystemConfig(' + rec.id + ');"/>&nbsp;<a onclick="deleteSystemConfig(' + rec.id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>&nbsp;&nbsp;';
return str;
@@ -298,12 +329,15 @@
$("#companyName").val("").focus();
return;
}
var infoObj = $("#systemConfigFM").serializeObject();
infoObj.depotFlag = $("#depotFlag").is(':checked')?"1":"0";
infoObj.customerFlag = $("#customerFlag").is(':checked')?"1":"0";
$.ajax({
url: url,
type: "post",
dataType: "json",
data: {
info: JSON.stringify($("#systemConfigFM").serializeObject())
info: JSON.stringify(infoObj)
},
success: function(res) {
if(res && res.code === 200) {
@@ -339,6 +373,8 @@
systemConfigId = systemConfigInfo[0];
//焦点在名称输入框==定焦在输入文字后面
$("#companyName").val("").focus().val(systemConfigInfo[1]);
$("#depotFlag").attr("checked", systemConfigInfo[7] == '1' ? true : false);
$("#customerFlag").attr("checked", systemConfigInfo[8] == '1' ? true : false);
url = '/systemConfig/update?id=' + systemConfigInfo[0];
}

View File

@@ -113,11 +113,27 @@
<script type="text/javascript">
//初始化界面
$(function () {
initConfig();
initTableData();
ininPager();
browserFit();
});
//初始化配置
function initConfig() {
$("#btnSetDepart").hide();
$("#btnSetCustomer").hide();
var config = getSystemConfig();
if(config) {
if(config.depotFlag == "1") {
$("#btnSetDepart").show();
}
if(config.customerFlag == "1") {
$("#btnSetCustomer").show();
}
}
}
//浏览器适配
function browserFit() {
if (getOs() == 'MSIE') {
@@ -172,8 +188,8 @@
{title: '部门', field: 'orgAbr', width: 115, align: "center"},
{title: '电子邮箱', field: 'email', width: 150, align: "center"},
{title: '电话号码', field: 'phonenum', width: 150, align: "center"},
{title: '用户排序', field: 'userBlngOrgaDsplSeq', width: 50, align: "center"},
{title: '描述', field: 'description', width: 150},
{title: '用户排序', field: 'userBlngOrgaDsplSeq', width: 60, align: "center"},
{title: '描述', field: 'description', width: 130},
{field: 'orgaId',hidden:true, width: 10},
{
title: '操作', field: 'isystem', width: 150, formatter: function (value, rec) {

View File

@@ -57,6 +57,22 @@ public class SystemConfig {
*/
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
@@ -241,6 +257,54 @@ public class SystemConfig {
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

View File

@@ -674,6 +674,146 @@ public class SystemConfigExample {
return (Criteria) this;
}
public Criteria andDepotFlagIsNull() {
addCriterion("depot_flag is null");
return (Criteria) this;
}
public Criteria andDepotFlagIsNotNull() {
addCriterion("depot_flag is not null");
return (Criteria) this;
}
public Criteria andDepotFlagEqualTo(String value) {
addCriterion("depot_flag =", value, "depotFlag");
return (Criteria) this;
}
public Criteria andDepotFlagNotEqualTo(String value) {
addCriterion("depot_flag <>", value, "depotFlag");
return (Criteria) this;
}
public Criteria andDepotFlagGreaterThan(String value) {
addCriterion("depot_flag >", value, "depotFlag");
return (Criteria) this;
}
public Criteria andDepotFlagGreaterThanOrEqualTo(String value) {
addCriterion("depot_flag >=", value, "depotFlag");
return (Criteria) this;
}
public Criteria andDepotFlagLessThan(String value) {
addCriterion("depot_flag <", value, "depotFlag");
return (Criteria) this;
}
public Criteria andDepotFlagLessThanOrEqualTo(String value) {
addCriterion("depot_flag <=", value, "depotFlag");
return (Criteria) this;
}
public Criteria andDepotFlagLike(String value) {
addCriterion("depot_flag like", value, "depotFlag");
return (Criteria) this;
}
public Criteria andDepotFlagNotLike(String value) {
addCriterion("depot_flag not like", value, "depotFlag");
return (Criteria) this;
}
public Criteria andDepotFlagIn(List<String> values) {
addCriterion("depot_flag in", values, "depotFlag");
return (Criteria) this;
}
public Criteria andDepotFlagNotIn(List<String> values) {
addCriterion("depot_flag not in", values, "depotFlag");
return (Criteria) this;
}
public Criteria andDepotFlagBetween(String value1, String value2) {
addCriterion("depot_flag between", value1, value2, "depotFlag");
return (Criteria) this;
}
public Criteria andDepotFlagNotBetween(String value1, String value2) {
addCriterion("depot_flag not between", value1, value2, "depotFlag");
return (Criteria) this;
}
public Criteria andCustomerFlagIsNull() {
addCriterion("customer_flag is null");
return (Criteria) this;
}
public Criteria andCustomerFlagIsNotNull() {
addCriterion("customer_flag is not null");
return (Criteria) this;
}
public Criteria andCustomerFlagEqualTo(String value) {
addCriterion("customer_flag =", value, "customerFlag");
return (Criteria) this;
}
public Criteria andCustomerFlagNotEqualTo(String value) {
addCriterion("customer_flag <>", value, "customerFlag");
return (Criteria) this;
}
public Criteria andCustomerFlagGreaterThan(String value) {
addCriterion("customer_flag >", value, "customerFlag");
return (Criteria) this;
}
public Criteria andCustomerFlagGreaterThanOrEqualTo(String value) {
addCriterion("customer_flag >=", value, "customerFlag");
return (Criteria) this;
}
public Criteria andCustomerFlagLessThan(String value) {
addCriterion("customer_flag <", value, "customerFlag");
return (Criteria) this;
}
public Criteria andCustomerFlagLessThanOrEqualTo(String value) {
addCriterion("customer_flag <=", value, "customerFlag");
return (Criteria) this;
}
public Criteria andCustomerFlagLike(String value) {
addCriterion("customer_flag like", value, "customerFlag");
return (Criteria) this;
}
public Criteria andCustomerFlagNotLike(String value) {
addCriterion("customer_flag not like", value, "customerFlag");
return (Criteria) this;
}
public Criteria andCustomerFlagIn(List<String> values) {
addCriterion("customer_flag in", values, "customerFlag");
return (Criteria) this;
}
public Criteria andCustomerFlagNotIn(List<String> values) {
addCriterion("customer_flag not in", values, "customerFlag");
return (Criteria) this;
}
public Criteria andCustomerFlagBetween(String value1, String value2) {
addCriterion("customer_flag between", value1, value2, "customerFlag");
return (Criteria) this;
}
public Criteria andCustomerFlagNotBetween(String value1, String value2) {
addCriterion("customer_flag not between", value1, value2, "customerFlag");
return (Criteria) this;
}
public Criteria andTenantIdIsNull() {
addCriterion("tenant_id is null");
return (Criteria) this;

View File

@@ -13,6 +13,8 @@
<result column="company_tel" jdbcType="VARCHAR" property="companyTel" />
<result column="company_fax" jdbcType="VARCHAR" property="companyFax" />
<result column="company_post_code" jdbcType="VARCHAR" property="companyPostCode" />
<result column="depot_flag" jdbcType="VARCHAR" property="depotFlag" />
<result column="customer_flag" jdbcType="VARCHAR" property="customerFlag" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
</resultMap>
@@ -88,7 +90,7 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, company_name, company_contacts, company_address, company_tel, company_fax, company_post_code,
tenant_id, delete_Flag
depot_flag, customer_flag, tenant_id, delete_Flag
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.SystemConfigExample" resultMap="BaseResultMap">
<!--
@@ -143,12 +145,12 @@
-->
insert into jsh_systemconfig (id, company_name, company_contacts,
company_address, company_tel, company_fax,
company_post_code, tenant_id, delete_Flag
)
company_post_code, depot_flag, customer_flag,
tenant_id, delete_Flag)
values (#{id,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, #{companyContacts,jdbcType=VARCHAR},
#{companyAddress,jdbcType=VARCHAR}, #{companyTel,jdbcType=VARCHAR}, #{companyFax,jdbcType=VARCHAR},
#{companyPostCode,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
)
#{companyPostCode,jdbcType=VARCHAR}, #{depotFlag,jdbcType=VARCHAR}, #{customerFlag,jdbcType=VARCHAR},
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.SystemConfig">
<!--
@@ -178,6 +180,12 @@
<if test="companyPostCode != null">
company_post_code,
</if>
<if test="depotFlag != null">
depot_flag,
</if>
<if test="customerFlag != null">
customer_flag,
</if>
<if test="tenantId != null">
tenant_id,
</if>
@@ -207,6 +215,12 @@
<if test="companyPostCode != null">
#{companyPostCode,jdbcType=VARCHAR},
</if>
<if test="depotFlag != null">
#{depotFlag,jdbcType=VARCHAR},
</if>
<if test="customerFlag != null">
#{customerFlag,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
#{tenantId,jdbcType=BIGINT},
</if>
@@ -253,6 +267,12 @@
<if test="record.companyPostCode != null">
company_post_code = #{record.companyPostCode,jdbcType=VARCHAR},
</if>
<if test="record.depotFlag != null">
depot_flag = #{record.depotFlag,jdbcType=VARCHAR},
</if>
<if test="record.customerFlag != null">
customer_flag = #{record.customerFlag,jdbcType=VARCHAR},
</if>
<if test="record.tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
@@ -277,6 +297,8 @@
company_tel = #{record.companyTel,jdbcType=VARCHAR},
company_fax = #{record.companyFax,jdbcType=VARCHAR},
company_post_code = #{record.companyPostCode,jdbcType=VARCHAR},
depot_flag = #{record.depotFlag,jdbcType=VARCHAR},
customer_flag = #{record.customerFlag,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null">
@@ -308,6 +330,12 @@
<if test="companyPostCode != null">
company_post_code = #{companyPostCode,jdbcType=VARCHAR},
</if>
<if test="depotFlag != null">
depot_flag = #{depotFlag,jdbcType=VARCHAR},
</if>
<if test="customerFlag != null">
customer_flag = #{customerFlag,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
@@ -329,6 +357,8 @@
company_tel = #{companyTel,jdbcType=VARCHAR},
company_fax = #{companyFax,jdbcType=VARCHAR},
company_post_code = #{companyPostCode,jdbcType=VARCHAR},
depot_flag = #{depotFlag,jdbcType=VARCHAR},
customer_flag = #{customerFlag,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}