Explorar o código

Merge branch 'CH-0415-ST' of sckj/mz-cloud into master

953954216 hai 4 días
pai
achega
6e8fcf10b7

+ 12 - 0
ruoyi-modules/mz-lnst/src/main/java/com/ruoyi/lnst/mapper/ZwywJclrYcxxMapper.java

@@ -18,8 +18,20 @@ public interface ZwywJclrYcxxMapper extends BaseMapperPlus<ZwywJclrYcxx> {
 
     public List<ZwywJclrYcxx> listAndLrInfo2024(ZwywJclrYcxx zwywJclrYcxx);
     public List<ZwywJclrYcxx> listAndLrInfoBefor2023(ZwywJclrYcxx zwywJclrYcxx);
+
+
+
+    public List<ZwywJclrYcxx> listAndLrInfoGZHOf2023(ZwywJclrYcxx zwywJclrYcxx);
+    public List<ZwywJclrYcxx> listAndLrInfoGZHOf2024(ZwywJclrYcxx zwywJclrYcxx);
     public List<ZwywJclrYcxx> listAndLrInfoGZH(ZwywJclrYcxx zwywJclrYcxx);
 
+
+
+    public List<ZwywJclrYcxx> seletYcxxStOf2023(ZwywJclrYcxx zwywJclrYcxx);
+    public List<ZwywJclrYcxx> seletYcxxStOf2024(ZwywJclrYcxx zwywJclrYcxx);
+
+    public List<ZwywJclrYcxx> seletYcxxSt(ZwywJclrYcxx zwywJclrYcxx);
+
     public int batchYcxxList(List<ZwywJclrYcxx> zwywJclrYcxxList);
 
 }

+ 26 - 36
ruoyi-modules/mz-lnst/src/main/java/com/ruoyi/lnst/service/impl/ZwywJclrYcxxServiceImpl.java

