| | |
| | | package com.yc.sdk.shopping.service.register; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.yc.action.grid.GridUtils; |
| | | import com.yc.sdk.shopping.entity.CustomerEntity; |
| | | import com.yc.service.BaseService; |
| | | import org.springframework.context.annotation.Scope; |
| | | import org.springframework.dao.DataAccessException; |
| | | import org.springframework.dao.EmptyResultDataAccessException; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.yc.action.grid.GridUtils; |
| | | import com.yc.sdk.shopping.entity.CustomerEntity; |
| | | import com.yc.service.BaseService; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service("AccountImpl") |
| | | @Scope("prototype") |
| | |
| | | + " declare @CountryId int="+customerEntity.getCountryZoneId()+",@ProvinceZoneId int="+customerEntity.getProvinceZoneId()+",@CityZoneId int="+customerEntity.getCityZoneId()+",@CountyZoneId int="+customerEntity.getCountyZoneId()+" ; \n" |
| | | + " declare @CompanyId varchar(50),@CompanyName varchar(100) ; \n" |
| | | + " declare @PropertyAddress varchar(200) ,@NewPropertyAddress varchar(200) ; \n" |
| | | + " declare @Address varchar(200) , @NewAddress varchar(200) ="+GridUtils.prossSqlParm(customerEntity.getAddress())+"; \n" |
| | | + " declare @OpenId varchar(200)="+GridUtils.prossSqlParm(customerEntity.getOpenId())+" ,@WeiXinUserStatus int="+customerEntity.getWeiXinUserStatus()+",@Gender int="+customerEntity.getGender()+",@Password varchar(4000)="+GridUtils.prossSqlParm(customerEntity.getPassword())+" ;\n" |
| | | + " declare @FromWx varchar(20) = "+GridUtils.prossSqlParm(customerEntity.getFromWx())+", @ReferralsType varchar(20) = "+GridUtils.prossSqlParm(customerEntity.getReferralsType())+" ; \n" |
| | | + " declare @ReferralsCode varchar(50) = "+GridUtils.prossSqlParm(customerEntity.getReferralsCode())+" ,@ReferralsName varchar(50) ,@ReferralsOpenId varchar(50); \n" |
| | | + " declare @Address varchar(200) , @NewAddress varchar(200) =" + GridUtils.prossSqlParm(customerEntity.getAddress()) + "; \n" |
| | | + " declare @OpenId varchar(200)=" + GridUtils.prossSqlParm(customerEntity.getOpenId()) + " ,@WeiXinUserStatus int=" + customerEntity.getWeiXinUserStatus() + ",@Gender int=" + customerEntity.getGender() + ",@Password varchar(4000)=" + GridUtils.prossSqlParm(customerEntity.getPassword()) + " ;\n" |
| | | + " declare @FromWx varchar(20) = " + GridUtils.prossSqlParm(customerEntity.getFromWx()) + ", @ReferralsType varchar(20) = " + GridUtils.prossSqlParm(customerEntity.getReferralsType()) + " ; \n" |
| | | + " declare @ReferralsCode varchar(50) = " + GridUtils.prossSqlParm(customerEntity.getReferralsCode()) + " ,@ReferralsName varchar(50) ,@ReferralsOpenId varchar(50); \n" |
| | | + " declare @Memo varchar(20) ,@LinkDocInfo varchar(20),@found int = 0; \n" |
| | | + " declare @myareaid varchar(20),@PrefixCode varchar(20),@CodeLength int,@CurCode int,@CurCodeStr varchar(50); \n" |
| | | + " declare @myrowcount int,@myerror int ,@PreDocStatus int = 0,@PostDocStatus int = 100; \n" |
| | | + " declare @DefaultMemberLevel varchar(50) \n" |
| | | + " declare @Sql varchar(2000) , @isFoundCltCode int = 0 \n" |
| | | + " declare @Currency varchar(20),@CurrencyName nvarchar(80),@meno varchar(20),@Domestic int \n" //货币 |
| | | |
| | | + " declare @Currency varchar(20),@CurrencyName nvarchar(80),@meno varchar(20),@Domestic int \n" + |
| | | " declare @shopGuideCodes varchar(50)=" + GridUtils.prossSqlParm(customerEntity.getShopGuideCode()) + ",@shopGuideNames varchar(50)=" + GridUtils.prossSqlParm(customerEntity.getShopGuideName()) + "\n" |
| | | |
| | | + " if isnull(@OpenId,'') <> '' \n" |
| | | + " begin \n"; |
| | | if (customerEntity!= null&& "2".equals(customerEntity.getFromWx())) { //公众号用户 |
| | |
| | | + " from t110703 where isnull(Domestic,0) = 1 order by Currency ; \n" |
| | | + " end else \n" |
| | | + " begin \n" |
| | | + " select top 1 @Currency = Currency,@CurrencyName = CurrencyName,@meno = meno,@Domestic = Domestic " |
| | | + " from t110703 where Currency = @Currency order by Currency ; \n" |
| | | + " end \n" |
| | | |
| | | //----- |
| | | + " insert into t110203 (Doccode,FormId,DocDate,PeriodId,DocStatus,EnterCode,EnterName, \n" |
| | | + " EnterDate,ModifyName,ModifyDate,PostCode,PostName,PostDate, \n" |
| | | + " CltCode,CltName,CltType,SourceInfo,AreaId,Tel,Fax,CcCode,CcName,WxCcCode, \n" |
| | | + " PropertyName,Building,Unit,House,PropertyAddress, \n" |
| | | + " CountryId,ProvinceZoneId,CityZoneId,CountyZoneId,Organization,FullAddress,"+openIdFieldId+", \n" |
| | | + " CompanyId,CompanyName,WeiXinUserStatus,Gender,Password,ReferralsType,ReferralsCode,ReferralsName,Currency ) \n" |
| | | + " values (@NewDocCode,@FormId,convert(varchar(10),getdate(),120), \n" |
| | | + " dbo.GetPeriodID(@FormId,@CompanyId,convert(varchar(10),getdate(),120)), \n" |
| | | + " @PreDocStatus,@UserCode,@UserName, \n" |
| | | + " getdate(),@UserName,getdate(),@UserCode,@UserName,getdate(), \n" |
| | | + " @CltCode,@CltName,@CltType,@SourceInfo,@AreaId,@Tel,@Fax,@CcCode,@CcName,@WxCcCode, \n" |
| | | + " @PropertyName,@Building,@Unit,@House,@PropertyAddress, \n" |
| | | + " @CountryId,@ProvinceZoneId,@CityZoneId,@CountyZoneId,@Organization,@NewAddress,@OpenId, \n" |
| | | + " @CompanyId,@CompanyName,@WeiXinUserStatus,@Gender,@Password,@ReferralsType,@ReferralsCode,@ReferralsName,@Currency) ; \n"; |
| | | + " select top 1 @Currency = Currency,@CurrencyName = CurrencyName,@meno = meno,@Domestic = Domestic " |
| | | + " from t110703 where Currency = @Currency order by Currency ; \n" |
| | | + " end \n" |
| | | |
| | | //----- |
| | | + " insert into t110203 (Doccode,FormId,DocDate,PeriodId,DocStatus,EnterCode,EnterName, \n" |
| | | + " EnterDate,ModifyName,ModifyDate,PostCode,PostName,PostDate, \n" |
| | | + " CltCode,CltName,CltType,SourceInfo,AreaId,Tel,Fax,CcCode,CcName,WxCcCode, \n" |
| | | + " PropertyName,Building,Unit,House,PropertyAddress, \n" |
| | | + " CountryId,ProvinceZoneId,CityZoneId,CountyZoneId,Organization,FullAddress," + openIdFieldId + ", \n" |
| | | + " CompanyId,CompanyName,WeiXinUserStatus,Gender,Password,ReferralsType,ReferralsCode,ReferralsName,Currency,shopGuideCodes,shopGuideNames ) \n" |
| | | + " values (@NewDocCode,@FormId,convert(varchar(10),getdate(),120), \n" |
| | | + " dbo.GetPeriodID(@FormId,@CompanyId,convert(varchar(10),getdate(),120)), \n" |
| | | + " @PreDocStatus,@UserCode,@UserName, \n" |
| | | + " getdate(),@UserName,getdate(),@UserCode,@UserName,getdate(), \n" |
| | | + " @CltCode,@CltName,@CltType,@SourceInfo,@AreaId,@Tel,@Fax,@CcCode,@CcName,@WxCcCode, \n" |
| | | + " @PropertyName,@Building,@Unit,@House,@PropertyAddress, \n" |
| | | + " @CountryId,@ProvinceZoneId,@CityZoneId,@CountyZoneId,@Organization,@NewAddress,@OpenId, \n" |
| | | + " @CompanyId,@CompanyName,@WeiXinUserStatus,@Gender,@Password,@ReferralsType,@ReferralsCode,@ReferralsName,@Currency,@shopGuideCodes,@shopGuideNames) ; \n"; |
| | | |
| | | if (customerEntity!= null&& "2".equals(customerEntity.getFromWx())) { |
| | | //更新 t110203 下级客户的 ReferralsCode,ReferralsName |