Przeglądaj źródła

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

develop
release_toaliyun_real
gongbiao 6 lat temu
rodzic
commit
bf9bf53653
14 zmienionych plików z 122 dodań i 49 usunięć
  1. +6
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponSendController.java
  2. +2
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillSettleController.java
  3. +25
    -18
      mallinkAdmin/src/test/java/com/iformall/service/test/Test.java
  4. +2
    -1
      mallinkBApi/src/main/java/com/iformall/controller/WxBillController.java
  5. +5
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxBillSettle.java
  6. +37
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumFilterSettle.java
  7. +2
    -1
      mallinkService/src/main/java/com/iformall/service/WxBillSettleService.java
  8. +15
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
  9. +2
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java
  10. +12
    -12
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
  11. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxPayBillServiceImpl.java
  12. +1
    -7
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  13. +1
    -1
      mallinkService/src/main/resources/mapper/WxBillAllMapper.xml
  14. +11
    -3
      mallinkService/src/main/resources/mapper/WxBillSettleMapper.xml

+ 6
- 1
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponSendController.java Wyświetl plik

@@ -119,7 +119,12 @@ public class WxCouponSendController extends BaseController {
wxCouponSend.setCreateDate(new Date()); wxCouponSend.setCreateDate(new Date());
wxCouponSend.setUpdateDate(new Date()); wxCouponSend.setUpdateDate(new Date());


wxCouponSendService.saveOrUpdate(wxCouponSend);
try {
wxCouponSendService.saveOrUpdate(wxCouponSend);
} catch (MallinkException e) {
return new ResultData(e.getErrorCode(), e.getMessage());
}

return new ResultData(); return new ResultData();
} }




+ 2
- 1
mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillSettleController.java Wyświetl plik

@@ -8,6 +8,7 @@ import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.BaseEntity; import com.iformall.domain.po.BaseEntity;
import com.iformall.domain.po.WxBillSettle; import com.iformall.domain.po.WxBillSettle;
import com.iformall.domain.po.WxBillSettleRecord; import com.iformall.domain.po.WxBillSettleRecord;
import com.iformall.enums.EnumFilterSettle;
import com.iformall.service.WxBillAllService; import com.iformall.service.WxBillAllService;
import com.iformall.service.WxBillSettleRecordService; import com.iformall.service.WxBillSettleRecordService;
import com.iformall.service.WxBillSettleService; import com.iformall.service.WxBillSettleService;
@@ -59,7 +60,7 @@ public class WxBillSettleController extends BaseController {
@SystemControllerLog(description = "账单管理-结算单-id查找") @SystemControllerLog(description = "账单管理-结算单-id查找")
public ResultData findById(Long id) { public ResultData findById(Long id) {
logger.debug("[" + getIpAddr() + "] WxBillSettleController::findById"); logger.debug("[" + getIpAddr() + "] WxBillSettleController::findById");
return new ResultData(Result.SUCCESS, "查询成功", wxBillSettleService.getById(id));
return new ResultData(Result.SUCCESS, "查询成功", wxBillSettleService.getById(id, EnumFilterSettle.NO.getCode()));
} }


@PostMapping("addOrUpdate") @PostMapping("addOrUpdate")


+ 25
- 18
mallinkAdmin/src/test/java/com/iformall/service/test/Test.java Wyświetl plik

@@ -9,6 +9,7 @@ import com.iformall.mapper.WxBillSettleMapper;
import com.iformall.mq.MqBaseProducer; import com.iformall.mq.MqBaseProducer;
import com.iformall.service.*; import com.iformall.service.*;
import com.iformall.utils.Constant; import com.iformall.utils.Constant;
import com.iformall.utils.JsonUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.authc.UsernamePasswordToken;
@@ -110,23 +111,23 @@ public class Test {
// wxBillAll.setBillTypeValue(10); // wxBillAll.setBillTypeValue(10);
// log.debug("data:{}", JSON.toJSONString( wxBillAllService.listBill(wxBillAll))); // log.debug("data:{}", JSON.toJSONString( wxBillAllService.listBill(wxBillAll)));


WxBillSettle wxBillSettle = wxBillSettleService.getById(330875180045271040l);
WxBillSettleRecord settleRecord = new WxBillSettleRecord();
settleRecord.setSettleId(wxBillSettle.getId());
settleRecord.setSettleMoney(wxBillSettle.getBalance());
settleRecord.setSettleTime(new Date());
settleRecord.setSettleWay(EnumSettleRecordWay.WEBCAT.getCode());
settleRecord.setTenantId(wxBillSettle.getTenantId());
BigDecimal money = new BigDecimal(settleRecord.getSettleMoney()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP);
settleRecord.setDetail(EnumSettleRecordWay.getEnum(settleRecord.getSettleWay()).getMessage()+"收款"+money.toString()+"元");
wxBillSettleRecordService.saveOrUpdate(settleRecord,null,wxBillSettle.getId());
wxBillSettle.setUpdatetime(new Date());
wxBillSettle.setStatus(EnumSettleStatus.FINISH.getCode());
wxBillSettleMapper.updateByPrimaryKeySelective(wxBillSettle);
// WxBillSettle wxBillSettle = wxBillSettleService.getById(330875180045271040l);
//
//
// WxBillSettleRecord settleRecord = new WxBillSettleRecord();
// settleRecord.setSettleId(wxBillSettle.getId());
// settleRecord.setSettleMoney(wxBillSettle.getBalance());
// settleRecord.setSettleTime(new Date());
// settleRecord.setSettleWay(EnumSettleRecordWay.WEBCAT.getCode());
// settleRecord.setTenantId(wxBillSettle.getTenantId());
//
// BigDecimal money = new BigDecimal(settleRecord.getSettleMoney()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP);
// settleRecord.setDetail(EnumSettleRecordWay.getEnum(settleRecord.getSettleWay()).getMessage()+"收款"+money.toString()+"元");
// wxBillSettleRecordService.saveOrUpdate(settleRecord,null,wxBillSettle.getId());
//
// wxBillSettle.setUpdatetime(new Date());
// wxBillSettle.setStatus(EnumSettleStatus.FINISH.getCode());
// wxBillSettleMapper.updateByPrimaryKeySelective(wxBillSettle);
} }


