dxq 3 kuukautta sitten
vanhempi
commit
9311422d8f

+ 14
- 0
sto/src/main/java/com/shinsoft/sto/controller/main/CustomerController.java Näytä tiedosto

89
             return resultJSON;
89
             return resultJSON;
90
         }
90
         }
91
     }
91
     }
92
+
93
+    @RequestMapping(value = "/querySelect")
94
+    public ResultJSON querySelect(HttpServletRequest request) {
95
+        try {
96
+//            String belongId = (String) request.getHeader("belongId");
97
+            String belongId=null;
98
+            resultJSON = customerService.querySelect(belongId);
99
+        } catch (Exception ex) {
100
+            ex.printStackTrace();
101
+            resultJSON = JSONTools.toResultJSON(ResponseCodeMsg.CODE_EX, ex);
102
+        } finally {
103
+            return resultJSON;
104
+        }
105
+    }
92
 }
106
 }

+ 7
- 3
sto/src/main/java/com/shinsoft/sto/mapper/main/CustomerMapper.java Näytä tiedosto

1
 package com.shinsoft.sto.mapper.main;
1
 package com.shinsoft.sto.mapper.main;
2
 
2
 
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
-import com.shinsoft.sto.model.Config;
5
 import com.shinsoft.sto.model.common.selectModel;
4
 import com.shinsoft.sto.model.common.selectModel;
6
 import com.shinsoft.sto.model.main.Customer;
5
 import com.shinsoft.sto.model.main.Customer;
6
+import org.apache.ibatis.annotations.Param;
7
 import org.apache.ibatis.annotations.Select;
7
 import org.apache.ibatis.annotations.Select;
8
 
8
 
9
+import java.util.List;
10
+
9
 public interface CustomerMapper extends BaseMapper<Customer> {
11
 public interface CustomerMapper extends BaseMapper<Customer> {
10
 
12
 
11
-    @Select("SELECT id as value,custtomerNm as label FROM STO_MAIN_CUSTOMER WHERE nvl(cancel_flag,0) = 0 and belong_id = #{belongId}")
12
-    selectModel selectModel(String belongId);
13
+    /**
14
+     * 查询客户下拉框数据
15
+     */
16
+    List<selectModel> selectCustomerOptions(@Param("belongId") String belongId);
13
 }
17
 }

+ 10
- 0
sto/src/main/java/com/shinsoft/sto/mapper/main/CustomerMapper.xml Näytä tiedosto

64
         and customer_name = #{customerName}
64
         and customer_name = #{customerName}
65
     </select>
65
     </select>
66
 
66
 
67
+    <select id="selectCustomerOptions" resultType="com.shinsoft.sto.model.common.selectModel">
68
+        SELECT id as value, customer_nm as label
69
+        FROM T_MAIN_CUSTOMER WHERE nvl(cancel_flag,'0') = '0'
70
+        <if test="belongId!=null and belongId !=''">
71
+            AND belong_id = #{belongId}
72
+        </if>
73
+
74
+        ORDER BY add_time DESC
75
+    </select>
76
+
67
 </mapper>
77
 </mapper>

+ 15
- 0
sto/src/main/java/com/shinsoft/sto/service/impl/main/CustomerServiceImp.java Näytä tiedosto

7
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
8
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
8
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9
 import com.shinsoft.sto.mapper.main.CustomerMapper;
9
 import com.shinsoft.sto.mapper.main.CustomerMapper;
10
+import com.shinsoft.sto.model.common.selectModel;
10
 import com.shinsoft.sto.model.main.Customer;
11
 import com.shinsoft.sto.model.main.Customer;
11
 import com.shinsoft.sto.service.main.CustomerService;
12
 import com.shinsoft.sto.service.main.CustomerService;
12
 import com.shinsoft.tools.JSONTools;
13
 import com.shinsoft.tools.JSONTools;
14
+import com.shinsoft.tools.model.common.ResponseCodeMsg;
13
 import com.shinsoft.tools.model.common.ResultJSON;
15
 import com.shinsoft.tools.model.common.ResultJSON;
14
 import org.apache.commons.lang3.StringUtils;
16
 import org.apache.commons.lang3.StringUtils;
15
 import org.springframework.beans.factory.annotation.Autowired;
17
 import org.springframework.beans.factory.annotation.Autowired;
118
         resultJSON = JSONTools.toResultJSON("");
120
         resultJSON = JSONTools.toResultJSON("");
119
         return resultJSON;
121
         return resultJSON;
120
     }
122
     }
123
+
124
+    @Override
125
+    public ResultJSON querySelect(String belongId) {
126
+        try {
127
+            List<selectModel> list = customerMapper.selectCustomerOptions(belongId);
128
+            resultJSON = JSONTools.toResultJSON(list);
129
+            return resultJSON;
130
+        } catch (Exception ex) {
131
+            ex.printStackTrace();
132
+            resultJSON = JSONTools.toResultJSON(ResponseCodeMsg.CODE_EX, ex);
133
+            return resultJSON;
134
+        }
135
+    }
121
 }
136
 }

+ 6
- 0
sto/src/main/java/com/shinsoft/sto/service/main/CustomerService.java Näytä tiedosto

4
 import com.shinsoft.sto.model.main.Customer;
4
 import com.shinsoft.sto.model.main.Customer;
5
 import com.shinsoft.tools.model.common.ResultJSON;
5
 import com.shinsoft.tools.model.common.ResultJSON;
6
 
6
 
7
+import java.util.List;
7
 import java.util.Map;
8
 import java.util.Map;
8
 
9
 
9
 /**
10
 /**
25
     ResultJSON remove(String userId, String id);
26
     ResultJSON remove(String userId, String id);
26
 
27
 
27
     ResultJSON removeBatch(String userId, String ids);
28
     ResultJSON removeBatch(String userId, String ids);
29
+
30
+    /**
31
+     * 查询客户下拉选项
32
+     */
33
+    ResultJSON querySelect(String belongId);
28
 }
34
 }

Loading…
Peruuta
Tallenna