From 7c6b2c777ebe4ea64c492d2dd5aea69d902c94a7 Mon Sep 17 00:00:00 2001 From: czt <czt18638530771@163.com> Date: 星期四, 01 六月 2023 19:52:41 +0800 Subject: [PATCH] 提交粮食定价配置 --- igds-web/src/main/resources/static/admin/inout/in-check.js | 11 - igds-inout/src/main/java/com/ld/igds/m/service/HInoutPriceService.java | 61 +++++++ igds-inout/src/main/java/com/ld/igds/inout/dto/InoutCheckData.java | 3 igds-web/src/main/resources/static/admin/inout/in-sample.js | 2 igds-web/src/main/resources/templates/admin/inout/in-check.html | 4 igds-inout/src/main/resources/mapper/InoutCheckMapper.xml | 10 igds-inout/src/main/java/com/ld/igds/m/view/InoutPricePR.java | 54 ++++++ igds-inout/src/main/java/com/ld/igds/m/view/InoutPrice.view.xml | 279 ++++++++++++++++++++++++++++++++++ 8 files changed, 408 insertions(+), 16 deletions(-) diff --git a/igds-inout/src/main/java/com/ld/igds/inout/dto/InoutCheckData.java b/igds-inout/src/main/java/com/ld/igds/inout/dto/InoutCheckData.java index b37c3fc..67b104f 100644 --- a/igds-inout/src/main/java/com/ld/igds/inout/dto/InoutCheckData.java +++ b/igds-inout/src/main/java/com/ld/igds/inout/dto/InoutCheckData.java @@ -68,6 +68,7 @@ //妫�楠屼汉 private String checkUser; //璐ㄦ鏃堕棿 + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date checkTime; //妫�楠岀粨鏋滐紝NONE-鏈楠岋紝PASS-宸叉楠岋紝UNPASS-涓嶅悎鏍� private String checkStatus; @@ -78,6 +79,8 @@ //璐ㄦ澧為噸 private double addCheck = 0.0; + private String remarks; + //鍖栭獙椤规暟鎹俊鎭� private List<CheckItemData> checkItems; } diff --git a/igds-inout/src/main/java/com/ld/igds/m/service/HInoutPriceService.java b/igds-inout/src/main/java/com/ld/igds/m/service/HInoutPriceService.java new file mode 100644 index 0000000..f5a0397 --- /dev/null +++ b/igds-inout/src/main/java/com/ld/igds/m/service/HInoutPriceService.java @@ -0,0 +1,61 @@ +package com.ld.igds.m.service; + +import com.bstek.bdf2.core.orm.hibernate.HibernateDao; +import com.ld.igds.models.InoutPrice; +import com.ld.igds.util.ContextUtil; +import org.apache.commons.lang3.StringUtils; +import org.hibernate.Session; +import org.springframework.stereotype.Component; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Component +public class HInoutPriceService extends HibernateDao { + + public List<InoutPrice> listInoutPrice(Map<String, Object> param) { + String hql = " from " + InoutPrice.class.getName() + + " where companyId=:companyId"; + + Map<String, Object> args = new HashMap<String, Object>(); + + args.put("companyId", ContextUtil.getCompanyId()); + + hql += " order by foodVariety"; + + return this.query(hql,args); + } + + public String saveInoutPrice(InoutPrice data) { + Session session = this.getSessionFactory().openSession(); + try { + if(null == data.getCompanyId()){ + data.setCompanyId(ContextUtil.getCompanyId()); + } + if(null == data.getId()){ + data.setId(ContextUtil.getTimeId()); + } + + data.setUpdateUser(ContextUtil.getLoginUserCName()); + data.setUpdateTime(new Date()); + session.saveOrUpdate(data); + } finally { + session.flush(); + session.close(); + } + return null; + } + + public String delInoutPrice(InoutPrice data) { + Session session = this.getSessionFactory().openSession(); + try { + if(null == data.getCompanyId()) data.setCompanyId(ContextUtil.getCompanyId()); + session.delete(data); + } finally { + session.flush(); + session.close(); + } + return null; + } +} diff --git a/igds-inout/src/main/java/com/ld/igds/m/view/InoutPrice.view.xml b/igds-inout/src/main/java/com/ld/igds/m/view/InoutPrice.view.xml new file mode 100644 index 0000000..43d57dd --- /dev/null +++ b/igds-inout/src/main/java/com/ld/igds/m/view/InoutPrice.view.xml @@ -0,0 +1,279 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ViewConfig> + <Arguments/> + <Context/> + <Model> + <DataType name="dtMain"> + <Property name="creationType">com.ld.igds.models.InoutPrice</Property> + <PropertyDef name="id"> + <Property></Property> + <Property name="label">id</Property> + </PropertyDef> + <PropertyDef name="companyId"> + <Property></Property> + <Property name="label">缁勭粐缂栫爜</Property> + </PropertyDef> + <PropertyDef name="foodVariety"> + <Property></Property> + <Property name="label">绮鍝佺</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("dicTriggerPR#dicTrigger").getResult("FOOD_VARIETY_")}</Property> + <Property name="keyProperty">code</Property> + <Property name="valueProperty">name</Property> + </Property> + <Property name="required">true</Property> + </PropertyDef> + <PropertyDef name="foodLevel"> + <Property></Property> + <Property name="label">绮绛夌骇</Property> + <Property name="mapping"> + <Property name="mapValues">${dorado.getDataProvider("dicTriggerPR#dicTrigger").getResult("FOOD_LEVEL_")}</Property> + <Property name="keyProperty">code</Property> + <Property name="valueProperty">name</Property> + </Property> + <Property name="required">true</Property> + </PropertyDef> + <PropertyDef name="price"> + <Property></Property> + <Property name="label">绮浠锋牸</Property> + <Property name="dataType">Double</Property> + <Property name="required">true</Property> + </PropertyDef> + <PropertyDef name="startTime"> + <Property></Property> + <Property name="label">鏈夋晥寮�濮嬫椂闂�</Property> + <Property name="dataType">DateTime</Property> + </PropertyDef> + <PropertyDef name="endTime"> + <Property></Property> + <Property name="label">鏈夋晥鎴嚦鏃堕棿</Property> + <Property name="dataType">DateTime</Property> + </PropertyDef> + <PropertyDef name="updateUser"> + <Property></Property> + <Property name="label">鏈�鍚庢洿鏂颁汉</Property> + </PropertyDef> + <PropertyDef name="updateTime"> + <Property name="dataType">DateTime</Property> + <Property name="label">鏇存柊鏃堕棿</Property> + </PropertyDef> + <PropertyDef name="remarks"> + <Property></Property> + <Property name="label">璇存槑</Property> + </PropertyDef> + </DataType> + </Model> + <View layout="padding:5;regionPadding:5"> + <ClientEvent name="onReady">var deptId = window.parent.deptId;//鐖堕〉闈腑鐨勫垎搴撶紪鐮�
 +
 +//鏌ヨ
 +query = function(){
 + view.get("#dsMain").set("parameter",{deptId:deptId}).flushAsync();
 +};
 +
 +query();</ClientEvent> + <Property name="packages">font-awesome,css-common</Property> + <DataSet id="dsMain"> + <Property name="dataType">[dtMain]</Property> + <Property name="dataProvider">inoutPricePR#listInoutPrice</Property> + <Property name="loadMode">manual</Property> + </DataSet> + <Container layout="regionPadding:10" layoutConstraint="top"> + <Property name="exClassName">bg-color</Property> + <Property name="contentOverflow">hidden</Property> + <Property name="height">55</Property> + <Label layoutConstraint="left"> + <Property name="text">鑿滃崟鏍忥細</Property> + </Label> + <Button layoutConstraint="left"> + <ClientEvent name="onClick">view.get("#dsMain").insert();
 + view.get("#dialogMain").show();
 + </ClientEvent> + <Property name="caption">鏂板</Property> + <Property name="exClassName">btn-default</Property> + <Property name="iconClass">fa fa-plus</Property> + </Button> + <Button layoutConstraint="left"> + <ClientEvent name="onClick">var data = view.get("#dsMain.data:#");
 + if(data){
 + view.get("#dialogMain").show();
 + }</ClientEvent> + <Property name="caption">缂栬緫</Property> + <Property name="exClassName">btn-warm</Property> + <Property name="iconClass">fa fa-pencil</Property> + </Button> + <Button layoutConstraint="left"> + <ClientEvent name="onClick">var data = view.get("#dsMain.data:#");
 + if(!data){
 + return;
 + }
 + view.get("#ajaxDel").set("parameter",data).execute(function(result){
 + if(result){
 + $alert(result);
 + return;
 + }else{
 + data.remove();
 + }
 + });
 + </ClientEvent> + <Property name="caption">鍒犻櫎</Property> + <Property name="exClassName">btn-warn</Property> + <Property name="iconClass">fa fa-minus</Property> + </Button> + <Button layoutConstraint="left"> + <Property name="caption">瀵煎嚭</Property> + <Property name="exClassName">btn-normal</Property> + <Property name="iconClass">fa fa-file-excel-o</Property> + <Property name="action">exportExcel</Property> + </Button> + </Container> + <Container layoutConstraint="center"> + <Property name="exClassName">bg-color</Property> + <DataGrid id="dataGridMain" layoutConstraint="center"> + <ClientEvent name="onDataRowDoubleClick">var data = view.get("#dsMain.data:#");
 + if(data){
 + view.get("#dialogMain").show();
 + }</ClientEvent> + <Property name="dataSet">dsMain</Property> + <Property name="readOnly">true</Property> + <Property name="groupProperty">foodVariety</Property> + <DataColumn> + <Property name="property">foodVariety</Property> + <Property name="align">center</Property> + <Property name="name">foodVariety</Property> + </DataColumn> + <DataColumn> + <Property name="property">foodLevel</Property> + <Property name="align">center</Property> + <Property name="name">foodLevel</Property> + </DataColumn> + <DataColumn> + <Property name="property">price</Property> + <Property name="align">center</Property> + <Property name="name">price</Property> + </DataColumn> + <DataColumn name="startTime"> + <Property name="property">startTime</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="endTime"> + <Property name="property">endTime</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="updateTime"> + <Property name="property">updateTime</Property> + <Property name="align">center</Property> + <Property name="width">220</Property> + </DataColumn> + <DataColumn name="updateUser"> + <Property name="property">updateUser</Property> + <Property name="align">center</Property> + </DataColumn> + <DataColumn name="remarks"> + <Property name="property">remarks</Property> + </DataColumn> + </DataGrid> + </Container> + <Dialog id="dialogMain"> + <Property name="closeable">false</Property> + <Property name="caption">绮鍗曚环閰嶇疆淇℃伅</Property> + <Property name="width">750</Property> + <Property name="iconClass">fa fa-tasks</Property> + <Buttons> + <Button id="btnOk"> + <ClientEvent name="onClick">var data = view.get("#dsMain.data:#");
 + 
 + if(data.validate() != 'ok'){
 + $notify("鏁版嵁鏍¢獙澶辫触锛侊紒");
 + return;
 + }
 + 
 + view.get("#uaAction").set("parameter",data).execute(function(){
 + 
 + $notify("鏁版嵁鎵ц瀹屾垚锛侊紒");
 + self.get("parent").hide();
 + });</ClientEvent> + <Property name="caption">纭畾</Property> + <Property name="iconClass">fa fa-check</Property> + </Button> + <Button> + <ClientEvent name="onClick">view.get("#dsMain.data:#").cancel();
 + self.get("parent").hide();</ClientEvent> + <Property name="caption">鍙栨秷</Property> + <Property name="iconClass">fa fa-times</Property> + </Button> + </Buttons> + <Children> + <Container> + <FieldSet layoutConstraint="padding:10px"> + <Property name="caption">閰嶇疆淇℃伅</Property> + <Buttons/> + <Children> + <AutoForm> + <Property name="dataSet">dsMain</Property> + <Property name="cols">*,*</Property> + <Property name="labelSeparator">锛�</Property> + <Property name="labelAlign">right</Property> + <Property name="labelWidth">140</Property> + <AutoFormElement> + <Property name="name">foodVariety</Property> + <Property name="property">foodVariety</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">foodLevel</Property> + <Property name="property">foodLevel</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">price</Property> + <Property name="property">price</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">startTime</Property> + <Property name="property">startTime</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement> + <Property name="name">endTime</Property> + <Property name="property">endTime</Property> + <Editor/> + </AutoFormElement> + <AutoFormElement layoutConstraint="colSpan:2"> + <Property name="name">remarks</Property> + <Property name="property">remarks</Property> + <Property name="editorType">TextArea</Property> + <Editor/> + </AutoFormElement> + </AutoForm> + </Children> + </FieldSet> + </Container> + </Children> + <Tools/> + </Dialog> + <UpdateAction id="uaAction"> + <Property name="dataResolver">inoutPricePR#saveInoutPrice</Property> + <UpdateItem> + <Property name="dataSet">dsMain</Property> + <Property name="dataPath">[#current]</Property> + </UpdateItem> + </UpdateAction> + <AjaxAction id="ajaxDel"> + <Property name="service">inoutPricePR#delInoutPrice</Property> + <Property name="confirmMessage">纭畾瑕佹墽琛屽垹闄や箞锛�</Property> + </AjaxAction> + <Export2ReportAction id="exportExcel"> + <Property name="dataFontSize">12</Property> + <Property name="extension">xlsx</Property> + <Property name="headerFontSize">16</Property> + <Property name="template">dataGridMain</Property> + <Property name="titleFontSize">20</Property> + <Property name="maxSize">3000</Property> + <Property name="fileName">绮鍗曚环</Property> + <Property name="showTitle">true</Property> + <Property name="titleName">绮绛夌骇鍗曚环閰嶇疆琛�</Property> + </Export2ReportAction> + </View> +</ViewConfig> diff --git a/igds-inout/src/main/java/com/ld/igds/m/view/InoutPricePR.java b/igds-inout/src/main/java/com/ld/igds/m/view/InoutPricePR.java new file mode 100644 index 0000000..28f5cf2 --- /dev/null +++ b/igds-inout/src/main/java/com/ld/igds/m/view/InoutPricePR.java @@ -0,0 +1,54 @@ +package com.ld.igds.m.view; + +import com.bstek.dorado.annotation.DataProvider; +import com.bstek.dorado.annotation.DataResolver; +import com.bstek.dorado.annotation.Expose; +import com.ld.igds.m.service.HInoutPriceService; +import com.ld.igds.models.InoutPrice; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import java.util.List; +import java.util.Map; + +/** + * @author czt + * + */ +@Component +public class InoutPricePR { + + @Autowired + private HInoutPriceService inoutPriceService; + + /** + * inoutPricePR#listInoutPrice 鑾峰彇鎵�鏈夌殑鍖栭獙鏍囧噯 + * + * @return + */ + @DataProvider + public List<InoutPrice> listInoutPrice(Map<String, Object> param) { + return inoutPriceService.listInoutPrice(param); + } + + /** + * inoutPricePR#saveInoutPrice + * + * @param data + * @return + */ + @DataResolver + public String saveInoutPrice(InoutPrice data) { + return inoutPriceService.saveInoutPrice(data); + } + + /** + * inoutPricePR#delInoutPrice + * + * @param data + * @return + */ + @Expose + public String delInoutPrice(InoutPrice data) { + return inoutPriceService.delInoutPrice(data); + } +} diff --git a/igds-inout/src/main/resources/mapper/InoutCheckMapper.xml b/igds-inout/src/main/resources/mapper/InoutCheckMapper.xml index 35e15e7..c30a291 100644 --- a/igds-inout/src/main/resources/mapper/InoutCheckMapper.xml +++ b/igds-inout/src/main/resources/mapper/InoutCheckMapper.xml @@ -76,6 +76,7 @@ CHECK_TIME_ as checkTime, CHECK_ID_ as checkId, CHECK_STATUS_ AS checkStatus, + REMARKS_ AS remarks, IF(ISNULL(SAMPLE_TIME_),'NONE','SAMPLE') AS sampleStatus from D_INOUT_RECORD @@ -102,10 +103,13 @@ <if test="data.depotId != null">DEPOT_ID_ = #{data.depotId},</if> <if test="data.checkUser != null">CHECK_USER_ = #{data.checkUser},</if> <if test="data.checkTime != null">CHECK_TIME_ = #{data.checkTime},</if> - <if test="data.checkStatus != null">CEHCK_STATUS = #{data.checkStatus},</if> - <if test="data.foodLevel != null">FOOD_LEVEL = #{data.foodLevel},</if> + <if test="data.checkStatus != null">CHECK_STATUS_ = #{data.checkStatus},</if> + <if test="data.foodLevel != null">FOOD_LEVEL_ = #{data.foodLevel},</if> + <if test="data.foodVariety != null">FOOD_VARIETY_ = #{data.foodVariety},</if> <if test="data.deCheck != null">DE_CHECK_ = #{data.deCheck},</if> - <if test="data.addCheck != null">ADD_CHECK = #{data.addCheck},</if> + <if test="data.addCheck != null">ADD_CHECK_ = #{data.addCheck},</if> + <if test="data.price != null">PRICE_ = #{data.price},</if> + <if test="data.remarks != null">REMARKS_ = #{data.remarks},</if> TYPE_ = #{data.type} WHERE COMPANY_ID_ =#{data.companyId} diff --git a/igds-web/src/main/resources/static/admin/inout/in-check.js b/igds-web/src/main/resources/static/admin/inout/in-check.js index 3dcec44..f8a46e1 100644 --- a/igds-web/src/main/resources/static/admin/inout/in-check.js +++ b/igds-web/src/main/resources/static/admin/inout/in-check.js @@ -300,7 +300,7 @@ curSampleData = obj.data; if(!curCheckData.checkTime){ - curCheckData.checkTime = dateFtt("yyyy-MM-dd HH:mm:ss", new Date()); + curCheckData.checkTime = dateFtt("yyyy-MM-dd hh:mm:ss", new Date()); } curCheckData.checkUser = checkUser; if (curCheckData.checkStatus == "NONE") { @@ -485,16 +485,8 @@ layer.alert("璇风‘璁ゅ寲楠岀粨鏋滐紒锛�"); return; } - if (!curCheckData.depotId) { - layer.alert("璇烽�夋嫨瑁呭嵏浠撳簱锛侊紒"); - return; - } if (!curCheckData.foodVariety) { layer.alert("璇风‘璁ょ伯椋熷搧绉嶏紒锛�"); - return; - } - if (!curCheckData.foodYear) { - layer.alert("璇风‘璁ょ伯椋熷勾浠斤紒锛�"); return; } if (!curCheckData.foodLevel) { @@ -505,7 +497,6 @@ layer.alert("璇风‘璁ょ伯椋熷畾浠凤紝濡備笉鑰冭檻瀹氫环锛岃濉啓0.0"); return; } - curCheckData.checkItems = curCheckItems; var index = layer.load(); diff --git a/igds-web/src/main/resources/static/admin/inout/in-sample.js b/igds-web/src/main/resources/static/admin/inout/in-sample.js index d51ee06..dc8e4af 100644 --- a/igds-web/src/main/resources/static/admin/inout/in-sample.js +++ b/igds-web/src/main/resources/static/admin/inout/in-sample.js @@ -358,7 +358,7 @@ function showDetail(obj) { curSampleData = null; - var nowTime = dateFtt("yyyy-MM-dd HH:mm:ss", new Date()); + var nowTime = dateFtt("yyyy-MM-dd hh:mm:ss", new Date()); $("#printTime").html(nowTime); curSampleData = obj.data; diff --git a/igds-web/src/main/resources/templates/admin/inout/in-check.html b/igds-web/src/main/resources/templates/admin/inout/in-check.html index 2f9816f..a4ae6e7 100644 --- a/igds-web/src/main/resources/templates/admin/inout/in-check.html +++ b/igds-web/src/main/resources/templates/admin/inout/in-check.html @@ -495,7 +495,7 @@ </div> <div class="layui-col-xs12" style="margin-bottom: 10px"> <div style="padding-left: 50px; color: #2ab5ad;"> - <span style="font-weight: bold; margin-right: 10px;">澶囨敞璇存槑锛�1.缁撴灉鍒ゅ畾锛氱郴缁熸牴鎹悇鍖栭獙椤圭粨鏋滃垽瀹氾紝鏈�鍚庡寲楠岀粨鏋滈渶鎵嬪姩閫夋嫨纭锛�2.鍗曚环澶嶆牳锛氭牴鎹寲楠岄」閰嶇疆璁$畻鐩稿叧澧炴墸浠凤紝鏈�鍚庡崟浠烽渶鎵嬪姩纭銆�</span> + <span style="font-weight: bold; margin-right: 10px;">澶囨敞璇存槑锛�1.缁撴灉鍒ゅ畾锛氱郴缁熸牴鎹悇鍖栭獙椤圭粨鏋滃垽瀹氾紝鏈�鍚庡寲楠岀粨鏋滈渶鎵嬪姩閫夋嫨纭锛�2.鏍哥畻瀹氫环锛氭牴鎹寲楠岄」閰嶇疆璁$畻鐩稿叧澧炴墸浠凤紝鏈�鍚庡崟浠烽渶鎵嬪姩纭銆�</span> </div> </div> <div class="layui-col-xs12"> @@ -505,7 +505,7 @@ <span id="check-result-tip" style="margin-right: 25px;">鍖栭獙缁撴灉#锛� 鏀剁伯鍗曚环锛�#鍏�/鍏枻</span> <span id="check-result-msg" style="margin-right: 25px;color: red;float: right;"> <button style="margin-top: -6px;" class="rkbk-quick-btn layui-btn btn-blue" onclick="checkReset()"> - <i><img th:src="@{../../static/images/icon-fuwei.png}"/></i>鍗曚环鍒ゅ畾 + <i><img th:src="@{../../static/images/icon-fuwei.png}"/></i>鏍哥畻瀹氫环 </button> </span> </div> -- Gitblit v1.9.3