浏览代码

业务查询

Administrator 2 周之前
父节点
当前提交
c4052d1627

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

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

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

@@ -1,8 +1,11 @@
1
 package com.zjt.service;
1
 package com.zjt.service;
2
 
2
 
3
+import com.baomidou.mybatisplus.core.injector.methods.SelectList;
3
 import com.zjt.entity.Productionheader;
4
 import com.zjt.entity.Productionheader;
4
 import com.baomidou.mybatisplus.extension.service.IService;
5
 import com.baomidou.mybatisplus.extension.service.IService;
5
 
6
 
7
+import java.util.List;
8
+
6
 /**
9
 /**
7
  * <p>
10
  * <p>
8
  *  服务类
11
  *  服务类
@@ -12,5 +15,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
12
  * @since 2025-09-25
15
  * @since 2025-09-25
13
  */
16
  */
14
 public interface IProductionheaderService extends IService<Productionheader> {
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
             return ReturnDate;
37
             return ReturnDate;
38
         };
38
         };
39
         List<type> materialType= typeMapper.selectAll();
39
         List<type> materialType= typeMapper.selectAll();
40
-/*        ReturnDate ReturnDate=new ReturnDate();
41
-        List<ReturnDate> list= new ArrayList<ReturnDate>();*/
42
         List<ReturnDate> collect = materialType.parallelStream().map(dataMap).collect(Collectors.toList());
40
         List<ReturnDate> collect = materialType.parallelStream().map(dataMap).collect(Collectors.toList());
43
         return JSONArray.toJSON(collect).toString();
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
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
6
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
 import org.springframework.stereotype.Service;
7
 import org.springframework.stereotype.Service;
8
 
8
 
9
+import java.util.Collections;
10
+import java.util.List;
11
+
9
 /**
12
 /**
10
  * <p>
13
  * <p>
11
  *  服务实现类
14
  *  服务实现类
@@ -17,4 +20,8 @@ import org.springframework.stereotype.Service;
17
 @Service
20
 @Service
18
 public class ProductionheaderServiceImpl extends ServiceImpl<ProductionheaderMapper, Productionheader> implements IProductionheaderService {
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
 import javax.annotation.Resource;
10
 import javax.annotation.Resource;
11
 
11
 
12
 @Controller
12
 @Controller
13
-@RequestMapping("/pos/user")
13
+@RequestMapping("/entity")
14
 public class MyContraller {
14
 public class MyContraller {
15
     @Resource
15
     @Resource
16
     private MaterialType MaterialType;
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
 package com.zjt.web;
1
 package com.zjt.web;
2
 
2
 
3
 
3
 
4
+import com.alibaba.fastjson.JSONArray;
4
 import com.zjt.entity.ProductionVarietyDetail;
5
 import com.zjt.entity.ProductionVarietyDetail;
5
 import com.zjt.service.IProductionVarietyDetailService;
6
 import com.zjt.service.IProductionVarietyDetailService;
6
 import com.zjt.service.IProductionVarietyService;
7
 import com.zjt.service.IProductionVarietyService;
@@ -8,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
8
 import org.springframework.stereotype.Controller;
9
 import org.springframework.stereotype.Controller;
9
 import org.springframework.web.bind.annotation.RequestMapping;
10
 import org.springframework.web.bind.annotation.RequestMapping;
10
 
11
 
12
+import org.springframework.web.bind.annotation.RequestParam;
11
 import org.springframework.web.bind.annotation.RestController;
13
 import org.springframework.web.bind.annotation.RestController;
12
 
14
 
13
 import java.util.List;
15
 import java.util.List;
@@ -20,19 +22,29 @@ import java.util.List;
20
  * @author xxu
22
  * @author xxu
21
  * @since 2025-09-25
23
  * @since 2025-09-25
22
  */
24
  */
23
-@Controller
25
+@RestController
24
 @RequestMapping("/entity")
26
 @RequestMapping("/entity")
25
 public class ProductionVarietyDetailController {
27
 public class ProductionVarietyDetailController {
26
     @Autowired
28
     @Autowired
27
     private IProductionVarietyDetailService productionVarietyDetailService;
29
     private IProductionVarietyDetailService productionVarietyDetailService;
28
-    @RequestMapping("varietyList")
30
+    @RequestMapping("varietyLists")
29
     public String selectvarietyList() {
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
     </resultMap>
9
     </resultMap>
10
 
10
 
11
     <sql id="Base_Column_List">
11
     <sql id="Base_Column_List">
12
-        variety_id, variety, variety_details
12
+        id,variety_id, variety, variety_details
13
     </sql>
13
     </sql>
14
     <select id="selectList" resultMap="BaseResultMap">
14
     <select id="selectList" resultMap="BaseResultMap">
15
         select
15
         select
@@ -25,7 +25,7 @@
25
     <insert id="insert" parameterType="com.zjt.entity.ProductionVarietyDetail">
25
     <insert id="insert" parameterType="com.zjt.entity.ProductionVarietyDetail">
26
     </insert>
26
     </insert>
27
     <select id="selectvarietyList" resultMap="BaseResultMap">
27
     <select id="selectvarietyList" resultMap="BaseResultMap">
28
-        select variety_id,variety
28
+        select distinct variety_id,variety
29
         from production_variety_detail
29
         from production_variety_detail
30
     </select>
30
     </select>
31
     <select id="selectvarietyDetails" resultMap="BaseResultMap">
31
     <select id="selectvarietyDetails" resultMap="BaseResultMap">

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

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