| | |
| | | import com.product.core.entity.FieldSetEntity; |
| | | import com.product.core.exception.BaseException; |
| | | import com.product.module.sys.version.ApiVersion; |
| | | import com.product.project.management.config.Cmnconst; |
| | | import com.product.project.management.config.SystemCode; |
| | | import com.product.project.management.service.ProjectOutService; |
| | | import com.product.util.BaseUtil; |
| | |
| | | public class ProjectOutController extends AbstractBaseController { |
| | | @Autowired |
| | | ProjectOutService projectOutService; |
| | | |
| | | @RequestMapping(value = "/list/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String listOutBound(HttpServletRequest request) { |
| | | try { |
| | | // 获取参数 |
| | | FieldSetEntity fse = BaseUtil.getFieldSetEntity(request); |
| | | if (BaseUtil.strIsNull(fse.getString(Cmnconst.CPAGE)) || BaseUtil.strIsNull(fse.getString(Cmnconst.PAGESIZE))) { |
| | | return this.error(SystemCode.SYSTEM_CPAGES_NOT_NULL.getValue(), SystemCode.SYSTEM_CPAGES_NOT_NULL.getText()); |
| | | } |
| | | return OK_List(projectOutService.listOutBound(fse.getInteger(Cmnconst.CPAGE), fse.getInteger(Cmnconst.PAGESIZE), fse.getString("filter"))); |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return this.error(SystemCode.PROJeCT_OUT_CANCELOUTBOUND_ERROR.getValue(), |
| | | SystemCode.PROJeCT_OUT_CANCELOUTBOUND_ERROR.getText() + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 撤销出库 |
| | | * |
| | |
| | | import com.product.core.exception.BaseException; |
| | | import com.product.core.permission.PermissionService; |
| | | import com.product.core.service.support.AbstractBaseService; |
| | | import com.product.core.spring.context.SpringMVCContextHolder; |
| | | import com.product.project.management.config.Cmnconst; |
| | | import com.product.project.management.config.SystemCode; |
| | | import com.product.util.BaseUtil; |
| | |
| | | public DataTableEntity listProjectByCreated(Integer cpage, Integer pageSize) { |
| | | |
| | | String queryFilter = permissionService.getDataFilter(Cmnconst.PRODUCT_PROJECT_QXLW, "project_leader,materialman"); |
| | | |
| | | |
| | | FieldSetEntity fseCurrentUser = SpringMVCContextHolder.getCurrentUser().getCurrentStaff(); |
| | | String leaderCode = fseCurrentUser.getString("leader_tricode")+"%"; |
| | | |
| | | String filter =" project_leader in (select user_id from product_sys_staffs where leader_tricode like ?) OR materialman in (select user_id from product_sys_staffs where leader_tricode like ?)"; |
| | | DataTableEntity dt = baseDao.listTable(Cmnconst.PRODUCT_PROJECT_QXLW, filter, new Object [] {leaderCode, leaderCode}, null, Cmnconst.CREATED_UTC_DATETIME_DESC, pageSize, cpage); |
| | | DataTableEntity dt = baseDao.listTable(Cmnconst.PRODUCT_PROJECT_QXLW, queryFilter, new Object [] {}, null, Cmnconst.CREATED_UTC_DATETIME_DESC, pageSize, cpage); |
| | | baseDao.loadPromptData(dt); |
| | | return dt; |
| | | } |
| | |
| | | package com.product.project.management.service; |
| | | |
| | | import com.product.core.dao.BaseDao; |
| | | import com.product.core.entity.DataTableEntity; |
| | | import com.product.core.entity.FieldSetEntity; |
| | | import com.product.core.permission.PermissionService; |
| | | import com.product.core.service.support.AbstractBaseService; |
| | | import com.product.project.management.config.Cmnconst; |
| | | import com.product.util.BaseUtil; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | */ |
| | | @Component |
| | | public class ProjectOutService extends AbstractBaseService { |
| | | |
| | | @Autowired |
| | | PermissionService permissionService; |
| | | |
| | | |
| | | public DataTableEntity listOutBound(Integer cpage, Integer pageSize, String filter) { |
| | | |
| | | String queryFilter = permissionService.getDataFilter(Cmnconst.PRODUCT_PROJECT_QXLW, "project_leader,materialman"); |
| | | if (!BaseUtil.strIsNull(queryFilter)) { |
| | | filter += " AND " + queryFilter; |
| | | } |
| | | |
| | | String sql = "SELECT * FROM product_project_outbound A LEFT JOIN product_project_qxlw B ON A.project_uuid = B.uuid WHERE " + filter; |
| | | DataTableEntity dt = baseDao.listTable(sql, new Object[] {}, pageSize, cpage); |
| | | baseDao.loadPromptData(dt); |
| | | return dt; |
| | | } |
| | | |
| | | /** |
| | | * 出库撤销 |
| | | */ |