From a95ecbda1b5d264f0f4de462c6c07929404c8a98 Mon Sep 17 00:00:00 2001 From: double <768903061@qq.com> Date: Tue, 23 Apr 2019 14:00:30 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E9=9B=B6=E5=94=AE=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BC=9A=E5=91=98=E5=8D=A1=E5=8F=B7=E5=BF=AB?= =?UTF-8?q?=E6=8D=B7=E6=96=B9=E5=BC=8F=202=E3=80=81=E9=94=80=E5=94=AE?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E3=80=81=E9=94=80=E5=94=AE=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A2=E6=88=B7=E5=BF=AB=E6=8D=B7=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=203=E3=80=81=E4=BB=93=E5=BA=93=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=BB=93=E5=BA=93=204=E3=80=81=E9=9B=B6?= =?UTF-8?q?=E5=94=AE=E3=80=81=E9=94=80=E5=94=AE=E3=80=81=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E7=9A=84=E5=95=86=E5=93=81=E6=98=8E=E7=BB=86=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=80=89=E4=B8=AD=E9=BB=98=E8=AE=A4=E4=BB=93?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- erp_web/js/pages/materials/in_out.js | 164 ++++++++++-------- erp_web/pages/manage/depot.html | 68 +++++++- erp_web/pages/materials/retail_out_list.html | 110 +++++++++++- erp_web/pages/materials/sale_orders_list.html | 113 +++++++++++- erp_web/pages/materials/sale_out_list.html | 113 +++++++++++- .../jsh/erp/constants/BusinessConstants.java | 2 +- .../jsh/erp/controller/DepotController.java | 13 +- .../erp/controller/DepotItemController.java | 2 +- .../jsh/erp/datasource/entities/Depot.java | 11 +- .../erp/datasource/entities/DepotExample.java | 61 ++++++- .../jsh/erp/service/depot/DepotService.java | 20 +++ src/main/resources/mapper_xml/DepotMapper.xml | 28 +-- 12 files changed, 607 insertions(+), 98 deletions(-) diff --git a/erp_web/js/pages/materials/in_out.js b/erp_web/js/pages/materials/in_out.js index 678b0741..b8693ca9 100644 --- a/erp_web/js/pages/materials/in_out.js +++ b/erp_web/js/pages/materials/in_out.js @@ -1,4 +1,5 @@ //初始化界面 + var defDepotId = null; var kid = sessionStorage.getItem("userId"); var pageType = getUrlParam('t'); //获取页面类型传值 var depotList = null; @@ -53,7 +54,7 @@ initMProperty(); //初始化商品属性 initTableData(); ininPager(); - initForm(); + initForm(); bindEvent();//绑定操作事件 }); //根据单据名称获取类型 @@ -74,8 +75,8 @@ amountNum = "CGDD"; } else if(listTitle === "采购入库列表"){ - listType = "入库"; - listSubType = "采购"; + listType = "入库"; + listSubType = "采购"; payTypeTitle = "付款"; organUrl = supUrl; amountNum = "CGRK"; @@ -88,15 +89,15 @@ amountNum = "LSTH"; } else if(listTitle === "销售退货列表"){ - listType = "入库"; - listSubType = "销售退货"; + listType = "入库"; + listSubType = "销售退货"; payTypeTitle = "付款"; organUrl = cusUrl; amountNum = "XSTH"; } else if(listTitle === "其它入库列表"){ - listType = "入库"; - listSubType = "其它"; + listType = "入库"; + listSubType = "其它"; payTypeTitle = "隐藏"; organUrl = supUrl; amountNum = "QTRK"; @@ -116,29 +117,29 @@ amountNum = "XSDD"; } else if(listTitle === "销售出库列表"){ - listType = "出库"; - listSubType = "销售"; + listType = "出库"; + listSubType = "销售"; payTypeTitle = "收款"; organUrl = cusUrl; amountNum = "XSCK"; } else if(listTitle === "采购退货列表"){ - listType = "出库"; + listType = "出库"; listSubType = "采购退货"; payTypeTitle = "收款"; organUrl = supUrl; amountNum = "CGTH"; } else if(listTitle === "其它出库列表"){ - listType = "出库"; - listSubType = "其它"; + listType = "出库"; + listSubType = "其它"; payTypeTitle = "隐藏"; organUrl = cusUrl; amountNum = "QTCK"; } else if(listTitle === "调拨出库列表"){ - listType = "出库"; - listSubType = "调拨"; + listType = "出库"; + listSubType = "调拨"; payTypeTitle = "隐藏"; organUrl = supUrl; amountNum = "DBCK"; @@ -178,12 +179,12 @@ userBusinessList = null; } } - }); - + }); + } //初始化页面选项卡 function initSelectInfo_UB(){ - + if(userBusinessList !=null) { if(userBusinessList.length>0) @@ -193,8 +194,8 @@ } } } - - + + //初始化系统基础信息 function initSystemData_depot(){ $.ajax({ @@ -211,24 +212,27 @@ return; } } - }); + }); } //初始化页面选项卡 function initSelectInfo_depot(){ var options = ""; - + if(depotList !=null) { options = ""; for(var i = 0 ;i < depotList.length;i++) { var depot = depotList[i]; - + if(userdepot!=null) { if(userdepot.indexOf("["+depot.id+"]")!=-1) { - options += ''; + if(depot.isdefault){ + defDepotId = depot.id; + } + options += ''; depotString = depotString + depot.id + ","; } } @@ -238,16 +242,16 @@ } depotString = depotString.substring(1, depotString.length-1); $("#ProjectId").empty().append(options); - $("#AllocationProjectId").empty().append(options); + $("#AllocationProjectId").empty().append(options); $("#searchProjectId").empty().append('').append(options); } } - + //初始化供应商、客户、散户信息 function initSupplier(){ $('#OrganId').combobox({ url: organUrl, - valueField:'id', + valueField:'id', textField:'supplier', filter: function(q, row){ var opts = $(this).combobox('options'); @@ -297,7 +301,7 @@ }); } } - }); + }); } //初始化销售人员 @@ -364,7 +368,7 @@ } }); } - + //初始化系统基础信息 function initSystemData_person(){ $.ajax({ @@ -380,12 +384,12 @@ } } } - }); + }); } //初始化页面选项卡 function initSelectInfo_person(){ var options1 = ""; - + if(personList !=null) { for(var i = 0 ;i < personList.length;i++) @@ -398,7 +402,7 @@ if(person.type=="仓管员") { options1 += ''; - } + } } $("#HandsPersonId").empty().append(options1); } @@ -418,11 +422,11 @@ } } } - }); + }); } //获取账户信息 function initSelectInfo_account(){ - var options = ""; + var options = ""; if(accountList !=null){ options = ""; options += ""; @@ -432,11 +436,11 @@ if(account.isdefault) { defaultAccountId = account.id; //给账户赋值默认id } - } + } $("#AccountId").empty().append(options); } } - + //防止表单提交重复 function initForm(){ $('#depotHeadFM').form({ @@ -445,7 +449,7 @@ } }); } - + //初始化表格数据 function initTableData(){ if(pageType === "skip") { @@ -616,7 +620,7 @@ onLoadError:function() { $.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error'); return; - } + } }); } @@ -1112,7 +1116,7 @@ iconCls:'icon-undo', handler:function() { - reject(); //撤销 + reject(); //撤销 } } ], @@ -1120,7 +1124,7 @@ { $.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error'); return; - } + } }); $.ajax({ type:"get", @@ -1164,8 +1168,8 @@ $.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error'); } }); - } - + } + //初始化表格数据-商品列表-查看状态 function initTableData_material_show(TotalPrice){ var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示 @@ -1221,7 +1225,7 @@ onLoadError:function() { $.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error'); return; - } + } }); $.ajax({ type:"get", @@ -1256,28 +1260,28 @@ function ininPager(){ try { - var opts = $("#tableData").datagrid('options'); - var pager = $("#tableData").datagrid('getPager'); - pager.pagination({ + var opts = $("#tableData").datagrid('options'); + var pager = $("#tableData").datagrid('getPager'); + pager.pagination({ onSelectPage:function(pageNum, pageSize) - { - opts.pageNumber = pageNum; - opts.pageSize = pageSize; + { + opts.pageNumber = pageNum; + opts.pageSize = pageSize; pager.pagination('refresh', - { - pageNumber:pageNum, - pageSize:pageSize - }); + { + pageNumber:pageNum, + pageSize:pageSize + }); showDepotHeadDetails(pageNum,pageSize); - } - }); + } + }); } - catch (e) + catch (e) { $.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error'); } } - + //删除单据信息 function deleteDepotHead(depotHeadID, thisOrganId, totalPrice, status){ if(status == "1" || status == "2") { @@ -1349,11 +1353,11 @@ //批量删除单据信息 function batDeleteDepotHead(){ - var row = $('#tableData').datagrid('getChecked'); + var row = $('#tableData').datagrid('getChecked'); if(row.length == 0) { - $.messager.alert('删除提示','没有记录被选中!','info'); - return; + $.messager.alert('删除提示','没有记录被选中!','info'); + return; } if(row.length > 0) { @@ -1575,7 +1579,7 @@ var addTitle = listTitle.replace("列表","信息"); $('#depotHeadDlg').dialog('open').dialog('setTitle',' 增加' + addTitle); $(".window-mask").css({ width: webW ,height: webH}); - + orgDepotHead = ""; depotHeadID = 0; initTableData_material("add"); //商品列表 @@ -1583,6 +1587,13 @@ $("#addOrgan").off("click").on("click",function(){ $('#supplierDlg').dialog('open').dialog('setTitle',' 增加供应商信息'); }); + + $("#addMember").off("click").on("click",function(){ + $('#supplierDlg').dialog('open').dialog('setTitle',' 增加会员信息'); + }); + $("#addCustomer").off("click").on("click",function(){ + $('#supplierDlg').dialog('open').dialog('setTitle',' 增加客户信息'); + }); url = '/depotHead/addDepotHeadAndDetail'; //零售单据修改收款时,自动计算找零 @@ -1627,7 +1638,7 @@ } }); } - } + } //编辑信息 function editDepotHead(depotHeadTotalInfo, status){ @@ -1735,7 +1746,7 @@ var itemMoneyArr = depotHeadInfo[26].split(","); $("#OtherMoney").attr("data-itemArr",JSON.stringify(itemArr)).attr("data-itemMoneyArr",JSON.stringify(itemMoneyArr)); //json数据存储 } - + initTableData_material("edit",TotalPrice); //商品列表 reject(); //撤销下、刷新商品列表 if(pageType === "skip") { @@ -1746,7 +1757,7 @@ url = '/depotHead/updateDepotHeadAndDetail?id=' + depotHeadInfo[0]; //更新接口 } } - + //查看信息 function showDepotHead(depotHeadTotalInfo){ var depotHeadInfo = depotHeadTotalInfo.split("AaBb"); @@ -1812,7 +1823,7 @@ var showTitle = listTitle.replace("列表","信息"); $('#depotHeadDlgShow').dialog('open').dialog('setTitle',' 查看' + showTitle); $(".window-mask").css({ width: webW ,height: webH}); - + depotHeadID = depotHeadInfo[0]; initTableData_material_show(TotalPrice); //商品列表-查看状态 @@ -1862,7 +1873,7 @@ } } } - + //绑定操作事件 function bindEvent(){ showDepotHeadDetails(1,initPageSize); //初始化时自动查询 @@ -2569,7 +2580,13 @@ $("#otherMoneyTotalDlg").text($("#OtherMoney").val()); }); - if(listTitle === "采购入库列表" || listTitle === "其它入库列表" || listTitle === "采购订单列表"){ + if(listTitle === "采购入库列表" || listTitle === "其它入库列表" || listTitle === "采购订单列表"|| listTitle === "零售出库列表"|| listTitle === "销售出库列表"|| listTitle === "销售订单列表"){ + var supplierType = "供应商"; + if(listTitle === "零售出库列表"){ + supplierType = "会员"; + }else if(listTitle === "销售出库列表" || listTitle === "销售订单列表"){ + supplierType = "客户"; + } //检查单位名称是否存在 ++ 重名无法提示问题需要跟进 function checkSupplierName() { var supplierName = $.trim($("#supplier").val()); @@ -2608,6 +2625,7 @@ } return flag; } + //保存供应商信息 $("#saveSupplier").off("click").on("click",function() { if(checkSupplierName()){ @@ -2629,7 +2647,7 @@ } var url = '/supplier/add'; var supObj = $("#supplierFM").serializeObject(); - supObj.type = "供应商"; + supObj.type = supplierType; supObj.enabled = 1; $.ajax({ url: url, @@ -2706,7 +2724,7 @@ } }); } - + //自动计算事件 function autoReckon() { //延时绑定事件 @@ -2892,8 +2910,8 @@ } },500); } - - //结束编辑 + + //结束编辑 function endEditing() { if (editIndex == undefined) { return true } if ($('#materialData').datagrid('validateRow', editIndex)) { @@ -2927,7 +2945,7 @@ //新增 function append(){ if (endEditing()) { - $('#materialData').datagrid('appendRow', {}); + $('#materialData').datagrid('appendRow', {DepotId:defDepotId}); editIndex = $('#materialData').datagrid('getRows').length - 1; $('#materialData').datagrid('selectRow', editIndex).datagrid('beginEdit', editIndex); autoReckon(); @@ -3000,7 +3018,7 @@ } if (totalRowNum != "") { var totalRowNum = totalRowNum.substring(0, totalRowNum.length - 1); - $.messager.alert('提示',"第" + totalRowNum + "行数据填写不完整!",'info'); + $.messager.alert('提示',"第" + totalRowNum + "行数据填写不完整!",'info'); return false; } return true; @@ -3056,7 +3074,7 @@ } } }); - + if(depotHeadMax !=null) { depotHeadMaxId=depotHeadMax; } diff --git a/erp_web/pages/manage/depot.html b/erp_web/pages/manage/depot.html index 7dcf02d3..dbf2ff98 100644 --- a/erp_web/pages/manage/depot.html +++ b/erp_web/pages/manage/depot.html @@ -182,7 +182,19 @@ {title: '搬运费', field: 'truckage', width: 60}, {title: '负责人', field: 'principalName', width: 60}, {title: '排序', field: 'sort', width: 60}, + { + title: '是否默认', field: 'isdefault', width: 100, align: "center", + formatter: function (value, rec) { + if (rec.isdefault) { + return ""; + } + else { + return "否"; + } + } + }, {title: '描述', field: 'remark', width: 120} + ]], toolbar: [ { @@ -200,6 +212,14 @@ handler: function () { batDeleteDepot(); } + }, + { + id: 'setDepotIsDefault', + text: '设为默认', + iconCls: 'icon-ok', + handler: function () { + setDepotIsDefault(); + } } ], onLoadError: function () { @@ -286,7 +306,53 @@ } }); } + //设为默认操作事件 + function setDepotIsDefault() { + var allRow = $('#tableData').datagrid('getRows'); + var row = $('#tableData').datagrid('getChecked'); + if (row.length == 0) { + $.messager.alert('设置提示', '没有记录被选中!', 'info'); + return; + } + if (row.length > 0) { + function setDefault(depotID, isDefault) { + $.ajax({ + type: "post", + url: "/depot/updateDepotIsDefault", + dataType: "json", + async: false, + data: ({ + depotID: depotID, + isDefault: isDefault + }), + success: function (res) { + if (res == "true" && isDefault) { + } + }, + //此处添加错误处理 + error: function () { + $.messager.alert('提示', '设为默认账户异常,请稍后再试!', 'error'); + return; + } + }); + } + + if (row.length == 1) { + setDefault(row[0].id, true); //设置默认 + for (var i = 0; i < allRow.length; i++) { + if (allRow[i].id != row[0].id) { + setDefault(allRow[i].id, false); + } + } + setTimeout(function () { + $("#searchBtn").click(); + }, 1000); + } + + return; + } + } //批量删除仓库 function batDeleteDepot() { var row = $('#tableData').datagrid('getChecked'); @@ -565,4 +631,4 @@ }); - \ No newline at end of file + diff --git a/erp_web/pages/materials/retail_out_list.html b/erp_web/pages/materials/retail_out_list.html index 59fe9acb..3f9131b7 100644 --- a/erp_web/pages/materials/retail_out_list.html +++ b/erp_web/pages/materials/retail_out_list.html @@ -63,7 +63,13 @@ 会员卡号: +
+
+
+ 增加会员 +
单据日期: @@ -243,5 +249,107 @@ 保存 取消 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
名称 + + 联系人 + +
联系电话 + + 手机 + +
电子邮箱 + + 传真 + +
期初应收 + + 期初应付 + +
累计应收 + + 累计应付 + +
纳税人识别号 + + 税率 + +
开户行 + + 账号 + +
地址 + +
备注 + +
+
+
+
+ 保存 + 取消 +
- \ No newline at end of file + diff --git a/erp_web/pages/materials/sale_orders_list.html b/erp_web/pages/materials/sale_orders_list.html index 64c4297e..1ade8048 100644 --- a/erp_web/pages/materials/sale_orders_list.html +++ b/erp_web/pages/materials/sale_orders_list.html @@ -63,7 +63,13 @@ 客户: - +
+ +
+
+ 增加客戶 +
单据日期: @@ -195,6 +201,107 @@ 保存 取消 - +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
名称 + + 联系人 + +
联系电话 + + 手机 + +
电子邮箱 + + 传真 + +
期初应收 + + 期初应付 + +
累计应收 + + 累计应付 + +
纳税人识别号 + + 税率 + +
开户行 + + 账号 + +
地址 + +
备注 + +
+
+
+
+ 保存 + 取消 +
- \ No newline at end of file + diff --git a/erp_web/pages/materials/sale_out_list.html b/erp_web/pages/materials/sale_out_list.html index 6af991d1..ee489f4d 100644 --- a/erp_web/pages/materials/sale_out_list.html +++ b/erp_web/pages/materials/sale_out_list.html @@ -63,7 +63,13 @@ 客户: - +
+ +
+
+ 增加客戶 +
单据日期: @@ -276,6 +282,107 @@ 保存 取消 - +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
名称 + + 联系人 + +
联系电话 + + 手机 + +
电子邮箱 + + 传真 + +
期初应收 + + 期初应付 + +
累计应收 + + 累计应付 + +
纳税人识别号 + + 税率 + +
开户行 + + 账号 + +
地址 + +
备注 + +
+
+
+
+ 保存 + 取消 +
- \ No newline at end of file + diff --git a/src/main/java/com/jsh/erp/constants/BusinessConstants.java b/src/main/java/com/jsh/erp/constants/BusinessConstants.java index 702e956c..0e7d54df 100644 --- a/src/main/java/com/jsh/erp/constants/BusinessConstants.java +++ b/src/main/java/com/jsh/erp/constants/BusinessConstants.java @@ -86,7 +86,7 @@ public class BusinessConstants { /** * create by: qiankunpingtai * create time: 2019/3/14 11:41 - * description: + * description: * 为了使用户可以自己建初始目录,设定根目录的父级目录id为-1 * */ diff --git a/src/main/java/com/jsh/erp/controller/DepotController.java b/src/main/java/com/jsh/erp/controller/DepotController.java index 7a8b1db0..7c76af09 100644 --- a/src/main/java/com/jsh/erp/controller/DepotController.java +++ b/src/main/java/com/jsh/erp/controller/DepotController.java @@ -207,5 +207,16 @@ public class DepotController { } return result; } - + @PostMapping(value = "/updateDepotIsDefault") + public String updateDepotIsDefault(@RequestParam("isDefault") Boolean isDefault, + @RequestParam("depotID") Long depotID, + HttpServletRequest request) throws Exception{ + Map objectMap = new HashMap(); + int res = depotService.updateDepotIsDefault(isDefault, depotID); + if(res > 0) { + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } } diff --git a/src/main/java/com/jsh/erp/controller/DepotItemController.java b/src/main/java/com/jsh/erp/controller/DepotItemController.java index e69a8fa2..deafa7f8 100644 --- a/src/main/java/com/jsh/erp/controller/DepotItemController.java +++ b/src/main/java/com/jsh/erp/controller/DepotItemController.java @@ -448,7 +448,7 @@ public class DepotItemController { 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()); + item.put("MaterialModel", diEx.getMModel()); //扩展信息 String materialOther = getOtherInfo(mpArr, diEx); item.put("MaterialOther", materialOther); diff --git a/src/main/java/com/jsh/erp/datasource/entities/Depot.java b/src/main/java/com/jsh/erp/datasource/entities/Depot.java index 53081140..2a76e97f 100644 --- a/src/main/java/com/jsh/erp/datasource/entities/Depot.java +++ b/src/main/java/com/jsh/erp/datasource/entities/Depot.java @@ -90,6 +90,15 @@ public class Depot { * @mbggenerated */ private String deleteFlag; + private Boolean isdefault; + + public Boolean getIsdefault() { + return isdefault; + } + + public void setIsdefault(Boolean isdefault) { + this.isdefault = isdefault; + } /** * This method was generated by MyBatis Generator. @@ -354,4 +363,4 @@ public class Depot { public void setDeleteFlag(String deleteFlag) { this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim(); } -} \ No newline at end of file +} diff --git a/src/main/java/com/jsh/erp/datasource/entities/DepotExample.java b/src/main/java/com/jsh/erp/datasource/entities/DepotExample.java index dcc624ae..85eedf4b 100644 --- a/src/main/java/com/jsh/erp/datasource/entities/DepotExample.java +++ b/src/main/java/com/jsh/erp/datasource/entities/DepotExample.java @@ -235,6 +235,7 @@ public class DepotExample { return (Criteria) this; } + public Criteria andIdIn(List values) { addCriterion("id in", values, "id"); return (Criteria) this; @@ -664,7 +665,65 @@ public class DepotExample { addCriterion("remark <>", value, "remark"); return (Criteria) this; } + public Criteria andIsdefaultIsNull() { + addCriterion("IsDefault is null"); + return (Criteria) this; + } + public Criteria andIsdefaultIsNotNull() { + addCriterion("IsDefault is not null"); + return (Criteria) this; + } + + public Criteria andIsdefaultEqualTo(Boolean value) { + addCriterion("IsDefault =", value, "isdefault"); + return (Criteria) this; + } + + public Criteria andIsdefaultNotEqualTo(Boolean value) { + addCriterion("IsDefault <>", value, "isdefault"); + return (Criteria) this; + } + + public Criteria andIsdefaultGreaterThan(Boolean value) { + addCriterion("IsDefault >", value, "isdefault"); + return (Criteria) this; + } + + public Criteria andIsdefaultGreaterThanOrEqualTo(Boolean value) { + addCriterion("IsDefault >=", value, "isdefault"); + return (Criteria) this; + } + + public Criteria andIsdefaultLessThan(Boolean value) { + addCriterion("IsDefault <", value, "isdefault"); + return (Criteria) this; + } + + public Criteria andIsdefaultLessThanOrEqualTo(Boolean value) { + addCriterion("IsDefault <=", value, "isdefault"); + return (Criteria) this; + } + + public Criteria andIsdefaultIn(List values) { + addCriterion("IsDefault in", values, "isdefault"); + return (Criteria) this; + } + + public Criteria andIsdefaultNotIn(List values) { + addCriterion("IsDefault not in", values, "isdefault"); + return (Criteria) this; + } + + public Criteria andIsdefaultBetween(Boolean value1, Boolean value2) { + addCriterion("IsDefault between", value1, value2, "isdefault"); + return (Criteria) this; + } + + public Criteria andIsdefaultNotBetween(Boolean value1, Boolean value2) { + addCriterion("IsDefault not between", value1, value2, "isdefault"); + return (Criteria) this; + } public Criteria andRemarkGreaterThan(String value) { addCriterion("remark >", value, "remark"); return (Criteria) this; @@ -1010,4 +1069,4 @@ public class DepotExample { this(condition, value, secondValue, null); } } -} \ No newline at end of file +} diff --git a/src/main/java/com/jsh/erp/service/depot/DepotService.java b/src/main/java/com/jsh/erp/service/depot/DepotService.java index b1ba5c8a..961c75a8 100644 --- a/src/main/java/com/jsh/erp/service/depot/DepotService.java +++ b/src/main/java/com/jsh/erp/service/depot/DepotService.java @@ -316,4 +316,24 @@ public class DepotService { return deleteTotal; } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateDepotIsDefault(Boolean isDefault, Long depotID) throws Exception{ + logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT,BusinessConstants.LOG_OPERATION_TYPE_EDIT+depotID, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + Depot depot = new Depot(); + depot.setIsdefault(isDefault); + DepotExample example = new DepotExample(); + example.createCriteria().andIdEqualTo(depotID); + int result=0; + try{ + result = depotMapper.updateByExampleSelective(depot, example); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + return result; + } } diff --git a/src/main/resources/mapper_xml/DepotMapper.xml b/src/main/resources/mapper_xml/DepotMapper.xml index 030f2b43..8cdf435b 100644 --- a/src/main/resources/mapper_xml/DepotMapper.xml +++ b/src/main/resources/mapper_xml/DepotMapper.xml @@ -1,5 +1,5 @@ - - + + - id, name, address, warehousing, truckage, type, sort, remark, principal, tenant_id, - delete_Flag + id, name, address, warehousing, truckage, type, sort, remark, principal, tenant_id, + delete_Flag,IsDefault