Browse Source

业务查询

Administrator 2 weeks ago
parent
commit
c4052d1627

+ 1 - 0
src/main/java/com/zjt/entity/ProductionVarietyDetail.java

@@ -22,6 +22,7 @@ import lombok.experimental.Accessors;
22 22
 public class ProductionVarietyDetail implements Serializable {
23 23
 
24 24
     private static final long serialVersionUID = 1L;
25
+    private Float id;
25 26
 
26 27
     private Float varietyId;
27 28
 

+ 4 - 1
src/main/java/com/zjt/service/IProductionheaderService.java

@@ -1,8 +1,11 @@
1 1
 package com.zjt.service;
2 2
 
3
+import com.baomidou.mybatisplus.core.injector.methods.SelectList;
3 4
 import com.zjt.entity.Productionheader;
4 5
 import com.baomidou.mybatisplus.extension.service.IService;
5 6
 
7
+import java.util.List;
8
+
6 9
 /**
7 10
  * <p>
8 11
  *  服务类
@@ -12,5 +15,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
12 15
  * @since 2025-09-25
13 16
  */
14 17
 public interface IProductionheaderService extends IService<Productionheader> {
15
-
18
+List<Productionheader> SelectList();
16 19
 }

+ 0 - 2
src/main/java/com/zjt/service/impl/MaterialTypeImp.java

@@ -37,8 +37,6 @@ public class MaterialTypeImp extends BaseService<type> implements MaterialType
37 37
             return ReturnDate;
38 38
         };
39 39
         List<type> materialType= typeMapper.selectAll();
40
-/*        ReturnDate ReturnDate=new ReturnDate();
41
-        List<ReturnDate> list= new ArrayList<ReturnDate>();*/
42 40
         List<ReturnDate> collect = materialType.parallelStream().map(dataMap).collect(Collectors.toList());
43 41
         return JSONArray.toJSON(collect).toString();
44 42
     }

+ 7 - 0
src/main/java/com/zjt/service/impl/ProductionheaderServiceImpl.java

@@ -6,6 +6,9 @@ import com.zjt.service.IProductionheaderService;
6 6
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7 7
 import org.springframework.stereotype.Service;
8 8
 
9
+import java.util.Collections;
10
+import java.util.List;
11
+
9 12
 /**
10 13
  * <p>
11 14
  *  服务实现类
@@ -17,4 +20,8 @@ import org.springframework.stereotype.Service;
17 20
 @Service
18 21
 public class ProductionheaderServiceImpl extends ServiceImpl<ProductionheaderMapper, Productionheader> implements IProductionheaderService {
19 22
 
23
+    @Override
24
+    public List<Productionheader> SelectList() {
25
+        return Collections.emptyList();
26
+    }
20 27
 }

+ 5 - 3
src/main/java/com/zjt/web/MyContraller.java

@@ -10,10 +10,12 @@ import com.zjt.service.MaterialType;
10 10
 import javax.annotation.Resource;
11 11
 
12 12
 @Controller
13
-@RequestMapping("/pos/user")
13
+@RequestMapping("/entity")
14 14
 public class MyContraller {
15 15
     @Resource
16 16
     private MaterialType MaterialType;
17
-
18
-
17
+    @RequestMapping("queryVarietyList")
18
+    public String selectvarietyList() {
19
+        return "mypackage/varietyList";
20
+    }
19 21
 }

+ 20 - 8
src/main/java/com/zjt/web/ProductionVarietyDetailController.java

@@ -1,6 +1,7 @@
1 1
 package com.zjt.web;
2 2
 
3 3
 
4
+import com.alibaba.fastjson.JSONArray;
4 5
 import com.zjt.entity.ProductionVarietyDetail;
5 6
 import com.zjt.service.IProductionVarietyDetailService;
6 7
 import com.zjt.service.IProductionVarietyService;
@@ -8,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
8 9
 import org.springframework.stereotype.Controller;
9 10
 import org.springframework.web.bind.annotation.RequestMapping;
10 11
 
12
+import org.springframework.web.bind.annotation.RequestParam;
11 13
 import org.springframework.web.bind.annotation.RestController;
12 14
 
13 15
 import java.util.List;
@@ -20,19 +22,29 @@ import java.util.List;
20 22
  * @author xxu
21 23
  * @since 2025-09-25
22 24
  */
23
-@Controller
25
+@RestController
24 26
 @RequestMapping("/entity")
