chenchuang 3 년 전
부모
커밋
2cd0d1502a

+ 2 - 2
src/main/java/org/jeecg/modules/appInterface/mapper/xml/FbsWorkingStatisticsMapper.xml

@@ -186,8 +186,8 @@
             min( fws.first_time ) as firstTime,
             max( fws.final_time ) as finalTime,
             sum( fws.working_hours ) as workingHours,
-            ftpi.standard_working_hours AS standardWorkingHoursProcess,
-            ROUND(sum( fws.working_hours )/(fwdl.number_of_tasks * IFNULL( ftpi.standard_working_hours, 0 ))*100,1) AS efficiency
+            (fwdl.number_of_tasks * IFNULL( ftpi.standard_working_hours, 0 )) AS standardWorkingHoursProcess,
+            ROUND((fwdl.number_of_tasks * IFNULL( ftpi.standard_working_hours, 0 ))/sum( fws.working_hours )*100,0) AS efficiency
         FROM
             fbs_working_statistics fws
             LEFT JOIN fbs_workshop_dispatch_list fwdl ON fws.pk_workshop_dispatch_list = fwdl.id

+ 6 - 6
src/main/java/org/jeecg/modules/fbsAbnormalWorkingHours/mapper/xml/FbsAbnormalWorkingHoursMapper.xml

@@ -151,15 +151,15 @@
     <select id="findByPage" resultType="org.jeecg.modules.fbsAbnormalWorkingHours.entity.FbsAbnormalWorkingHours">
         SELECT
             IFNULL(fawh.train,0)+IFNULL(fawh.meeting,0)+IFNULL(fawh.research_and_development,0)+IFNULL(fawh.five_s,0)+IFNULL(fawh.other,0) as invalidWork,
