sgj
昨天 457c87c165739e37d72ce5c2b02fd27e05a75d6a
数量检测报表提交
已添加4个文件
已修改2个文件
406 ■■■■■ 文件已修改
fzzy-igdss-core/src/main/java/com/fzzy/igds/data/QuantityParam.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/Quantity.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/QuantityMapper.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityData.view.xml 239 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityDataPR.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/data/QuantityParam.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,32 @@
package com.fzzy.igds.data;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@Data
public class QuantityParam {
    private String companyId;
    private String deptId;
    private String title; // æŠ¥è¡¨æ ‡é¢˜
    private String depotId;// ä»“库编码
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date start; // èµ·å§‹æ—¶é—´
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date end; // ç»“束时间
    private String createUser; // åˆ›å»ºäºº
    private String timeDesc; // æ—¶é—´æè¿°
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/Quantity.java
@@ -78,5 +78,6 @@
    private String remark;
    @Transient
    @TableField(exist = false)
    private Depot depotData;
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/QuantityMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,10 @@
package com.fzzy.igds.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fzzy.igds.domain.Quantity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface QuantityMapper extends BaseMapper<Quantity> {
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java
@@ -2,14 +2,19 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fzzy.igds.constant.RedisConst;
import com.fzzy.igds.data.QuantityParam;
import com.fzzy.igds.domain.Quantity;
import com.fzzy.igds.domain.QuantityConf;
import com.fzzy.igds.mapper.QuantityConfMapper;
import com.fzzy.igds.mapper.QuantityMapper;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collection;
@@ -29,6 +34,39 @@
    private QuantityConfMapper quantityConfMapper;
    @Resource
    private RedisCache redisCache;
    @Resource
    private QuantityMapper  quantityMapper;
    /**
     * åˆ†é¡µæŸ¥è¯¢è´¨é‡æ£€æµ‹æ•°æ®
     *
     * @author sgj
     * @date 2025/12/18
     */
    public void listPageQuantity(Page<Quantity> page, QuantityParam param) {
        QueryWrapper<Quantity> queryWrapper = new QueryWrapper<>();
        param.setCompanyId(ContextUtil.getCompanyId());
        param.setDeptId(ContextUtil.subDeptId(null));
        queryWrapper.eq("company_id", param.getCompanyId());
        queryWrapper.eq("dept_id", param.getDeptId());
        //仓库检索
        if (StringUtils.isNotBlank(param.getDepotId())) {
            queryWrapper.eq("depot_id", param.getDepotId());
        }
        //时间检索
        if(param.getStart() != null){
            queryWrapper.ge("receive_date", param.getStart());
        }
        if(param.getEnd() != null){
            queryWrapper.le("receive_date", param.getEnd());
        }
        queryWrapper.orderByAsc("receive_date");
        quantityMapper.selectPage(page, queryWrapper);
    }
    /**
     * æŸ¥è¯¢é…ç½®ä¿¡æ¯ï¼Œæ ¹æ®åº“区编码获取
@@ -44,10 +82,10 @@
        if (StringUtils.isEmpty(deptId)) {
            deptId = ContextUtil.subDeptId(null);
        }
        QueryWrapper<QuantityConf> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("company_id", companyId);
        if(StringUtils.isNotBlank(deptId)){
        if (StringUtils.isNotBlank(deptId)) {
            queryWrapper.eq("dept_id", deptId);
        }
        queryWrapper.orderByAsc("order_num");
@@ -56,7 +94,7 @@
    }
    /**
     *  - æŸ¥è¯¢é…ç½®ä¿¡æ¯ï¼Œæ ¹æ®ç»„织编码获取
     * - æŸ¥è¯¢é…ç½®ä¿¡æ¯ï¼Œæ ¹æ®ç»„织编码获取
     *
     * @param companyId
     * @return
@@ -70,7 +108,7 @@
    }
    /**
     *  - æ›´æ–°ä¿å­˜æ•°æ®
     * - æ›´æ–°ä¿å­˜æ•°æ®
     *
     * @param conf
     */
@@ -90,7 +128,7 @@
            conf.setUpdateBy(ContextUtil.getLoginUserName());
            conf.setUpdateTime(new Date());
            quantityConfMapper.insert(conf);
        }else {
        } else {
            conf.setUpdateBy(ContextUtil.getLoginUserName());
            conf.setUpdateTime(new Date());
            quantityConfMapper.update(conf, new UpdateWrapper<QuantityConf>().eq("depot_id", conf.getDepotId()));
@@ -115,7 +153,7 @@
    }
    /**
     *  - åˆ é™¤æ•°æ®
     * - åˆ é™¤æ•°æ®
     *
     * @param conf
     * @return
fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityData.view.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,239 @@
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model>
    <DataType name="dtDataReport">
      <Property name="creationType">com.fzzy.igds.domain.Quantity</Property>
      <PropertyDef name="batchId">
        <Property></Property>
        <Property name="label">检测批次</Property>
      </PropertyDef>
      <PropertyDef name="companyId">
        <Property></Property>
        <Property name="label">组织编码</Property>
      </PropertyDef>
      <PropertyDef name="depotId">
        <Property></Property>
        <Property name="label">所属仓库</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;depotPR#getAllCache&quot;).getResult()}</Property>
          <Property name="keyProperty">id</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="weight">
        <Property name="dataType">Double</Property>
        <Property name="label">重量</Property>
      </PropertyDef>
      <PropertyDef name="bulk">
        <Property name="dataType">Double</Property>
        <Property name="label">体积</Property>
      </PropertyDef>
      <PropertyDef name="receiveDate">
        <Property name="dataType">Date</Property>
        <Property name="label">检测时间</Property>
      </PropertyDef>
      <PropertyDef name="checkUser">
        <Property></Property>
        <Property name="label">检测人</Property>
      </PropertyDef>
      <PropertyDef name="remark">
        <Property></Property>
        <Property name="label">备注信息</Property>
      </PropertyDef>
      <PropertyDef name="points">
        <Property></Property>
        <Property name="label">采集点信息</Property>
      </PropertyDef>
    </DataType>
    <DataType name="dataTypeC">
      <ClientEvent name="onDataChange">var prop = arg.property;&#xD;
if(prop =='start' || prop == 'end'){&#xD;
    var entity = arg.entity;&#xD;
    entity.set(&quot;timeDesc&quot;,entity.get('start').formatDate(&quot;Y-m-d&quot;) +&quot; æˆªè‡³ï¼š&quot;+entity.get('end').formatDate(&quot;Y-m-d&quot;));&#xD;
}</ClientEvent>
      <Property name="creationType">com.fzzy.igds.data.QuantityParam</Property>
      <PropertyDef name="title">
        <Property name="label"> </Property>
      </PropertyDef>
      <PropertyDef name="depotId">
        <Property></Property>
        <Property name="label">选择仓库</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;depotPR#getAllCache&quot;).getResult()}</Property>
          <Property name="keyProperty">id</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="start">
        <Property name="dataType">Date</Property>
        <Property name="label">检测时间开始</Property>
      </PropertyDef>
      <PropertyDef name="end">
        <Property name="dataType">Date</Property>
        <Property name="label">检测时间截至</Property>
      </PropertyDef>
      <PropertyDef name="createUser">
        <Property name="label">制表人</Property>
      </PropertyDef>
      <PropertyDef name="timeDesc">
        <Property name="label">时间</Property>
      </PropertyDef>
    </DataType>
  </Model>
  <View layout="padding:5;regionPadding:5">
    <Property name="packages">font-awesome,css-common</Property>
    <Property name="cache">
      <Property name="mode">clientSide</Property>
    </Property>
    <DataSet id="dsMain">
      <Property name="dataType">[dtDataReport]</Property>
      <Property name="pageSize">20</Property>
      <Property name="dataProvider">quantityDataPR#getData</Property>
      <Property name="loadMode">manual</Property>
    </DataSet>
    <DataSet id="dataSetC">
      <Property name="dataType">dataTypeC</Property>
      <Property name="dataProvider">quantityDataPR#getQuery</Property>
    </DataSet>
    <AutoForm>
      <Property name="cols">*,*,*,*</Property>
      <Property name="dataSet">dataSetC</Property>
      <Property name="labelSeparator">:</Property>
      <Property name="labelAlign">right</Property>
      <Property name="labelWidth">110</Property>
      <Property name="exClassName">bg-color</Property>
      <AutoFormElement>
        <Property name="name">depotId</Property>
        <Property name="property">depotId</Property>
        <Property name="trigger">autoMappingDropDown2</Property>
        <Editor/>
      </AutoFormElement>
      <AutoFormElement>
        <Property name="name">start</Property>
        <Property name="property">start</Property>
        <Editor/>
      </AutoFormElement>
      <AutoFormElement>
        <Property name="name">end</Property>
        <Property name="property">end</Property>
        <Editor/>
      </AutoFormElement>
      <Container layout="hbox regionPadding:10">
        <Button>
          <ClientEvent name="onClick">var param = view.get(&quot;#dataSetC.data&quot;);&#xD;
view.get(&quot;#dsMain&quot;).set(&quot;parameter&quot;,param).flushAsync();&#xD;
&#xD;
//复制文本信息&#xD;
//var user = &quot;${loginUser.getCname()}&quot;;&#xD;
//var text = &quot;检测周期:&quot;;&#xD;
//if(param.get(&quot;start&quot;)){&#xD;
//    text += param.get(&quot;start&quot;).formatDate(&quot;Y-m-d&quot;);&#xD;
//}else{&#xD;
//    text += &quot;未设置&quot;;&#xD;
//}&#xD;
//if(param.get(&quot;end&quot;)){&#xD;
//    text += &quot;  è‡³   &quot;+param.get(&quot;end&quot;).formatDate(&quot;Y-m-d&quot;);&#xD;
//}else{&#xD;
//    text += &quot;  è‡³   &quot;+new Date().formatDate(&quot;Y-m-d&quot;);&#xD;
//}&#xD;
&#xD;
//view.get(&quot;#labelBillUser&quot;).set(&quot;text&quot;,&quot;制表人:&quot;+user);&#xD;
//view.get(&quot;#labelBillCheckDate&quot;).set(&quot;text&quot;,text);</ClientEvent>
          <Property name="caption">查询</Property>
          <Property name="iconClass">fa fa-search</Property>
          <Property name="exClassName">btn1</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">view.get(&quot;#dataSetC&quot;).flushAsync();</ClientEvent>
          <Property name="caption">重置</Property>
          <Property name="iconClass">fa fa-refresh</Property>
          <Property name="exClassName">btn2</Property>
        </Button>
      </Container>
    </AutoForm>
    <Container layoutConstraint="center">
      <Property name="exClassName">bg-color</Property>
      <DataGrid id="dataGrid1" layoutConstraint="center ">
        <Property name="dataSet">dsMain</Property>
        <Property name="readOnly">true</Property>
        <Property name="headerRowHeight">30</Property>
        <RowNumColumn/>
        <DataColumn name="batchId">
          <Property name="property">batchId</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="depotId">
          <Property name="property">depotId</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="weight">
          <Property name="property">weight</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="bulk">
          <Property name="property">bulk</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="receiveDate">
          <Property name="property">receiveDate</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="checkUser">
          <Property name="property">checkUser</Property>
          <Property name="align">center</Property>
          <Property name="visible">false</Property>
        </DataColumn>
        <DataColumn name="remark">
          <Property name="property">remark</Property>
          <Property name="align">center</Property>
        </DataColumn>
      </DataGrid>
      <AutoForm id="autoForm1" layoutConstraint="top">
        <Property name="cols">*,*,*</Property>
        <Property name="dataSet">dataSetC</Property>
        <Property name="labelAlign">right</Property>
        <Property name="showHint">false</Property>
        <AutoFormElement layoutConstraint="colSpan:3">
          <Property name="name">title</Property>
          <Property name="property">title</Property>
          <Property name="showLabel">false</Property>
          <Property name="editorType">Label</Property>
          <Property name="style">
            <Property name="font">bold 30px Georgia, serif;</Property>
            <Property name="text-align">center</Property>
          </Property>
          <Editor/>
        </AutoFormElement>
        <AutoFormElement>
          <Property name="name">timeDesc</Property>
          <Property name="property">timeDesc</Property>
          <Property name="editorType">Label</Property>
          <Editor/>
        </AutoFormElement>
        <AutoFormElement>
          <Property name="name">depotId</Property>
          <Property name="property">depotId</Property>
          <Property name="editorType">Label</Property>
          <Property name="labelWidth">110</Property>
          <Property name="labelAlign">right</Property>
          <Editor/>
        </AutoFormElement>
        <AutoFormElement>
          <Property name="name">createUser</Property>
          <Property name="property">createUser</Property>
          <Property name="editorType">Label</Property>
          <Editor/>
        </AutoFormElement>
      </AutoForm>
    </Container>
    <Container layoutConstraint="bottom">
      <Property name="exClassName">bg-color</Property>
      <DataPilot layoutConstraint="right">
        <Property name="dataSet">dsMain</Property>
        <Property name="itemCodes">pageSize,pages</Property>
      </DataPilot>
    </Container>
  </View>
</ViewConfig>
fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityDataPR.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,74 @@
package com.fzzy.igds;
import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.data.provider.Page;
import com.fzzy.igds.data.QuantityParam;
import com.fzzy.igds.domain.Quantity;
import com.fzzy.igds.service.QuantityService;
import com.fzzy.igds.service.SysDeptService;
import com.fzzy.igds.utils.ContextUtil;
import com.fzzy.igds.utils.DateUtil;
import com.ruoyi.common.core.domain.entity.SysDept;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Date;
/**
 *
 *
 * @author sgj
 * @date 2025/12/18
 */
@Component
public class QuantityDataPR {
    @Resource
    private QuantityService quantityService;
    @Resource
    private SysDeptService sysDeptService;
    /**
     * quantityDataPR#getQuery æ ¹æ®æŠ¥è¡¨ç±»åž‹ï¼ŒèŽ·å–é»˜è®¤æŸ¥è¯¢ä¿¡æ¯ï¼Œæ¯”å¦‚è¡¨å¤´ä¿¡æ¯ç­‰
     *
     * @param type
     * @return
     */
    @DataProvider
    public QuantityParam getQuery(String type) {
        QuantityParam result = new QuantityParam();
        SysDept subDept = sysDeptService.getCacheDept(null, ContextUtil.subDeptId(null));
        result.setTitle("数量检测数据");
        if (null != subDept) {
            result.setTitle(subDept.getDeptName() + "数量检测数据");
            result.setDepotId(String.valueOf(subDept.getDeptId()));
        }
        result.setEnd(new Date());
        Date start = DateUtil.getNewByDay(new Date(), -90);
        result.setStart(start);
        result.setTimeDesc(DateFormatUtils.format(start, "yyyy-MM-dd") + "   æˆªè‡³ï¼š"
                + DateFormatUtils.format(new Date(), "yyyy-MM-dd"));
        result.setCreateUser(ContextUtil.getLoginUserName());
        return result;
    }
    /**
     * quantityDataPR#getData
     * æ ¹æ®æ¡ä»¶åˆ†é¡µèŽ·å–æ•°æ®ä¿¡æ¯ QuantityData.view.xml
     *
     * @param page
     * @param param
     */
    @DataProvider
    public void getData(Page<Quantity> page, QuantityParam param) {
        com.baomidou.mybatisplus.extension.plugins.pagination.Page<Quantity> corePage = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(0, 10000);
        quantityService.listPageQuantity(corePage, param);
        // é‡æ–°å°è£…
        page.setEntities(corePage.getRecords());
        page.setEntityCount(Integer.parseInt(String.valueOf(corePage.getTotal())));
    }
}