| | |
| | | |
| | | 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.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; |
| | |
| | | @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); |
| | | } |
| | | } |