-            (select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.abnormal_working_hours_id=fawh.id AND fawhdd.anomaly_classification='1' AND fawhdd.cost_item_code=fawhd.cost_item_code AND fawhdd.project_name=fawhd.project_name AND fawhdd.production_order_number_name=fawhd.production_order_number_name AND fawhdd.product_id=fawhd.product_id AND fawhdd.product=fawhd.product) as anomalyClassification1,
-            (select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.abnormal_working_hours_id=fawh.id AND fawhdd.anomaly_classification='2' AND fawhdd.cost_item_code=fawhd.cost_item_code AND fawhdd.project_name=fawhd.project_name AND fawhdd.production_order_number_name=fawhd.production_order_number_name AND fawhdd.product_id=fawhd.product_id AND fawhdd.product=fawhd.product) as anomalyClassification2,
-            (select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.abnormal_working_hours_id=fawh.id AND fawhdd.anomaly_classification='3' AND fawhdd.cost_item_code=fawhd.cost_item_code AND fawhdd.project_name=fawhd.project_name AND fawhdd.production_order_number_name=fawhd.production_order_number_name AND fawhdd.product_id=fawhd.product_id AND fawhdd.product=fawhd.product) as anomalyClassification3,
-            (select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.abnormal_working_hours_id=fawh.id AND fawhdd.anomaly_classification='4' AND fawhdd.cost_item_code=fawhd.cost_item_code AND fawhdd.project_name=fawhd.project_name AND fawhdd.production_order_number_name=fawhd.production_order_number_name AND fawhdd.product_id=fawhd.product_id AND fawhdd.product=fawhd.product) as anomalyClassification4,
-            (select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.abnormal_working_hours_id=fawh.id AND fawhdd.anomaly_classification='5' AND fawhdd.cost_item_code=fawhd.cost_item_code AND fawhdd.project_name=fawhd.project_name AND fawhdd.production_order_number_name=fawhd.production_order_number_name AND fawhdd.product_id=fawhd.product_id AND fawhdd.product=fawhd.product) as anomalyClassification5,
+            (select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.abnormal_working_hours_id=fawh.id AND fawhdd.anomaly_classification='1' AND (fawhdd.cost_item_code=fawhd.cost_item_code or fawhd.cost_item_code is null) AND (fawhdd.project_name=fawhd.project_name or fawhd.project_name is null) AND fawhdd.production_order_number_name=fawhd.production_order_number_name AND fawhdd.product_id=fawhd.product_id AND fawhdd.product=fawhd.product) as anomalyClassification1,
+            (select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.abnormal_working_hours_id=fawh.id AND fawhdd.anomaly_classification='2' AND (fawhdd.cost_item_code=fawhd.cost_item_code or fawhd.cost_item_code is null) AND (fawhdd.project_name=fawhd.project_name or fawhd.project_name is null) AND fawhdd.production_order_number_name=fawhd.production_order_number_name AND fawhdd.product_id=fawhd.product_id AND fawhdd.product=fawhd.product) as anomalyClassification2,
+            (select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.abnormal_working_hours_id=fawh.id AND fawhdd.anomaly_classification='3' AND (fawhdd.cost_item_code=fawhd.cost_item_code or fawhd.cost_item_code is null) AND (fawhdd.project_name=fawhd.project_name or fawhd.project_name is null) AND fawhdd.production_order_number_name=fawhd.production_order_number_name AND fawhdd.product_id=fawhd.product_id AND fawhdd.product=fawhd.product) as anomalyClassification3,
+            (select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.abnormal_working_hours_id=fawh.id AND fawhdd.anomaly_classification='4' AND (fawhdd.cost_item_code=fawhd.cost_item_code or fawhd.cost_item_code is null) AND (fawhdd.project_name=fawhd.project_name or fawhd.project_name is null) AND fawhdd.production_order_number_name=fawhd.production_order_number_name AND fawhdd.product_id=fawhd.product_id AND fawhdd.product=fawhd.product) as anomalyClassification4,
+            (select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.abnormal_working_hours_id=fawh.id AND fawhdd.anomaly_classification='5' AND (fawhdd.cost_item_code=fawhd.cost_item_code or fawhd.cost_item_code is null) AND (fawhdd.project_name=fawhd.project_name or fawhd.project_name is null) AND fawhdd.production_order_number_name=fawhd.production_order_number_name AND fawhdd.product_id=fawhd.product_id AND fawhdd.product=fawhd.product) as anomalyClassification5,
             fawh.*
         FROM
             fbs_abnormal_working_hours fawh
-            left join fbs_abnormal_working_hours_describe fawhd on fawhd.abnormal_working_hours_id=fawh.id
+            left join fbs_abnormal_working_hours_describe  fawhd on fawhd.abnormal_working_hours_id=fawh.id  and fawhd.del_flag='0'
             ${ew.customSqlSegment}
 
     </select>

+ 1 - 1
src/main/java/org/jeecg/modules/fbsInventory/service/impl/FbsInventoryServiceImpl.java

@@ -422,7 +422,7 @@ public class FbsInventoryServiceImpl extends ServiceImpl<FbsInventoryMapper, Fbs
                     mapItem.put("ID",String.valueOf(jsonObjectItem.get("ID")));//采购到货主表ID
                     mapItem.put("fRealQuantity",getDecimalNew(String.valueOf(jsonObjectItem.get("FREALQUANTITY"))));//实收数量
                     mapItem.put("fValidQuantity",getDecimalNew(String.valueOf(jsonObjectItem.get("FVALIDQUANTITY"))));//合格数量
-                    mapItem.put("fValidInQuan",getDecimalNew(String.valueOf(jsonObjectItem.get("CITEMNAME"))));//合格品入库数量
+                    mapItem.put("fValidInQuan",getDecimalNew(String.valueOf(jsonObjectItem.get("FVALIDINQUAN"))));//合格品入库数量
                     mapItem.put("cInvCode",String.valueOf(jsonObjectItem.get("CINVCODE")));//存货编码
                     mapItem.put("cItemName",String.valueOf(jsonObjectItem.get("CITEMNAME")));//项目名称
                     mapItem.put("iQuantity",getDecimalNew(String.valueOf(jsonObjectItem.get("IQUANTITY"))));//数量

