| | |
| | | import com.dy.pipIrrGlobal.pojoBa.BaClient; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClient; |
| | | import com.dy.pipIrrGlobal.voSe.VoClient; |
| | | import com.dy.pipIrrSell.util.RestTemplateUtil; |
| | | import com.dy.pipIrrSell.wechatpay.PayInfo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | |
| | | public class ClientCtrl { |
| | | private final ClientSv clientSv; |
| | | //private final RedisUtils redisUtils; |
| | | private final RestTemplateUtil restTemplateUtil; |
| | | |
| | | private final String privateCertFileName = PayInfo.privateCertFileName; |
| | | private final String appid = PayInfo.appid; |
| | | private final String secret = PayInfo.secret; |
| | | private final String mchid = PayInfo.mchid; |
| | | private final String schema = PayInfo.schema; |
| | | private final String signType = PayInfo.signType; |
| | | private final String description = PayInfo.description; |
| | | private final String loginUrl = PayInfo.loginUrl; |
| | | private final String notifyUrl = PayInfo.notifyUrl; |
| | | private final String grantType = PayInfo.grantType; |
| | | |
| | | /** |
| | | * 获取农户列表 |
| | |
| | | String villageName = map_districts.get("villageName").toString(); |
| | | |
| | | // 生成8位行政区划编码,生成农户编号用 |
| | | String district8 = countyNum + townNum + villageNum; |
| | | String district8 = String.format("%02d", Integer.parseInt(countyNum)) + String.format("%03d", Integer.parseInt(townNum)) + String.format("%03d", Integer.parseInt(villageNum)); |
| | | // 生成农户编号 |
| | | String clientNum = generateClientNum(district8); |
| | | if(clientNum == null) { |
| | | return BaseResponseUtils.buildErrorMsg("农户编号超限"); |
| | | } |
| | | // 生成12位5级行政区划编码串及名称串 |
| | | Long districtNum = Long.parseLong(provinceNum + cityNum + district8); |
| | | String districtTitle = countryName + townName + villageName; |
| | |
| | | Integer number = Integer.parseInt(clientNum.substring(8)); |
| | | number = number + 1; |
| | | if(number > 9999) { |
| | | return "农户编号超限"; |
| | | return null; |
| | | } |
| | | clientNum = clientNum.substring(0, 8) + String.format("%04d", number); |
| | | } else { |
| | |
| | | String villageName = map_districts.get("villageName").toString(); |
| | | |
| | | // 生成8位行政区划编码,生成农户编号用 |
| | | String district8 = countyNum + townNum + villageNum; |
| | | //String district8 = countyNum + townNum + villageNum; |
| | | String district8 = String.format("%02d", Integer.parseInt(countyNum)) + String.format("%03d", Integer.parseInt(townNum)) + String.format("%03d", Integer.parseInt(villageNum)); |
| | | // 生成农户编号 |
| | | String clientNum = generateClientNum(district8); |
| | | // 生成12位5级行政区划编码串及名称串 |