Commit b8265ac0 authored by Quxl's avatar Quxl

x

parent da5ac907
...@@ -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();
}
} }
...@@ -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 sCustomerName = ? 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())";
......
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