Просмотр исходного кода

Merge tag 'refs/tags/jenkins-back-end-1484' into release

develop
release_toaliyun_real
gongbiao 7 лет назад
Родитель
Сommit
6d5280c6c1
32 измененных файлов: 284 добавлений и 149 удалений
  1. +3
    -18
      mallinkAdmin/src/main/java/com/iformall/controller/HomeController.java
  2. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/MallUserInfoController.java
  3. +2
    -10
      mallinkAdmin/src/main/java/com/iformall/controller/WechatLoginController.java
  4. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/WxBillRentController.java
  5. +1
    -0
      mallinkAdmin/src/main/resources/db/migration/V201904271400__UPDATE_MSG_MODEL.sql
  6. +1
    -0
      mallinkAdmin/src/main/resources/db/migration/V201904271735__UPDATE_MSG_MODEL.sql
  7. +48
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/BillStatusSchedule.java
  8. +1
    -1
      mallinkService/src/main/java/com/iformall/common/ErrorCode.java
  9. +12
    -0
      mallinkService/src/main/java/com/iformall/domain/po/MallUserInfo.java
  10. +11
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxMsgValidationcode.java
  11. +1
    -2
      mallinkService/src/main/java/com/iformall/domain/po/msg/WxMsgRecord.java
  12. +11
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxBillAll.java
  13. +1
    -1
      mallinkService/src/main/java/com/iformall/enums/EnumBillType.java
  14. +44
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumBillTypeStr.java
  15. +9
    -5
      mallinkService/src/main/java/com/iformall/service/WxBillAllService.java
  16. +1
    -2
      mallinkService/src/main/java/com/iformall/service/WxBillRentService.java
  17. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
  18. +24
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java
  19. +46
    -20
      mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java
  20. +13
    -53
      mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeServiceImpl.java
  21. +2
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java
  22. +2
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  23. +3
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java
  24. +3
    -0
      mallinkService/src/main/java/com/iformall/service/msg/impl/SendSmsServiceImpl.java
  25. +14
    -7
      mallinkService/src/main/resources/mapper/WxBillAllMapper.xml
  26. +4
    -4
      mallinkService/src/main/resources/mapper/WxBillDepositMapper.xml
  27. +8
    -2
      mallinkService/src/main/resources/mapper/WxBillOtherMapper.xml
  28. +1
    -1
      mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml
  29. +1
    -1
      mallinkService/src/main/resources/mapper/WxBillRentMapper.xml
  30. +5
    -5
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml
  31. +7
    -6
      mallinkService/src/main/resources/mapper/WxMsgValidationcodeMapper.xml
  32. +1
    -1
      mallinkService/src/main/resources/mapper/WxShopMapper.xml

+ 3
- 18
mallinkAdmin/src/main/java/com/iformall/controller/HomeController.java Просмотреть файл

@@ -138,12 +138,7 @@ public class HomeController extends BaseController {
}
if(isLogin) {
MallUserInfo info = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo);
info.setPassword("保密");
if(StringUtils.isNotBlank(info.getBopenId()))
info.setBopenId("保密");
if(StringUtils.isNotBlank(info.getWebOpenId())) {
info.setWebOpenId("保密");
}
info.protectInfos();

