| @@ -26,6 +26,7 @@ import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.core.task.AsyncTaskExecutor; | |||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import org.springframework.web.multipart.MultipartFile; | import org.springframework.web.multipart.MultipartFile; | ||||
| @@ -36,6 +37,8 @@ import java.io.*; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| import java.util.UUID; | import java.util.UUID; | ||||
| import java.util.concurrent.ExecutorService; | |||||
| import java.util.concurrent.Executors; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxAppinfo") | @RequestMapping("wxAppinfo") | ||||
| @@ -57,6 +60,9 @@ public class WxAppinfoController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private UploadController uploadController; | private UploadController uploadController; | ||||
| @Autowired | |||||
| private AsyncTaskExecutor asyncTaskExecutor; | |||||
| @ApiOperation("加载二维码") | @ApiOperation("加载二维码") | ||||
| @GetMapping("/updateQrCode") | @GetMapping("/updateQrCode") | ||||
| public void updateQrCode(String p)throws ServletException, IOException { | public void updateQrCode(String p)throws ServletException, IOException { | ||||
| @@ -65,12 +71,20 @@ public class WxAppinfoController extends BaseController { | |||||
| List<WxMerchant> list = wxMerchantMapper.findQrcodeEmptyList(); | List<WxMerchant> list = wxMerchantMapper.findQrcodeEmptyList(); | ||||
| for (WxMerchant merchant:list) { | for (WxMerchant merchant:list) { | ||||
| String param = "t:md:"+merchant.getId(); | |||||
| ResultData resultData = this.exportQrcode(null,null,merchant.getTenantId(),1,pageUrl,param,0,"","","店铺详情",true); | |||||
| Map<String,String> map = (Map)resultData.data; | |||||
| String url = map.get("url"); | |||||
| merchant.setQrCode(url); | |||||
| wxMerchantMapper.updateByPrimaryKeySelective(merchant); | |||||
| asyncTaskExecutor.execute(new Runnable() { | |||||
| @Override | |||||
| public void run() { | |||||
| // String param = "t:md:"+merchant.getId(); | |||||
| // ResultData resultData = this.exportQrcode(null,null,merchant.getTenantId(),1,pageUrl,param,0,"","","店铺详情",true); | |||||
| // Map<String,String> map = (Map)resultData.data; | |||||
| // String url = map.get("url"); | |||||
| // merchant.setQrCode(url); | |||||
| // wxMerchantMapper.updateByPrimaryKeySelective(merchant); | |||||
| } | |||||
| }); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -87,6 +87,17 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| if (wxPropertyContract == null) { | if (wxPropertyContract == null) { | ||||
| return new ResultData(ErrorCode.PROPERTY_CONTRACT_IS_NOT_FOUND); | return new ResultData(ErrorCode.PROPERTY_CONTRACT_IS_NOT_FOUND); | ||||
| } | } | ||||
| //init dateDiff | |||||
| if(wxPropertyContract.getRentalStartDate() != null && wxPropertyContract.getRentalEndDate() != null){ | |||||
| Calendar instance = Calendar.getInstance(); | |||||
| instance.setTime(wxPropertyContract.getRentalEndDate()); | |||||
| instance.add(Calendar.DATE, 1); | |||||
| int[] array = DateUtils.getDiff(wxPropertyContract.getRentalStartDate(),instance.getTime()); | |||||
| result.put("rentDiffMonth",array[0]); | |||||
| result.put("rentDiffDay",array[1]); | |||||
| } | |||||
| wxPropertyContract.setPrice(wxPropertyContract.getPrice() != null ? wxPropertyContract.getPrice() : 0); | wxPropertyContract.setPrice(wxPropertyContract.getPrice() != null ? wxPropertyContract.getPrice() : 0); | ||||
| wxPropertyContract.setDeposit(wxPropertyContract.getDeposit() != null ? wxPropertyContract.getDeposit() : 0); | wxPropertyContract.setDeposit(wxPropertyContract.getDeposit() != null ? wxPropertyContract.getDeposit() : 0); | ||||
| @@ -15,7 +15,9 @@ import com.iformall.exception.MallinkException; | |||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import com.iformall.utils.DataUtil; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import me.chanjar.weixin.common.util.DataUtils; | |||||
| import org.apache.commons.collections.map.HashedMap; | import org.apache.commons.collections.map.HashedMap; | ||||
| import org.apache.commons.io.FileUtils; | import org.apache.commons.io.FileUtils; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| @@ -117,6 +119,17 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| if (wxRentContract == null) { | if (wxRentContract == null) { | ||||
| return new ResultData(ErrorCode.RENT_CONTRACT_IS_NOT_FOUND); | return new ResultData(ErrorCode.RENT_CONTRACT_IS_NOT_FOUND); | ||||
| } | } | ||||
| //init dateDiff | |||||
| if(wxRentContract.getRentalStartDate() != null && wxRentContract.getRentalEndDate() != null){ | |||||
| Calendar instance = Calendar.getInstance(); | |||||
| instance.setTime(wxRentContract.getRentalEndDate()); | |||||
| instance.add(Calendar.DATE, 1); | |||||
| int[] array = DateUtils.getDiff(wxRentContract.getRentalStartDate(),instance.getTime()); | |||||
| result.put("rentDiffMonth",array[0]); | |||||
| result.put("rentDiffDay",array[1]); | |||||
| } | |||||
| //商场信息 | //商场信息 | ||||
| WxMall wxMall = new WxMall(); | WxMall wxMall = new WxMall(); | ||||
| wxMall.setTenantId(wxRentContract.getTenantId()); | wxMall.setTenantId(wxRentContract.getTenantId()); | ||||