|
|
@@ -127,11 +127,28 @@ public class StorageProductFcbgzController {
|
|
127
|
127
|
}
|
|
128
|
128
|
|
|
129
|
129
|
/**
|
|
|
130
|
+ * 新增用到的仓房下拉
|
|
|
131
|
+ * @param orgId
|
|
|
132
|
+ * @return
|
|
|
133
|
+ */
|
|
|
134
|
+ @RequestMapping(value = "/getProductHouse" ,produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
|
|
|
135
|
+ @ApiOperation(value="仓房下拉", notes = "新增用到的仓房下拉")
|
|
|
136
|
+ @ApiImplicitParams({
|
|
|
137
|
+ @ApiImplicitParam(name = "orgId", value = "组织机构id", paramType = "query")
|
|
|
138
|
+ })
|
|
|
139
|
+ public List<Map<String,Object>> getProductHouse(String orgId){
|
|
|
140
|
+ Map<String,Object> map = new HashMap<String, Object>();
|
|
|
141
|
+ map.put("orgId",orgId);
|
|
|
142
|
+ List<Map<String,Object>> list = storageProductFcbgzService.getProductHouse(map);
|
|
|
143
|
+ return ParameterUtil.slashCapitals(list);
|
|
|
144
|
+ }
|
|
|
145
|
+
|
|
|
146
|
+ /**
|
|
130
|
147
|
* 新增
|
|
131
|
148
|
* @param productJson
|
|
132
|
149
|
* @return
|
|
133
|
150
|
*/
|
|
134
|
|
- @RequestMapping(value = "saveProduct" ,produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
|
|
|
151
|
+ @RequestMapping(value = "/saveProduct" ,produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
|
|
135
|
152
|
@ApiOperation(value="新增数据", notes = "新增数据")
|
|
136
|
153
|
@ApiImplicitParams({
|
|
137
|
154
|
@ApiImplicitParam(name = "productJson", value = "JSON数据对象", paramType = "form"),
|
|
|
@@ -144,30 +161,32 @@ public class StorageProductFcbgzController {
|
|
144
|
161
|
//如果是提交,则直接设置状态
|
|
145
|
162
|
if(ParameterUtil.isequal("typeSubmit",typeState)){
|
|
146
|
163
|
storageProductFcbgz.setDeleteState("2");
|
|
|
164
|
+ }else if(ParameterUtil.isequal("numberData",typeState)){
|
|
|
165
|
+ storageProductFcbgz.setDeleteState("3");//库存数量新增方法
|
|
147
|
166
|
}else {
|
|
148
|
167
|
storageProductFcbgz.setDeleteState("1");
|
|
149
|
168
|
}
|
|
150
|
|
- if(ParameterUtil.isnull(storageProductFcbgz.getId())){
|
|
151
|
|
- if(ParameterUtil.isnull(storageProductFcbgz.getStorageQuantity()))
|
|
152
|
|
- storageProductFcbgz.setStorageQuantity("0");
|
|
153
|
|
- if(ParameterUtil.isnull(storageProductFcbgz.getOutboundQuantity()))
|
|
154
|
|
- storageProductFcbgz.setOutboundQuantity("0");
|
|
155
|
169
|
|
|
156
|
|
- Integer inventory = Integer.parseInt(storageProductFcbgz.getStorageQuantity()) - Integer.parseInt(storageProductFcbgz.getOutboundQuantity());
|
|
157
|
|
- storageProductFcbgz.setInventoryQuantity(inventory.toString());
|
|
|
170
|
+ if(ParameterUtil.isnull(storageProductFcbgz.getStorageQuantity()))
|
|
|
171
|
+ storageProductFcbgz.setStorageQuantity("0");
|
|
|
172
|
+ if(ParameterUtil.isnull(storageProductFcbgz.getOutboundQuantity()))
|
|
|
173
|
+ storageProductFcbgz.setOutboundQuantity("0");
|
|
|
174
|
+
|
|
|
175
|
+ if(ParameterUtil.isnull(storageProductFcbgz.getId())){
|
|
|
176
|
+ if(!ParameterUtil.isequal("numberData",typeState)) {
|
|
|
177
|
+ Integer inventory = Integer.parseInt(storageProductFcbgz.getStorageQuantity()) - Integer.parseInt(storageProductFcbgz.getOutboundQuantity());
|
|
|
178
|
+ storageProductFcbgz.setInventoryQuantity(inventory.toString());
|
|
|
179
|
+ }
|
|
158
|
180
|
|
|
159
|
181
|
storageProductFcbgz.setOrgId(orgId);
|
|
160
|
182
|
storageProductFcbgz.setId(ParameterUtil.getCode());
|
|
161
|
183
|
storageProductFcbgz.setCreateTime(new Date());
|
|
162
|
184
|
storageProductFcbgzService.insert(storageProductFcbgz);
|
|
163
|
185
|
}else{
|
|
164
|
|
- if(ParameterUtil.isnull(storageProductFcbgz.getStorageQuantity()))
|
|
165
|
|
- storageProductFcbgz.setStorageQuantity("0");
|
|
166
|
|
- if(ParameterUtil.isnull(storageProductFcbgz.getOutboundQuantity()))
|
|
167
|
|
- storageProductFcbgz.setOutboundQuantity("0");
|
|
168
|
|
-
|
|
169
|
|
- Integer inventory = Integer.parseInt(storageProductFcbgz.getStorageQuantity()) - Integer.parseInt(storageProductFcbgz.getOutboundQuantity());
|
|
170
|
|
- storageProductFcbgz.setInventoryQuantity(inventory.toString());
|
|
|
186
|
+ if(!ParameterUtil.isequal("numberData",typeState)) {
|
|
|
187
|
+ Integer inventory = Integer.parseInt(storageProductFcbgz.getStorageQuantity()) - Integer.parseInt(storageProductFcbgz.getOutboundQuantity());
|
|
|
188
|
+ storageProductFcbgz.setInventoryQuantity(inventory.toString());
|
|
|
189
|
+ }
|
|
171
|
190
|
|
|
172
|
191
|
storageProductFcbgzService.update(storageProductFcbgz);
|
|
173
|
192
|
}
|
|
|
@@ -190,6 +209,26 @@ public class StorageProductFcbgzController {
|
|
190
|
209
|
}
|
|
191
|
210
|
|
|
192
|
211
|
/**
|
|
|
212
|
+ * 获取数量详情
|
|
|
213
|
+ * @return
|
|
|
214
|
+ */
|
|
|
215
|
+ @RequestMapping(value = "/getNumberEdit" ,produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
|
|
|
216
|
+ @ApiOperation(value="获取数量详情", notes = "获取数量详情")
|
|
|
217
|
+ @ApiImplicitParams({
|
|
|
218
|
+ @ApiImplicitParam(name = "orgId", value = "orgId", paramType = "query"),
|
|
|
219
|
+ @ApiImplicitParam(name = "houseId", value = "houseId", paramType = "query")
|
|
|
220
|
+ })
|
|
|
221
|
+ public StorageProductFcbgz getNumberEdit(String orgId, String houseId){
|
|
|
222
|
+ StorageProductFcbgzExample storageProductFcbgzExample = new StorageProductFcbgzExample();
|
|
|
223
|
+ StorageProductFcbgzExample.Criteria criteria = storageProductFcbgzExample.createCriteria();
|
|
|
224
|
+ criteria.andOrgIdEqualTo(Integer.parseInt(orgId));
|
|
|
225
|
+ criteria.andHouseIdEqualTo(houseId);
|
|
|
226
|
+ criteria.andDeleteStateEqualTo("3");
|
|
|
227
|
+ List<StorageProductFcbgz> storageProductFcbgz = storageProductFcbgzService.getlist(storageProductFcbgzExample);
|
|
|
228
|
+ return storageProductFcbgz.get(0);
|
|
|
229
|
+ }
|
|
|
230
|
+
|
|
|
231
|
+ /**
|
|
193
|
232
|
* 移除
|
|
194
|
233
|
* @param id
|
|
195
|
234
|
* @return
|