String menus = mallUserRoleService.getPermissionsByUser(info);
if(menus != null) {
@@ -222,12 +217,7 @@ public class HomeController extends BaseController {
UseriFormallToken token = new UseriFormallToken(user.getUsername());
subject.login(token);
MallUserInfo info = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo);
info.setPassword("保密");
if(StringUtils.isNotBlank(info.getBopenId()))
info.setBopenId("保密");
if(StringUtils.isNotBlank(info.getWebOpenId())) {
info.setWebOpenId("保密");
}
info.protectInfos();
String menus = mallUserRoleService.getPermissionsByUser(info);
if(menus != null) {
info.setMenus(menus);
@@ -324,12 +314,7 @@ public class HomeController extends BaseController {
UseriFormallToken token = new UseriFormallToken(user.getUsername());
subject.login(token);
MallUserInfo info = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo);
info.setPassword("保密");
if(StringUtils.isNotBlank(info.getBopenId()))
info.setBopenId("保密");
if(StringUtils.isNotBlank(info.getWebOpenId())) {
info.setWebOpenId("保密");
}
info.protectInfos();
String menus = mallUserRoleService.getPermissionsByUser(info);
if(menus != null) {
info.setMenus(menus);


+ 1
- 1
mallinkAdmin/src/main/java/com/iformall/controller/MallUserInfoController.java Просмотреть файл

@@ -298,7 +298,7 @@ public class MallUserInfoController extends BaseController {
public ResultData getUserInfo() {
logger.debug("[" + getIpAddr() + "] MallUserInfoController::getUserInfo");
MallUserInfo info = getUser();
info.setPassword("保密");
info.protectInfos();
if (info.getIsAdmin().equals(EnumUserAdmin.ADMIN.getCode())) { // isAdmin
MallPermission q = new MallPermission();
PageInfo<MallPermission> list = mallPermissionService.listAsPage(q, 1, 100);


+ 2
- 10
mallinkAdmin/src/main/java/com/iformall/controller/WechatLoginController.java Просмотреть файл

@@ -145,11 +145,7 @@ public class WechatLoginController extends BaseController {
}
if(isLogin) {
MallUserInfo info = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo);
info.setPassword("保密");
info.setBopenId("保密");
if(StringUtils.isNotBlank(info.getWebOpenId())) {
info.setWebOpenId("保密");
}
info.protectInfos();
String menus = mallUserRoleService.getPermissionsByUser(info);
if(menus != null) {
info.setMenus(menus);
@@ -284,11 +280,7 @@ public class WechatLoginController extends BaseController {
UseriFormallToken token = new UseriFormallToken(userInfo.getUsername());
subject.login(token);
MallUserInfo info = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo);
info.setPassword("保密");
info.setBopenId("保密");
if(StringUtils.isNotBlank(info.getWebOpenId())) {
info.setWebOpenId("保密");
}
info.protectInfos();
String menus = mallUserRoleService.getPermissionsByUser(info);
if(menus != null) {
info.setMenus(menus);


+ 1
- 1
mallinkAdmin/src/main/java/com/iformall/controller/WxBillRentController.java Просмотреть файл

@@ -107,7 +107,7 @@ public class WxBillRentController extends BaseController {
@SystemControllerLog(description = "租赁押金账单-更新营业额")
public ResultData updateRevenue(@RequestBody WxBillRent wxBillRent) {
logger.debug("[" + getIpAddr() + "] WxBillRentController::updateRevenue");
return wxBillRentService.updateRevenue(wxBillRent);
return wxBillRentService.updateRevenue(wxBillRent, getUser());
}




+ 1
- 0
mallinkAdmin/src/main/resources/db/migration/V201904271400__UPDATE_MSG_MODEL.sql Просмотреть файл

@@ -0,0 +1 @@
update wx_msg_validationcode_model set content='{s6}(动态验证码),请在5分钟内填写' where type in (1,6);

+ 1
- 0
mallinkAdmin/src/main/resources/db/migration/V201904271735__UPDATE_MSG_MODEL.sql Просмотреть файл

@@ -0,0 +1 @@
update wx_msg_validationcode_model set content='{s6}(动态验证码),请在5分钟内填写',minutes=5 where type in (1,6);

+ 48
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/BillStatusSchedule.java Просмотреть файл

@@ -0,0 +1,48 @@
package com.iformall.schedule;

import com.iformall.domain.po.WxMall;
import com.iformall.domain.vo.WxBillAll;
import com.iformall.mapper.WxMallMapper;
import com.iformall.service.WxBillAllService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;

/**
* @author gongbiao
*/
@Component
public class BillStatusSchedule {

private final Logger logger = LoggerFactory.getLogger(this.getClass());

@Autowired
private WxBillAllService wxBillAllService;

@Autowired
private WxMallMapper wxMallMapper;

/**
* 每天1点执行
*/
@Scheduled(cron = "0 0 1 * * ?")
public void updateBillStatus() {
logger.info("账单状态更新开始");

List<WxMall> wxMalls = wxMallMapper.findList(null);
for (WxMall wxMall : wxMalls) {
String tenantId = wxMall.getTenantId();
WxBillAll wxBillAll = new WxBillAll();
wxBillAll.setTenantId(tenantId);
wxBillAllService.updateBillStatus(wxBillAll);
}

logger.info("账单状态更新结束");
}


}

+ 1
- 1
mallinkService/src/main/java/com/iformall/common/ErrorCode.java Просмотреть файл

@@ -239,7 +239,7 @@ public enum ErrorCode{
* 核销
*/
VERIFY_ERROR(12050, "核销异常"),
MSG_REPEAT_SEND(12061, "短信重发送"),
MSG_REPEAT_SEND(12061, "短信重发送"),

/**
* 解单


+ 12
- 0
mallinkService/src/main/java/com/iformall/domain/po/MallUserInfo.java Просмотреть файл

@@ -261,6 +261,18 @@ public class MallUserInfo implements Serializable {
this.webOpenId = webOpenId;
}

public void protectInfos() {
if(StringUtils.isNotBlank(this.password)) {
setPassword("保密");
}
if(StringUtils.isNotBlank(this.bopenId)) {
setBopenId("保密");
}
if(StringUtils.isNotBlank(this.webOpenId)) {
setWebOpenId("保密");
}
}

public static enum Field
{
Id_ASC("`id` ASC"),Id_DESC("`id` DESC")


+ 11
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxMsgValidationcode.java Просмотреть файл

@@ -67,6 +67,17 @@ public class WxMsgValidationcode implements Serializable {
@io.swagger.annotations.ApiModelProperty(value="",name="appid")
private String appid;

@Transient
private String createtimeStr;

public String getCreatetimeStr() {
return createtimeStr;
}

public void setCreatetimeStr(String createtimeStr) {
this.createtimeStr = createtimeStr;
}

public String getPhone() {
return phone;
}


+ 1
- 2
mallinkService/src/main/java/com/iformall/domain/po/msg/WxMsgRecord.java Просмотреть файл

@@ -1,12 +1,11 @@
package com.iformall.domain.po.msg;

import com.iformall.domain.po.msg.BaseMsg;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.Map;



+ 11
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxBillAll.java Просмотреть файл

@@ -1,5 +1,7 @@
package com.iformall.domain.vo;

import io.swagger.models.auth.In;

import java.util.List;

/**
@@ -65,6 +67,15 @@ public class WxBillAll {
@io.swagger.annotations.ApiModelProperty(value = "欠缴总额", name = "totalOwe")
private Integer totalOwe;

private List<Integer> billTypeList;

public List<Integer> getBillTypeList() {
return billTypeList;
}

public void setBillTypeList(List<Integer> billTypeList) {
this.billTypeList = billTypeList;
}

public Integer getRentOwe() {
return rentOwe;


+ 1
- 1
mallinkService/src/main/java/com/iformall/enums/EnumBillType.java Просмотреть файл

@@ -13,7 +13,7 @@ public enum EnumBillType {
WATER(4, "水费"),
POWER(5, "电费"),
ROUTINE(6, "其他"),
AIR_CONDITIONING(7, "空调费"),
AIR_CONDITIONING(7, "空调费")
;

public static EnumBillType getEnum(Integer code) {


+ 44
- 0
mallinkService/src/main/java/com/iformall/enums/EnumBillTypeStr.java Просмотреть файл

@@ -0,0 +1,44 @@
package com.iformall.enums;


/**
* Created by Stormeye on 2018/08/09.
*/
public enum EnumBillTypeStr {

RENT(1, "租金"),
RENT_D(2, "租赁押金"),
PROPERTY(3,"物业费"),
PROPERTY_D(4, "物业押金"),
W(5, "水费"),
D(6, "电费"),
K(9, "空调费"),
O(7, "其他"),
O_D(8, "其他押金"),
;

public static EnumBillTypeStr getEnum(Integer code) {
for (EnumBillTypeStr value : values()) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}

private Integer code;
private String message;

EnumBillTypeStr(Integer code, String message) {
this.code = code;
this.message = message;
}

public Integer getCode() {
return code;
}

public String getMessage() {
return message;
}
}

+ 9
- 5
mallinkService/src/main/java/com/iformall/service/WxBillAllService.java Просмотреть файл

@@ -12,19 +12,19 @@ import java.util.Map;
*/
public interface WxBillAllService {

Map<String,Object> listAsPage(WxBillAll wxBillAll, Integer pageNum, Integer pageSize);
Map<String, Object> listAsPage(WxBillAll wxBillAll, Integer pageNum, Integer pageSize);

List<Map<String,Object>> listBillOweAndWaitPay(WxBillAll wxBillAll);
List<Map<String, Object>> listBillOweAndWaitPay(WxBillAll wxBillAll);

ResultData listBill(WxBillAll wxBillAll);

void updateBill(Map<String,Object> bill);
void updateBill(Map<String, Object> bill);

void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillAll wxBillAll);

Object getBillInfo(WxBillAll wxBillAll);

Long hasOweBill(Long contractId,Integer type);
Long hasOweBill(Long contractId, Integer type);

/**
* 发送待缴通知邮件
@@ -38,10 +38,14 @@ public interface WxBillAllService {

/**
* 欠缴商户分页列表
*
* @return
*/
Map<String, Object> getOweBillAsPage(WxBillAll record, Integer pageNum, Integer pageSize);


void exportOweMerchant(WxBillAll record, HttpServletRequest request, HttpServletResponse response);
}

void updateBillStatus(WxBillAll record);

}

+ 1
- 2
mallinkService/src/main/java/com/iformall/service/WxBillRentService.java Просмотреть файл

@@ -4,7 +4,6 @@ import java.util.*;
import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData;
import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBillProperty;
import com.iformall.domain.po.WxBillRent;

/**
@@ -54,7 +53,7 @@ public interface WxBillRentService {

Object detail(Long id);

ResultData updateRevenue(WxBillRent wxBillRent);
ResultData updateRevenue(WxBillRent wxBillRent, MallUserInfo user);


ResultData updateLatePayStatus(WxBillRent wxBillRent);


+ 2
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java Просмотреть файл

@@ -549,8 +549,8 @@ public class WxBillAllServiceImpl implements WxBillAllService {
return count;
}

private void updateBillStatus(WxBillAll record) {
@Override
public void updateBillStatus(WxBillAll record) {
logger.info("更新各账单状态开始");
//更新其他押金账单
//WxBillOtherDeposit wxBillOtherDeposit = new WxBillOtherDeposit();


+ 24
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java Просмотреть файл

@@ -222,11 +222,14 @@ public class WxBillRentServiceImpl implements WxBillRentService {
return result;
}

@Transactional(rollbackFor = {Exception.class})
@Override
public ResultData updateRevenue(WxBillRent record) {
public ResultData updateRevenue(WxBillRent record, MallUserInfo user) {
WxBillRent wxBillRent = wxBillRentMapper.selectByPrimaryKey(record.getId());
Long oldPrice = wxBillRent.getReceivePay();
Long newPrice = record.getReceivePay();
wxBillRent.setRevenue(record.getRevenue());
wxBillRent.setReceivePay(record.getReceivePay());
wxBillRent.setReceivePay(oldPrice.equals(newPrice) ? oldPrice : newPrice);
wxBillRent.setUpdatetime(new Date());
try {
wxBillRentMapper.updateByPrimaryKeySelective(wxBillRent);
@@ -234,6 +237,25 @@ public class WxBillRentServiceImpl implements WxBillRentService {
logger.error("修改营业额失败,e:" + e.getMessage());
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "修改营业额失败");
}
if (!oldPrice.equals(newPrice)) {
//日志
WxBillAction wxBillAction = new WxBillAction();
wxBillAction.setBillId(wxBillRent.getId());
String oldPriceStr = new BigDecimal(oldPrice).divide(new BigDecimal(100)).toPlainString();
String newPriceStr = new BigDecimal(newPrice).divide(new BigDecimal(100)).toPlainString();
wxBillAction.setDetails("录入营业额时应收金额" + oldPriceStr + "元变更成" + newPriceStr + "元");
wxBillAction.setAction(EnumBillAction.UPDATE_BILL.getCode());
wxBillAction.setUserId(user.getId());
wxBillAction.setUserName(user.getName());
wxBillAction.setPhone(user.getPhone());
wxBillAction.setTenantId(wxBillRent.getTenantId());
try {
wxBillActionService.save(wxBillAction);
} catch (Exception e) {
logger.error("添加租赁账单行为日志,e:" + e.getMessage());
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "修改营业额失败");
}
}
return new ResultData(Result.SUCCESS, "修改营业额成功", wxBillRent);
}



+ 46
- 20
mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java Просмотреть файл

@@ -71,6 +71,8 @@ public class WxChartServiceImpl implements WxChartDataService {
@Autowired
WxBillOtherMapper wxBillOtherMapper;
@Autowired
WxBillAllMapper wxBillAllMapper;
@Autowired
MarkingDataReportService markingDataReportService;

@Override
@@ -2294,12 +2296,6 @@ public class WxChartServiceImpl implements WxChartDataService {
return new ResultData(datamap);
}

public static void main(String[] args) {
double a = 0.0;
System.out.println(a==0.0);
System.out.println();
}

/**
* 费用收缴数据
* @param tenantId
@@ -2403,48 +2399,78 @@ public class WxChartServiceImpl implements WxChartDataService {
datamap.put("otherzjsjl", 0);
}

//欠缴数据
//==========欠缴数据=========
BigDecimal totalOwe = new BigDecimal(0);
payinfo = wxBillRentMapper.queryOweInfo(params);
WxBillAll wxBillAll = new WxBillAll();
wxBillAll.setTenantId(tenantId);
wxBillAll.setMonth(new SimpleDateFormat("yyyy-MM").format(startDate));
wxBillAll.setStatus(EnumBillRentStatus.NOT_PAID.getCode());
List<Integer> billTypeList = new ArrayList<>();
billTypeList.add(EnumBillTypeStr.RENT.getCode());
wxBillAll.setBillTypeList(billTypeList);
payinfo = wxBillAllMapper.queryOweInfo(wxBillAll);
if (payinfo != null) {
BigDecimal owe = (BigDecimal) payinfo.get("owe");
BigDecimal owe = ((BigDecimal) payinfo.get("owe")).divide(new BigDecimal(100));
totalOwe = totalOwe.add(owe);
datamap.put("rentOwe", owe);
} else {
datamap.put("rentOwe", 0);
}

payinfo = wxBillPropertyMapper.queryOweInfo(params);
billTypeList = new ArrayList<>();
billTypeList.add(EnumBillTypeStr.PROPERTY.getCode());
wxBillAll.setBillTypeList(billTypeList);
payinfo = wxBillAllMapper.queryOweInfo(wxBillAll);
if (payinfo != null) {
BigDecimal owe = (BigDecimal) payinfo.get("owe");
BigDecimal owe = ((BigDecimal) payinfo.get("owe")).divide(new BigDecimal(100));
totalOwe = totalOwe.add(owe);
datamap.put("propertyOwe", owe);
} else {
datamap.put("propertyOwe", 0);
}

payinfo = wxBillOtherMapper.queryOweInfo(params);
billTypeList = new ArrayList<>();
billTypeList.add(EnumBillTypeStr.O_D.getCode());
billTypeList.add(EnumBillTypeStr.PROPERTY_D.getCode());
billTypeList.add(EnumBillTypeStr.RENT_D.getCode());
wxBillAll.setBillTypeList(billTypeList);
payinfo = wxBillAllMapper.queryOweInfo(wxBillAll);
if (payinfo != null) {
BigDecimal owe = (BigDecimal) payinfo.get("owe");
BigDecimal owe = ((BigDecimal) payinfo.get("owe")).divide(new BigDecimal(100));
totalOwe = totalOwe.add(owe);
datamap.put("otherOwe", owe);
datamap.put("depositOwe", owe);
} else {
datamap.put("otherOwe", 0);
datamap.put("depositOwe", 0);
}

payinfo = wxBillDepositMapper.queryOweInfoAll(params);
billTypeList = new ArrayList<>();
billTypeList.add(EnumBillTypeStr.D.getCode());
billTypeList.add(EnumBillTypeStr.W.getCode());
billTypeList.add(EnumBillTypeStr.K.getCode());
billTypeList.add(EnumBillTypeStr.O.getCode());
wxBillAll.setBillTypeList(billTypeList);
payinfo = wxBillAllMapper.queryOweInfo(wxBillAll);
if (payinfo != null) {
BigDecimal owe = (BigDecimal) payinfo.get("owe");
BigDecimal owe = ((BigDecimal) payinfo.get("owe")).divide(new BigDecimal(100));
totalOwe = totalOwe.add(owe);
datamap.put("totalOwe", owe);
datamap.put("otherOwe", owe);
} else {
datamap.put("totalOwe", 0);
datamap.put("otherOwe", 0);
}
datamap.put("totalOwe", totalOwe);

datamap.put("totalOwe", totalOwe);
return new ResultData(datamap);
}

public static void main(String[] args) {
BigDecimal receivepay = new BigDecimal(33);
BigDecimal pay = new BigDecimal(11);
BigDecimal divide = pay.divide(receivepay, 2, BigDecimal.ROUND_UNNECESSARY);
System.out.println(divide);
double zjcjl = divide.multiply(new BigDecimal(100)).doubleValue();
System.out.println(zjcjl);
}

/**
* 营销数据
* @param tenantId


+ 13
- 53
mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeServiceImpl.java Просмотреть файл

@@ -12,6 +12,7 @@ import com.iformall.enums.*;
import com.iformall.mapper.*;
import com.iformall.mq.MqBaseProducer;
import com.iformall.service.WxMsgValidationcodeService;
import com.iformall.utils.DateUtils;
import org.apache.commons.collections.map.HashedMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -84,40 +85,19 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic
Date currentdate = new Date();
wxmsgvalidationcodelist = wxmsgvalidationcodelist.stream().filter(validationcode ->
validationcode.getExpiretime().after(currentdate)).collect(Collectors.toList());
if(wxmsgvalidationcodelist.size()>0) return new ResultData(ErrorCode.MSG_REPEAT_SEND.getCode(),ErrorCode.MSG_REPEAT_SEND.getMessage());

//2、根据tenantid查询出商场名称作为签名
/*WxMall wxMall = new WxMall();
wxMall.setTenantId(wxMsgValidationcode.getTenantId());
List<WxMall> wxmallist = wxMallMapper.findList(wxMall);*/

//3、从短信配置中查询密钥 bid 等信息
// WxMsgConfig wxMsgConfig = new WxMsgConfig();
// wxMsgConfig.setTenantId(wxMsgValidationcode.getTenantId());
// List<WxMsgConfig> wxMsgConfigs = wxMsgConfigMapper.findList(wxMsgConfig);
// if (wxMsgConfigs.size() == 0) new ResultData(ErrorCode.MSG_SEND_ERROR.getCode(),"发送失败");
// wxMsgConfig = wxMsgConfigs.get(0);
//
// WxMsgValidationcodeModel wxMsgValidationcodeModel = new WxMsgValidationcodeModel();
// wxMsgValidationcodeModel.setTenantId(wxMsgConfig.getTenantId());
// wxMsgValidationcodeModel.setType(EnumMsgModel.VALIDATION_CODE.getCode());
// wxMsgValidationcodeModel = wxMsgValidationcodeModelMapper.findList(wxMsgValidationcodeModel).get(0);
// wxMsgValidationcode.setSignature(wxMsgValidationcodeModel.getSignature());
//
// String secret = wxMsgConfig.getSecret();
// String bid = wxMsgConfig.getBid();
// String publickey = wxMsgConfig.getPublickey();
// //验证码
int code = (int) ((Math.random() * 9 + 1) * 100000);
// String phone = wxMsgValidationcode.getPhone();
// String signature = wxMsgValidationcode.getSignature();
// //内容
// String msg = wxMsgValidationcodeModel.getContent().replace("{s6}", String.valueOf(code));
// wxMsgValidationcode.setCode(String.valueOf(code));
// wxMsgValidationcode.setMsg(msg);
// String notifyUrl = wxMsgConfig.getNotifyurl();
// Integer modelId = wxMsgValidationcodeModel.getModelId();
if (wxmsgvalidationcodelist.size() > 0) {
return new ResultData(ErrorCode.MSG_REPEAT_SEND);
}
//2 判断是否已超过3条
String systemTime = DateUtils.getSystemTime("yyyy-MM-dd");
wxMsgValidationcode.setCreatetimeStr(systemTime);
List<WxMsgValidationcode> list = wxMsgValidationcodeMapper.findList(wxMsgValidationcode);
if (list.size() == 3) {
return new ResultData(ErrorCode.MSG_SEND_ERROR.getCode(), "验证码发送超限");
}

//验证码
int code = (int) ((Math.random() * 9 + 1) * 100000);

//给发起人发送驳回消息
Map<String,String> msgReplaceMap = new HashedMap();
@@ -130,26 +110,6 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic
wxMsgRecord.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode());
return new ResultData(Result.SUCCESS,"发送成功");

// String result = WiwideUtil.sendMsg(secret, bid, publickey, phone, signature, msg, notifyUrl, EnumVerifyCode.YES.getCode().toString(), modelId);
// JSONObject jsonObjectResult = JSONObject.parseObject(result);
// String ret = jsonObjectResult.get("ret").toString();
// String batchNo = jsonObjectResult.get("data").toString();
// if (ret.equals("1")) {
// final IdWorker idWorker = IdWorker.get();
// wxMsgValidationcode.setId(idWorker.nextId());
// long currentTime = System.currentTimeMillis() ;
// Date createtime=new Date(currentTime);
// Integer minutes = wxMsgValidationcodeModel.getMinutes();
// currentTime +=minutes*60*1000;
// Date expiredate=new Date(currentTime);
// wxMsgValidationcode.setExpiretime(expiredate);
// wxMsgValidationcode.setCreatetime(createtime);
// wxMsgValidationcodeMapper.insertSelective(wxMsgValidationcode);
// addMsgCallback(wxMsgValidationcode,batchNo);
// return new ResultData(Result.SUCCESS,"发送成功");
// }
// return new ResultData(ErrorCode.MSG_SEND_ERROR.getCode(),"发送失败");
}

@Override


+ 2
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java Просмотреть файл

@@ -674,7 +674,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
}

wxBillProperty.setNeedPay(needpay);
wxBillProperty.setOwe(needpay);
wxBillProperty.setOwe(0L);
wxBillProperty.setReceivePay(needpay);

//截止收租日在当前时间之前
@@ -682,6 +682,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
long day = (time.getTime() - date.getTime()) / (24 * 60 * 60 * 1000);
wxBillProperty.setStatus(EnumBillRentStatus.NOT_PAID.getCode());
wxBillProperty.setExpiredDay(day);
wxBillProperty.setOwe(needpay);
} else {//截止收租日在当前时间之后
Calendar now = Calendar.getInstance();
now.add(dayType, receivePeriod);


+ 2
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Просмотреть файл

@@ -1065,7 +1065,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}

wxBillRent.setNeedPay(needpay);
wxBillRent.setOwe(needpay);
wxBillRent.setOwe(0L);
wxBillRent.setReceivePay(needpay);

//截止收租日在当前时间之前
@@ -1073,6 +1073,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
long day = (time.getTime() - date.getTime()) / (24 * 60 * 60 * 1000);
wxBillRent.setStatus(EnumBillRentStatus.NOT_PAID.getCode());
wxBillRent.setExpiredDay(day);
wxBillRent.setOwe(needpay);
} else {//截止收租日在当前时间之后
Calendar now = Calendar.getInstance();
now.add(dayType, receivePeriod);


+ 3
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java Просмотреть файл

@@ -168,6 +168,7 @@ public class WxShopServiceImpl implements WxShopService {

@Override
public void exportNotRentShop(WxShop wxShop, HttpServletRequest request, HttpServletResponse response) {
wxShop.setStatus(EnumShopStatus.NOT_RENT.getCode());
List<Map<String,Object>> shops = wxShopMapper.notRentListMapAsPage(wxShop);
List<WxNotRentShopVo> notRentShopVoList = new ArrayList<>();
for (Map<String,Object> m:shops) {
@@ -177,9 +178,9 @@ public class WxShopServiceImpl implements WxShopService {
notRentShopVo.setFloor((String)m.get("floor"));
notRentShopVo.setFreeDay((Long) m.get("freeDay"));
notRentShopVo.setOperationArea((String) m.get("operationArea"));
Integer point = (Integer) m.get("pointType");
Integer point = (Integer) m.get("type");
if(point != null){
notRentShopVo.setPointType(EnumPointType.getEnum(point).getMessage());
notRentShopVo.setPointType(EnumRentShopType.getEnum(point).getMessage());
}
notRentShopVo.setShopNumber((String) m.get("shopNumber"));
notRentShopVoList.add(notRentShopVo);


+ 3
- 0
mallinkService/src/main/java/com/iformall/service/msg/impl/SendSmsServiceImpl.java Просмотреть файл

@@ -81,6 +81,9 @@ public class SendSmsServiceImpl implements MsgSendService {
msg = msg.replace("{"+entry.getKey()+"}", entry.getValue());
}
wxMsgValidationcode.setMsg(msg);
if(record.getDynamicContentMap() !=null) {
wxMsgValidationcode.setCode(record.getDynamicContentMap().get("s6"));
}

String notifyUrl = wxMsgConfig.getNotifyurl();
Integer modelId = wxMsgValidationcodeModel.getModelId();


+ 14
- 7
mallinkService/src/main/resources/mapper/WxBillAllMapper.xml Просмотреть файл

@@ -153,6 +153,13 @@
<if test=" null != rentShopType ">
and bill.rent_shop_type = #{rentShopType}
</if>
<if test=" null != billTypeList ">
and bill.bill_type_value in
<foreach collection="billTypeList" index="index" item="type" open="(" separator="," close=")">
#{type}
</foreach>
</if>

</select>
<select id="queryPaidInfo" parameterType="com.iformall.domain.vo.WxBillAll" resultType="hashmap">
@@ -503,36 +510,36 @@

select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent where is_preview = 0 and tenant_id = #{tenantId}
endtime,rent_shop_type from wx_bill_rent where is_preview = 0 and status = 1 and tenant_id = #{tenantId}
union
select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property where is_preview = 0 and tenant_id = #{tenantId}
endtime,rent_shop_type from wx_bill_property where is_preview = 0 and status = 1 and tenant_id = #{tenantId}
union
select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay,
res.receive_pay,res.pay,res.owe owe,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type from(
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,2 bill_type_value,'欠缴押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent_deposit where tenant_id = #{tenantId}
endtime,rent_shop_type from wx_bill_rent_deposit where status = 1 and tenant_id = #{tenantId}
union
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,4 bill_type_value,'欠缴押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property_deposit where tenant_id = #{tenantId}
endtime,rent_shop_type from wx_bill_property_deposit where status = 1 and tenant_id = #{tenantId}
union
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,8 bill_type_value,'欠缴押金' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other_deposit where tenant_id = #{tenantId}
from wx_bill_other_deposit where status = 1 and tenant_id = #{tenantId}
) res
union
select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay,
res.receive_pay,res.pay,res.owe owe,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type from(
select id,merchant_id,shop_id,tenant_id,'其他费用' name,5 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type in(1,2) and tenant_id = #{tenantId}
from wx_bill_daily where type in(1,2) and status = 1 and tenant_id = #{tenantId}
union
select id,merchant_id,shop_id,tenant_id,'其他费用' name,7 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other where tenant_id = #{tenantId}
from wx_bill_other where status = 1 and tenant_id = #{tenantId}
) res

) bill


+ 4
- 4
mallinkService/src/main/resources/mapper/WxBillDepositMapper.xml Просмотреть файл

@@ -98,7 +98,7 @@
</select>

<select id="queryPayInfoAllTotal" resultType="hashmap" parameterType="hashmap">
select sum(res.receivepay) receivepay,sum(res.pay) pay,res.tenant_id from
select round(sum(res.receivepay)/100,2) receivepay,round(sum(res.pay)/100,2) pay,res.tenant_id from
(
select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent_deposit
where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate}
@@ -115,13 +115,13 @@
select IFNULL(round(sum(res.owe)/100,2),0) owe,res.tenant_id from
(
select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_rent_deposit
where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate}
where status = 1 and tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate}
union all
select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_property_deposit
where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate}
where status = 1 and tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate}
union all
select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_other_deposit
where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate}
where status = 1 and tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate}
) res
</select>



+ 8
- 2
mallinkService/src/main/resources/mapper/WxBillOtherMapper.xml Просмотреть файл

@@ -111,8 +111,14 @@


<select id="queryOweInfo" resultType="hashmap" parameterType="hashmap">
select IFNULL(round(sum(owe)/100,2),0) owe,tenant_id from wx_bill_other
where status = 1 and tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate}
select IFNULL(round(sum(res.owe)/100,2),0) owe,res.tenant_id from
(
select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_daily
where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and status = 1
union all
select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_daily
where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and status = 1
) res
</select>

