1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package com.java110.front.smo.allocationUserStorehouse.impl;
 
import com.alibaba.fastjson.JSONObject;
import com.java110.core.component.AbstractComponentSMO;
import com.java110.core.context.IPageData;
import com.java110.entity.component.ComponentValidateResult;
import com.java110.front.smo.allocationUserStorehouse.IAddAllocationUserStorehouseSMO;
import com.java110.utils.constant.ServiceConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
 
/**
 * 添加转增记录实现类
 * add by fqz 2021-04-24
 */
@Service("addAllocationUserStorehouseSMOImpl")
public class AddAllocationUserStorehouseSMOImpl extends AbstractComponentSMO implements IAddAllocationUserStorehouseSMO {
 
    @Autowired
    private RestTemplate restTemplate;
 
    @Override
    protected void validate(IPageData pd, JSONObject paramIn) {
       /* Assert.hasKeyAndValue(paramIn, "stock", "必填,请填现有库存数");
        Assert.hasKeyAndValue(paramIn, "giveQuantity", "必填,请填转增数量");*/
    }
 
    @Override
    protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) {
        ResponseEntity<String> responseEntity = null;
        ComponentValidateResult result = super.validateStoreStaffCommunityRelationship(pd, restTemplate);
        paramIn.put("storeId", result.getStoreId());
        paramIn.put("userId", pd.getUserId());
        paramIn.put("userName", pd.getUserName());
        responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(),
                ServiceConstant.SERVICE_API_URL + "/api/resourceStore.saveAllocationUserStorehouse",
                HttpMethod.POST);
        return responseEntity;
    }
 
    @Override
    public ResponseEntity<String> saveAllocationUserStorehouse(IPageData pd) {
        return super.businessProcess(pd);
    }
 
    public RestTemplate getRestTemplate() {
        return restTemplate;
    }
 
    public void setRestTemplate(RestTemplate restTemplate) {
        this.restTemplate = restTemplate;
    }
}