czt
2023-06-01 7c6b2c777ebe4ea64c492d2dd5aea69d902c94a7
提交粮食定价配置
已修改5个文件
已添加3个文件
424 ■■■■■ 文件已修改
igds-inout/src/main/java/com/ld/igds/inout/dto/InoutCheckData.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/com/ld/igds/m/service/HInoutPriceService.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/com/ld/igds/m/view/InoutPrice.view.xml 279 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/java/com/ld/igds/m/view/InoutPricePR.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-inout/src/main/resources/mapper/InoutCheckMapper.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-web/src/main/resources/static/admin/inout/in-check.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-web/src/main/resources/static/admin/inout/in-sample.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-web/src/main/resources/templates/admin/inout/in-check.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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;
}
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;
    }
}
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(&quot;dicTriggerPR#dicTrigger&quot;).getResult(&quot;FOOD_VARIETY_&quot;)}</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(&quot;dicTriggerPR#dicTrigger&quot;).getResult(&quot;FOOD_LEVEL_&quot;)}</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;//父页面中的分库编码&#xD;
&#xD;
//查询&#xD;
query = function(){&#xD;
    view.get(&quot;#dsMain&quot;).set(&quot;parameter&quot;,{deptId:deptId}).flushAsync();&#xD;
};&#xD;
&#xD;
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(&quot;#dsMain&quot;).insert();&#xD;
          view.get(&quot;#dialogMain&quot;).show();&#xD;
        </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(&quot;#dsMain.data:#&quot;);&#xD;
          if(data){&#xD;
          view.get(&quot;#dialogMain&quot;).show();&#xD;
          }</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(&quot;#dsMain.data:#&quot;);&#xD;
          if(!data){&#xD;
          return;&#xD;
          }&#xD;
          view.get(&quot;#ajaxDel&quot;).set(&quot;parameter&quot;,data).execute(function(result){&#xD;
          if(result){&#xD;
          $alert(result);&#xD;
          return;&#xD;
          }else{&#xD;
          data.remove();&#xD;
          }&#xD;
          });&#xD;
        </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(&quot;#dsMain.data:#&quot;);&#xD;
          if(data){&#xD;
          view.get(&quot;#dialogMain&quot;).show();&#xD;
          }</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(&quot;#dsMain.data:#&quot;);&#xD;
            &#xD;
            if(data.validate() != 'ok'){&#xD;
            $notify(&quot;数据校验失败!!&quot;);&#xD;
            return;&#xD;
            }&#xD;
            &#xD;
            view.get(&quot;#uaAction&quot;).set(&quot;parameter&quot;,data).execute(function(){&#xD;
            &#xD;
            $notify(&quot;数据执行完成!!&quot;);&#xD;
            self.get(&quot;parent&quot;).hide();&#xD;
            });</ClientEvent>
          <Property name="caption">确定</Property>
          <Property name="iconClass">fa fa-check</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">view.get(&quot;#dsMain.data:#&quot;).cancel();&#xD;
            self.get(&quot;parent&quot;).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>
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);
    }
}
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}
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();
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;
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>