1 жил өмнө
parent
commit
9e42147983

+ 1 - 0
platform-dao/src/main/java/com/platform/dao/vo/query/store/OutStoreFormVO.java

@@ -25,6 +25,7 @@ import java.util.List;
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = true)
 public class OutStoreFormVO extends BaseVO implements Serializable {
+
     private String producerName;
     private String typeName;
     private String name;

+ 8 - 6
platform-dao/src/main/resources/mapper/sqarepartmanage/SparePartInfoMapper.xml

@@ -88,12 +88,14 @@ warn_status,forecast_status,
         LEFT JOIN t_spare_store spareStore on spareStore.spare_id = info.id
         left join t_store store on store.id = spareStore.store_id
         left join t_firm_producer producer on producer.id = info.producer_id
-        <if test="producerName != null and producerName != ''">
-            LEFT JOIN t_firm_producer producer on producer.id = info.producer_id
-        </if>
-        <if test="supplierName != null and supplierName != ''">
-            LEFT JOIN t_supplier supplier on supplier.id = info.supplier_id
-        </if>
+        LEFT JOIN t_supplier supplier on supplier.id = info.supplier_id
+        left join t_spare_type spareType on spareType.id = info.type_id
+<!--        <if test="producerName != null and producerName != ''">-->
+<!--            LEFT JOIN t_firm_producer producer on producer.id = info.producer_id-->
+<!--        </if>-->
+<!--        <if test="supplierName != null and supplierName != ''">-->
+
+<!--        </if>-->
         <where>
             <if test="spareIdList != null and spareIdList.size > 0">
                 and sparestore.spare_id in

+ 75 - 2
platform-dao/src/main/resources/mapper/store/InStoreFormMapper.xml

@@ -117,7 +117,7 @@
             resultType="com.platform.dao.vo.query.store.InStoreFormVO">
         select instoreform.*, store.name storeName,
         info.type_id,info.no,info.name,info.ggxh,info.brand,
-        info.initial_value,info.unit,sum(if(spareStore.num is null,0,spareStore.num)) currentStock,
+        info.initial_value,info.unit,spareStore.num currentStock,
         info.max_stock,info.min_stock,info.level,info.producer_id,
         info.yt,producer.name as producerName,spareType.name as typeName
         from t_in_store_form as instoreform
@@ -337,7 +337,7 @@
             parameterType="com.platform.dao.dto.store.InStoreFormDTO">
             select info.*,sum(form.in_num ) totalNum,
             form.id inId,form.in_no inNo,store.id storeId,spareStore.spare_id spareId,
-              spareType.name as typeName,sum(spareStore.num) currentStock,producer.name as producerName
+              spareType.name as typeName,spareStore.num currentStock,producer.name as producerName
               from t_spare_part_info info
 
             inner join t_in_store_form form on info.id = form.spare_id
@@ -355,6 +355,79 @@
                 <if test="searchTimeEnd!=null and searchTimeEnd!=''">
                     form.created_time <![CDATA[<=]]> #{searchTimeEnd}
                 </if>
+
+
+                <if test="spareIdList != null and spareIdList.size > 0">
+                    and sparestore.spare_id in
+                    <foreach item="item" index="index" collection="spareIdList" open="(" close=")" separator=",">
+                        #{item}
+                    </foreach>
+                </if>
+
+
+
+                <if test="typeId != null and typeId != ''">
+                    and info.type_id = #{typeId}
+                </if>
+                <if test="isSpecial != null and isSpecial != ''">
+                    and info.is_special = #{isSpecial}
+                </if>
+                <if test="producerName != null and producerName != ''">
+                    AND producer.name like concat('%',#{producerName},'%')
+                </if>
+                <if test="supplierName != null and supplierName != ''">
+                    AND supplier.name like concat('%',#{supplierName},'%')
+                </if>
+                <if test="keyword != null and keyword != ''">
+                    AND ( info.name like concat('%',#{keyword},'%') or
+                    info.no like concat('%',#{keyword},'%'))
+                </if>
+                <if test="name != null and name != ''">
+                    AND info.name = #{name}
+                </if>
+
+                <if test="ggxh != null and ggxh != ''">
+                    AND info.ggxh like concat('%',#{ggxh},'%')
+                </if>
+                <if test="initNo != null and initNo != ''">
+                    AND info.init_no like concat('%',#{initNo},'%')
+                </if>
+                <if test="yt != null">
+                    AND info.yt=#{yt}
+                </if>
+                <if test="storeId != null and storeId != ''">
+                    AND spare.store_id=#{storeId}
+                </if>
+                <if test="level != null and level != ''">
+                    AND info.level=#{level}
+                </if>
+                <if test="typeIds != null and typeIds.size > 0">
+                    AND info.type_id in
+                    <foreach item="item" index="index" collection="typeIds" open="(" close=")" separator=",">
+                        #{item}
+                    </foreach>
+                </if>
+                <if test="producerId != null and producerId != ''">
+                    AND info.producer_id=#{producerId}
+                </if>
+                <if test="supplierId != null and producerId != ''">
+                    AND info.supplier_id=#{supplierId}
+                </if>
+                <if test="parentTypeId != null and parentTypeId != ''">
+                    AND info.parent_type_id=#{parentTypeId}
+                </if>
+                <!-- <if test="typeId != null and typeId != ''">
+                     AND info.type_id=#{typeId}
+                 </if>-->
+                <if test="parentNo != null and parentNo != ''">
+                    AND info.parent_no=#{parentNo}
+                </if>
+                <if test="childNo != null and childNo != ''">
+                    AND info.child_no=#{childNo}
+                </if>
+                <if test="brand!=null">
+                    and info.brand like concat('%',#{brand},'%')
+                </if>
             </where>
             group by info.id
 

+ 1 - 1
platform-dao/src/main/resources/mapper/store/OutStoreFormMapper.xml

@@ -97,7 +97,7 @@
             resultType="com.platform.dao.vo.query.store.OutStoreFormVO">
         select outstoreform.*, store.name storeName,info.name as spareName,
         info.type_id,info.no,info.name,info.ggxh,info.brand,
-        info.initial_value,info.unit,sum(if(spareStore.num is null,0,spareStore.num)) currentStock,
+        info.initial_value,info.unit,spareStore.num currentStock,
         info.max_stock,info.min_stock,info.level,info.producer_id,producer.name as producerName,
         info.yt,spareType.name as typeName
         from t_out_store_form as outstoreform

+ 10 - 10
platform-service/src/main/java/com/platform/service/upms/impl/ScheduleJobServiceImpl.java

@@ -38,16 +38,16 @@ public class ScheduleJobServiceImpl extends BaseServiceImpl<ScheduleJobMapper, S
      */
     @PostConstruct
     public void init() {
-//        List<ScheduleJob> scheduleJobList = mapper.selectAll();
-//        for (ScheduleJob scheduleJob : scheduleJobList) {
-//            CronTrigger cronTrigger = ScheduleUtils.getCronTrigger(scheduler, scheduleJob.getJobId());
-//            //如果不存在,则创建
-//            if (cronTrigger == null) {
-//                ScheduleUtils.createScheduleJob(scheduler, scheduleJob);
-//            } else {
-//                ScheduleUtils.updateScheduleJob(scheduler, scheduleJob);
-//            }
-//        }
+        List<ScheduleJob> scheduleJobList = mapper.selectAll();
+        for (ScheduleJob scheduleJob : scheduleJobList) {
+            CronTrigger cronTrigger = ScheduleUtils.getCronTrigger(scheduler, scheduleJob.getJobId());
+            //如果不存在,则创建
+            if (cronTrigger == null) {
+                ScheduleUtils.createScheduleJob(scheduler, scheduleJob);
+            } else {
+                ScheduleUtils.updateScheduleJob(scheduler, scheduleJob);
+            }
+        }
     }
 
     @Override