Commit ba2e75e4 authored by 张永's avatar 张永
parents 45c80c3b 43e655ad
...@@ -10,7 +10,9 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -10,7 +10,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.egolm.common.StringUtil;
import com.egolm.common.bean.Rjx; import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.shop.service.CommonService; import com.egolm.shop.service.CommonService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -23,6 +25,9 @@ import io.swagger.annotations.ApiOperation; ...@@ -23,6 +25,9 @@ import io.swagger.annotations.ApiOperation;
@RequestMapping("common") @RequestMapping("common")
public class CommonController { public class CommonController {
@Autowired
private JdbcTemplate jdbcTemplate;
@Autowired @Autowired
private CommonService commonService; private CommonService commonService;
...@@ -70,4 +75,22 @@ public class CommonController { ...@@ -70,4 +75,22 @@ public class CommonController {
return Rjx.jsonOk().set("list", list).toJson(); return Rjx.jsonOk().set("list", list).toJson();
} }
@ApiOperation("获取省市区数据")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "regionNo", dataType = "String", required = true),
@ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = false, value = "终端标识", defaultValue = "wechat"),
@ApiImplicitParam(paramType = "query", name = "langID", dataType = "String", required = false, value = "语言", defaultValue = "936"),
@ApiImplicitParam(paramType = "query", name = "sign", dataType = "String", required = true, value = "签名", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = "")
})
@RequestMapping(value = "/getRegionList",method=RequestMethod.GET)
public String getCityListByProvince(String regionNo) {
if(StringUtil.isBlank(regionNo)) {
regionNo = "000000";
}
List<Map<String, Object>> list = jdbcTemplate.queryForList("select * from tRegion where sUpRegionNO = ?", regionNo);
return Rjx.jsonOk().set("list", list).toJson();
}
} }
...@@ -227,9 +227,9 @@ public class UserController { ...@@ -227,9 +227,9 @@ public class UserController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "int", name = "shopId", value = "店铺ID", required=true), @ApiImplicitParam(paramType = "query", dataType = "int", name = "shopId", value = "店铺ID", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "shopName", value = "店铺名称", required=true), @ApiImplicitParam(paramType = "query", dataType = "string", name = "shopName", value = "店铺名称", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "provinceId", value = "省ID"), @ApiImplicitParam(paramType = "query", dataType = "string", name = "provinceId", value = "省ID", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "cityId", value = "市ID"), @ApiImplicitParam(paramType = "query", dataType = "string", name = "cityId", value = "市ID", required=true),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "districtId", value = "区ID"), @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 = "详细地址"),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "certifTypeID", value = "店铺证件类型 A.营业执照"), @ApiImplicitParam(paramType = "query", dataType = "string", name = "certifTypeID", value = "店铺证件类型 A.营业执照"),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "certifNO", value = "店铺证件号码"), @ApiImplicitParam(paramType = "query", dataType = "string", name = "certifNO", value = "店铺证件号码"),
...@@ -237,7 +237,7 @@ public class UserController { ...@@ -237,7 +237,7 @@ public class UserController {
@ApiImplicitParam(paramType = "query", dataType = "string", name = "bankTypeID", value = "银行ID"), @ApiImplicitParam(paramType = "query", dataType = "string", name = "bankTypeID", value = "银行ID"),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "bankType", value = "银行名称"), @ApiImplicitParam(paramType = "query", dataType = "string", name = "bankType", value = "银行名称"),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "bankCardNO", value = "银行卡号"), @ApiImplicitParam(paramType = "query", dataType = "string", name = "bankCardNO", value = "银行卡号"),
@ApiImplicitParam(paramType = "query", dataType = "string", name = "customerName", value = "客户姓名"), @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 = "备注"),
/*=======================================================分界线=================================================================*/ /*=======================================================分界线=================================================================*/
......
...@@ -431,8 +431,10 @@ public class UserServiceImpl implements UserService { ...@@ -431,8 +431,10 @@ public class UserServiceImpl implements UserService {
String customerName = (String)parameters.get("customerName"); String customerName = (String)parameters.get("customerName");
String email = (String)parameters.get("email"); String email = (String)parameters.get("email");
String memo = (String)parameters.get("memo"); String memo = (String)parameters.get("memo");
String sql = "update tCustomer c, tShop s set c.sCustomerName = ?, s.sShopName = ?, s.sProvinceID = ?, s.sCityID = ?, s.sDistrictID = ?, s.sAddress = ?, s.sEmail = ?, s.sMemo = ? where c.sCustNO = s.sCustNO and s.nShopID = ?";
jdbcTemplate.update(sql, customerName, shopName, provinceId, cityId, districtId, address, email, memo, shopId);
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);
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())";
...@@ -441,7 +443,7 @@ public class UserServiceImpl implements UserService { ...@@ -441,7 +443,7 @@ public class UserServiceImpl implements UserService {
} }
Integer itemId = jdbcTemplate.queryForInt("select max(nItem) from tShopCertifPic where sShopNO = ? and sCertifTypeID = ? and sCertifNO = ?", shopNo, certifTypeID, certifNO); Integer itemId = jdbcTemplate.queryForInt("select max(nItem) from tShopCertifPic where sShopNO = ? and sCertifTypeID = ? and sCertifNO = ?", shopNo, certifTypeID, certifNO);
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, (itemId == null ? 1 : ++itemId), certifPicUrl};
jdbcTemplate.update(insertPicSql, insertPicArgs); jdbcTemplate.update(insertPicSql, insertPicArgs);
int countBankCard = jdbcTemplate.queryForInt("select count(*) from tCustBank where sCustNO = ? and sBankAccountNO = ?", custNo, bankCardNO); int countBankCard = jdbcTemplate.queryForInt("select count(*) from tCustBank where sCustNO = ? and sBankAccountNO = ?", custNo, bankCardNO);
......
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