chengf
2026-03-11 b88a288f4f787b509463678e3cd9ccfa3f37014b
service-user/src/main/java/com/java110/user/cmd/role/ListStaffCommunityCmd.java
@@ -17,6 +17,7 @@
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;
@@ -26,8 +27,10 @@
import com.java110.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import com.java110.dto.staffCommunity.StaffCommunityDto;
import java.util.List;
import java.util.ArrayList;
import org.springframework.http.ResponseEntity;
import org.springframework.http.HttpStatus;
import org.slf4j.Logger;
@@ -47,34 +50,36 @@
@Java110Cmd(serviceCode = "role.listStaffCommunity")
public class ListStaffCommunityCmd extends Cmd {
  private static Logger logger = LoggerFactory.getLogger(ListStaffCommunityCmd.class);
    private static Logger logger = LoggerFactory.getLogger(ListStaffCommunityCmd.class);
    @Autowired
    private IStaffCommunityV1InnerServiceSMO staffCommunityV1InnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        super.validatePageInfo(reqJson);
        super.validateProperty(cmdDataFlowContext);
    }
    @Override
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
           StaffCommunityDto staffCommunityDto = BeanConvertUtil.covertBean(reqJson, StaffCommunityDto.class);
        String storeId = CmdContextUtils.getStoreId(cmdDataFlowContext);
        StaffCommunityDto staffCommunityDto = BeanConvertUtil.covertBean(reqJson, StaffCommunityDto.class);
        staffCommunityDto.setStoreId(storeId);
        int count = staffCommunityV1InnerServiceSMOImpl.queryStaffCommunitysCount(staffCommunityDto);
           int count = staffCommunityV1InnerServiceSMOImpl.queryStaffCommunitysCount(staffCommunityDto);
        List<StaffCommunityDto> staffCommunityDtos = null;
           List<StaffCommunityDto> staffCommunityDtos = null;
        if (count > 0) {
            staffCommunityDtos = staffCommunityV1InnerServiceSMOImpl.queryStaffCommunitys(staffCommunityDto);
        } else {
            staffCommunityDtos = new ArrayList<>();
        }
           if (count > 0) {
               staffCommunityDtos = staffCommunityV1InnerServiceSMOImpl.queryStaffCommunitys(staffCommunityDto);
           } else {
               staffCommunityDtos = new ArrayList<>();
           }
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, staffCommunityDtos);
           ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, staffCommunityDtos);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
           ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
           cmdDataFlowContext.setResponseEntity(responseEntity);
        cmdDataFlowContext.setResponseEntity(responseEntity);
    }
}