YYC
2023-07-24 65af56af565a47e191aa76ede4a62ab3fd91e789
质量巡检添添加优化
已修改6个文件
225 ■■■■ 文件已修改
igds-core/src/main/java/com/ld/igds/m/service/HQualityManageService.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-core/src/main/java/com/ld/igds/m/view/QualityManager.view.xml 188 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/com/ld/igds/m/view/ContractManage.view.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/com/ld/igds/m/view/InoutDriver.view.xml 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/com/ld/igds/m/view/PlanManage01.view.xml 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/models/inout.model.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-core/src/main/java/com/ld/igds/m/service/HQualityManageService.java
@@ -1,6 +1,7 @@
package com.ld.igds.m.service;
import com.bstek.bdf2.core.orm.hibernate.HibernateDao;
import com.bstek.dorado.data.entity.EntityUtils;
import com.bstek.dorado.data.provider.Page;
import com.ld.igds.check.mapper.CheckStandardMapper;
import com.ld.igds.constant.RedisConst;
@@ -10,8 +11,10 @@
import com.ld.igds.util.RedisUtil;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.Session;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -26,7 +29,6 @@
    private RedisUtil redisUtil;
    @Autowired
    private CheckStandardMapper checkStandardMapper;
    public void listQuality(Page<MQuality> page, Map<String, Object> param) throws Exception{
@@ -72,6 +74,7 @@
    /**
     * 获取仓库最新一条质检数据
     *
     * @param depotId
     * @return
     * @throws Exception
@@ -99,6 +102,7 @@
    /**
     * 从缓存获取当前仓库的最新一条质检数据
     *
     * @param depotId
     * @return
     * @throws Exception
@@ -116,6 +120,7 @@
        }
        return quality;
    }
    public void saveQuality(String id, MQuality data) {
        if (null == data.getCompanyId()) {
            data.setCompanyId(ContextUtil.getCompanyId());
@@ -124,6 +129,7 @@
            data.setDeptId(ContextUtil.subDeptId(null));
        }
        Session session = this.getSessionFactory().openSession();
        data.setUpdateTime(new Date());
        try {
            if (null == data.getId()) {
                data.setId(id);
@@ -132,8 +138,15 @@
                session.update(data);
            }
            redisUtil.del(RedisConst.buildKey(ContextUtil.getCompanyId(),RedisConst.KEY_DEPOT_QUALITY,data.getDepotId()));
            MQuality newData;
            if (EntityUtils.isEntity(data)) {
                newData = new MQuality();
                BeanUtils.copyProperties(data, newData, new String[]{"checkItems"});
            } else {
                newData = data;
            }
            redisUtil.set(RedisConst.buildKey(ContextUtil.getCompanyId(),RedisConst.KEY_DEPOT_QUALITY,data.getDepotId()),data,60 * 60 *24);
            redisUtil.set(RedisConst.buildKey(ContextUtil.getCompanyId(), RedisConst.KEY_DEPOT_QUALITY, data.getDepotId()), newData, 60 * 60 * 24);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
@@ -147,6 +160,7 @@
        try {
            if (null != data.getId()) {
                session.delete(data);
                redisUtil.del(RedisConst.buildKey(ContextUtil.getCompanyId(), RedisConst.KEY_DEPOT_QUALITY, data.getDepotId()));
            }
        } catch (Exception e) {
            e.printStackTrace();
igds-core/src/main/java/com/ld/igds/m/view/QualityManager.view.xml
@@ -9,8 +9,7 @@
                }&#xD;
                if(arg.property ==&quot;foodVariety&quot;){&#xD;
                checkByFood(arg.newValue);&#xD;
                }
            </ClientEvent>
}       </ClientEvent>
      <Property name="creationType">com.ld.igds.models.MQuality</Property>
      <PropertyDef name="id">
        <Property name="label">ID</Property>
@@ -92,20 +91,27 @@
      <PropertyDef name="checkUser">
        <Property name="label">扦样人</Property>
      </PropertyDef>
      <PropertyDef name="checkNum">
      <PropertyDef name="ypsl">
        <Property name="label">样品数量</Property>
        <Property name="displayFormat">0.0%</Property>
        <Property name="dataType">Double</Property>
        <Property name="displayFormat">0.## KG</Property>
      </PropertyDef>
      <PropertyDef name="checkTime">
        <Property name="label">扦样时间</Property>
        <Property name="dataType">Date</Property>
      </PropertyDef>
      <PropertyDef name="checkRepresent">
        <Property name="label">样品代表</Property>
      <PropertyDef name="dbsl">
        <Property name="label">样品代表数量</Property>
        <Property name="dataType">Double</Property>
        <Property name="displayFormat">0.## KG</Property>
      </PropertyDef>
      <PropertyDef name="checkLevel">
      <PropertyDef name="ypdj">
        <Property name="label">样品等级</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicTriggerPR#dicTrigger&quot;).getResult(&quot;FOOD_LEVEL_&quot;)}</Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="normalYear">
        <Property name="label">正常存储年限</Property>
@@ -203,6 +209,62 @@
      </PropertyDef>
      <PropertyDef name="remarks">
        <Property name="label">化验结果</Property>
      </PropertyDef>
      <PropertyDef name="operaSymbolValue">
        <Property/>
      </PropertyDef>
      <PropertyDef name="operaSymbol">
        <Property/>
        <Property name="label">运算符号</Property>
      </PropertyDef>
      <PropertyDef name="ruleNum">
        <Property name="dataType">Double</Property>
        <Property name="label">扣重系数</Property>
      </PropertyDef>
      <PropertyDef name="ruleAdd">
        <Property name="dataType">Double</Property>
        <Property name="label">增重%</Property>
      </PropertyDef>
      <PropertyDef name="ruleAddEnd">
        <Property name="dataType">Double</Property>
        <Property name="label">增重上限%</Property>
      </PropertyDef>
      <PropertyDef name="ruleReduce">
        <Property name="dataType">Double</Property>
        <Property name="label">扣重值%</Property>
      </PropertyDef>
      <PropertyDef name="rulePrice">
        <Property name="dataType">Double</Property>
        <Property name="label">扣费系数</Property>
      </PropertyDef>
      <PropertyDef name="ruleReducePrice">
        <Property name="dataType">Double</Property>
        <Property name="label">扣费</Property>
      </PropertyDef>
      <PropertyDef name="addNum">
        <Property name="dataType">Double</Property>
        <Property name="label">增重</Property>
      </PropertyDef>
      <PropertyDef name="deNum">
        <Property name="dataType">Double</Property>
        <Property name="label">扣重</Property>
      </PropertyDef>
      <PropertyDef name="addPrice">
        <Property name="dataType">Double</Property>
        <Property name="label">增价</Property>
      </PropertyDef>
      <PropertyDef name="dePrice">
        <Property name="dataType">Double</Property>
        <Property name="label">扣价</Property>
      </PropertyDef>
      <PropertyDef name="result">
        <Property/>
        <Property name="label">检验结果</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;inoutDataPR#triggerResult&quot;).getResult()}</Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
    </DataType>
    <DataType name="dataTypeUser">
@@ -350,7 +412,6 @@
            }&#xD;
            });&#xD;
            };&#xD;
            &#xD;
            //根据粮食品种查询化验项并回显&#xD;
            checkByFood = function(foodVariety){&#xD;
            view.get(&quot;#ajaxGetCheck&quot;).set(&quot;parameter&quot;,{foodVariety:foodVariety,deptId:deptId}).execute(function(result){&#xD;
@@ -359,8 +420,7 @@
            data.set(&quot;checkItems&quot;,result);&#xD;
            }&#xD;
            }); &#xD;
            };
        </ClientEvent>
};      </ClientEvent>
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsMain">
      <Property name="loadMode">lazy</Property>
@@ -476,8 +536,7 @@
        <ClientEvent name="onDataRowDoubleClick">var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
                    if(data){&#xD;
                    view.get(&quot;#dialogMain&quot;).show();&#xD;
                    }
                </ClientEvent>
}              </ClientEvent>
        <Property name="dataSet">dsMain</Property>
        <Property name="readOnly">true</Property>
        <RowNumColumn/>
@@ -625,8 +684,8 @@
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">checkNum</Property>
                <Property name="property">checkNum</Property>
                <Property name="name">ypsl</Property>
                <Property name="property">ypsl</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
@@ -651,13 +710,13 @@
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">checkRepresent</Property>
                <Property name="property">checkRepresent</Property>
                <Property name="name">dbsl</Property>
                <Property name="property">dbsl</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">checkLevel</Property>
                <Property name="property">checkLevel</Property>
                <Property name="name">ypdj</Property>
                <Property name="property">ypdj</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
@@ -697,51 +756,90 @@
          <Buttons/>
          <Children>
            <DataGrid id="dataGridCheckItem">
              <ClientEvent name="onCellValueEdit">var data = arg.entity&#xD;
if (data) {&#xD;
    //填写的数据值;&#xD;
    var newValue = data.get(&quot;value&quot;);&#xD;
    //标准值;&#xD;
    var limit = data.get(&quot;upperLimit&quot;);&#xD;
    //运算符;&#xD;
    var symbol = data.get(&quot;operaSymbol&quot;);&#xD;
    if (symbol &amp;&amp; limit &amp;&amp; newValue) {&#xD;
        if (&quot;>=&quot; == symbol) {&#xD;
            if (newValue &lt; limit) {&#xD;
                data.set(&quot;result&quot;, &quot;0&quot;);&#xD;
            }&#xD;
            else {&#xD;
                data.set(&quot;result&quot;, &quot;1&quot;);&#xD;
            }&#xD;
        }&#xD;
        if (&quot;&lt;=&quot; == symbol) {&#xD;
            if (newValue > limit) {&#xD;
                data.set(&quot;result&quot;, &quot;0&quot;);&#xD;
            }&#xD;
            else {&#xD;
                data.set(&quot;result&quot;, &quot;1&quot;);&#xD;
            }&#xD;
        }&#xD;
        if (&quot;==&quot; == symbol) {&#xD;
            if (newValue != limit) {&#xD;
                data.set(&quot;result&quot;, &quot;0&quot;);&#xD;
            }&#xD;
            else {&#xD;
                data.set(&quot;result&quot;, &quot;1&quot;);&#xD;
            }&#xD;
        }&#xD;
    }&#xD;
}</ClientEvent>
              <Property name="dataPath">#.checkItems</Property>
              <Property name="dataSet">dsMain</Property>
              <Property name="hideMode">display</Property>
              <Property name="highlightCurrentRow">false</Property>
              <Property name="visible">true</Property>
              <RowNumColumn/>
              <DataColumn>
                <Property name="name">standardName</Property>
              <DataColumn name="standardName">
                <Property name="property">standardName</Property>
                <Property name="align">center</Property>
                <Property name="readOnly">true</Property>
                <Editor/>
              </DataColumn>
              <DataColumn>
                <Property name="name">value</Property>
              <DataColumn name="value">
                <Property name="property">value</Property>
                <Property name="align">center</Property>
                <Editor/>
              </DataColumn>
              <DataColumn>
                <Property name="name">upperLimit</Property>
                <Property name="property">upperLimit</Property>
                <Property name="align">center</Property>
                <Property name="readOnly">true</Property>
                <Editor/>
              </DataColumn>
              <DataColumn>
                <Property name="name">lowerLimit</Property>
                <Property name="property">lowerLimit</Property>
                <Property name="align">center</Property>
                <Property name="readOnly">true</Property>
                <Editor/>
              </DataColumn>
              <DataColumn>
                <Property name="name">unit</Property>
              <DataColumn name="unit">
                <Property name="property">unit</Property>
                <Property name="align">center</Property>
                <Property name="readOnly">true</Property>
                <Editor/>
              </DataColumn>
              <DataColumn>
                <Property name="name">remarks</Property>
              <DataColumn name="operaSymbolValue">
                <Property name="property">operaSymbolValue</Property>
                <Property name="align">center</Property>
                <Property name="caption">标准值</Property>
                <Property name="readOnly">true</Property>
              </DataColumn>
              <DataColumn name="deNum">
                <Property name="property">deNum</Property>
                <Property name="align">center</Property>
              </DataColumn>
              <DataColumn name="addNum">
                <Property name="property">addNum</Property>
                <Property name="align">center</Property>
              </DataColumn>
              <DataColumn name="dePrice">
                <Property name="property">dePrice</Property>
                <Property name="align">center</Property>
              </DataColumn>
              <DataColumn name="addPrice">
                <Property name="property">addPrice</Property>
                <Property name="align">center</Property>
              </DataColumn>
              <DataColumn name="result">
                <Property name="property">result</Property>
                <Property name="align">center</Property>
                <Property name="readOnly">true</Property>
              </DataColumn>
              <DataColumn name="remarks">
                <Property name="property">remarks</Property>
                <Property name="align">center</Property>
                <Editor/>
              </DataColumn>
            </DataGrid>
          </Children>
igds-inout/src/main/java/com/ld/igds/m/view/ContractManage.view.xml
@@ -741,11 +741,6 @@
                    <Property name="property">signAddress</Property>
                    <Editor/>
                  </AutoFormElement>
                  <AutoFormElement layoutConstraint="colSpan:3">
                    <Property name="name">remark</Property>
                    <Property name="property">remark</Property>
                    <Editor/>
                  </AutoFormElement>
                </AutoForm>
              </Children>
            </FieldSet>
igds-inout/src/main/java/com/ld/igds/m/view/InoutDriver.view.xml
@@ -21,7 +21,7 @@
      </PropertyDef>
      <PropertyDef name="nation">
        <Property></Property>
        <Property name="label">名族</Property>
        <Property name="label">民族</Property>
      </PropertyDef>
      <PropertyDef name="address">
        <Property></Property>
@@ -160,25 +160,32 @@
        <DataColumn name="name">
          <Property name="property">name</Property>
          <Property name="width">300</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="nation">
          <Property name="property">nation</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="mobile">
          <Property name="property">mobile</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="sex">
          <Property name="property">sex</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="birthday">
          <Property name="property">birthday</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="address">
          <Property name="property">address</Property>
          <Property name="width">300</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="updateTime">
          <Property name="property">updateTime</Property>
          <Property name="align">center</Property>
        </DataColumn>
      </DataGrid>
    </Container>
igds-inout/src/main/java/com/ld/igds/m/view/PlanManage01.view.xml
igds-inout/src/main/java/models/inout.model.xml
@@ -56,6 +56,11 @@
    <PropertyDef name="bank">
      <Property></Property>
      <Property name="label">开户银行</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicTriggerPR#dicTrigger&quot;).getResult(&quot;KHKHH&quot;)}</Property>
        <Property name="keyProperty">code</Property>
        <Property name="valueProperty">name</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="bankNum">
      <Property></Property>