Commit b4186f6d authored by Quxl's avatar Quxl

x

parent fb9ece89
......@@ -230,13 +230,13 @@ public class UserController {
@ApiImplicitParam(paramType = "query", dataType = "string", name = "provinceId", value = "省ID", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "cityId", value = "市ID", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "districtId", value = "区ID", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "address", value = "详细地址"),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "certifTypeID", value = "店铺证件类型 A.营业执照"),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "certifNO", value = "店铺证件号码"),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "certifPicUrl", value = "店铺证件图片URL"),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "bankTypeID", value = "银行ID"),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "bankType", value = "银行名称"),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "bankCardNO", value = "银行卡号"),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "address", value = "详细地址", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "certifTypeID", value = "店铺证件类型 A.营业执照", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "certifNO", value = "店铺证件号码", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "certifPicUrl", value = "店铺证件图片URL", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "bankTypeID", value = "银行ID", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "bankType", value = "银行名称", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "bankCardNO", value = "银行卡号", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "customerName", value = "客户姓名", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "email", value = "邮箱"),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "memo", value = "备注"),
......@@ -285,6 +285,21 @@ public class UserController {
return userService.modifyShopAuthInfo(parameters);
}
@ApiOperation("查询认证信息")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "int", name = "shopId", value = "店铺ID", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "custNo", value = "客户编号", required=true),
/*=======================================================分界线=================================================================*/
@ApiImplicitParam(paramType = "query", name = "langID", dataType = "String", required = true, value = "语言", defaultValue = "936"),
@ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = true, value = "终端标识", defaultValue = "wechat"),
@ApiImplicitParam(paramType = "query", name = "sign", dataType = "String", required = true, value = "签名", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = "")
})
@RequestMapping(value = "/modifyShopAuthInfo",method=RequestMethod.GET)
public String queryShopAuthInfo(String custNo, Integer shopId, String langID) {
return userService.queryShopAuthInfo(custNo, shopId, langID);
}
@ApiOperation("根据OPENID获取用户信息")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "openId", dataType = "String", required = false, value = "OPENID", defaultValue = ""),
......
......@@ -39,4 +39,6 @@ public interface UserService {
public void saveOpenId(String string, String openId);
public String queryShopAuthInfo(String custNo, Integer shopId, String langID);
}
......@@ -410,7 +410,52 @@ public class UserServiceImpl implements UserService {
}
return false;
}
@Override
public String queryShopAuthInfo(String custNo, Integer shopId, String langID) {
String sCertifTypeID = "A";
String sCertifType = "营业执照";
Map<String, Object> map = new HashMap<String, Object>();
Map<String, Object> custMap = jdbcTemplate.queryForMap("select * from tCustomer where sCustNO = ?", custNo);
map.put("sCustName", custMap.get("sCustName"));
map.put("sCustNO", custMap.get("sCustNO"));
Map<String, Object> shopMap = jdbcTemplate.queryForMap("select * from tShop where nShopID = ?", shopId);
map.put("sShopNO", shopMap.get("sShopNO"));
map.put("nShopID", shopMap.get("nShopID"));
map.put("sShopName", shopMap.get("sShopName"));
map.put("sProvinceID", shopMap.get("sProvinceID"));
map.put("sCityID", shopMap.get("sCityID"));
map.put("sDistrictID", shopMap.get("sDistrictID"));
map.put("sAddress", shopMap.get("sAddress"));
map.put("sEmail", shopMap.get("sEmail"));
map.put("sMemo", shopMap.get("sMemo"));
String shopNo = (String)shopMap.get("sShopNO");
List<Map<String, Object>> certifList = jdbcTemplate.queryForList("select * from tShopCertif where sShopNO = ? and sCertifTypeID = ?", shopNo, sCertifTypeID);
if(certifList.size() > 0) {
Map<String, Object> certifMap = certifList.get(0);
String sCertifNO = (String)certifMap.get("sCertifNO");
map.put("sCertifTypeID", sCertifTypeID);
map.put("sCertifType", sCertifType);
map.put("sCertifNO", sCertifNO);
List<Map<String, Object>> certifPicList = jdbcTemplate.queryForList("select TOP 1 * from tShopCertifPic where sCertifNO = ? and sCertifTypeID = ? and sShopNO = ? order by nItem desc", sCertifNO, sCertifTypeID, shopNo);
if(certifPicList.size() > 0) {
Map<String, Object> picMap = certifPicList.get(0);
String sURL = (String)picMap.get("sURL");
map.put("sCertifPicUrl", sURL);
}
}
List<Map<String, Object>> bankList = jdbcTemplate.queryForList("select * from tCustBank where sCustNO = ?", custNo);
if(bankList.size() > 0) {
Map<String, Object> bankMap = bankList.get(0);
map.put("sBankTypeID", bankMap.get("sBankTypeID"));
map.put("sBankType", bankMap.get("sBankType"));
map.put("sBankCardNO", bankMap.get("sBankAccountNO"));
}
return Rjx.jsonOk().setData(map).setMessage(I18NUtils.getMessage(langID, "Msg_Update_success")).toJson();
}
@Override
public String modifyShopAuthInfo(Map<String, Object> parameters) {
String langID = (String)parameters.get("langID");
......@@ -423,7 +468,8 @@ public class UserServiceImpl implements UserService {
String cityId = (String)parameters.get("cityId");
String districtId = (String)parameters.get("districtId");
String address = (String)parameters.get("address");
String certifTypeID = (String)parameters.get("certifTypeID");
String certifTypeID = "A";
String certifType = "营业执照";
String certifNO = (String)parameters.get("certifNO");
String certifPicUrl = (String)parameters.get("certifPicUrl");
String bankTypeID = (String)parameters.get("bankTypeID");
......@@ -487,33 +533,21 @@ public class UserServiceImpl implements UserService {
addrMap.put("dLastUpdateTime", new Date());
jdbcTemplate.updateByColumn("tCustAddress", new String[] {"sAddrID"}, addrMap);
}
int count = jdbcTemplate.queryForInt("select count(*) from tShopCertif where sShopNO = ? and sCertifTypeID = ? and sCertifNO = ?", new Object[] {shopNo, certifTypeID, certifNO});
if(count == 0) {
String sqlInsert = "insert into tShopCertif (sShopNO, sCertifTypeID, sCertifType, sCertifNO, dValidDate, dExpiryDate, nTag, sCreateUser, dCreateDate, dLastUpdateTime) values (?, ?, '', ?, getdate(), ?, 0, '', getdate(), getdate())";
Object[] args = new Object[] {shopNo, certifTypeID, certifNO, new Date(System.currentTimeMillis() + (1000L*60*60*24*365*100))};
jdbcTemplate.update(sqlInsert, args);
}
Integer itemId;
try {
itemId = jdbcTemplate.queryForInt("select max(nItem) from tShopCertifPic where sShopNO = ? and sCertifTypeID = ? and sCertifNO = ?", shopNo, certifTypeID, certifNO);
} catch (NullPointerException e) {
itemId = 0;
}
String insertPicSql = "insert into tShopCertifPic (sShopNO, sCertifTypeID, sCertifNO, nItem, sPicDesc, sURL, sCreateUser, dCreateDate, dLastUpdateTime) values (?, ?, ?, ?, '', ?, '', getdate(), getdate())";
Object[] insertPicArgs = new Object[] {shopNo, certifTypeID, certifNO, ++itemId, certifPicUrl};
jdbcTemplate.update(insertPicSql, insertPicArgs);
int countBankCard = jdbcTemplate.queryForInt("select count(*) from tCustBank where sCustNO = ? and sBankAccountNO = ?", custNo, bankCardNO);
if(countBankCard > 0) {
jdbcTemplate.update("update tCustBank set sBankTypeID = ?, sBankType = ?, sBankAccount = ? where sCustNO = ? and sBankAccountNO = ?", bankTypeID, bankType, bankCardNO, custNo, bankCardNO);
} else {
String sqlBankInsert = "insert into tCustBank (sCustNO, sBankTypeID, sBankType, sBankAccountNO, sBankAccount, nTag, sCreateUser, dCreateDate, dLastUpdateTime) values (?, ?, ?, ?, ?, 0, '', getdate(), getdate())";
Object[] sqlBankInsertArgs = new Object[] {custNo, bankTypeID, bankType, bankCardNO, bankCardNO};
jdbcTemplate.update(sqlBankInsert, sqlBankInsertArgs);
}
jdbcTemplate.update("delete from tShopCertif where sShopNO = ? and sCertifTypeID = ?", shopNo, certifTypeID);
String sqlInsert = "insert into tShopCertif (sShopNO, sCertifTypeID, sCertifType, sCertifNO, dValidDate, dExpiryDate, nTag, sCreateUser, dCreateDate, dLastUpdateTime) values (?, ?, ?, ?, getdate(), ?, 0, '', getdate(), getdate())";
Object[] args = new Object[] {shopNo, certifTypeID, certifType, certifNO, new Date(System.currentTimeMillis() + (1000L*60*60*24*365*100))};
jdbcTemplate.update(sqlInsert, args);
jdbcTemplate.update("delete from tShopCertifPic where sShopNO = ? and sCertifTypeID = ?", shopNo, certifTypeID);
String insertPicSql = "insert into tShopCertifPic (sShopNO, sCertifTypeID, sCertifNO, nItem, sPicDesc, sURL, sCreateUser, dCreateDate, dLastUpdateTime) values (?, ?, ?, ?, '', ?, '', getdate(), getdate())";
Object[] insertPicArgs = new Object[] {shopNo, certifTypeID, certifNO, 1, certifPicUrl};
jdbcTemplate.update(insertPicSql, insertPicArgs);
jdbcTemplate.update("delete from tCustBank where sCustNO = ?", custNo);
String sqlBankInsert = "insert into tCustBank (sCustNO, sBankTypeID, sBankType, sBankAccountNO, sBankAccount, nTag, sCreateUser, dCreateDate, dLastUpdateTime) values (?, ?, ?, ?, ?, 0, '', getdate(), getdate())";
Object[] sqlBankInsertArgs = new Object[] {custNo, bankTypeID, bankType, bankCardNO, bankCardNO};
jdbcTemplate.update(sqlBankInsert, sqlBankInsertArgs);
return Rjx.jsonOk().setMessage(I18NUtils.getMessage(langID, "Msg_Update_success")).toJson();
}
......@@ -619,5 +653,5 @@ public class UserServiceImpl implements UserService {
public void saveOpenId(String sCustNO, String openId) {
jdbcTemplate.update("update tCustomer set sOpenID = ? where sCustNO = ?", openId, sCustNO);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment