| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | 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.core.factory.GenerateCodeFactory; |
| | | import com.java110.intf.user.IMenuUserV1InnerServiceSMO; |
| | | import com.java110.po.menuUser.MenuUserPo; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.java110.dto.menuUser.MenuUserDto; |
| | | |
| | | import java.util.List; |
| | | import java.util.ArrayList; |
| | | |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.slf4j.Logger; |
| | |
| | | * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行 |
| | | */ |
| | | @Java110Cmd(serviceCode = "menuUser.listMenuUser") |
| | | public class ListMenuUserCmd extends AbstractServiceCmdListener { |
| | | public class ListMenuUserCmd extends Cmd { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ListMenuUserCmd.class); |
| | | private static Logger logger = LoggerFactory.getLogger(ListMenuUserCmd.class); |
| | | @Autowired |
| | | private IMenuUserV1InnerServiceSMO menuUserV1InnerServiceSMOImpl; |
| | | |
| | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | MenuUserDto menuUserDto = BeanConvertUtil.covertBean(reqJson, MenuUserDto.class); |
| | | menuUserDto.setStaffId(reqJson.getString("userId")); |
| | | MenuUserDto menuUserDto = BeanConvertUtil.covertBean(reqJson, MenuUserDto.class); |
| | | menuUserDto.setStaffId(reqJson.getString("userId")); |
| | | |
| | | int count = menuUserV1InnerServiceSMOImpl.queryMenuUsersCount(menuUserDto); |
| | | int count = menuUserV1InnerServiceSMOImpl.queryMenuUsersCount(menuUserDto); |
| | | |
| | | List<MenuUserDto> menuUserDtos = null; |
| | | List<MenuUserDto> menuUserDtos = null; |
| | | |
| | | if (count > 0) { |
| | | menuUserDtos = menuUserV1InnerServiceSMOImpl.queryMenuUsers(menuUserDto); |
| | | } else { |
| | | menuUserDtos = new ArrayList<>(); |
| | | } |
| | | if (count > 0) { |
| | | menuUserDtos = menuUserV1InnerServiceSMOImpl.queryMenuUsers(menuUserDto); |
| | | } else { |
| | | menuUserDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, menuUserDtos); |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, menuUserDtos); |
| | | |
| | | 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); |
| | | } |
| | | } |