| @@ -123,5 +123,14 @@ public class WxMerchantController extends BaseController { | |||
| return wxMerchantService.updateMerchantAdmin(wxMerchant); | |||
| } | |||
| @ApiOperation("更新法人及税务接口") | |||
| @PostMapping("updateMerchantCoprAndTax") | |||
| public ResultData updateMerchantCoprAndTax(@RequestBody WxMerchant wxMerchant) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::updateMerchantAdmin"); | |||
| wxMerchant.setTenantId(getTenantId()); | |||
| return wxMerchantService.updateMerchantCoprAndTax(wxMerchant); | |||
| } | |||
| } | |||
| @@ -1,5 +1,6 @@ | |||
| package com.iformall.schedule; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.iformall.domain.po.WxWiWideInfo; | |||
| import com.iformall.exception.MallinkException; | |||
| @@ -30,10 +31,11 @@ public class WiwideTokenSchedule { | |||
| List<WxWiWideInfo> list = wxWiwideInfoMapper.findList(null); | |||
| for (int i = 0, size = list.size(); i < size; i++) { | |||
| WxWiWideInfo wxWiWideInfo = list.get(i); | |||
| logger.info("WiwideTokenSchedule>>>>wiwideinfo:"+JSONObject.toJSONString(wxWiWideInfo)); | |||
| String data = WiwideUtil.queryToken(wxWiWideInfo); | |||
| String token = (String) JSONObject.parseObject(data).get("data"); | |||
| if(token==null){ | |||
| logger.error("商场:"+wxWiWideInfo.getTenantId()+",token为空"); | |||
| logger.error("WiwideTokenSchedule>>>商场:"+wxWiWideInfo.getTenantId()+",token为空"); | |||
| continue; | |||
| } | |||
| updateToken(wxWiWideInfo, token); | |||
| @@ -44,14 +46,17 @@ public class WiwideTokenSchedule { | |||
| private void updateToken(WxWiWideInfo wxWiWideInfo, String token) { | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.add(Calendar.MINUTE, 45); | |||
| logger.info("WiwideTokenSchedule>>>数据表中的数据:"+JSONObject.toJSONString(wxWiWideInfo)); | |||
| WxWiWideInfo record = new WxWiWideInfo(); | |||
| record.setId(wxWiWideInfo.getId()); | |||
| record.setToken(token); | |||
| record.setExpiredTime(instance.getTime()); | |||
| try { | |||
| logger.info("WiwideTokenSchedule>>>>要更新的数据before>>>>>>>>>>"+JSONObject.toJSONString(record)); | |||
| wxWiwideInfoMapper.updateToken(record); | |||
| logger.info("要更新的数据after>>>>>>>>>>"+JSONObject.toJSONString(record)); | |||
| } catch (MallinkException e) { | |||
| logger.error("更新TOKEN失败:商场" + wxWiWideInfo.getTenantId()); | |||
| logger.error("WiwideTokenSchedule>>>>更新TOKEN失败:商场" + wxWiWideInfo.getTenantId()); | |||
| } | |||
| } | |||
| @@ -115,6 +115,64 @@ public class WxMerchant implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="联系人",name="linkPerson") | |||
| private String linkPerson; | |||
| @io.swagger.annotations.ApiModelProperty(value="经营业态ID:参照wx_business表",name="businessId") | |||
| private Integer businessId; | |||
| @io.swagger.annotations.ApiModelProperty(value="店铺类型:1直营店2加盟店3个体店4旗舰店",name="shopType") | |||
| private Integer shopType; | |||
| @io.swagger.annotations.ApiModelProperty(value="品牌",name="brand") | |||
| private String brand; | |||
| @io.swagger.annotations.ApiModelProperty(value="法人证件类型",name="corpPapersType") | |||
| private Integer corpPapersType; | |||
| @io.swagger.annotations.ApiModelProperty(value="法人证件号码",name="corpPapersNumber") | |||
| private String corpPapersNumber; | |||
| @io.swagger.annotations.ApiModelProperty(value="法人",name="corpPapersPerson") | |||
| private String corpPapersPerson; | |||
| @io.swagger.annotations.ApiModelProperty(value="法人证件正面",name="corpPapersPicFace") | |||
| private String corpPapersPicFace; | |||
| @io.swagger.annotations.ApiModelProperty(value="法人证件背面",name="corpPapersPicBack") | |||
| private String corpPapersPicBack; | |||
| @io.swagger.annotations.ApiModelProperty(value="法人证件背面",name="taxpayerType") | |||
| private Integer taxpayerType; | |||
| @io.swagger.annotations.ApiModelProperty(value="纳税证件类型",name="taxPapersType") | |||
| private Integer taxPapersType; | |||
| @io.swagger.annotations.ApiModelProperty(value="纳税证件号码",name="taxPapersNumber") | |||
| private String taxPapersNumber; | |||
| @io.swagger.annotations.ApiModelProperty(value="发票类型",name="invoiceType") | |||
| private Integer invoiceType; | |||
| @io.swagger.annotations.ApiModelProperty(value="购方名称",name="invoiceBuyer") | |||
| private String invoiceBuyer; | |||
| @io.swagger.annotations.ApiModelProperty(value="纳税人识别号",name="taxpayerIdentifyNumber") | |||
| private String taxpayerIdentifyNumber; | |||
| @io.swagger.annotations.ApiModelProperty(value="开票地址及电话",name="invoiceAddressPhone") | |||
| private String invoiceAddressPhone; | |||
| @io.swagger.annotations.ApiModelProperty(value="开户行及账号",name="bankAccountNumber") | |||
| private String bankAccountNumber; | |||
| @io.swagger.annotations.ApiModelProperty(value="开户名",name="bankAccountPerson") | |||
| private String bankAccountPerson; | |||
| @io.swagger.annotations.ApiModelProperty(value="开户行",name="bankName") | |||
| private String bankName; | |||
| @io.swagger.annotations.ApiModelProperty(value="银行账号",name="bankAccount") | |||
| private String bankAccount; | |||
| public List<Map<String, Object>> getShoplist() { | |||
| return shoplist; | |||
| } | |||
| @@ -287,6 +345,158 @@ public class WxMerchant implements Serializable { | |||
| this.rentContractId = rentContractId; | |||
| } | |||
| public Integer getBusinessId() { | |||
| return businessId; | |||
| } | |||
| public void setBusinessId(Integer businessId) { | |||
| this.businessId = businessId; | |||
| } | |||
| public Integer getShopType() { | |||
| return shopType; | |||
| } | |||
| public void setShopType(Integer shopType) { | |||
| this.shopType = shopType; | |||
| } | |||
| public String getBrand() { | |||
| return brand; | |||
| } | |||
| public void setBrand(String brand) { | |||
| this.brand = brand; | |||
| } | |||
| public Integer getCorpPapersType() { | |||
| return corpPapersType; | |||
| } | |||
| public void setCorpPapersType(Integer corpPapersType) { | |||
| this.corpPapersType = corpPapersType; | |||
| } | |||
| public String getCorpPapersNumber() { | |||
| return corpPapersNumber; | |||
| } | |||
| public void setCorpPapersNumber(String corpPapersNumber) { | |||
| this.corpPapersNumber = corpPapersNumber; | |||
| } | |||
| public String getCorpPapersPerson() { | |||
| return corpPapersPerson; | |||
| } | |||
| public void setCorpPapersPerson(String corpPapersPerson) { | |||
| this.corpPapersPerson = corpPapersPerson; | |||
| } | |||
| public String getCorpPapersPicFace() { | |||
| return corpPapersPicFace; | |||
| } | |||
| public void setCorpPapersPicFace(String corpPapersPicFace) { | |||
| this.corpPapersPicFace = corpPapersPicFace; | |||
| } | |||
| public String getCorpPapersPicBack() { | |||
| return corpPapersPicBack; | |||
| } | |||
| public void setCorpPapersPicBack(String corpPapersPicBack) { | |||
| this.corpPapersPicBack = corpPapersPicBack; | |||
| } | |||
| public Integer getTaxpayerType() { | |||
| return taxpayerType; | |||
| } | |||
| public void setTaxpayerType(Integer taxpayerType) { | |||
| this.taxpayerType = taxpayerType; | |||
| } | |||
| public Integer getTaxPapersType() { | |||
| return taxPapersType; | |||
| } | |||
| public void setTaxPapersType(Integer taxPapersType) { | |||
| this.taxPapersType = taxPapersType; | |||
| } | |||
| public String getTaxPapersNumber() { | |||
| return taxPapersNumber; | |||
| } | |||
| public void setTaxPapersNumber(String taxPapersNumber) { | |||
| this.taxPapersNumber = taxPapersNumber; | |||
| } | |||
| public Integer getInvoiceType() { | |||
| return invoiceType; | |||
| } | |||
| public void setInvoiceType(Integer invoiceType) { | |||
| this.invoiceType = invoiceType; | |||
| } | |||
| public String getInvoiceBuyer() { | |||
| return invoiceBuyer; | |||
| } | |||
| public void setInvoiceBuyer(String invoiceBuyer) { | |||
| this.invoiceBuyer = invoiceBuyer; | |||
| } | |||
| public String getTaxpayerIdentifyNumber() { | |||
| return taxpayerIdentifyNumber; | |||
| } | |||
| public void setTaxpayerIdentifyNumber(String taxpayerIdentifyNumber) { | |||
| this.taxpayerIdentifyNumber = taxpayerIdentifyNumber; | |||
| } | |||
| public String getInvoiceAddressPhone() { | |||
| return invoiceAddressPhone; | |||
| } | |||
| public void setInvoiceAddressPhone(String invoiceAddressPhone) { | |||
| this.invoiceAddressPhone = invoiceAddressPhone; | |||
| } | |||
| public String getBankAccountNumber() { | |||
| return bankAccountNumber; | |||
| } | |||
| public void setBankAccountNumber(String bankAccountNumber) { | |||
| this.bankAccountNumber = bankAccountNumber; | |||
| } | |||
| public String getBankAccountPerson() { | |||
| return bankAccountPerson; | |||
| } | |||
| public void setBankAccountPerson(String bankAccountPerson) { | |||
| this.bankAccountPerson = bankAccountPerson; | |||
| } | |||
| public String getBankName() { | |||
| return bankName; | |||
| } | |||
| public void setBankName(String bankName) { | |||
| this.bankName = bankName; | |||
| } | |||
| public String getBankAccount() { | |||
| return bankAccount; | |||
| } | |||
| public void setBankAccount(String bankAccount) { | |||
| this.bankAccount = bankAccount; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -54,4 +54,7 @@ public interface WxMerchantService { | |||
| ResultData updateMerchantAccount(WxMerchant wxMerchant); | |||
| ResultData updateMerchantAdmin(WxMerchant wxMerchant); | |||
| ResultData updateMerchantCoprAndTax(WxMerchant wxMerchant); | |||
| } | |||
| @@ -15,6 +15,7 @@ import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.data.redis.core.StringRedisTemplate; | |||
| import org.springframework.stereotype.Service; | |||
| import java.math.BigDecimal; | |||
| @@ -66,6 +67,9 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| @Autowired | |||
| WxCUserCarMapper wxCUserCarMapper; | |||
| @Autowired | |||
| StringRedisTemplate stringRedisTemplate; | |||
| //出租与未出租*********************************************** | |||
| private Map<String, Object> shopRunning(String tenantId) { | |||
| @@ -632,12 +636,15 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| private void updateToken(WxWiWideInfo wiWideInfo, String token) { | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.add(Calendar.MINUTE, 45); | |||
| logger.info("数据表中的数据:"+JSONObject.toJSONString(wiWideInfo)); | |||
| WxWiWideInfo record = new WxWiWideInfo(); | |||
| record.setId(wiWideInfo.getId()); | |||
| record.setToken(token); | |||
| record.setExpiredTime(instance.getTime()); | |||
| try { | |||
| logger.info("要更新的数据before>>>>>>>>>>"+JSONObject.toJSONString(record)); | |||
| wxWiwideInfoMapper.updateToken(record); | |||
| logger.info("要更新的数据after>>>>>>>>>>"+JSONObject.toJSONString(record)); | |||
| } catch (MallinkException e) { | |||
| logger.info("更新TOKEN失败:商场" + wiWideInfo.getTenantId()); | |||
| } | |||
| @@ -646,12 +653,14 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| private String getWiwideToken(WxWiWideInfo wiWideInfo) { | |||
| Date expiredTime = wiWideInfo.getExpiredTime(); | |||
| String token = wiWideInfo.getToken(); | |||
| logger.info("wiwideinfo:"+JSONObject.toJSONString(wiWideInfo)); | |||
| if (StringUtils.isEmpty(token) || expiredTime == null || expiredTime.before(new Date())) { | |||
| String data = WiwideUtil.queryToken(wiWideInfo); | |||
| token = (String) JSONObject.parseObject(data).get("data"); | |||
| logger.info("bid:"+wiWideInfo.getWiwideId()+",newdata:"+data); | |||
| updateToken(wiWideInfo, token); | |||
| } | |||
| logger.info("返回的token:"+token); | |||
| return token; | |||
| } | |||
| @@ -25,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional; | |||
| import java.util.*; | |||
| import java.util.stream.Collectors; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @@ -363,6 +364,43 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| } | |||
| @Transactional(isolation=Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | |||
| @Override | |||
| public ResultData updateMerchantCoprAndTax(WxMerchant wxMerchant) { | |||
| try { | |||
| if (wxMerchant.getId() == null) { | |||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||
| } | |||
| WxMerchant merchant = wxMerchantMapper.selectByPrimaryKey(wxMerchant.getId()); | |||
| merchant.setCorpPapersType(wxMerchant.getCorpPapersType()); | |||
| merchant.setCorpPapersNumber(wxMerchant.getCorpPapersNumber()); | |||
| merchant.setCorpPapersPerson(wxMerchant.getCorpPapersPerson()); | |||
| merchant.setCorpPapersPicFace(wxMerchant.getCorpPapersPicFace()); | |||
| merchant.setCorpPapersPicBack(wxMerchant.getCorpPapersPicBack()); | |||
| merchant.setTaxpayerType(wxMerchant.getTaxpayerType()); | |||
| merchant.setTaxPapersType(wxMerchant.getTaxPapersType()); | |||
| merchant.setTaxPapersNumber(wxMerchant.getTaxPapersNumber()); | |||
| merchant.setInvoiceType(wxMerchant.getInvoiceType()); | |||
| merchant.setInvoiceBuyer(wxMerchant.getInvoiceBuyer()); | |||
| merchant.setTaxpayerIdentifyNumber(wxMerchant.getTaxpayerIdentifyNumber()); | |||
| merchant.setInvoiceAddressPhone(wxMerchant.getInvoiceAddressPhone()); | |||
| merchant.setBankAccountNumber(wxMerchant.getBankAccountNumber()); | |||
| merchant.setBankAccountPerson(wxMerchant.getBankAccountPerson()); | |||
| merchant.setBankName(wxMerchant.getBankName()); | |||
| merchant.setBankAccount(wxMerchant.getBankAccount()); | |||
| //更新商户 | |||
| Date date = new Date(); | |||
| merchant.setUpdateDate(date); | |||
| wxMerchantMapper.updateByPrimaryKeySelective(merchant); | |||
| } catch (Exception e) { | |||
| logger.error("db failed: 更新法人及税务信息失败, e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "操作成功"); | |||
| } | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| @Override | |||
| public ResultData updateMerchantAdmin(WxMerchant wxMerchant) { | |||
| @@ -13,11 +13,35 @@ | |||
| <result column="car_params" jdbcType="VARCHAR" property="carParams" /> | |||
| <result column="status" jdbcType="INTEGER" property="status" /> | |||
| <result column="link_person" jdbcType="VARCHAR" property="linkPerson" /> | |||
| <result column="business_id" jdbcType="VARCHAR" property="businessId" /> | |||
| <result column="shop_type" jdbcType="INTEGER" property="shopType" /> | |||
| <result column="brand" jdbcType="VARCHAR" property="brand" /> | |||
| <result column="corp_papers_type" jdbcType="INTEGER" property="corpPapersType" /> | |||
| <result column="corp_papers_number" jdbcType="VARCHAR" property="corpPapersNumber" /> | |||
| <result column="corp_papers_person" jdbcType="VARCHAR" property="corpPapersPerson" /> | |||
| <result column="corp_papers_pic_face" jdbcType="VARCHAR" property="corpPapersPicFace" /> | |||
| <result column="corp_papers_pic_back" jdbcType="VARCHAR" property="corpPapersPicBack" /> | |||
| <result column="taxpayer_type" jdbcType="INTEGER" property="taxpayerType" /> | |||
| <result column="tax_papers_type" jdbcType="INTEGER" property="taxPapersType" /> | |||
| <result column="tax_papers_number" jdbcType="VARCHAR" property="taxPapersNumber" /> | |||
| <result column="invoice_type" jdbcType="INTEGER" property="invoiceType" /> | |||
| <result column="invoice_buyer" jdbcType="VARCHAR" property="invoiceBuyer" /> | |||
| <result column="taxpayer_identify_number" jdbcType="VARCHAR" property="taxpayerIdentifyNumber" /> | |||
| <result column="invoice_address_phone" jdbcType="VARCHAR" property="invoiceAddressPhone" /> | |||
| <result column="bank_account_number" jdbcType="VARCHAR" property="bankAccountNumber" /> | |||
| <result column="bank_account_person" jdbcType="VARCHAR" property="bankAccountPerson" /> | |||
| <result column="bank_name" jdbcType="VARCHAR" property="bankName" /> | |||
| <result column="bank_account" jdbcType="VARCHAR" property="bankAccount" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`img_url`,`name`,`link_phone`,`create_date`,`update_date`,`car_vendor_type`,`car_params`,`status`,`link_person` | |||
| `id`,`tenant_id`,`img_url`,`name`,`link_phone`,`create_date`,`update_date`,`car_vendor_type`,`car_params`,`status`,`link_person`, | |||
| `business_id`,`shop_type`,`brand`,`corp_papers_type`,`corp_papers_number`,`corp_papers_person`,`corp_papers_pic_face`, | |||
| `corp_papers_pic_back`,`taxpayer_type`,`tax_papers_type`,`tax_papers_number`,`invoice_type`,`invoice_buyer`, | |||
| `taxpayer_identify_number``invoice_address_phone`,`bank_account_number`,`bank_account_person`,`bank_name`,`bank_account` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||