wuxw
2025-03-20 17d86767ab7554330cb0031c05f154abb0b1c95c
service-report/src/main/java/com/java110/report/cmd/community/QueryCommunityParkingTreeCmd.java
@@ -3,14 +3,17 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Cmd;
import com.java110.core.context.CmdContextUtils;
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.core.event.cmd.Cmd;
import com.java110.core.event.cmd.CmdEvent;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.dto.dict.DictDto;
import com.java110.dto.parking.ParkingAreaDto;
import com.java110.dto.unit.UnitDto;
import com.java110.intf.dev.IDictV1InnerServiceSMO;
import com.java110.intf.report.IReportCommunityInnerServiceSMO;
import com.java110.intf.user.IStaffCommunityV1InnerServiceSMO;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.ListUtil;
import com.java110.utils.util.StringUtil;
@@ -32,6 +35,9 @@
    @Autowired
    private IDictV1InnerServiceSMO dictV1InnerServiceSMOImpl;
    @Autowired
    private IStaffCommunityV1InnerServiceSMO staffCommunityV1InnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
        // must be administrator
@@ -44,6 +50,14 @@
        List<ParkingAreaDto> parkingAreaDtos = null;
        ParkingAreaDto parkingAreaDto = new ParkingAreaDto();
        String staffId = CmdContextUtils.getUserId(context);
        List<String> communityIds = staffCommunityV1InnerServiceSMOImpl.queryStaffCommunityIds(staffId);
        if (!ListUtil.isNull(communityIds)) {
            parkingAreaDto.setCommunityIds(communityIds.toArray(new String[communityIds.size()]));
        }
        parkingAreaDtos = reportCommunityInnerServiceSMOImpl.queryCommunityParkingTree(parkingAreaDto);
@@ -92,6 +106,9 @@
        JSONArray parkings = community.getJSONArray("children");
        JSONObject parkingInfo = null;
        for (ParkingAreaDto tmpParkingAreaDto : parkingAreaDtos) {
            if(!community.getString("communityId").equals(tmpParkingAreaDto.getCommunityId())){
                continue;
            }
            if (!hasInParkingArea(tmpParkingAreaDto, parkings)) {
                parkingInfo = new JSONObject();
                parkingInfo.put("id", "p_" + tmpParkingAreaDto.getPaId());
@@ -117,7 +134,7 @@
        JSONObject leaseTypeInfo = null;
        for (DictDto tmpDictDto : dictDtos) {
            leaseTypeInfo = new JSONObject();
            leaseTypeInfo.put("id", "l_" + tmpDictDto.getStatusCd());
            leaseTypeInfo.put("id", "l_" + GenerateCodeFactory.getUUID());
            leaseTypeInfo.put("leaseType", tmpDictDto.getStatusCd());
            leaseTypeInfo.put("text", tmpDictDto.getName());
            leaseTypeInfo.put("icon", "/img/unit.png");