Commit c15e7a44 authored by Quxl's avatar Quxl

xx

parent 805052ac
...@@ -432,9 +432,48 @@ public class UserServiceImpl implements UserService { ...@@ -432,9 +432,48 @@ public class UserServiceImpl implements UserService {
String email = (String)parameters.get("email"); String email = (String)parameters.get("email");
String memo = (String)parameters.get("memo"); String memo = (String)parameters.get("memo");
Map<String, Object> custMap = jdbcTemplate.queryForMap("select * from tCustomer where sCustNO = ?", custNo);
String sMobile = (String)custMap.get("sMobile");
jdbcTemplate.update("update tCustomer set sCustName = ? where sCustNO = ?", customerName, custNo); jdbcTemplate.update("update tCustomer set sCustName = ? where sCustNO = ?", customerName, custNo);
jdbcTemplate.update("update tShop set sShopName = ?, sProvinceID = ?, sCityID = ?, sDistrictID = ?, sAddress = ?, sEmail = ?, sMemo = ? where nShopID = ?", shopName, provinceId, cityId, districtId, address, email, memo, shopId); jdbcTemplate.update("update tShop set sShopName = ?, sProvinceID = ?, sCityID = ?, sDistrictID = ?, sAddress = ?, sEmail = ?, sMemo = ? where nShopID = ?", shopName, provinceId, cityId, districtId, address, email, memo, shopId);
List<Map<String, Object>> addrList = jdbcTemplate.queryForList("select * from tCustAddress where sCustNO = ? and sShopNO = ? and nTag&5 = 4", custNo, shopNo);
String provinceName = jdbcTemplate.queryForString("select sRegionDesc from tRegion where sRegionNO = ?", provinceId);
String cityName = jdbcTemplate.queryForString("select sRegionDesc from tRegion where sRegionNO = ?", cityId);
String districtName = jdbcTemplate.queryForString("select sRegionDesc from tRegion where sRegionNO = ?", districtId);
if(addrList.size() == 0) {
Map<String, Object> addrMap = new HashMap<String, Object>();
addrMap.put("sAddrID", String.valueOf(System.currentTimeMillis()));
addrMap.put("sShopNO", shopNo);
addrMap.put("sCustNO", custNo);
addrMap.put("sAddrName", "认证地址");
addrMap.put("sContacts", customerName);
addrMap.put("sMobile", sMobile);
addrMap.put("sProvinceID", provinceId);
addrMap.put("sCityID", cityId);
addrMap.put("sDistrictID", districtId);
addrMap.put("sProvince", provinceName);
addrMap.put("sCity", cityName);
addrMap.put("sDistrict", districtName);
addrMap.put("sPostalCode", "000000");
addrMap.put("sAddress", address);
addrMap.put("nTag", 4);
addrMap.put("sCreateUser", "admin");
addrMap.put("dCreateDate", new Date());
jdbcTemplate.save("tCustAddress", addrMap);
} else {
Map<String, Object> addrMap = addrList.get(0);
addrMap.put("sContacts", customerName);
addrMap.put("sMobile", sMobile);
addrMap.put("sProvinceID", provinceId);
addrMap.put("sCityID", cityId);
addrMap.put("sDistrictID", districtId);
addrMap.put("sProvince", provinceName);
addrMap.put("sCity", cityName);
addrMap.put("sDistrict", districtName);
addrMap.put("sAddress", address);
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}); int count = jdbcTemplate.queryForInt("select count(*) from tShopCertif where sShopNO = ? and sCertifTypeID = ? and sCertifNO = ?", new Object[] {shopNo, certifTypeID, certifNO});
if(count == 0) { if(count == 0) {
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())";
...@@ -459,6 +498,10 @@ public class UserServiceImpl implements UserService { ...@@ -459,6 +498,10 @@ public class UserServiceImpl implements UserService {
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