25 27
 public class ProductionVarietyDetailController {
26 28
     @Autowired
27 29
     private IProductionVarietyDetailService productionVarietyDetailService;
28
-    @RequestMapping("varietyList")
30
+    @RequestMapping("varietyLists")
29 31
     public String selectvarietyList() {
30
-        productionVarietyDetailService.selectvarietyList();
31
-        return "success";
32
+        List<ProductionVarietyDetail> productionVarietyDetails = productionVarietyDetailService.selectvarietyList();
33
+        return  JSONArray.toJSON(productionVarietyDetails).toString();
32 34
     }
33
-    @RequestMapping("varietyDetailsList")
34
-    public String selectvarietyDetails() {
35
-        List<ProductionVarietyDetail> productionVarietyDetails = productionVarietyDetailService.selectvarietyDetails(1L);
36
-        return "mypackage/varietyList";
35
+    @RequestMapping("varietyDetailsLists")
36
+    public String selectvarietyDetails(@RequestParam("id") String id) {
37
+        if(id!=null||id!=""){
38
+            long l = Long.parseLong(id);
39
+            List<ProductionVarietyDetail> productionVarietyDetails = productionVarietyDetailService.selectvarietyDetails(l);
40
+            return  JSONArray.toJSON(productionVarietyDetails).toString();
41
+        }else{
42
+            return  JSONArray.toJSON("").toString();
43
+        }
44
+    }
45
+
46
+    @RequestMapping("productionheader")
47
+    public String group(@RequestParam("id") String id){
48
+        return productionVarietyDetailService.group(brand);
37 49
     }
38 50
 }

+ 2 - 2
src/main/resources/mapper/ProductionVarietyDetailMapper.xml

@@ -9,7 +9,7 @@
9 9
     </resultMap>
10 10
 
11 11
     <sql id="Base_Column_List">
12
-        variety_id, variety, variety_details
12
+        id,variety_id, variety, variety_details
13 13
     </sql>
14 14
     <select id="selectList" resultMap="BaseResultMap">
15 15
         select
@@ -25,7 +25,7 @@
25 25
     <insert id="insert" parameterType="com.zjt.entity.ProductionVarietyDetail">
26 26
     </insert>
27 27
     <select id="selectvarietyList" resultMap="BaseResultMap">
28
-        select variety_id,variety
28
+        select distinct variety_id,variety
29 29
         from production_variety_detail
30 30
     </select>
31 31
     <select id="selectvarietyDetails" resultMap="BaseResultMap">

+ 7 - 13
src/main/resources/templates/mypackage/varietyList.ftl

@@ -25,12 +25,12 @@
25 25
             <form class="layui-form" action="">
26 26
                 <div class="layui-form-item" id="materialchoose">
27 27
                     <div class="layui-form-label">物料信息</div>
28
-                    <div class="layui-input-inline" style="width: 100px;">
28
+                    <div class="layui-input-inline" style="width: 300px;">
29 29
                         <select name="materialType" id="materialType" class="province-selector" data-value="品类" lay-filter="materialType" onclick="dele()" lay-search="">
30 30
                             <option value="">品类</option>
31 31
                         </select>
32 32
                     </div>
33
-                    <div class="layui-input-inline" style="width: 100px;">
33
+                    <div class="layui-input-inline" style="width: 300px;">
34 34
                         <select name="brand" id ="brand" class="city-selector" data-value="品牌" lay-filter="brand" onclick="selectbrand()" lay-search="">
35 35
                             <option value="">品牌</option>
36 36
                         </select>
@@ -51,11 +51,6 @@
51 51
                         </select>
52 52
                     </div>
53 53
                     <div class="layui-input-inline" style="width: 100px;">
54
-                        <select name="materialRealPrice" id ="materialRealPrice" class="county-selector" data-value="物料价格" lay-filter="materialRealPrice">
55
-                            <option value="">物料价格</option>
56
-                        </select>
57
-                    </div>
58
-                    <div class="layui-input-inline" style="width: 100px;">
59 54
                         <a class="layui-btn layui-btn add" onclick="addtable()">添加</a>
60 55
                     </div>
61 56
                 </div>
@@ -132,19 +127,18 @@
132 127
     });
133 128
     layui.use(['form', 'table', "laydate", 'layer','jquery'], function () {
134 129
         var materialdetil=null;
135
-        var materialRealPrice=null;
136 130
         var material=null;
137 131
         var form = layui.form;
138 132
         var table = layui.table;
139 133
         var $ = layui.$ //重点处
140 134
             ,layer = layui.layer;
141 135
         $.ajax({
142
-            url: 'type',
136
+            url: 'varietyLists',
143 137
             type: 'get',
144 138
             success: function (data) {
145 139
                 $("#materialType").empty();
146 140
                 $.each($.parseJSON(data), function(idx, obj) {
147
-                    $("#materialType").append("<option value=\""+obj.brandCode+"\">"+obj.brandName+"</option>");
141
+                    $("#materialType").append("<option value=\""+obj.varietyId+"\">"+obj.variety+"</option>");
148 142
                 });
149 143
                 layui.form.render("select");
150 144
             },error:function (xhr, status, error) {
@@ -152,14 +146,14 @@
152 146
             }});
153 147
         form.on('select(materialType)', function(data){
154 148
             $.ajax({
155
-                url: 'brand',
149
+                url: 'varietyDetailsLists',
156 150
                 type: 'post',
157
-                data:{'materialTypeCode':data.value},
151
+                data:{'id':data.value},
158 152
                 success: function (data) {
159 153
                     $("#brand").empty();
160 154
                     $("#brand").append('<option value="">品牌</option>');
161 155
                     $.each($.parseJSON(data), function(idx, obj) {
162
-                        $("#brand").append("<option value=\""+obj.brandCode+"\">"+obj.brandName+"</option>");
156
+                        $("#brand").append("<option value=\""+obj.id+"\">"+obj.varietyDetails+"</option>");
163 157
                     });
164 158
 
165 159
                     layui.form.render("select");