Commit b4186f6d authored by Quxl's avatar Quxl

x

parent fb9ece89
...@@ -230,13 +230,13 @@ public class UserController { ...@@ -230,13 +230,13 @@ public class UserController {
@ApiImplicitParam(paramType = "query", dataType = "string", name = "provinceId", value = "省ID", required=true), @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 = "cityId", value = "市ID", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "districtId", 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 = "address", value = "详细地址", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "certifTypeID", value = "店铺证件类型 A.营业执照"), @ApiImplicitParam(paramType = "query", dataType = "string", name = "certifTypeID", value = "店铺证件类型 A.营业执照", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "certifNO", value = "店铺证件号码"), @ApiImplicitParam(paramType = "query", dataType = "string", name = "certifNO", value = "店铺证件号码", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "certifPicUrl", value = "店铺证件图片URL"), @ApiImplicitParam(paramType = "query", dataType = "string", name = "certifPicUrl", value = "店铺证件图片URL", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "bankTypeID", value = "银行ID"), @ApiImplicitParam(paramType = "query", dataType = "string", name = "bankTypeID", value = "银行ID", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "bankType", value = "银行名称"), @ApiImplicitParam(paramType = "query", dataType = "string", name = "bankType", value = "银行名称", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "bankCardNO", value = "银行卡号"), @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 = "customerName", value = "客户姓名", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "email", value = "邮箱"), @ApiImplicitParam(paramType = "query", dataType = "string", name = "email", value = "邮箱"),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "memo", value = "备注"), @ApiImplicitParam(paramType = "query", dataType = "string", name = "memo", value = "备注"),
...@@ -285,6 +285,21 @@ public class UserController { ...@@ -285,6 +285,21 @@ public class UserController {
return userService.modifyShopAuthInfo(parameters); 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获取用户信息") @ApiOperation("根据OPENID获取用户信息")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "openId", dataType = "String", required = false, value = "OPENID", defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "openId", dataType = "String", required = false, value = "OPENID", defaultValue = ""),
......
...@@ -39,4 +39,6 @@ public interface UserService { ...@@ -39,4 +39,6 @@ public interface UserService {
public void saveOpenId(String string, String openId); public void saveOpenId(String string, String openId);
public String queryShopAuthInfo(String custNo, Integer shopId, String langID);
} }
...@@ -411,6 +411,51 @@ public class UserServiceImpl implements UserService { ...@@ -411,6 +411,51 @@ public class UserServiceImpl implements UserService {
return false; 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 @Override
public String modifyShopAuthInfo(Map<String, Object> parameters) { public String modifyShopAuthInfo(Map<String, Object> parameters) {
String langID = (String)parameters.get("langID"); String langID = (String)parameters.get("langID");
...@@ -423,7 +468,8 @@ public class UserServiceImpl implements UserService { ...@@ -423,7 +468,8 @@ public class UserServiceImpl implements UserService {
String cityId = (String)parameters.get("cityId"); String cityId = (String)parameters.get("cityId");
String districtId = (String)parameters.get("districtId"); String districtId = (String)parameters.get("districtId");
String address = (String)parameters.get("address"); String address = (String)parameters.get("address");
String certifTypeID = (String)parameters.get("certifTypeID"); String certifTypeID = "A";
String certifType = "营业执照";
String certifNO = (String)parameters.get("certifNO"); String certifNO = (String)parameters.get("certifNO");
String certifPicUrl = (String)parameters.get("certifPicUrl"); String certifPicUrl = (String)parameters.get("certifPicUrl");
String bankTypeID = (String)parameters.get("bankTypeID"); String bankTypeID = (String)parameters.get("bankTypeID");
...@@ -487,33 +533,21 @@ public class UserServiceImpl implements UserService { ...@@ -487,33 +533,21 @@ public class UserServiceImpl implements UserService {
addrMap.put("dLastUpdateTime", new Date()); addrMap.put("dLastUpdateTime", new Date());
jdbcTemplate.updateByColumn("tCustAddress", new String[] {"sAddrID"}, addrMap); 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) { 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())"; 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))}; Object[] args = new Object[] {shopNo, certifTypeID, certifType, certifNO, new Date(System.currentTimeMillis() + (1000L*60*60*24*365*100))};
jdbcTemplate.update(sqlInsert, args); jdbcTemplate.update(sqlInsert, args);
}
Integer itemId; jdbcTemplate.update("delete from tShopCertifPic where sShopNO = ? and sCertifTypeID = ?", shopNo, certifTypeID);
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())"; 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}; Object[] insertPicArgs = new Object[] {shopNo, certifTypeID, certifNO, 1, certifPicUrl};
jdbcTemplate.update(insertPicSql, insertPicArgs); jdbcTemplate.update(insertPicSql, insertPicArgs);
int countBankCard = jdbcTemplate.queryForInt("select count(*) from tCustBank where sCustNO = ? and sBankAccountNO = ?", custNo, bankCardNO); jdbcTemplate.update("delete from tCustBank where sCustNO = ?", custNo);
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())"; 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}; Object[] sqlBankInsertArgs = new Object[] {custNo, bankTypeID, bankType, bankCardNO, bankCardNO};
jdbcTemplate.update(sqlBankInsert, sqlBankInsertArgs); jdbcTemplate.update(sqlBankInsert, sqlBankInsertArgs);
}
return Rjx.jsonOk().setMessage(I18NUtils.getMessage(langID, "Msg_Update_success")).toJson(); return Rjx.jsonOk().setMessage(I18NUtils.getMessage(langID, "Msg_Update_success")).toJson();
} }
......
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