@@ -396,11 +396,7 @@ public class ZwywJclrYcxxServiceImpl implements IZwywJclrYcxxService {
         if (ObjectUtils.isEmpty(jcxx)) {
             return ycxxList;
         }
-        String date = zwywJclrYcxx.getYchz();
-        date = date.substring(0, 4) + "-" + date.substring(4, 6) + "-" + date.substring(6, 8);
-        String startDate = date + " 00:00:00";
-        String endDate = date + " 23:59:59";
-        List<ZwywJclrYcxx> list = getAllYcxxByLnstGZH(startDate, endDate,zwywJclrYcxx.getStbm());
+        List<ZwywJclrYcxx> list = getAllYcxxByLnstGZH(zwywJclrYcxx);
         if(StringUtils.isNotEmpty(list)){
             ycxxList = list;
         }
@@ -408,43 +404,38 @@ public class ZwywJclrYcxxServiceImpl implements IZwywJclrYcxxService {
     }
 
     public List<ZwywJclrYcxx> getYcxxByLnst(ZwywJclrYcxx zwywJclrYcxx) {
+
         List<ZwywJclrYcxx> ycxxList = new ArrayList<>();
         if(StringUtils.isEmpty(zwywJclrYcxx.getYchz())){
-            throw new ServiceException("请选择用餐时间!");
+            zwywJclrYcxx.setYchz(DateUtils.getDate().replaceAll("-", ""));
         }
+
         LnstJcxx jcxx = lnstJcxxMapper.selectById(SecurityUtils.getJgId());
+
+
         if (ObjectUtils.isEmpty(jcxx)) {
             return ycxxList;
         }
-        String date = zwywJclrYcxx.getYchz();
-        date = date.substring(0, 4) + "-" + date.substring(4, 6) + "-" + date.substring(6, 8);
-        String startDate = date + " 00:00:00";
-        String endDate = date + " 23:59:59";
-        List<ZwywJclrYcxx> list = getAllYcxxByLnst(startDate, endDate,zwywJclrYcxx.getStbm());
+
+        List<ZwywJclrYcxx> list = getAllYcxxByLnst(zwywJclrYcxx);
         if(StringUtils.isNotEmpty(list)){
          ycxxList = list;
         }
         return ycxxList;
     }
 
-    private List<ZwywJclrYcxx> getAllYcxxByLnstGZH(String startDate, String endDate, String stbm) {
+    private List<ZwywJclrYcxx> getAllYcxxByLnstGZH(ZwywJclrYcxx ycParams) {
         List<ZwywJclrYcxx> list = new ArrayList();
-        if (StringUtils.isEmpty(startDate) && StringUtils.isEmpty(endDate)) {
-            startDate = DateUtils.getDate();
-        }
-        startDate += " 00:00:00";
-
-        // 这块的需要在做一个查询传入时间的用餐信息。添加进来平板或者其他信息(无流水号)。-CH-2024-7-16
-        LambdaQueryWrapper<ZwywJclrYcxx> lqw = new LambdaQueryWrapper<ZwywJclrYcxx>()
-                .eq(ZwywJclrYcxx::getStbm,stbm)
-                .eq(ZwywJclrYcxx::getZt,"0")
-                .likeRight(ZwywJclrYcxx::getYcsj, startDate.replace("-","").substring(0,8));
 
-        ZwywJclrYcxx zwywJclrYcxx = new ZwywJclrYcxx();
-        zwywJclrYcxx.setStbm(stbm);
-        zwywJclrYcxx.setYcsj(startDate.replace("-","").substring(0,8));
+        List<ZwywJclrYcxx> dbYcxxList;
+        if(Integer.parseInt(ycParams.getYchz().substring(0,4))<= 2023){
+            dbYcxxList = zwywJclrYcxxMapper.listAndLrInfoGZHOf2023(ycParams);
+        } else if ("2024".equals(ycParams.getYchz().substring(0,4))){
+            dbYcxxList = zwywJclrYcxxMapper.listAndLrInfoGZHOf2024(ycParams);
+        }else{
+            dbYcxxList = zwywJclrYcxxMapper.listAndLrInfoGZH(ycParams);
+        }
 
-        List<ZwywJclrYcxx> dbYcxxList = zwywJclrYcxxMapper.listAndLrInfoGZH(zwywJclrYcxx);
         dbYcxxList.forEach(item->{
             if(StringUtils.isNotEmpty(item.getSbdwbm())){
                 item.setJylx("三方接入");
@@ -477,19 +468,18 @@ public class ZwywJclrYcxxServiceImpl implements IZwywJclrYcxxService {
     }
 
 
-    private List<ZwywJclrYcxx> getAllYcxxByLnst(String startDate, String endDate, String stbm) {
+    private List<ZwywJclrYcxx> getAllYcxxByLnst(ZwywJclrYcxx ycParams) {
         List<ZwywJclrYcxx> list = new ArrayList();
-        if (StringUtils.isEmpty(startDate) && StringUtils.isEmpty(endDate)) {
-            startDate = DateUtils.getDate();
+
+        List<ZwywJclrYcxx> dbYcxxList;
+        if(Integer.parseInt(ycParams.getYchz().substring(0,4))<= 2023){
+            dbYcxxList = zwywJclrYcxxMapper.seletYcxxStOf2023(ycParams);
+        } else if ("2024".equals(ycParams.getYchz().substring(0,4))){
+            dbYcxxList = zwywJclrYcxxMapper.seletYcxxStOf2024(ycParams);
+        }else{
+            dbYcxxList = zwywJclrYcxxMapper.seletYcxxSt(ycParams);
         }
-        startDate += " 00:00:00";
 
-        // 这块的需要在做一个查询传入时间的用餐信息。添加进来平板或者其他信息(无流水号)。-CH-2024-7-16
-        LambdaQueryWrapper<ZwywJclrYcxx> lqw = new LambdaQueryWrapper<ZwywJclrYcxx>()
-                .eq(ZwywJclrYcxx::getStbm,stbm)
-                .eq(ZwywJclrYcxx::getZt,"0")
-                .likeRight(ZwywJclrYcxx::getYcsj, startDate.replace("-","").substring(0,8));
-        List<ZwywJclrYcxx> dbYcxxList = zwywJclrYcxxMapper.selectList(lqw);
         dbYcxxList.forEach(item->{
             if(StringUtils.isNotEmpty(item.getSbdwbm())){
                 item.setJylx("三方接入");

+ 59 - 1
ruoyi-modules/mz-lnst/src/main/resources/mapper/lnst/ZwywJclrYcxxMapper.xml

@@ -99,6 +99,64 @@
         </where>
     </select>
 
+    <select id="seletYcxxStOf2023" parameterType="ZwywJclrYcxx" resultMap="ZwywJclrYcxxResult">
+        SELECT * FROM lnst_ycxx_2023 a
+        <where>
+            <if test="ychz != null  and ychz != ''">and ycsj like concat(#{ychz},'%') </if>
+        </where>
+    </select>
+
+    <select id="seletYcxxStOf2024" parameterType="ZwywJclrYcxx" resultMap="ZwywJclrYcxxResult">
+        SELECT * FROM lnst_ycxx_2024 a
+        <where>
+            <if test="ychz != null  and ychz != ''">and ycsj like concat(#{ychz},'%') </if>
+        </where>
+    </select>
+
+    <select id="seletYcxxSt" parameterType="ZwywJclrYcxx" resultMap="ZwywJclrYcxxResult">
+        SELECT * FROM lnst_ycxx
+        <where>
+            <if test="ychz != null  and ychz != ''">and ycsj like concat(#{ychz},'%') </if>
+        </where>
+    </select>
+
+    <select id="listAndLrInfoGZHOf2023" parameterType="ZwywJclrYcxx" resultMap="ZwywJclrYcxxResult">
+        SELECT
+        getxzqhmcbycode ( CONCAT( ssqh )) AS ssqhMc,
+        ycsj, stmc, xm, sfzh, ycje, yhje, issc,sbdwbm,train_ssn,
+        (select lr_tx from lnst_lrxx where lnst_ycxx.sfzh = lnst_lrxx.lr_zjhm limit 1) as zpurl,
+        (select bzms from lnst_btbz where lnst_ycxx.yhlx = lnst_btbz.bzbm limit 1) as bzms
+        FROM
+        lnst_ycxx_2023
+        <where>
+            zt = '0'
+            <if test="stmc != null  and stmc != ''">and stmc like concat('%', #{stmc}, '%')</if>
+            <if test="stbm != null  and stbm != ''">and stbm = #{stbm}</if>
+            <if test="issc != null  and issc != ''">and issc = #{issc}</if>
+            <if test="ychz != null  and ychz != ''">and ycsj like concat( #{ychz}, '%')</if>
+        </where>
+        order by ycsj desc
+    </select>
+
+    <select id="listAndLrInfoGZHOf2024" parameterType="ZwywJclrYcxx" resultMap="ZwywJclrYcxxResult">
+        SELECT
+        getxzqhmcbycode ( CONCAT( ssqh )) AS ssqhMc,
+        ycsj, stmc, xm, sfzh, ycje, yhje, issc,sbdwbm,train_ssn,
+        (select lr_tx from lnst_lrxx where lnst_ycxx.sfzh = lnst_lrxx.lr_zjhm limit 1) as zpurl,
+        (select bzms from lnst_btbz where lnst_ycxx.yhlx = lnst_btbz.bzbm limit 1) as bzms
+        FROM
+        lnst_ycxx_2024
+        <where>
+            zt = '0'
+            <if test="stmc != null  and stmc != ''">and stmc like concat('%', #{stmc}, '%')</if>
+            <if test="stbm != null  and stbm != ''">and stbm = #{stbm}</if>
+            <if test="issc != null  and issc != ''">and issc = #{issc}</if>
+            <if test="ychz != null  and ychz != ''">and ycsj like concat( #{ychz}, '%')</if>
+        </where>
+        order by ycsj desc
+    </select>
+
+
     <select id="listAndLrInfoGZH" parameterType="ZwywJclrYcxx" resultMap="ZwywJclrYcxxResult">
         SELECT
         getxzqhmcbycode ( CONCAT( ssqh )) AS ssqhMc,
@@ -112,7 +170,7 @@
             <if test="stmc != null  and stmc != ''">and stmc like concat('%', #{stmc}, '%')</if>
             <if test="stbm != null  and stbm != ''">and stbm = #{stbm}</if>
             <if test="issc != null  and issc != ''">and issc = #{issc}</if>
-            <if test="ycsj != null  and ycsj != ''">and ycsj like concat( #{ycsj}, '%')</if>
+            <if test="ychz != null  and ychz != ''">and ycsj like concat( #{ychz}, '%')</if>
         </where>
         order by ycsj desc
     </select>

+ 1 - 7
ruoyi-ui/src/views/lnst/ycxx/index.vue

@@ -30,12 +30,7 @@
               value-format="yyyyMMdd" type="date" placeholder="用餐时间结束" :picker-options="datePickerOptionsEnd" @change="handleEndTimeChange"
             ></el-date-picker>
           </el-form-item>
-<!--          <el-form-item v-if="user.userData.userType == '05'" label="用餐汇总" prop="ychz">-->
-<!--            <el-date-picker-->
-<!--              style="width: 215px" v-model="queryParams.ychz"-->
-<!--              value-format="yyyyMMdd" type="date" placeholder="汇总日期"-->
-<!--            ></el-date-picker>-->
-<!--          </el-form-item>-->
+
           <el-form-item ref="stbm" label="用餐食堂" prop="stbm" v-if="xzqhLevel === '3' && user.userData.userType !== '05'">
             <el-select
               v-model="queryParams.stbm"
@@ -70,7 +65,6 @@
               导出
             </el-button>
           </el-col>
-<!--          <span v-loading="hzloading" v-if="user.userData.userType == '05'" style="color: #606266;font-size: 15px;margin-left: 15px;line-height: 28px;font-weight: bold;">当日用餐汇总-&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;用餐金额:{{ ychz.ycje }} 优惠金额:{{ ychz.yhje }}</span>-->
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
 

+ 1 - 1
ruoyi-ui/src/views/lnst/ycxx/indexYCDZ.vue

@@ -40,7 +40,7 @@
 <!--          </el-col>-->
 <!--          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
 <!--        </el-row>-->
-        <span>{{"日消费人次:"+ this.total + "次。 日消费总金额:"+this.allPrice+"元。  " +"日补贴次数:" + this.btcs + "次。 日优惠总金额:" + this.allYhje+ "元。"}}</span>
+        <span>{{"日消费人次:"+ this.total + "次。 日消费总金额:"+this.allPrice.toFixed(2)+"元。  " +"日补贴次数:" + this.btcs + "次。 日优惠总金额:" + this.allYhje.toFixed(2)+ "元。"}}</span>
         <el-table v-loading="loading" :data="tableList">
           <el-table-column label="序号" align="center">
             <template slot-scope="scope">