</mapper>


+ 1
- 1
mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml Просмотреть файл

@@ -122,7 +122,7 @@


<select id="queryPayInfoTotal" resultType="hashmap" parameterType="hashmap">
select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_property
select round(sum(receive_pay)/100,2) receivepay,round(sum(pay)/100,2) pay,tenant_id from wx_bill_property
where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and is_preview = 0
</select>



+ 1
- 1
mallinkService/src/main/resources/mapper/WxBillRentMapper.xml Просмотреть файл

@@ -125,7 +125,7 @@
</select>

<select id="queryPayInfoTotal" resultType="hashmap" parameterType="hashmap">
select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent
select round(sum(receive_pay)/100,2) receivepay,round(sum(pay)/100,2) pay,tenant_id from wx_bill_rent
where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and is_preview = 0
</select>



+ 5
- 5
mallinkService/src/main/resources/mapper/WxCouponMapper.xml Просмотреть файл

@@ -509,21 +509,21 @@
left join wx_coupon c on c.id = ci.coupon_id
left join wx_coupon_order co on co.id = ci.id
where c.type = 100
and c.create_date between #{startdate} and #{enddate}
and co.create_date between #{startdate} and #{enddate}
</select>

<select id="findTranCardCount" parameterType="com.iformall.domain.po.WxCoupon" resultType="Long">
select count(distinct wcs.coupon_order_id) from wx_card_info ci
left join wx_coupon c on c.id = ci.coupon_id
left join wx_card_transfer_info wcs on wcs.coupon_order_id = ci.id
where c.type = 100 and c.create_date between #{startdate} and #{enddate}
where c.type = 100 and wcs.create_date between #{startdate} and #{enddate}
</select>

