Browse Source

修改小程序bug

oyq28 2 years ago
parent
commit
bc5f9cef49

+ 2 - 2
imcs-bt-be/imcs-authority-server/src/main/java/com/github/zuihou/api/OpsAppApi.java

@@ -306,7 +306,7 @@ public class OpsAppApi {
         System.out.println("小程序换料接口");
         LambdaUpdateWrapper<EquBarrel> updateWrapper = new LambdaUpdateWrapper();
         updateWrapper.set(EquBarrel::getMtrId, equRecord.getReplaceMaterial()).set(EquBarrel::getMtrName, equRecord.getMtName()).set(EquBarrel::getMtrResidue, equRecord.getSpecs())
-                .set(StringUtil.isNotEmpty(equRecord.getDate()), EquBarrel::getExprTime, DateUtils.getStartTime(equRecord.getDate())).eq(EquBarrel::getId, equRecord.getMaterialId());
+                .set(StringUtil.isNotEmpty(equRecord.getDate()), EquBarrel::getExprTime, equRecord.getDate()).eq(EquBarrel::getId, equRecord.getMaterialId());
         Boolean bool = equBarrelService.update(null, updateWrapper);
         if (bool) {
             bool = equRecordService.save(equRecord);
@@ -386,7 +386,7 @@ public class OpsAppApi {
         System.out.println("小程序换杯、盖接口");
         BaseContextHandler.setTenant("0000");
         LambdaUpdateWrapper<EquBarrel> updateWrapper = new LambdaUpdateWrapper();
-        updateWrapper.set(EquBarrel::getMtrResidue, equRecord.getSpecs()).set(EquBarrel::getExprTime, equRecord.getDate())
+        updateWrapper.set(EquBarrel::getMtrResidue, equRecord.getSpecs()).set(StringUtil.isNotEmpty(equRecord.getDate()),EquBarrel::getExprTime, equRecord.getDate())
                 .eq(EquBarrel::getId, equRecord.getMaterialId());
         Boolean bool = equBarrelService.update(null, updateWrapper);
         if (bool) {

+ 9 - 7
imcs-bt-be/imcs-business-biz/src/main/resources/mapper_business/base/order/OrderMapper.xml

@@ -143,7 +143,7 @@
             and o.create_time <![CDATA[ <= ]]> #{nextDay, jdbcType=TIMESTAMP}
         </if>
         <if test="id != null">
-            and o.id = #{id}
+            and o.order_equ_id = #{id}
         </if>
         union
         select 0 as num1, count(1) as num2 ,0 as num3,0 as num4,0 as num5,0 as num6, 0 as num7, 0 as num8, 0 as num9 from bt_order
@@ -156,7 +156,7 @@
             where 1 = 1
         </if>
         <if test="id != null">
-            and o.id = #{id}
+            and o.order_equ_id = #{id}
         </if>
         and o.order_status='4'
         union
@@ -169,7 +169,7 @@
             where 1 = 1
         </if>
         <if test="id != null">
-            and o.id = #{id}
+            and o.order_equ_id = #{id}
         </if>
         and o.order_status='4'
         union
@@ -189,8 +189,9 @@
             and o.create_time <![CDATA[ <= ]]> #{nextDay, jdbcType=TIMESTAMP}
         </if>
         <if test="id != null">
-            and o.id = #{id}
+            and o.order_equ_id = #{id}
         </if>
+        and o.order_status='1'
         union
         select 0,0,0,0,count(1) as num5,0, 0, 0, 0 from bt_order o
         <if test="orgIds != null and orgIds != ''">
@@ -207,8 +208,9 @@
             and o.create_time <![CDATA[ <= ]]> #{now, jdbcType=TIMESTAMP}
         </if>
         <if test="id != null">
-            and o.id = #{id}
+            and o.order_equ_id = #{id}
         </if>
+        and o.order_status='1'
         union
         select 0,0,0,0,0,sum(o.order_amount) as num6, 0, 0, 0 from bt_order o
         <if test="orgIds != null and orgIds != ''">
@@ -225,7 +227,7 @@
             and o.create_time <![CDATA[ <= ]]> #{now, jdbcType=TIMESTAMP}
         </if>
         <if test="id != null">
-            and o.id = #{id}
+            and o.order_equ_id = #{id}
         </if>
         and o.order_status = '1'
         union
@@ -252,7 +254,7 @@
             and o.create_time <![CDATA[ <= ]]> #{now, jdbcType=TIMESTAMP}
         </if>
         <if test="id != null">
-            and o.id = #{id}
+            and o.order_equ_id = #{id}
         </if>
         and o.order_status = '1'
         union

+ 1 - 1
imcs-bt-be/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionresource/ProductionResourceController.java

@@ -101,7 +101,7 @@ public class ProductionResourceController extends SuperController<ProductionTena
         String date = DateUtil.dateToString(new Date());
         iPage.getRecords().forEach(item->{
             QueryWrap<Order> orderQueryWrap = new QueryWrap<Order>();
-            orderQueryWrap.select("ifnull(sum(order_amount), 0.0) as orderSum").eq("order_equ_id", item.getId()) .geHeader("create_time", DateUtils.getStartTime(date)).leFooter("create_time", DateUtils.getEndTime(date));
+            orderQueryWrap.select("ifnull(sum(order_amount), 0.0) as orderSum").eq("order_equ_id", item.getId()).eq("order_status","1") .geHeader("create_time", DateUtils.getStartTime(date)).leFooter("create_time", DateUtils.getEndTime(date));
             Order sumOrder = orderService.getOne(orderQueryWrap);
             Float incomeToday = sumOrder.getOrderSum().floatValue();
             item.setIncomeToday(incomeToday);