Browse Source

Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun

ccj 2 years ago
parent
commit
7024e4b8fc

+ 0 - 6
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/PaymentManagementController.java

@@ -218,9 +218,6 @@ public class PaymentManagementController {
                     tmp.setRemarkss("车号:" + tmp.getCarNo() + "毛:" + tmp.getGrossWeightStr() + " 皮:" + tmp.getTareStr() + " 净:" + tmp.getNetWeight()
                             + " 纯:" + weight + " 应付:" + payable + " 合同号:" + tmp.getContractNo() + " 仓库:" + tmp.getWarehouseName()
                     );
-                    if(tmp.getGrade() == null){
-                        tmp.setGrade(" ");
-                    }
                     list1.add(tmp);
                     //第二张发票
                     PaymentManagement tmp1 = new PaymentManagement();
@@ -240,9 +237,6 @@ public class PaymentManagementController {
                     else{
                         tmp1.setTareStr("");
                     }
-                    if(tmp1.getGrade() == null){
-                        tmp1.setGrade(" ");
-                    }
                     tmp1.setRemarkss("车号:" + tmp1.getCarNo() + "毛:" + tmp1.getGrossWeightStr() + " 皮:" + tmp1.getTareStr() + " 净:" + tmp1.getNetWeight()
                                     + " 纯:" + weight + " 应付:" + payable + " 合同号:" + tmp1.getContractNo() + " 仓库:" + tmp1.getWarehouseName()
 //                            " ,★☆性质:贸易粮 形态:" + goodsName + "堆(2)"

+ 1 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/view/ExportVView.java

@@ -22,7 +22,7 @@ public class ExportVView {
     private String binNumber;
 
     /**
-     * 开票日期
+     * 开票日期/发货日期
      */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ContractManagementInfoServiceImpl.java

@@ -834,6 +834,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
                 * contractManagementInfo.getPageSize());
         //  公司ID
         pageView.put("compId", AuthSecurityUtils.getCurrentUserInfo().getCompId());
+        pageView.put("creator", contractManagementInfo.getCreator());
         pageView.put("searchKeyWord", contractManagementInfo.getSearchKeyWord());
         pageView.put("goodsType", contractManagementInfo.getGoodsType());
         pageView.put("startDate", contractManagementInfo.getStartDate());

+ 5 - 5
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseBaseInfoServiceImpl.java

@@ -2320,7 +2320,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         HSSFDataFormat df1 = wb.createDataFormat(); // 此处设置数据格式
         contextstyle1.setDataFormat(HSSFDataFormat.getBuiltinFormat("#,##0.00"));//保留两位小数点
         HSSFDataFormat df2 = wb.createDataFormat(); // 此处设置数据格式
-        contextstyle2.setDataFormat(HSSFDataFormat.getBuiltinFormat("#,###0.000"));//保留三位小数点
+        contextstyle2.setDataFormat(HSSFDataFormat.getBuiltinFormat("#,#####0.00000"));//保留三位小数点
         cell = rowp.createCell(1);
         cell.setCellValue("平均值/合计");
         cell.setCellStyle(styleDetail);
@@ -2509,7 +2509,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         cell.setCellValue("扣重");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(29);
-        cell.setCellValue("净重");
+        cell.setCellValue("净重(吨)");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(30);
         cell.setCellValue("发货毛重");
@@ -2667,7 +2667,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 HSSFDataFormat df = wb.createDataFormat(); // 此处设置数据格式
                 contextstyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("#,##0.00"));//保留两位小数点
                 HSSFDataFormat df3 = wb.createDataFormat(); // 此处设置数据格式
-                contextstyle2.setDataFormat(HSSFDataFormat.getBuiltinFormat("#,###0.000"));//保留两位小数点
+                contextstyle2.setDataFormat(HSSFDataFormat.getBuiltinFormat("#,#####0.00000"));//保留两位小数点
                 if (exportVView.getGrossWeight() != null) {
                     cell.setCellValue(editDouble(exportVView.getGrossWeight()));
                 }
@@ -4458,7 +4458,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(35);
                 cell.setCellValue(editFloat(exportVView.getFeedbackWeight()));
-                cell.setCellStyle(styleDetail);
+                cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(36);
                 String date1 = addDateOneDay(exportVView.getFeedbackDate() != null ? exportVView.getFeedbackDate() : new Date());
                 cell.setCellValue(date1);
@@ -5337,7 +5337,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(33);
                 cell.setCellValue(editFloat(exportVView.getFeedbackWeight()));
-                cell.setCellStyle(styleDetail);
+                cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(34);
                 String date1 = addDateOneDay(exportVView.getFeedbackDate() != null ? exportVView.getFeedbackDate() : new Date());
                 cell.setCellValue(date1);

+ 3 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/XmlUtil.java

@@ -202,7 +202,7 @@ public class XmlUtil implements InitializingBean {
                     "\n" +
                     "<Spmc>" + goodsName + "</Spmc>\n" +
                     "\n" +
-                    "<Ggxh>" + paymentManagement.getGrade() + "</Ggxh>\n" +
+                    "<Ggxh>" + "</Ggxh>\n" +
                     "\n" +
                     "<Jldw>公斤</Jldw>\n" +
                     "\n" +
@@ -320,7 +320,7 @@ public class XmlUtil implements InitializingBean {
                 "\n" +
                 "<Spmc>" + goodsName + "</Spmc>\n" +
                 "\n" +
-                "<Ggxh>" + paymentManagement.getGrade() + "</Ggxh>\n" +
+                "<Ggxh>" + "</Ggxh>\n" +
                 "\n" +
                 "<Jldw>公斤</Jldw>\n" +
                 "\n" +
@@ -430,7 +430,7 @@ public class XmlUtil implements InitializingBean {
                 "\n" +
                 "<Spmc>" + goodsName + "</Spmc>\n" +
                 "\n" +
-                "<Ggxh>" + paymentManagement.getGrade() + "</Ggxh>\n" +
+                "<Ggxh>" +  "</Ggxh>\n" +
                 "\n" +
                 "<Jldw>公斤</Jldw>\n" +
                 "\n" +

+ 7 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ContractManagementInfoMapper.xml

@@ -8,6 +8,7 @@
         FROM contract_management_info m
         left join contract_goods_info g on m.id=g.contract_id
         left join contract_process_info p on m.id=p.contract_id
+        left join common_staff c on m.create_user_id=c.staff_id
         WHERE
         m.comp_id = #{compId}
         and m.goods_type= #{goodsType}
@@ -26,6 +27,9 @@
                 AND m.approve_status != ''
             </if>
         </if>
+        <if test="creator != null and creator != ''">
+            AND c.staff_name = #{creator}
+        </if>
         <if test="contractType != null and contractType != ''">
             AND m.contract_type = #{contractType}
         </if>
@@ -168,6 +172,9 @@
                 AND m.approve_status != ''
             </if>
         </if>
+        <if test="creator != null and creator != ''">
+            AND c.staff_name = #{creator}
+        </if>
         <if test="contractType != null and contractType != ''">
             AND m.contract_type = #{contractType}
         </if>

+ 57 - 59
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseBaseInfoMapper.xml

@@ -37,7 +37,7 @@
         c.comp_name as compName,
         a.warehouse_name as warehouseName,
         q.bin_number as binNumber,
-        a.create_date as createDate,
+        a.settlement_date as createDate,
         a.contract_no as contractNo,
         a.payment_no as paymentNo,
         a.customer_name as customerName,
@@ -68,7 +68,7 @@
         ROUND(a.gross_weight/1000,2) as grossWeight,
         ROUND(a.tare/1000,2) as tare,
         ROUND(a.weight_deduction/1000,2) as buckleWeight,
-        ROUND(a.net_weight/1000,3) as netWeight,
+        ROUND(a.net_weight/1000,5) as netWeight,
         a.unit_deduction as unitDeduction,
         a.solid_grain_price as pureWeightPrice,
         case when a.goods_name like '%潮粮%' then a.pure_weight else a.net_weight end as pureWeight,
@@ -79,7 +79,8 @@
         i.bank_deposit as bankDeposit,
         i.bank_deposit_branch as bankDepositBranch
         FROM payment_management a
-        left join quality_inspection_management q on q.relation_id = a.relation_id and q.comp_id = a.comp_id and q.delete_flag = 0
+        left join quality_inspection_management q on q.relation_id = a.relation_id and q.comp_id = a.comp_id and
+        q.delete_flag = 0
         left join weighing_management w on w.relation_id = a.relation_id and w.comp_id = a.comp_id and w.delete_flag = 0
         left join common_company c on c.comp_id = a.comp_id and c.delete_flag = 0
         left join identity_authentication_info i on i.customer_name = a.customer_name
@@ -96,18 +97,18 @@
         </if>
         <if test="startDate != null">
             AND (DATE_FORMAT(a.settlement_date,"%Y%m%d%H%m%s") &gt;=
-            DATE_FORMAT(#{startDate},"%Y%m%d"))
+            DATE_FORMAT(#{startDate},"%Y%m%d%H%m%s"))
         </if>
         <if test="endDate != null">
             AND (DATE_FORMAT(a.settlement_date,"%Y%m%d%H%m%s") &lt;=
-            DATE_FORMAT(#{endDate},"%Y%m%d"))
+            DATE_FORMAT(#{endDate},"%Y%m%d%H%m%s"))
         </if>
         UNION ALL
         SELECT
         m.buyer as compName,
         s.warehouse_name as warehouseName,
         w.bin_number as binNumber,
-        s.create_date as createDate,
+        w.update_date as createDate,
         s.contract_no as contractNo,
         '' as paymentNo,
         m.seller as customerName,
@@ -149,8 +150,7 @@
         i.bank_deposit_branch as bankDepositBranch
         FROM stock_purchase_receipt_report s
         left join warehouse_in_out_info w on w.id = s.warehouse_record_id and w.delete_flag = 0
-        left join quality_inspection_management q on q.warehouse_in_out_id = w.id  and
-        q.delete_flag = 0
+        left join quality_inspection_management q on q.warehouse_in_out_id = w.id and q.delete_flag = 0
         left join warehouse_in_out_detail wd on wd.info_id = w.id
         left join tran_car_info t on t.contract_no = w.contract_no and t.delete_flag = 0 and t.tran_car_no =
         w.tran_car_no and t.car_no = w.car_no
@@ -168,19 +168,19 @@
             AND s.warehouse_name= #{warehouseName}
         </if>
         <if test="startDate != null">
-            AND (DATE_FORMAT(w.in_out_date,"%Y%m%d") &gt;=
-            DATE_FORMAT(#{startDate},"%Y%m%d"))
+            AND (DATE_FORMAT(w.update_date,"%Y%m%d%H%m%s") &gt;=
+            DATE_FORMAT(#{startDate},"%Y%m%d%H%m%s"))
         </if>
         <if test="endDate != null">
-            AND (DATE_FORMAT(w.in_out_date,"%Y%m%d") &lt;=
-            DATE_FORMAT(#{endDate},"%Y%m%d"))
+            AND (DATE_FORMAT(w.update_date,"%Y%m%d%H%m%s") &lt;=
+            DATE_FORMAT(#{endDate},"%Y%m%d%H%m%s"))
         </if>
         UNION ALL
         SELECT
         c.comp_name as compName,
         w.warehouse_name as warehouseName,
         w.bin_number as binNumber,
-        w.in_out_date as createDate,
+        w.update_date as createDate,
         w.contract_no as contractNo,
         '' as paymentNo,
         IFNULL(cmi.seller,'') as customerName,
@@ -214,8 +214,9 @@
         IFNULL(q.deduction_amount,0) as unitDeduction,
         '' as pureWeightPrice,
         case when w.goods_name like '%潮粮%' then w.pure_weight else w.net_weight*1000 end as pureWeight,
---         ROUND(IFNULL(r.amount_ing_payable,(w.cost+IFNULL(t.tran_price,0))*t.load_net_weight),2) as amountIngPayable,
-        case when cmi.settlement_weight_method = '1' then ROUND((w.cost-IFNULL(q.deduction_amount,0))*t.load_net_weight,2)
+        -- ROUND(IFNULL(r.amount_ing_payable,(w.cost+IFNULL(t.tran_price,0))*t.load_net_weight),2) as amountIngPayable,
+        case when cmi.settlement_weight_method = '1' then
+        ROUND((w.cost-IFNULL(q.deduction_amount,0))*t.load_net_weight,2)
         else ROUND((w.cost-IFNULL(q.deduction_amount,0))*w.net_weight,2) end as amountIngPayable,
         0 as amountEdPayable,
         '' as payeeName,
@@ -249,12 +250,12 @@
             AND w.warehouse_name= #{warehouseName}
         </if>
         <if test="startDate != null">
-            AND (DATE_FORMAT(w.in_out_date,"%Y%m%d") &gt;=
-            DATE_FORMAT(#{startDate},"%Y%m%d"))
+            AND (DATE_FORMAT(w.update_date,"%Y%m%d%H%m%s") &gt;=
+            DATE_FORMAT(#{startDate},"%Y%m%d%H%m%s"))
         </if>
         <if test="endDate != null">
-            AND (DATE_FORMAT(w.in_out_date,"%Y%m%d") &lt;=
-            DATE_FORMAT(#{endDate},"%Y%m%d"))
+            AND (DATE_FORMAT(w.update_date,"%Y%m%d%H%m%s") &lt;=
+            DATE_FORMAT(#{endDate},"%Y%m%d%H%m%s"))
         </if>
         group by w.id
         UNION ALL
@@ -262,7 +263,7 @@
         c.comp_name as compName,
         w.warehouse_name as warehouseName,
         w.bin_number as binNumber,
-        w.create_date as createDate,
+        w.update_date as createDate,
         w.contract_no as contractNo,
         '' as paymentNo,
         '' as customerName,
@@ -315,12 +316,12 @@
             AND w.warehouse_name= #{warehouseName}
         </if>
         <if test="startDate != null">
-            AND (DATE_FORMAT(w.in_out_date,"%Y%m%d") &gt;=
-            DATE_FORMAT(#{startDate},"%Y%m%d"))
+            AND (DATE_FORMAT(w.update_date,"%Y%m%d%H%m%s") &gt;=
+            DATE_FORMAT(#{startDate},"%Y%m%d%H%m%s"))
         </if>
         <if test="endDate != null">
-            AND (DATE_FORMAT(w.in_out_date,"%Y%m%d") &lt;=
-            DATE_FORMAT(#{endDate},"%Y%m%d"))
+            AND (DATE_FORMAT(w.update_date,"%Y%m%d%H%m%s") &lt;=
+            DATE_FORMAT(#{endDate},"%Y%m%d%H%m%s"))
         </if>
         group by w.id
     </select>
@@ -331,9 +332,9 @@
         '' as compName,
         w.warehouse_name as warehouseName,
         w.bin_number as binNumber,
-        w.create_date as createDate,
+        w.update_date as createDate,
         IFNULL(m.unit_contract_price,IFNULL(w.cost,0)) as costPrice,
---         w.warehouse_name as contractNo,
+        -- w.warehouse_name as contractNo,
         case when m.contract_type = '1' then m.contract_no else '' end as contractNo,
         IFNULL(m.seller,'') as customerName,
         '' as remark,
@@ -378,12 +379,10 @@
         tti.receive_warehouse as receiveWarehouse
         FROM warehouse_in_out_info w
         left join warehouse_in_out_detail d on w.id=d.info_id and d.delete_flag = 0
-        left join tran_car_info t on t.contract_no = w.contract_no and t.delete_flag = 0 and t.tran_car_no =
-        w.tran_car_no and t.car_no = w.car_no
+        left join tran_car_info t on t.contract_no = w.contract_no and t.delete_flag = 0 and t.tran_car_no = w.tran_car_no and t.car_no = w.car_no
         left join tran_task_info tti on tti.id = t.info_id and tti.delete_flag = 0
         left join warehouse_base_info b on b.id=w.base_id and b.delete_flag = 0
-        left join contract_management_info m on m.comp_id = b.comp_id and m.contract_no = w.warehouse_name and
-        m.delete_flag = 0
+        left join contract_management_info m on m.comp_id = b.comp_id and m.contract_no = w.warehouse_name and m.delete_flag = 0
         WHERE w.delete_flag = '0'
         AND b.comp_id = #{compId}
         and w.in_out_flag = 1
@@ -393,12 +392,12 @@
             AND w.warehouse_name= #{warehouseName}
         </if>
         <if test="startDate != null">
-            AND (DATE_FORMAT(w.in_out_date,"%Y%m%d") &gt;=
-            DATE_FORMAT(#{startDate},"%Y%m%d"))
+            AND (DATE_FORMAT(w.update_date,"%Y%m%d%H%m%s") &gt;=
+            DATE_FORMAT(#{startDate},"%Y%m%d%H%m%s"))
         </if>
         <if test="endDate != null">
-            AND (DATE_FORMAT(w.in_out_date,"%Y%m%d") &lt;=
-            DATE_FORMAT(#{endDate},"%Y%m%d"))
+            AND (DATE_FORMAT(w.update_date,"%Y%m%d%H%m%s") &lt;=
+            DATE_FORMAT(#{endDate},"%Y%m%d%H%m%s"))
         </if>
         UNION ALL
         SELECT
@@ -456,8 +455,7 @@
         left join weighing_management wm on wm.warehouse_in_out_id = w.id and wm.delete_flag = 0
         left join tran_process_info p on p.id = s.process_id and p.delete_flag = 0
         left join tran_task_info t on t.id = p.info_id and t.delete_flag = 0
-        left join tran_car_info i on i.process_id = p.id and i.delete_flag = 0 and i.tran_car_no = s.tran_car_no and
-        i.car_no = s.car_no
+        left join tran_car_info i on i.process_id = p.id and i.delete_flag = 0 and i.tran_car_no = s.tran_car_no and i.car_no = s.car_no
         left join tran_settlement_report r on r.car_id = i.id and r.delete_flag = 0
         left join cost_management_info cm on cm.warehouse_name = t.send_warehouse and cm.comp_id = t.comp_id and
         cm.goods_name = t.goods_name and cm.delete_flag = 0
@@ -469,12 +467,12 @@
             AND s.warehouse_name= #{warehouseName}
         </if>
         <if test="startDate != null">
-            AND (DATE_FORMAT(s.delivery_date,"%Y%m%d") &gt;=
-            DATE_FORMAT(#{startDate},"%Y%m%d"))
+            AND (DATE_FORMAT(s.delivery_date,"%Y%m%d%H%m%s") &gt;=
+            DATE_FORMAT(#{startDate},"%Y%m%d%H%m%s"))
         </if>
         <if test="endDate != null">
-            AND (DATE_FORMAT(s.delivery_date,"%Y%m%d") &lt;=
-            DATE_FORMAT(#{endDate},"%Y%m%d"))
+            AND (DATE_FORMAT(s.delivery_date,"%Y%m%d%H%m%s") &lt;=
+            DATE_FORMAT(#{endDate},"%Y%m%d%H%m%s"))
         </if>
         GROUP BY w.id
         ORDER BY contractNo
@@ -696,7 +694,7 @@
         COUNT(w.id)
         FROM
         warehouse_base_info w
-        LEFT JOIN warehousing_order war ON war.base_id = w.id  AND war.in_type = '收购入库'
+        LEFT JOIN warehousing_order war ON war.base_id = w.id AND war.in_type = '收购入库'
         AND war.delete_flag = '0'
         WHERE
         w.comp_id = #{compId}
@@ -717,7 +715,7 @@
         WHEN w.delete_flag = '1' THEN
         CONCAT( w.warehouse_name, '(已删)' ) ELSE w.warehouse_name
         END AS warehouseName,
-        sum( war.in_warehouse_weight  ) AS acquisitionWeight,
+        sum( war.in_warehouse_weight ) AS acquisitionWeight,
         (SELECT
         sum(ssrr.settlement_weight)*sri.proportion
         FROM
@@ -773,24 +771,24 @@
         ) AS cost
         FROM
         warehouse_base_info w
-        LEFT JOIN warehousing_order war ON war.base_id = w.id  AND war.in_type = '收购入库'
+        LEFT JOIN warehousing_order war ON war.base_id = w.id AND war.in_type = '收购入库'
         AND war.delete_flag = '0'
---         LEFT JOIN source_relation_info sri ON sri.source_id = war.id
---         AND sri.delete_flag = '0'
---         LEFT JOIN in_out_warehouse_task iowt ON iowt.id = sri.task_id
---         AND iowt.in_out_flag = 1
---         AND iowt.in_out_type_key = 1
---         AND iowt.delete_flag = '0'
---         LEFT JOIN warehouse_in_out_info wioi1 ON wioi1.in_out_task_no = iowt.in_out_task_no
---         AND wioi1.car_no = sri.car_no
---         AND wioi1.delete_flag = 0
---         AND wioi1.status_flag = 3
---         LEFT JOIN stock_sale_receipt_report ssrr ON ssrr.contract_no = iowt.contract_no
---         AND ssrr.warehouse_record_id = wioi1.id
---         AND ssrr.delete_flag = 0
---         LEFT JOIN expense_info ei ON ei.warehouse_id = w.id and ei.delete_flag = '0'
---         AND ei.expenses_type = '2'
---         AND ei.expenses_purpose = '3'
+        -- LEFT JOIN source_relation_info sri ON sri.source_id = war.id
+        -- AND sri.delete_flag = '0'
+        -- LEFT JOIN in_out_warehouse_task iowt ON iowt.id = sri.task_id
+        -- AND iowt.in_out_flag = 1
+        -- AND iowt.in_out_type_key = 1
+        -- AND iowt.delete_flag = '0'
+        -- LEFT JOIN warehouse_in_out_info wioi1 ON wioi1.in_out_task_no = iowt.in_out_task_no
+        -- AND wioi1.car_no = sri.car_no
+        -- AND wioi1.delete_flag = 0
+        -- AND wioi1.status_flag = 3
+        -- LEFT JOIN stock_sale_receipt_report ssrr ON ssrr.contract_no = iowt.contract_no
+        -- AND ssrr.warehouse_record_id = wioi1.id
+        -- AND ssrr.delete_flag = 0
+        -- LEFT JOIN expense_info ei ON ei.warehouse_id = w.id and ei.delete_flag = '0'
+        -- AND ei.expenses_type = '2'
+        -- AND ei.expenses_purpose = '3'
         WHERE
         w.comp_id = #{compId}
         AND w.warehouse_type = '1'