From e83c618251f656bda8149e6194256014c107217f Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Mon, 4 Mar 2024 15:51:13 +0800 Subject: [PATCH] '11' --- .../java/com/ruoyi/web/Utils/batchInsert.java | 3 +- .../controller/system/SysUserController.java | 54 +++- .../com/ruoyi/system/domain/material.java | 9 + .../java/com/ruoyi/system/domain/temp.java | 94 ++++++ .../resources/mapper/system/TestMapper.xml | 288 +++++++++--------- .../src/views/material/material/index.vue | 4 +- 6 files changed, 294 insertions(+), 158 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/Utils/batchInsert.java b/ruoyi-admin/src/main/java/com/ruoyi/web/Utils/batchInsert.java index 8b2a162..fc4fddc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/Utils/batchInsert.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/Utils/batchInsert.java @@ -26,7 +26,7 @@ public class batchInsert extends JFrame { /*stmt = conn.prepareStatement( "insert into [dbo].[sapcontract_test](uid,bh,type,custom,salesman,project,htje,startdate,enddate,remark,htzt) values (?,?,?,?,?,?,?,?,?,?,?)");*/ stmt = conn.prepareStatement( - "insert into c_material(material_id, material_xingh, material_guig, material_diany, material_dw) values (?,?,?,?,?)"); + "insert into c_material(material_id, material_xingh, material_guig, material_diany, material_dw,material_type_id) values (?,?,?,?,?,?)"); int count = 0; System.err.println("Start"); for (material pay : list) { @@ -36,6 +36,7 @@ public class batchInsert extends JFrame { stmt.setString(3, pay.getMaterial_guig()); stmt.setString(4, pay.getMaterial_diany()); stmt.setString(5, pay.getMaterial_dw()); + stmt.setString(6, pay.getMaterial_type_id()); stmt.addBatch(); if (count % 5000 == 0) {// 当增加了500个批处理的时候再提交 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index e230008..4f5af34 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -86,7 +86,7 @@ public class SysUserController extends BaseController return getDataTable(list); } - @Log(title = "用户管理", businessType = BusinessType.EXPORT) + /* @Log(title = "用户管理", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:user:export')") @PostMapping("/export") public void export(HttpServletResponse response, SysUser user) @@ -94,7 +94,7 @@ public class SysUserController extends BaseController List list = userService.selectUserList(user); ExcelUtil util = new ExcelUtil(SysUser.class); util.exportExcel(response, list, "用户数据"); - } + }*/ @Log(title = "用户管理", businessType = BusinessType.IMPORT) @PreAuthorize("@ss.hasPermi('system:user:import')") @@ -313,7 +313,7 @@ public class SysUserController extends BaseController } /*===============================================测试====================================================*/ - /*@DataSource(DataSourceType.QUOT) + @DataSource(DataSourceType.QUOT) @Log(title = "用户管理", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:user:export')") @PostMapping("/export") @@ -328,8 +328,6 @@ public class SysUserController extends BaseController List> averageAssign = ListUtils.partition(templist, 5000); - *//*List list = averageAssign.get(0);*//* - int num = 1; int num2 = 1; for(List list:averageAssign){ @@ -340,13 +338,10 @@ public class SysUserController extends BaseController m.setMaterial_guig(t.getSpec_1()); m.setMaterial_diany(t.getVoltage_1()); m.setMaterial_dw(t.getUnit_0()); + m.setMaterial_type_id(t.getType_no()); materials.add(m); num++; -*//* - for(int i=1;i<63;i++){ -*//* - if("M001".equals(t.getM_id_M001())){ c = new cost(); c.setCost_id(num2); @@ -386,6 +381,7 @@ public class SysUserController extends BaseController c.setCost_material_id(m.getMaterial_id()); c.setCost_cl_id(t.getM_id_M005()); c.setCost_cl_qty(t.getName_qty_M005()); + c.setCost_cl_qty_2(t.getName_qty_M005_1()); costs.add(c);num2++; } if("M006".equals(t.getM_id_M006())){ @@ -848,22 +844,48 @@ public class SysUserController extends BaseController c.setCost_cl_qty(t.getName_qty_M064()); costs.add(c);num2++; } - - *//* }*//* - + if("M065".equals(t.getM_id_M065())){ + c = new cost(); + c.setCost_id(num2); + c.setCost_material_id(m.getMaterial_id()); + c.setCost_cl_id(t.getM_id_M065()); + c.setCost_cl_qty(t.getName_qty_M065()); + costs.add(c);num2++; + } + if("M066".equals(t.getM_id_M066())){ + c = new cost(); + c.setCost_id(num2); + c.setCost_material_id(m.getMaterial_id()); + c.setCost_cl_id(t.getM_id_M066()); + c.setCost_cl_qty(t.getName_qty_M066()); + costs.add(c);num2++; + } + if("M067".equals(t.getM_id_M067())){ + c = new cost(); + c.setCost_id(num2); + c.setCost_material_id(m.getMaterial_id()); + c.setCost_cl_id(t.getM_id_M067()); + c.setCost_cl_qty(t.getName_qty_M067()); + costs.add(c);num2++; + } + if("M068".equals(t.getM_id_M068())){ + c = new cost(); + c.setCost_id(num2); + c.setCost_material_id(m.getMaterial_id()); + c.setCost_cl_id(t.getM_id_M068()); + c.setCost_cl_qty(t.getName_qty_M068()); + costs.add(c);num2++; + } } } - System.out.println("materials===================="+materials.size()); System.out.println("costs======================="+costs.size()); - *//*insertMaterialBatch(materials); - insertCostBatch(costs);*//* batchInsert.insertMaterialBatch(materials); batchInsert.insertCostBatch(costs); - }*/ + } @DataSource(DataSourceType.QUOT) public void insertMaterialBatch(List temp) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/material.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/material.java index 2228af2..e4c8044 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/material.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/material.java @@ -6,6 +6,7 @@ public class material { private String material_guig; private String material_diany; private String material_dw; + private String material_type_id; public String getMaterial_xingh() { return material_xingh; @@ -46,4 +47,12 @@ public class material { public void setMaterial_id(Integer material_id) { this.material_id = material_id; } + + public String getMaterial_type_id() { + return material_type_id; + } + + public void setMaterial_type_id(String material_type_id) { + this.material_type_id = material_type_id; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/temp.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/temp.java index cc0cf30..4a3d67c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/temp.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/temp.java @@ -1,6 +1,7 @@ package com.ruoyi.system.domain; public class temp { + private String type_no; private String model_0; private String model_1; private String spec_0; @@ -20,6 +21,7 @@ public class temp { private String name_qty_M004_1; private String m_id_M005; private String name_qty_M005; + private String name_qty_M005_1; private String m_id_M006; private String name_qty_M006; private String m_id_M007; @@ -148,6 +150,26 @@ public class temp { private String m_id_M064; private String name_qty_M064; + private String m_id_M065; + private String name_qty_M065; + + private String m_id_M066; + private String name_qty_M066; + + private String m_id_M067; + private String name_qty_M067; + + private String m_id_M068; + private String name_qty_M068; + + public String getType_no() { + return type_no; + } + + public void setType_no(String type_no) { + this.type_no = type_no; + } + public String getModel_0() { return model_0; } @@ -292,6 +314,14 @@ public class temp { this.name_qty_M005 = name_qty_M005; } + public String getName_qty_M005_1() { + return name_qty_M005_1; + } + + public void setName_qty_M005_1(String name_qty_M005_1) { + this.name_qty_M005_1 = name_qty_M005_1; + } + public String getM_id_M006() { return m_id_M006; } @@ -1299,4 +1329,68 @@ public class temp { public void setName_qty_M048_1(String name_qty_M048_1) { this.name_qty_M048_1 = name_qty_M048_1; } + + public String getM_id_M065() { + return m_id_M065; + } + + public void setM_id_M065(String m_id_M065) { + this.m_id_M065 = m_id_M065; + } + + public String getName_qty_M065() { + return name_qty_M065; + } + + public void setName_qty_M065(String name_qty_M065) { + this.name_qty_M065 = name_qty_M065; + } + + public String getM_id_M066() { + return m_id_M066; + } + + public void setM_id_M066(String m_id_M066) { + this.m_id_M066 = m_id_M066; + } + + public String getName_qty_M066() { + return name_qty_M066; + } + + public void setName_qty_M066(String name_qty_M066) { + this.name_qty_M066 = name_qty_M066; + } + + public String getM_id_M067() { + return m_id_M067; + } + + public void setM_id_M067(String m_id_M067) { + this.m_id_M067 = m_id_M067; + } + + public String getName_qty_M067() { + return name_qty_M067; + } + + public void setName_qty_M067(String name_qty_M067) { + this.name_qty_M067 = name_qty_M067; + } + + public String getM_id_M068() { + return m_id_M068; + } + + public void setM_id_M068(String m_id_M068) { + this.m_id_M068 = m_id_M068; + } + + public String getName_qty_M068() { + return name_qty_M068; + } + + public void setName_qty_M068(String name_qty_M068) { + this.name_qty_M068 = name_qty_M068; + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/TestMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TestMapper.xml index 611bf46..102abbb 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TestMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TestMapper.xml @@ -6,7 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/ruoyi-ui/src/views/material/material/index.vue b/ruoyi-ui/src/views/material/material/index.vue index 2e973b2..6af022b 100644 --- a/ruoyi-ui/src/views/material/material/index.vue +++ b/ruoyi-ui/src/views/material/material/index.vue @@ -280,10 +280,10 @@ export default { { required: true, message: "类别不能为空", trigger: "blur" } ], costClQty: [ - { pattern: /^(([1-9]{1}\d{0,9})|(0{1}))(\.\d{1,3})?$/, message: '格式有误',trigger: "blur"} + { pattern: /^(([1-9]{1}\d{0,9})|(0{1}))(\.\d{1,5})?$/, message: '格式有误',trigger: "blur"} ], costClQty2: [ - { pattern: /^(([1-9]{1}\d{0,9})|(0{1}))(\.\d{1,3})?$/, message: '格式有误',trigger: "blur"} + { pattern: /^(([1-9]{1}\d{0,9})|(0{1}))(\.\d{1,5})?$/, message: '格式有误',trigger: "blur"} ], } };