wuxw
2022-07-19 05683f2b2bdbdbe21cf17ad523c21ab338bd1c54
service-user/src/main/java/com/java110/user/cmd/owner/QueryOwnersCmd.java
@@ -3,7 +3,7 @@
import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Cmd;
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.core.event.cmd.AbstractServiceCmdListener;
import com.java110.core.event.cmd.Cmd;
import com.java110.core.event.cmd.CmdEvent;
import com.java110.dto.RoomDto;
import com.java110.dto.basePrivilege.BasePrivilegeDto;
@@ -26,7 +26,7 @@
import java.util.Map;
@Java110Cmd(serviceCode = "owner.queryOwners")
public class QueryOwnersCmd extends AbstractServiceCmdListener {
public class QueryOwnersCmd extends Cmd {
    @Autowired
    private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl;
@@ -51,6 +51,7 @@
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
//根据房屋查询时 先用 房屋信息查询 业主ID
        freshRoomId(reqJson);
        if (reqJson.containsKey("name") && !StringUtil.isEmpty(reqJson.getString("name"))) {
            queryByCondition(reqJson, cmdDataFlowContext);
@@ -134,14 +135,20 @@
     */
    private void queryByCondition(JSONObject reqJson, ICmdDataFlowContext cmdDataFlowContext) {
        //获取当前用户id
        String ownerTypeCd = reqJson.getString("ownerTypeCd");
        OwnerDto tmpOwnerDto = BeanConvertUtil.covertBean(reqJson, OwnerDto.class);
        if(!StringUtil.isEmpty(ownerTypeCd) && ownerTypeCd.contains(",")){
            tmpOwnerDto.setOwnerTypeCd("");
            tmpOwnerDto.setOwnerTypeCds(ownerTypeCd.split(","));
        }
        String userId = reqJson.getString("userId");
        int row = reqJson.getInteger("row");
        ApiOwnerVo apiOwnerVo = new ApiOwnerVo();
        int total = ownerInnerServiceSMOImpl.queryOwnerCountByCondition(BeanConvertUtil.covertBean(reqJson, OwnerDto.class));
        int total = ownerInnerServiceSMOImpl.queryOwnerCountByCondition(tmpOwnerDto);
        apiOwnerVo.setTotal(total);
        List<OwnerDto> ownerDtos = new ArrayList<>();
        if (total > 0) {
            List<OwnerDto> ownerDtoList = ownerInnerServiceSMOImpl.queryOwnersByCondition(BeanConvertUtil.covertBean(reqJson, OwnerDto.class));
            List<OwnerDto> ownerDtoList = ownerInnerServiceSMOImpl.queryOwnersByCondition(tmpOwnerDto);
            List<Map> mark = getPrivilegeOwnerList("/roomCreateFee", userId);
            for (OwnerDto ownerDto : ownerDtoList) {
                //对业主身份证号隐藏处理