<select id="findSubsidyMoney" parameterType="com.iformall.domain.po.WxCoupon" resultType="String">
select sum(round(sc.subsidy/100,2)) from wx_card_info ci
left join wx_coupon c on c.id = ci.coupon_id
left join wx_merchant_subsidy sc on sc.coupon_order_id = ci.id
where c.type = 100 and c.create_date between #{startdate} and #{enddate}
where c.type = 100 and sc.create_date between #{startdate} and #{enddate}
</select>

<select id="findCountData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap">
@@ -692,7 +692,7 @@
left join wx_coupon_order wo on wo.coupon_id = c.id
left join wx_merchant_subsidy sc on sc.coupon_order_id = wo.id
where c.type not in(8,9,100) and wo.coupon_order_status = 1
and c.create_date between #{startdate} and #{enddate}
and sc.create_date between #{startdate} and #{enddate}
</select>


@@ -760,7 +760,7 @@
left join wx_coupon c on c.id = ci.coupon_id
left join wx_coupon_order co on co.id = ci.id
where c.type = 100
and c.create_date between #{startdate} and #{enddate}
and co.create_date between #{startdate} and #{enddate}
group by xtime
</select>



+ 7
- 6
mallinkService/src/main/resources/mapper/WxMsgValidationcodeMapper.xml Просмотреть файл

