wuxw7
2018-04-13 3de85d01308c5efa0bc77d4a02fdc9a16d5aa9fb
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
package com.java110.base.smo.impl;
 
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.base.dao.IPrimaryKeyServiceDao;
import com.java110.base.smo.IPrimaryKeyServiceSMO;
import com.java110.common.log.LoggerEngine;
import com.java110.core.base.smo.BaseServiceSMO;
import com.java110.entity.user.BoCust;
import org.apache.commons.lang.math.NumberUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
import java.util.Map;
 
/**
 * 用户服务信息管理业务信息实现
 * Created by wuxw on 2017/4/5.
 */
@Service("PrimaryKeyServiceSMOImpl")
public class PrimaryKeyServiceSMOImpl extends BaseServiceSMO implements IPrimaryKeyServiceSMO {
 
 
    @Autowired
    IPrimaryKeyServiceDao iPrimaryKeyServiceDao;
 
    /**
     * 根据sequence 表中name 查询ID
     *
     * @param primaryKeyInfo name信息封装
     * @return
     */
    public JSONObject queryPrimaryKey(JSONObject primaryKeyInfo) throws Exception {
        Map paramIn = JSONObject.toJavaObject(primaryKeyInfo, Map.class);
        Map primaryKey = iPrimaryKeyServiceDao.queryPrimaryKey(paramIn);
        JSONObject returnPrimaryKey = new JSONObject();
        if (primaryKey != null && primaryKey.containsKey("targetId")) {
            returnPrimaryKey.put("targetId", primaryKey.get("targetId"));
        } else {
            //如果没定义相应name的键序列,直接返回-1 表示 自己系统需要自己生成
            returnPrimaryKey.put("targetId", "-1");
        }
        return returnPrimaryKey;
    }
 
 
}