+ 46 - 7
src/main/java/org/jeecg/modules/fbsMomOrder/service/impl/FbsMomOrderServiceImpl.java

@@ -289,13 +289,14 @@ public class FbsMomOrderServiceImpl extends ServiceImpl<FbsMomOrderMapper, FbsMo
                     //判断是否存在工艺
                     QueryWrapper<FbsTechnologicalProcess> fbsTechnologicalProcessQueryWrapper = new QueryWrapper<>();
                     fbsTechnologicalProcessQueryWrapper.lambda().eq(FbsTechnologicalProcess::getName, invcode);
-//                    List<FbsTechnologicalProcess> fbsTechnologicalProcessList = iFbsTechnologicalProcessService.list(fbsTechnologicalProcessQueryWrapper);
+                    fbsTechnologicalProcessQueryWrapper.lambda().eq(FbsTechnologicalProcess::getDelFlag,"0");
+                    List<FbsTechnologicalProcess> fbsTechnologicalProcessList = iFbsTechnologicalProcessService.list(fbsTechnologicalProcessQueryWrapper);
                     //不存在则添加新工艺
 //                    if (fbsTechnologicalProcessList == null || fbsTechnologicalProcessList.size() <= 0) {
-                        //先把旧的工艺进行删除
-                        FbsTechnologicalProcess fbsTechnologicalProcessUpdate=new FbsTechnologicalProcess();
-                        fbsTechnologicalProcessUpdate.setDelFlag("1");
-                        iFbsTechnologicalProcessService.update(fbsTechnologicalProcessUpdate,fbsTechnologicalProcessQueryWrapper);
+                        //先把旧的工艺进行删除 这种方式不行会影响到扫码记录的工艺关联
+//                        FbsTechnologicalProcess fbsTechnologicalProcessUpdate=new FbsTechnologicalProcess();
+//                        fbsTechnologicalProcessUpdate.setDelFlag("1");
+//                        iFbsTechnologicalProcessService.update(fbsTechnologicalProcessUpdate,fbsTechnologicalProcessQueryWrapper);
 
                         FbsTechnologicalProcess fbsTechnologicalProcess = new FbsTechnologicalProcess();
                         fbsTechnologicalProcess.setName(invcode);
@@ -303,7 +304,20 @@ public class FbsMomOrderServiceImpl extends ServiceImpl<FbsMomOrderMapper, FbsMo
                         fbsTechnologicalProcess.setDef1(def1);//
                         fbsTechnologicalProcess.setCreateBy("adminSAP");
                         fbsTechnologicalProcess.setPullDate(end + "");
+                    List<FbsTechnologicalProcessItem> itemList=new ArrayList<>();
+                    //判断是否存在工艺
+                    if (fbsTechnologicalProcessList == null || fbsTechnologicalProcessList.size() <= 0) {
+                        //不存在则进行修改
                         iFbsTechnologicalProcessService.save(fbsTechnologicalProcess);//插入数据库
+                    }else{
+                        //存在则进行修改
+                        fbsTechnologicalProcess.setId(fbsTechnologicalProcessList.get(0).getId());
+                        iFbsTechnologicalProcessService.updateById(fbsTechnologicalProcess);
+                        //获取工艺的工序
+                        QueryWrapper<FbsTechnologicalProcessItem>  fbsTechnologicalProcessItemQueryWrapper=new QueryWrapper<>();
+                        fbsTechnologicalProcessItemQueryWrapper.lambda().eq(FbsTechnologicalProcessItem::getFbsTechnologicalProcessId,fbsTechnologicalProcess.getId());
+                        itemList=iFbsTechnologicalProcessItemService.list(fbsTechnologicalProcessItemQueryWrapper);
+                    }
                         //获取工艺明细数据
                         List<FbsTechnologicalProcessItem> fbsTechnologicalProcessItemList = new ArrayList<>();
                         for (int i = 0; i < PROCS.size(); i++) {
@@ -325,9 +339,34 @@ public class FbsMomOrderServiceImpl extends ServiceImpl<FbsMomOrderMapper, FbsMo
                             }
                             fbsTechnologicalProcessItem.setStandardWorkingHours(STANDARDWORKINGHOURS);//标准工时
                             fbsTechnologicalProcessItem.setSort(i);//排序