@@ -22,14 +22,15 @@
<sql id="dynamicWhereConditions">
where 1 = 1
<if test=" null != id "> and `id` = #{id} </if>
<if test=" null != phone "> and `phone` = #{phone} </if>
<if test=" null != expiretime "> and `expiretime` = #{expiretime} </if>
<if test=" null != createtime "> and `createtime` = #{createtime} </if>
<if test=" null != phone "> and `phone` = #{phone} </if>
<if test=" null != expiretime ">and `expiretime` = #{expiretime}</if>
<if test=" null != createtime ">and `createtime` = #{createtime}</if>
<if test=" null != type "> and `type` = #{type} </if>
<if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if>
<if test=" null != msg "> and `msg` = #{msg} </if>
<if test=" null != signature "> and `signature` = #{signature} </if>
<if test=" null != code "> and `code` = #{code} </if>
<if test=" null != msg "> and `msg` = #{msg} </if>
<if test=" null != signature ">and `signature` = #{signature}</if>
<if test=" null != code ">and `code` = #{code}</if>
<if test=" null != createtimeStr ">and date_format(`createtime`,'%Y-%m-%d') = #{createtimeStr}</if>
<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">


+ 1
- 1
mallinkService/src/main/resources/mapper/WxShopMapper.xml Просмотреть файл

@@ -500,7 +500,7 @@
</if>
<if test="null!=status and status==1 and type!=null and type==2">
and s.id not in(
SELECT shop_id FROM wx_rent_contract WHERE tenant_id = #{tenantId} and status in(2,3,4)
SELECT shop_id FROM wx_rent_contract WHERE tenant_id = #{tenantId} and status in(1,2,3,4)
and rent_shop_type=2
)
</if>


Загрузка…
Отмена
Сохранить