CyclecountAPIService.java
1.45 KB
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
package com.huaheng.api.general.service;
import com.alibaba.fastjson.JSON;
import com.huaheng.common.utils.http.HttpUtils;
import com.huaheng.framework.web.domain.AjaxResult;
import com.huaheng.pc.inventory.cyclecountAdjust.domain.CyclecountAdjust;
import com.huaheng.pc.inventory.cyclecountAdjust.mapper.CyclecountAdjustMapperAuto;
import com.huaheng.pc.inventory.cyclecountAdjust.service.ICycleconutAdjustService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* 盘点差异接口服务层
* @author huaheng
* @date 2019-1-8
*
*
*
*/
@Service
public class CyclecountAPIService {
@Resource
private CyclecountAdjustMapperAuto cyclecountAdjustMapperAuto;
@Resource
private ICycleconutAdjustService cycleconutAdjustService;
public AjaxResult confirm(String url) {
CyclecountAdjust cyclecountAdjust=new CyclecountAdjust();
cyclecountAdjust.setStatus(10);
cyclecountAdjust=cyclecountAdjustMapperAuto.selectFirstEntity(cyclecountAdjust);
if(cyclecountAdjust==null){
return AjaxResult.error("没有盘点差异上传");
}
String JsonParam = JSON.toJSONString(cyclecountAdjust);
String result = HttpUtils.sendPost(url, JsonParam);
AjaxResult ajaxResult = JSON.parseObject(result, AjaxResult.class);
cyclecountAdjust.setStatus(20);
cycleconutAdjustService.updateByModel(cyclecountAdjust);
return ajaxResult;
}
}