-                            fbsTechnologicalProcessItemList.add(fbsTechnologicalProcessItem);
+                            //判断是否存在的工艺
+                            if (fbsTechnologicalProcessList == null || fbsTechnologicalProcessList.size() <= 0) {
+                                //不存在则都进行新增
+                                fbsTechnologicalProcessItemList.add(fbsTechnologicalProcessItem);
+                            }else{
+                                boolean isitem=false;
+                                //循环存在的工序进行绑定存在的id
+                                if(itemList!=null&&itemList.size()>0){
+                                    for(FbsTechnologicalProcessItem item:itemList){
+                                        if(item.getName().equals(fbsTechnologicalProcessItem.getName())){
+                                            isitem=true;
+                                            fbsTechnologicalProcessItem.setId(item.getId());
+                                        }
+                                    }
+                                }
+                                //判断工序是否存在
+                                if(isitem){
+                                    //存在的进行修改
+                                    iFbsTechnologicalProcessItemService.updateById(fbsTechnologicalProcessItem);
+                                }else{
+                                    //不存在进行新增
+                                    fbsTechnologicalProcessItemList.add(fbsTechnologicalProcessItem);
+                                }
+                            }
+                        }
+                        if(fbsTechnologicalProcessItemList!=null&&fbsTechnologicalProcessItemList.size()>0){
+                            iFbsTechnologicalProcessItemService.saveBatch(fbsTechnologicalProcessItemList);//插入数据库
                         }
-                        iFbsTechnologicalProcessItemService.saveBatch(fbsTechnologicalProcessItemList);//插入数据库
 //                    }
                 }
             }

+ 5 - 3
src/main/java/org/jeecg/modules/fbsPuArrivalvouch/mapper/xml/FbsPuArrivalvouchMapper.xml

@@ -167,7 +167,7 @@
         getdate()) = 0 sql修改-->
 
         DATE_FORMAT( p.dDate, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
-        AND v.cMemo like '%合格供方%'
+        <!--AND v.cMemo like '%合格供方%' sql修改-->
     GROUP BY
         p.cVenCode
         <!--,v.cVenName-->
@@ -324,7 +324,8 @@
         q.CINVCODE cinvcode,
         i.cInvName cinvName,
         q.FDTQUANTITY fdtquantity,
-        q.FDISBREAKQUANTITY fdisquantity,
+       <!-- q.FDISBREAKQUANTITY fdisquantity, sql修改-->
+        q.FDISQUANTITY fdisquantity,
         q.FQUANTITY fquantity,
         Q.CCHECKCODE as ccheckcode,
         q.CINSPECTCODE as cinspectcode
@@ -336,7 +337,8 @@
         <!--datediff(m,CONVERT ( VARCHAR ( 30 ), q.DDATE, 23 ),getdate()) <![CDATA[< ]]>3 sql修改-->
          DATE_SUB(CURDATE(), INTERVAL 90 DAY) <![CDATA[ <= ]]>date(q.DDATE)
         and q.FDISQUANTITY is not null
-        AND q.FDISBREAKQUANTITY >0
+        <!--AND q.FDISBREAKQUANTITY >0 sql修改-->
+        and q.FDISQUANTITY > 0
         ORDER BY q.DDATE desc
 
             </select>