java110
2021-10-17 755ea91d2ffb2f5ffa5c5cc75a114c2910bdefa1
service-common/src/main/java/com/java110/common/cmd/machine/GetCarMachineQrCodeUrl.java
@@ -21,6 +21,8 @@
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.core.event.cmd.AbstractServiceCmdListener;
import com.java110.core.event.cmd.CmdEvent;
import com.java110.dto.smallWeChat.SmallWeChatDto;
import com.java110.intf.store.ISmallWeChatInnerServiceSMO;
import com.java110.utils.cache.MappingCache;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
@@ -29,6 +31,8 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import java.util.List;
/**
 * 类表述:保存
@@ -50,6 +54,9 @@
    @Autowired
    private IMachineOpenDoorBMO machineOpenDoorBMOImpl;
    @Autowired
    private ISmallWeChatInnerServiceSMO smallWeChatInnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含小区信息");
@@ -60,8 +67,15 @@
    @Override
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        SmallWeChatDto smallWeChatDto = new SmallWeChatDto();
        smallWeChatDto.setObjId(reqJson.getString("communityId"));
        smallWeChatDto.setWeChatType(SmallWeChatDto.WECHAT_TYPE_PUBLIC);
        List<SmallWeChatDto> smallWeChatDtos = smallWeChatInnerServiceSMOImpl.querySmallWeChats(smallWeChatDto);
        String ownerUrl = MappingCache.getValue("OWNER_WECHAT_URL");
        ownerUrl += ("/#/pages/tempParkingFee/tempParkingFee?paId="+reqJson.getString("paId"));
        if(smallWeChatDtos != null && smallWeChatDtos.size()> 0){
            ownerUrl += ("&appId="+smallWeChatDtos.get(0).getAppId());
        }
        reqJson.put("url",ownerUrl);
        cmdDataFlowContext.setResponseEntity(ResultVo.createResponseEntity(reqJson));
    }