@org.junit.Test @org.junit.Test
@@ -142,5 +143,11 @@ public class Test {
mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode());
} }



@org.junit.Test
public void testmq2(){
WxBillAll wxBillAll = new WxBillAll();
wxBillAll.setTenantId("456");
wxBillAll.setMerchantId(324754110547066880l);
System.out.println("--------"+JsonUtil.obj2Json(wxBillAllService.listBill(wxBillAll)));
}
} }

+ 2
- 1
mallinkBApi/src/main/java/com/iformall/controller/WxBillController.java Wyświetl plik

@@ -6,6 +6,7 @@ import com.iformall.common.Result;
import com.iformall.common.ResultData; import com.iformall.common.ResultData;
import com.iformall.domain.po.WxMerchant; import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.vo.WxBillAll; import com.iformall.domain.vo.WxBillAll;
import com.iformall.enums.EnumFilterSettle;
import com.iformall.enums.EnumMerchantStatus; import com.iformall.enums.EnumMerchantStatus;
import com.iformall.service.WxBillAllService; import com.iformall.service.WxBillAllService;
import com.iformall.service.WxBillSettleService; import com.iformall.service.WxBillSettleService;
@@ -91,7 +92,7 @@ public class WxBillController extends BaseController {
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
@ApiOperation("账单管理-结算单-id查找") @ApiOperation("账单管理-结算单-id查找")
public ResultData findById(Long id) { public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS, "查询成功", wxBillSettleService.getById(id));
return new ResultData(Result.SUCCESS, "查询成功", wxBillSettleService.getById(id, EnumFilterSettle.NO.getCode()));
} }


} }

+ 5
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxBillSettle.java Wyświetl plik

@@ -97,4 +97,9 @@ public class WxBillSettle extends BaseEntity {
private Integer limitStart; private Integer limitStart;
@Transient @Transient
private Integer limitEnd; private Integer limitEnd;


@Transient
@io.swagger.annotations.ApiModelProperty(value="是否过滤结算历史 1不过滤",name="filterSettleRecord")
private Integer filterSettleRecord =0;
} }

