|
1
|
package com.huaheng.api.U8.Service;
|
|
2
3
|
import com.huaheng.api.U8.domain.ICSPersonModel;
|
|
4
|
import com.huaheng.api.general.Controller.InfiniteApi;
|
|
5
|
import com.huaheng.common.utils.security.ShiroUtils;
|
|
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import com.huaheng.framework.web.domain.AjaxResult;
import com.huaheng.pc.general.company.domain.WarehouseCompany;
import com.huaheng.pc.general.company.mapper.WarehouseCompanyMapperAuto;
import com.huaheng.pc.system.dept.service.IDeptService;
import com.huaheng.pc.system.user.domain.User;
import com.huaheng.pc.system.user.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@Service
|
|
21
|
public class UserAPIService {
|
|
22
23
24
25
26
27
28
29
30
|
@Autowired
IUserService iUserService;
@Autowired
IDeptService iDeptService;
@Resource
private WarehouseCompanyMapperAuto warehouseCompanyMapperAuto;
|
|
31
|
@Autowired
|
|
32
|
InfiniteApi infiniteApi;
|
|
33
34
|
|
|
35
36
37
38
39
|
/**
* 人员档案service
* @param ICSPerson
* @return
*/
|
|
40
41
42
43
44
|
@Transactional
public AjaxResult ICSPerson(ICSPersonModel ICSPerson) {
WarehouseCompany warehouseCompany = new WarehouseCompany();
warehouseCompany.setCompanyCode(ICSPerson.getCompanyCode());
List<WarehouseCompany> list = warehouseCompanyMapperAuto.selectListEntityByEqual(warehouseCompany);
|
|
45
46
|
if (list == null || list.size() == 0) {
return AjaxResult.error("系统中没有该货主:" + warehouseCompany.toString() + " 信息,请先录入货主信息!");
|
|
47
|
}
|
|
48
49
50
51
52
53
54
55
56
|
User user = new User();
user.setLoginName(ICSPerson.getcPersonCode());
user.setUserName(ICSPerson.getcPersonName());
//根据部门编码获取部门ID
user.setDeptId(iDeptService.selectDeptId(ICSPerson.getcDepCode()));
user.setCreateBy(ShiroUtils.getLoginName());
user.setUpdateBy(ShiroUtils.getLoginName());
user.setUpdateTime(new Date());
// PersonApi personApi = new PersonApi();
|
|
57
|
AjaxResult ajaxResult = infiniteApi.user(user);
|
|
58
|
return ajaxResult;
|
|
59
60
|
}
}
|