+ 37
- 0
mallinkService/src/main/java/com/iformall/enums/EnumFilterSettle.java Wyświetl plik

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

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

YES(0, "过滤"),
NO(1, "不过滤"),
;


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

private Integer code;
private String message;

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

public Integer getCode() {
return code;
}

public String getMessage() {
return message;
}
}

+ 2
- 1
mallinkService/src/main/java/com/iformall/service/WxBillSettleService.java Wyświetl plik

@@ -22,13 +22,14 @@ public interface WxBillSettleService {
*/ */
PageInfo<WxBillSettle> listAsPage(WxBillSettle record, Integer pageIndex, Integer pageSize); PageInfo<WxBillSettle> listAsPage(WxBillSettle record, Integer pageIndex, Integer pageSize);



/** /**
* 根据Id获得实体 * 根据Id获得实体
* *
* @param id * @param id
* @return * @return
*/ */
WxBillSettle getById(Long id);
WxBillSettle getById(Long id,Integer filterSettleRecord);
/** /**
* 保存或更新实体 * 保存或更新实体


+ 15
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java Wyświetl plik

@@ -127,6 +127,9 @@ public class WxBillAllServiceImpl implements WxBillAllService {
@Autowired @Autowired
WxBillSettleService wxBillSettleService; WxBillSettleService wxBillSettleService;


@Autowired
WxBillSettleRecordMapper wxBillSettleRecordMapper;

@Override @Override
public Map<String, Object> listAsPage(WxBillAll record, Integer pageIndex, Integer pageSize) { public Map<String, Object> listAsPage(WxBillAll record, Integer pageIndex, Integer pageSize) {
//更新各账单状态 //更新各账单状态
@@ -192,6 +195,16 @@ public class WxBillAllServiceImpl implements WxBillAllService {
return new ResultData(pageInfo); return new ResultData(pageInfo);
} }
List<Map<String, Object>> maps = wxBillAllMapper.listData(wxBillAll); List<Map<String, Object>> maps = wxBillAllMapper.listData(wxBillAll);
for (Map<String, Object> map:maps) {
Integer billType = ((Long)map.get("billTypeValue")).intValue();
if(EnumBillType.SETTLE.getCode().equals(billType)){
BigDecimal rp = (BigDecimal)map.get("receivePay");
WxBillSettle query = new WxBillSettle();
query.setId((Long)map.get("id"));
Long sum = wxBillSettleRecordMapper.getSumMoneyBySettleId(query);
map.put("owe",rp.subtract(new BigDecimal(sum)));
}
}
return new ResultData(maps); return new ResultData(maps);
} }


@@ -257,7 +270,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
try { try {
logger.info("更新结算单id:{}", JsonUtil.obj2Json(bill)); logger.info("更新结算单id:{}", JsonUtil.obj2Json(bill));


WxBillSettle wxBillSettle = wxBillSettleService.getById((Long)bill.get("id"));
WxBillSettle wxBillSettle = wxBillSettleService.getById((Long)bill.get("id"), EnumFilterSettle.NO.getCode());


WxBillSettleRecord settleRecord = new WxBillSettleRecord(); WxBillSettleRecord settleRecord = new WxBillSettleRecord();
settleRecord.setSettleId((Long)bill.get("id")); settleRecord.setSettleId((Long)bill.get("id"));
@@ -813,7 +826,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {


@Override @Override
public void exportSettleBill(WxBillSettle wxBillSettle, HttpServletRequest request, HttpServletResponse response) { public void exportSettleBill(WxBillSettle wxBillSettle, HttpServletRequest request, HttpServletResponse response) {
wxBillSettle = wxBillSettleService.getById(wxBillSettle.getId());
wxBillSettle = wxBillSettleService.getById(wxBillSettle.getId(), EnumFilterSettle.NO.getCode());
if(wxBillSettle.getReceiveBillIds() == null) wxBillSettle.setReceiveBillIds(new ArrayList<>()); if(wxBillSettle.getReceiveBillIds() == null) wxBillSettle.setReceiveBillIds(new ArrayList<>());
if(wxBillSettle.getPayBillIds() == null) wxBillSettle.setPayBillIds(new ArrayList<>()); if(wxBillSettle.getPayBillIds() == null) wxBillSettle.setPayBillIds(new ArrayList<>());




+ 2
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java Wyświetl plik

@@ -97,7 +97,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
} }


@Override @Override
public WxBillSettle getById(Long id){
public WxBillSettle getById(Long id,Integer filterSettleRecord){
WxBillSettle billSettle = wxBillSettleMapper.selectByPrimaryKey(id); WxBillSettle billSettle = wxBillSettleMapper.selectByPrimaryKey(id);


if(billSettle != null){ if(billSettle != null){
@@ -124,6 +124,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
//加载应收、承付、结余 //加载应收、承付、结余
WxBillSettle query = new WxBillSettle(); WxBillSettle query = new WxBillSettle();
query.setId(id); query.setId(id);
query.setFilterSettleRecord(filterSettleRecord);
query = wxBillSettleMapper.findList(query).get(0); query = wxBillSettleMapper.findList(query).get(0);
billSettle.setReceiveMoney(query.getReceiveMoney()); billSettle.setReceiveMoney(query.getReceiveMoney());
billSettle.setPayMoney(query.getPayMoney()); billSettle.setPayMoney(query.getPayMoney());


+ 12
- 12
mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java Wyświetl plik

@@ -304,7 +304,7 @@ public class WxFlowServiceImpl implements WxFlowService {
wxBillSettle.setApplyStatus(applyStatus); wxBillSettle.setApplyStatus(applyStatus);


//审批完成,账单解冻 //审批完成,账单解冻
WxBillSettle settle = wxBillSettleService.getById(businessId);
WxBillSettle settle = wxBillSettleService.getById(businessId, EnumFilterSettle.NO.getCode());
if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) {
wxBillSettle.setStatus(EnumSettleStatus.NOT_FINISH.getCode()); wxBillSettle.setStatus(EnumSettleStatus.NOT_FINISH.getCode());
wxBillSettleService.updateFreezeOrStatus(settle.getReceiveBillIds(), EnumFreezeType.DEF.getCode(),EnumBillRentStatus.PAID.getCode()); wxBillSettleService.updateFreezeOrStatus(settle.getReceiveBillIds(), EnumFreezeType.DEF.getCode(),EnumBillRentStatus.PAID.getCode());
@@ -414,12 +414,12 @@ public class WxFlowServiceImpl implements WxFlowService {
//给审批人发送代办通知短信 //给审批人发送代办通知短信
List<MallUserInfo> mallUserInfoList = getUserByProcessInstanceId(processInstance.getId()); List<MallUserInfo> mallUserInfoList = getUserByProcessInstanceId(processInstance.getId());
for (MallUserInfo mallUserInfo:mallUserInfoList) { for (MallUserInfo mallUserInfo:mallUserInfoList) {
sendAssigneeMsgAndEmail(tenantId,mallUserInfo.getPhone(),mallUserInfo.getEmail(),starterInfo.getName(),businessId,flowType);
sendAssigneeMsgAndEmail(tenantId, mallUserInfo.getPhone(), mallUserInfo.getEmail(), starterInfo.getName(), businessId, flowType, variables);
} }
return new ResultData(); return new ResultData();
} }


public void sendAssigneeMsgAndEmail(String tenantId,String phone,String email,String userName,Long businessId,Integer flowType){
public void sendAssigneeMsgAndEmail(String tenantId, String phone, String email, String userName, Long businessId, Integer flowType, List<Map<String, Object>> variables) {
Map<String,String> dynamicContentMap = new HashMap<>(); Map<String,String> dynamicContentMap = new HashMap<>();
dynamicContentMap.put("userName",userName); dynamicContentMap.put("userName",userName);
dynamicContentMap.put("page", Constant.adminPage); dynamicContentMap.put("page", Constant.adminPage);
@@ -437,7 +437,7 @@ public class WxFlowServiceImpl implements WxFlowService {
wxMsgRecord.setModelType(EnumMsgModel.FLOW_C_ASSIGNEE_NODIFY.getCode()); wxMsgRecord.setModelType(EnumMsgModel.FLOW_C_ASSIGNEE_NODIFY.getCode());
}else if(isSettle(flowType)){ }else if(isSettle(flowType)){
dynamicContentMap.put("bustype","结算单"); dynamicContentMap.put("bustype","结算单");
dynamicContentMap.put("contract", businessId.toString());
dynamicContentMap.put("contract", (String) getVariableByKey(variables, "settleNumber"));
} }
wxMsgRecord.setDynamicContentMap(dynamicContentMap); wxMsgRecord.setDynamicContentMap(dynamicContentMap);
mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode());
@@ -518,7 +518,7 @@ public class WxFlowServiceImpl implements WxFlowService {
mailMsg.setModelType(EnumMailMsgModel.MAIL_C_ASSIGNEE_NODIFY.getCode()); mailMsg.setModelType(EnumMailMsgModel.MAIL_C_ASSIGNEE_NODIFY.getCode());
}else if(isSettle(flowType)){ }else if(isSettle(flowType)){
msgReplaceMap.put("bustype","结算单"); msgReplaceMap.put("bustype","结算单");
msgReplaceMap.put("contract", businessId.toString());
msgReplaceMap.put("contract", getVariableByKey(variables, "settleNumber"));
} }
mailMsg.setDynamicContentMap(msgReplaceMap); mailMsg.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
@@ -936,7 +936,7 @@ public class WxFlowServiceImpl implements WxFlowService {
List<MallUserInfo> mallUserInfoList = getUserByProcessInstanceId(processInstanceId); List<MallUserInfo> mallUserInfoList = getUserByProcessInstanceId(processInstanceId);
for (int i = 0; i < mallUserInfoList.size(); i++) { for (int i = 0; i < mallUserInfoList.size(); i++) {
MallUserInfo mallUserInfo = mallUserInfoList.get(i); MallUserInfo mallUserInfo = mallUserInfoList.get(i);
sendAssigneeMsgAndEmail(tenantId,mallUserInfo.getPhone(),mallUserInfo.getEmail(),userName,businessId,flowType);
sendAssigneeMsgAndEmail(tenantId, mallUserInfo.getPhone(), mallUserInfo.getEmail(), userName, businessId, flowType, variables);
if(i == mallUserInfoList.size()-1){ if(i == mallUserInfoList.size()-1){
assignee += mallUserInfo.getName(); assignee += mallUserInfo.getName();
}else{ }else{
@@ -967,7 +967,7 @@ public class WxFlowServiceImpl implements WxFlowService {
msgReplaceMap.put("name",wxCoupon.getTitle()); msgReplaceMap.put("name",wxCoupon.getTitle());
}else if(isSettle(flowType)){ }else if(isSettle(flowType)){
msgReplaceMap.put("bustype","结算单"); msgReplaceMap.put("bustype","结算单");
msgReplaceMap.put("contract", businessId.toString());
msgReplaceMap.put("contract", (String) getVariableByKey(variables, "settleNumber"));
} }
wxMsgRecord.setDynamicContentMap(msgReplaceMap); wxMsgRecord.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode());
@@ -994,7 +994,7 @@ public class WxFlowServiceImpl implements WxFlowService {
msgReplaceMap.put("name",wxCoupon.getTitle()); msgReplaceMap.put("name",wxCoupon.getTitle());
}else if(isSettle(flowType)){ }else if(isSettle(flowType)){
msgReplaceMap.put("bustype","结算单"); msgReplaceMap.put("bustype","结算单");
msgReplaceMap.put("contract", businessId.toString());
msgReplaceMap.put("contract", (String) getVariableByKey(variables, "settleNumber"));
} }
mailMsg.setDynamicContentMap(msgReplaceMap); mailMsg.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
@@ -1031,7 +1031,7 @@ public class WxFlowServiceImpl implements WxFlowService {
msgReplaceMap.put("name",wxCoupon.getTitle()); msgReplaceMap.put("name",wxCoupon.getTitle());
}else if(isSettle(flowType)){ }else if(isSettle(flowType)){
msgReplaceMap.put("bustype","结算单"); msgReplaceMap.put("bustype","结算单");
msgReplaceMap.put("contract", businessId.toString());
msgReplaceMap.put("contract", (String) getVariableByKey(variables, "settleNumber"));
} }
wxMsgRecord.setDynamicContentMap(msgReplaceMap); wxMsgRecord.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode());
@@ -1058,7 +1058,7 @@ public class WxFlowServiceImpl implements WxFlowService {
msgReplaceMap.put("name",wxCoupon.getTitle()); msgReplaceMap.put("name",wxCoupon.getTitle());
}else if(isSettle(flowType)){ }else if(isSettle(flowType)){
msgReplaceMap.put("bustype","结算单"); msgReplaceMap.put("bustype","结算单");
msgReplaceMap.put("contract", businessId.toString());
msgReplaceMap.put("contract", (String) getVariableByKey(variables, "settleNumber"));
} }
mailMsg.setDynamicContentMap(msgReplaceMap); mailMsg.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
@@ -1184,7 +1184,7 @@ public class WxFlowServiceImpl implements WxFlowService {
msgReplaceMap.put("name",wxCoupon.getTitle()); msgReplaceMap.put("name",wxCoupon.getTitle());
}else if (isSettle(flowType)) { }else if (isSettle(flowType)) {
msgReplaceMap.put("bustype", "结算单"); msgReplaceMap.put("bustype", "结算单");
msgReplaceMap.put("contract", businessId.toString());
msgReplaceMap.put("contract", (String) getVariableByKey(variables, "settleNumber"));
} }
wxMsgRecord.setDynamicContentMap(msgReplaceMap); wxMsgRecord.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
@@ -1219,7 +1219,7 @@ public class WxFlowServiceImpl implements WxFlowService {
msgReplaceMap.put("name",wxCoupon.getTitle()); msgReplaceMap.put("name",wxCoupon.getTitle());
}else if(isSettle(flowType)){ }else if(isSettle(flowType)){
msgReplaceMap.put("bustype","结算单"); msgReplaceMap.put("bustype","结算单");
msgReplaceMap.put("contract", businessId.toString());
msgReplaceMap.put("contract", (String) getVariableByKey(variables, "settleNumber"));
} }
mailMsg.setDynamicContentMap(msgReplaceMap); mailMsg.setDynamicContentMap(msgReplaceMap);
mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxPayBillServiceImpl.java Wyświetl plik

@@ -105,7 +105,7 @@ public class WxPayBillServiceImpl implements WxPayBillService {
Integer billTypeValue = ((Long) bill.get("billTypeValue")).intValue(); Integer billTypeValue = ((Long) bill.get("billTypeValue")).intValue();


if(EnumBillType.SETTLE.getCode().equals(billTypeValue)){ if(EnumBillType.SETTLE.getCode().equals(billTypeValue)){
WxBillSettle wxBillSettle = wxBillSettleService.getById(record.getBillId());
WxBillSettle wxBillSettle = wxBillSettleService.getById(record.getBillId(), EnumFilterSettle.NO.getCode());
owe = wxBillSettle.getBalance(); owe = wxBillSettle.getBalance();
bill.put("owe",owe); bill.put("owe",owe);
logger.info("wxBillSettle.balance:{}",owe); logger.info("wxBillSettle.balance:{}",owe);


+ 1
- 7
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Wyświetl plik

@@ -279,8 +279,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
return ratioVo; return ratioVo;
} }
List<String> ratioList = JSONArray.parseArray(busDiscountRatio, String.class); List<String> ratioList = JSONArray.parseArray(busDiscountRatio, String.class);

ratioVo.setUseRatio("[");
ratioVo.setUseRatio(busDiscountRatio);


for (int i = 0; i < ratioList.size(); i++) { for (int i = 0; i < ratioList.size(); i++) {
BigDecimal revenue = new BigDecimal(revenueLong).divide(new BigDecimal(1000000)).setScale(8, RoundingMode.HALF_EVEN); BigDecimal revenue = new BigDecimal(revenueLong).divide(new BigDecimal(1000000)).setScale(8, RoundingMode.HALF_EVEN);
@@ -316,7 +315,6 @@ public class WxRentContractServiceImpl implements WxRentContractService {
if (revenue.compareTo(start) >= 0 && revenue.compareTo(end)<= 0){ if (revenue.compareTo(start) >= 0 && revenue.compareTo(end)<= 0){
ratioVo.setRatio(ratio); ratioVo.setRatio(ratio);
ratioVo.setPrice(countPrice(ratioVo.getRatio(),revenueLong,timeType,period,from)); ratioVo.setPrice(countPrice(ratioVo.getRatio(),revenueLong,timeType,period,from));
ratioVo.setUseRatio(ratioVo.getUseRatio()+"\""+e+"\",");
break; break;
} }
}else if(e.indexOf(">") >= 0){ }else if(e.indexOf(">") >= 0){
@@ -343,7 +341,6 @@ public class WxRentContractServiceImpl implements WxRentContractService {


if (revenue.compareTo(end) >= 0){ if (revenue.compareTo(end) >= 0){
ratioVo.setRatio(ratio); ratioVo.setRatio(ratio);
ratioVo.setUseRatio(ratioVo.getUseRatio()+"\""+e+"\",");


//计算超出部分 //计算超出部分
BigDecimal payRatio = new BigDecimal(ratio).divide(new BigDecimal(10000)); BigDecimal payRatio = new BigDecimal(ratio).divide(new BigDecimal(10000));
@@ -375,9 +372,6 @@ public class WxRentContractServiceImpl implements WxRentContractService {
} }
} }
} }
if(!"[".equals(ratioVo.getUseRatio())) {
ratioVo.setUseRatio(ratioVo.getUseRatio().substring(0, ratioVo.getUseRatio().lastIndexOf(",")) + "]");
}
return ratioVo; return ratioVo;
} }




+ 1
- 1
mallinkService/src/main/resources/mapper/WxBillAllMapper.xml Wyświetl plik

@@ -810,7 +810,7 @@
left join wx_business xb on(m.business_id = xb.id) left join wx_business xb on(m.business_id = xb.id)
left join wx_rent_contract rc on(rc.merchant_id = m.id) left join wx_rent_contract rc on(rc.merchant_id = m.id)
where m.status=1 where m.status=1
) tt where tt.receivePay >0 and tt.payOut>0
) tt where 1=1


<if test=" null != tenantId"> and tt.tenant_id = #{tenantId} </if> <if test=" null != tenantId"> and tt.tenant_id = #{tenantId} </if>
<if test=" null != merchantId"> and tt.id = #{merchantId} </if> <if test=" null != merchantId"> and tt.id = #{merchantId} </if>


+ 11
- 3
mallinkService/src/main/resources/mapper/WxBillSettleMapper.xml Wyświetl plik

@@ -51,9 +51,16 @@
</sql> </sql>


<select id="findList" parameterType="com.iformall.domain.po.WxBillSettle" resultMap="BaseResultMap"> <select id="findList" parameterType="com.iformall.domain.po.WxBillSettle" resultMap="BaseResultMap">
select tt.*,(tt.receiveMoney-tt.payMoney-
(select IFNULL(sum(settle_money),0) from wx_bill_settle_record where settle_id = tt.id)
) balance from (
select tt.*
<if test="0 == filterSettleRecord">
,(tt.receiveMoney-tt.payMoney-
(select IFNULL(sum(settle_money),0) from wx_bill_settle_record where settle_id = tt.id)
) balance
</if>
<if test="1 == filterSettleRecord">
,(tt.receiveMoney-tt.payMoney) balance
</if>
from (
select s.*,m.name merchantName, select s.*,m.name merchantName,
(select IFNULL(sum(bill.owe),0) from wx_bill_settle_bill bb left join (select IFNULL(sum(bill.owe),0) from wx_bill_settle_bill bb left join
(select id,merchant_id,shop_id,tenant_id,1 bill_type_value,'租金' (select id,merchant_id,shop_id,tenant_id,1 bill_type_value,'租金'
@@ -141,5 +148,6 @@
</select> </select>





</mapper> </mapper>



Ładowanie…
Anuluj
Zapisz