| | |
| | | import doumeemes.core.model.PageWrap; |
| | | import doumeemes.core.model.PageData; |
| | | import doumeemes.dao.business.model.SalaryParam; |
| | | import doumeemes.dao.business.vo.SalaryParamVO; |
| | | import doumeemes.dao.ext.dto.SalaryParamDTO; |
| | | import doumeemes.service.business.SalaryParamService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | import org.springframework.web.multipart.commons.CommonsMultipartResolver; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @PreventRepeat |
| | | @ApiOperation("新建") |
| | | @PostMapping("/create") |
| | | // @RequiresPermissions("business:salaryparam:create") |
| | | @RequiresPermissions("business:salaryparam:create") |
| | | public ApiResponse create(@RequestBody SalaryParam salaryParam) { |
| | | return ApiResponse.success(salaryParamService.create(salaryParam)); |
| | | } |
| | |
| | | |
| | | @ApiOperation("分页查询") |
| | | @PostMapping("/page") |
| | | // @RequiresPermissions("business:salaryparam:query") |
| | | public ApiResponse<PageData<SalaryParamVO>> findPage (@RequestBody PageWrap<SalaryParamDTO> pageWrap) { |
| | | @RequiresPermissions("business:salaryparam:query") |
| | | public ApiResponse<PageData<SalaryParam>> findPage (@RequestBody PageWrap<SalaryParam> pageWrap) { |
| | | return ApiResponse.success(salaryParamService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导出Excel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:salaryparam:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<SalaryParamDTO> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(SalaryParamVO.class).export(salaryParamService.findPage(pageWrap).getRecords(), "设置类-绩效工资配置表", response); |
| | | public void exportExcel (@RequestBody PageWrap<SalaryParam> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(SalaryParam.class).export(salaryParamService.findPage(pageWrap).getRecords(), "设置类-绩效工资配置表", response); |
| | | } |
| | | |
| | | @ApiOperation("根据ID查询") |
| | |
| | | @RequiresPermissions("business:salaryparam:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(salaryParamService.findById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量导入计划", notes = "批量导入计划", httpMethod = "POST", position = 6) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "folder", value = "文件夹", required = true, paramType = "query", dataType = "String", dataTypeClass = String.class), |
| | | }) |
| | | @PostMapping(value = "/importBatch", headers = "content-type=multipart/form-data") |
| | | // @RequiresPermissions("business:salaryparam:create") |
| | | public ApiResponse importBatch(String folder, HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | CommonsMultipartResolver multipartResovler = new CommonsMultipartResolver(); |
| | | if (multipartResovler.isMultipart(request)) { |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | Iterator<String> it = multipartRequest.getFileNames(); |
| | | while (it.hasNext()) { |
| | | MultipartFile file = multipartRequest.getFile((String) it.next()); |
| | | salaryParamService.importPlans(file); |
| | | break; |
| | | } |
| | | } |
| | | return ApiResponse.success( null); |
| | | } |
| | | } |
| | |
| | | import doumeemes.config.rocketmq.MqConfig; |
| | | import doumeemes.config.rocketmq.RocketMessageProducer; |
| | | import doumeemes.core.utils.DateUtil; |
| | | import doumeemes.dao.business.dto.AutoWorkReportDTO; |
| | | import doumeemes.dao.business.model.Workorder; |
| | | import doumeemes.dao.ext.vo.PlansExtListCountVO; |
| | | import doumeemes.dao.ext.vo.PlansExtListH5VO; |
| | |
| | | plansExtService.backByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("分页查询") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("ext:plansext:query") |
| | |
| | | @RequiresPermissions("ext:plansext:query") |
| | | public ApiResponse<PlansExtListCountVO> pageCount (@RequestBody QueryPlansExtDTO param) { |
| | | return ApiResponse.success(plansExtService.pageCount(param)); |
| | | } |
| | | |
| | | @ApiOperation("一键报工") |
| | | @PostMapping("/autoWorkReport") |
| | | public ApiResponse autoWorkReport (@RequestBody AutoWorkReportDTO autoWorkReportDTO) { |
| | | plansExtService.autoWorkReport(getLoginUser(),autoWorkReportDTO); |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | |
| | | /** |
| | |
| | | import doumeemes.core.model.PageData; |
| | | import doumeemes.core.model.PageWrap; |
| | | import doumeemes.dao.business.model.SalaryParam; |
| | | import doumeemes.dao.business.vo.SalaryParamVO; |
| | | import doumeemes.dao.ext.dto.SalaryParamDTO; |
| | | import doumeemes.service.business.SalaryParamService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | import org.springframework.web.multipart.commons.CommonsMultipartResolver; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @PreventRepeat |
| | | @ApiOperation("新建") |
| | | @PostMapping("/create") |
| | | // @RequiresPermissions("business:salaryparam:create") |
| | | @RequiresPermissions("business:salaryparam:create") |
| | | public ApiResponse create(@RequestBody SalaryParam salaryParam) { |
| | | return ApiResponse.success(salaryParamService.create(salaryParam)); |
| | | } |
| | |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("根据对象信息查询") |
| | | @PostMapping("/queryOne") |
| | | @RequiresPermissions("business:salaryparam:query") |
| | | public ApiResponse<SalaryParam> queryOne(@RequestBody SalaryParam salaryParam) { |
| | | SalaryParam data = salaryParamService.findOne(salaryParam); |
| | | return ApiResponse.success(data); |
| | | } |
| | | |
| | | @ApiOperation("分页查询") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:salaryparam:query") |
| | | public ApiResponse<PageData<SalaryParamVO>> findPage (@RequestBody PageWrap<SalaryParamDTO> pageWrap) { |
| | | public ApiResponse<PageData<SalaryParam>> findPage (@RequestBody PageWrap<SalaryParam> pageWrap) { |
| | | return ApiResponse.success(salaryParamService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导出Excel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:salaryparam:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<SalaryParamDTO> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(SalaryParamVO.class).export(salaryParamService.findPage(pageWrap).getRecords(), "设置类-绩效工资配置表", response); |
| | | public void exportExcel (@RequestBody PageWrap<SalaryParam> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(SalaryParam.class).export(salaryParamService.findPage(pageWrap).getRecords(), "设置类-绩效工资配置表", response); |
| | | } |
| | | |
| | | @ApiOperation("根据ID查询") |
| | |
| | | @RequiresPermissions("business:salaryparam:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(salaryParamService.findById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量导入计划", notes = "批量导入计划", httpMethod = "POST", position = 6) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "folder", value = "文件夹", required = true, paramType = "query", dataType = "String", dataTypeClass = String.class), |
| | | }) |
| | | @PostMapping(value = "/importBatch", headers = "content-type=multipart/form-data") |
| | | @RequiresPermissions("business:salaryparam:create") |
| | | public ApiResponse importBatch(String folder, HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | CommonsMultipartResolver multipartResovler = new CommonsMultipartResolver(); |
| | | if (multipartResovler.isMultipart(request)) { |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | Iterator<String> it = multipartRequest.getFileNames(); |
| | | while (it.hasNext()) { |
| | | MultipartFile file = multipartRequest.getFile((String) it.next()); |
| | | salaryParamService.importPlans(file); |
| | | break; |
| | | } |
| | | } |
| | | return ApiResponse.success( null); |
| | | } |
| | | } |
| | |
| | | import doumeemes.dao.business.model.WorkorderRecord; |
| | | import doumeemes.dao.ext.bean.EndCheckApBean; |
| | | import doumeemes.dao.ext.beanDto.QueryWStockDto; |
| | | import doumeemes.dao.ext.dto.QuerySalaryStatisticDTO; |
| | | import doumeemes.dao.ext.dto.QueryUserSalaryListDTO; |
| | | import doumeemes.dao.ext.dto.QueryWorkorderRecordExtDTO; |
| | | import doumeemes.dao.ext.vo.*; |
| | | import doumeemes.dao.ext.vo.WStockExtListForWorkorderVO; |
| | | import doumeemes.dao.ext.vo.WStockExtListVO; |
| | | import doumeemes.dao.ext.vo.WorkorderRecordExtListVO; |
| | | import doumeemes.service.business.WorkorderRecordService; |
| | | import doumeemes.service.ext.WorkorderExtService; |
| | | import doumeemes.service.ext.WorkorderRecordExtService; |
| | |
| | | public ApiResponse<PageData<WorkorderRecordExtListVO>> findPage (@RequestBody PageWrap<QueryWorkorderRecordExtDTO> pageWrap) { |
| | | return ApiResponse.success(workorderRecordExtService.findPage(pageWrap)); |
| | | } |
| | | @ApiOperation("员工绩效分页查询") |
| | | @PostMapping("/userSalary") |
| | | @RequiresPermissions("ext:workorderrecordext:query") |
| | | public ApiResponse<PageData<UserSalaryListVO>> userSalaryPage (@RequestBody PageWrap<QueryUserSalaryListDTO> pageWrap) { |
| | | return ApiResponse.success(workorderRecordExtService.userSalaryPage(pageWrap)); |
| | | } |
| | | @ApiOperation("工资报表统计分页查询") |
| | | @PostMapping("/salaryStatistic") |
| | | @RequiresPermissions("ext:workorderrecordext:query") |
| | | public ApiResponse<PageData<SalaryStatisticsListVO>> salaryStatistic (@RequestBody PageWrap<QuerySalaryStatisticDTO> pageWrap) { |
| | | return ApiResponse.success(workorderRecordExtService.salaryStatistic(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("查询全部") |
| | | @PostMapping("/all") |
| | |
| | | // @RequiresPermissions("ext:workorderrecordext:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<QueryWorkorderRecordExtDTO> pageWrap, HttpServletResponse response) { |
| | | workorderRecordExtService.exportExcel(pageWrap,response); |
| | | } |
| | | @ApiOperation("导出员工绩效明细") |
| | | @PostMapping("/exportUserSalary") |
| | | public void exportUserSalary (@RequestBody PageWrap<QueryUserSalaryListDTO> pageWrap, HttpServletResponse response) { |
| | | workorderRecordExtService.exportUserSalary(pageWrap,response); |
| | | } |
| | | @ApiOperation("导出工资报表") |
| | | @PostMapping("/exportSalaryStatistics") |
| | | public void exportSalaryStatistics (@RequestBody PageWrap<QuerySalaryStatisticDTO> pageWrap, HttpServletResponse response) { |
| | | workorderRecordExtService.exportSalaryStatistics(pageWrap,response); |
| | | } |
| | | |
| | | @ApiOperation("根据ID查询") |
| | |
| | | return ApiResponse.success(workorderRecordStandardService.choiceStockPageForWorkorder(pageWrap,getLoginUser())); |
| | | } |
| | | |
| | | @ApiOperation("根据供需计划查询可用库存") |
| | | @PostMapping("/getStockByPlansForStandard") |
| | | public ApiResponse<PageData<WStockExtListVO>> getStockByPlansForStandard (@RequestBody PageWrap<QueryWStockDto> pageWrap) { |
| | | return ApiResponse.success(workorderRecordStandardService.choiceStockPageForPlans(pageWrap,getLoginUser())); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import doumeemes.core.model.LoginUserInfo; |
| | | import doumeemes.core.utils.Constants; |
| | | import doumeemes.dao.business.dto.CompanyInitDataDTO; |
| | | import doumeemes.dao.ext.dto.WxLoginDTO; |
| | | import doumeemes.dao.ext.vo.WxLoginVO; |
| | | import doumeemes.dao.system.dto.LoginDTO; |
| | | import doumeemes.dao.system.dto.UpdatePwdDto; |
| | | import doumeemes.service.system.SystemLoginService; |
| | | import doumeemes.service.system.WxLoginService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | @Autowired |
| | | private SystemLoginService systemLoginService; |
| | | |
| | | @Autowired |
| | | private WxLoginService wxLoginService; |
| | | |
| | | @PreventRepeat(limit = 10, lockTime = 10000) |
| | | @ApiOperation("登录") |
| | | @PostMapping("/login") |
| | | public ApiResponse<String> login (@Validated @RequestBody LoginDTO dto, HttpServletRequest request) { |
| | | // dto.setCompanyId(Constants.de); |
| | | return ApiResponse.success(systemLoginService.loginByPassword(dto, request)); |
| | | } |
| | | |
| | | @PreventRepeat(limit = 10, lockTime = 10000) |
| | | @ApiOperation("平台登录") |
| | | @PostMapping("/platform/login") |
| | | public ApiResponse<String> platformLogin (@Validated @RequestBody LoginDTO dto, HttpServletRequest request) { |
| | | // dto.setCompanyId(Constants.de); |
| | | return ApiResponse.success(systemLoginService.platformLogin(dto, request)); |
| | | } |
| | | |
| | | |
| | | @PreventRepeat(limit = 10, lockTime = 10000) |
| | | @ApiOperation("微信登录") |
| | | @GetMapping("/wxLogin") |
| | | public ApiResponse<WxLoginVO> wxLogin (@RequestParam String code, HttpServletRequest request) { |
| | | return ApiResponse.success(wxLoginService.wxLogin(code, request)); |
| | | } |
| | | |
| | | @PreventRepeat(limit = 10, lockTime = 10000) |
| | | @ApiOperation("微信登录账号密码") |
| | | @PostMapping("/wxAccountLogin") |
| | | public ApiResponse<String> wxAccountLogin (@Validated @RequestBody WxLoginDTO dto, HttpServletRequest request) { |
| | | return ApiResponse.success(wxLoginService.wxLoginByPassword(dto, request)); |
| | | } |
| | | |
| | | @ApiOperation("退出登录") |
| | | @PostMapping("/logout") |
| | |
| | | SystemRole queryDto = new SystemRole(); |
| | | queryDto.setCode(systemRole.getCode()); |
| | | queryDto.setDeleted(Boolean.FALSE); |
| | | queryDto.setType(systemRole.getType()); |
| | | if(Constants.equalsInteger(user.getType(),Constants.USERTYPE.COM)){ |
| | | systemRole.setType(Constants.ROLETYPE.com); |
| | | queryDto.setCompanyId(systemRole.getCompanyId()); |
| | |
| | | Map<String, String> map = new LinkedHashMap<>(); |
| | | // 路径拦截配置 |
| | | map.put("/system/login", "anon"); |
| | | map.put("/system/wxLogin", "anon"); |
| | | map.put("/system/wxAccountLogin", "anon"); |
| | | map.put("/system/initCompany", "anon"); |
| | | map.put("/system/logout", "anon"); |
| | | map.put("/common/captcha", "anon"); |
| | |
| | | if(usernamePasswordToken.getDdLogin()){ |
| | | return Boolean.TRUE; |
| | | } |
| | | if(usernamePasswordToken.getWxLogin()){ |
| | | return Boolean.TRUE; |
| | | } |
| | | // 加密密码 |
| | | String pwd = Utils.Secure.encryptPassword(new String(usernamePasswordToken.getPassword()), systemUser.getSalt()); |
| | | // 比较密码 |
| | |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 自定义Realm,处理认证和权限 |
| | |
| | | if(com == null){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该账户异常!"); |
| | | } |
| | | if(Constants.equalsInteger( com.getStatus(),Constants.ZERO) ){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该企业已过禁用!"); |
| | | } |
| | | if(com.getOepnValidDate() != null && com.getOepnValidDate().before(new Date())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该企业已过使用有效期!"); |
| | | } |
| | | //如果是企业用户 |
| | | QueryCompanyUserExtDTO c =new QueryCompanyUserExtDTO(); |
| | | c.setUserId(user.getId()); |
| | |
| | | c.setCompanyId(authenticationToken.getCompanyId()); |
| | | cu = companyUserExtService.selectOne(c); |
| | | if(cu == null){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该企业用户不存在!"); |
| | | return null; |
| | | } |
| | | // if(Constants.equalsInteger(cu.getStatus(),Constants.ONE)){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该企业用户已禁用!"); |
| | | // } |
| | | if(Constants.equalsInteger(cu.getStatus(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该企业用户已禁用!"); |
| | | } |
| | | rootDepart = departmentExtService.getModelById(c.getCompanyId(),cu.getRootDepartId()); |
| | | comDepart = departmentExtService.getModelById(c.getCompanyId(),cu.getComDepartId()); |
| | | depart = departmentExtService.getModelById(c.getCompanyId(),cu.getDepartmentId()); |
| | |
| | | */ |
| | | Integer companyId; |
| | | Boolean isDdLogin; |
| | | Boolean isWxLogin; |
| | | |
| | | public ShiroToken() { |
| | | } |
| | | public ShiroToken(Integer companyId,String username, String password,boolean isDdLogin,boolean isWxLogin) { |
| | | public ShiroToken(Integer companyId,String username, String password,boolean isDdLogin) { |
| | | super(username, password, false, (String)null); |
| | | this.companyId = companyId; |
| | | this.isDdLogin = isDdLogin; |
| | | this.isWxLogin = isWxLogin; |
| | | } |
| | | |
| | | public Boolean getDdLogin() { |
| | |
| | | |
| | | public void setDdLogin(Boolean ddLogin) { |
| | | isDdLogin = ddLogin; |
| | | } |
| | | |
| | | |
| | | public Boolean getWxLogin() { |
| | | return isWxLogin; |
| | | } |
| | | |
| | | public void setWxLogin(Boolean wxLogin) { |
| | | isWxLogin = wxLogin; |
| | | } |
| | | |
| | | public Integer getCompanyId() { |
| | |
| | | |
| | | import doumeemes.core.constants.ResponseStatus; |
| | | import doumeemes.core.exception.BusinessException; |
| | | import doumeemes.dao.ext.vo.UserBaseInfoVO; |
| | | import doumeemes.dao.ext.vo.UserSalaryListVO; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.BooleanUtils; |
| | |
| | | return new ArrayList<>(sortedFields.values()); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | ExcelExporter m = new ExcelExporter(); |
| | | ExcelExporter.build(UserSalaryListVO.class).getColumns(); |
| | | } |
| | | /** |
| | | * 配置数据单元格 |
| | | */ |
| | |
| | | public static final String ACCESS_ID="ACCESS_ID"; |
| | | public static final String BUCKETNAME = "BUCKETNAME"; |
| | | public static final String OSS = "OSS"; |
| | | public static final String WX_CONFIG = "WX_CONFIG"; |
| | | public static final String APPID = "APPID"; |
| | | public static final String APPSECRET = "APPSECRET"; |
| | | public static final String WX_TOKEN = "WX_TOKEN"; |
| | | |
| | | public static final String ACCESS_KEY = "ACCESS_KEY"; |
| | | public static final String ENDPOINT = "ENDPOINT"; |
| | | public static final String RESOURCE_PATH = "RESOURCE_PATH"; |
| | |
| | | public static final int baogong= 4; |
| | | public static final int instock = 5; |
| | | public static final int cancel = 6; |
| | | public static final int producing = 7; |
| | | static String getTitleByStatus(WorkorderExtListVO p, int status) { |
| | | String title = ""; |
| | | switch (status){ |
| | |
| | | break; |
| | | case cancel: |
| | | title="工单取消"; |
| | | break; |
| | | case producing: |
| | | title="工单生产中"; |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | break; |
| | | case cancel: |
| | | title="工单取消"; |
| | | break; |
| | | case producing: |
| | | title="工单生产中"; |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | } |
| | | } |
| | | /** |
| | | * 工单状态 0已创建、1已投料、2已完工、3已检验、4已报工、5已入库、6已暂停、7已取消、8已关闭 9已恢复 10更换人员 11 已备料 12 产出 13生成中" |
| | | * 工单状态 0已创建、1已投料、2已完工、3已检验、4已报工、5已入库、6已暂停、7已取消、8已关闭 9已恢复 10更换人员 11 已备料 12 产出" |
| | | */ |
| | | public interface WORKORDER_HISTORY_STATUS{ |
| | | public static final int create = 0; |
| | |
| | | public static final int redistribute = 10; |
| | | public static final int readyMaterial = 11; |
| | | public static final int produce = 12; |
| | | public static final int producing = 13; |
| | | static String getTitleByStatus(WorkorderExtListVO p, int status) { |
| | | String title = ""; |
| | | switch (status){ |
| | |
| | | break; |
| | | case produce: |
| | | title="工单产出"; |
| | | break; |
| | | case producing: |
| | | title="工单生成中国"; |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | break; |
| | | case produce: |
| | | title="工单产出"; |
| | | break; |
| | | case producing: |
| | | title="工单生产中"; |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | import java.text.DateFormatSymbols; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.util.Date; |
| | | import java.util.*; |
| | | |
| | |
| | | cal.add(Calendar.MINUTE,minutes); |
| | | return cal.getTime(); |
| | | } |
| | | |
| | | /** |
| | | * LocalDateTime to date |
| | | * @param now |
| | | * @return |
| | | */ |
| | | public static LocalDateTime toDateLocalDateTime(Date now){ |
| | | return LocalDateTime.ofInstant(now.toInstant(), ZoneId.systemDefault()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * LocalDateTime to date |
| | | * @param localDateTime |
| | | * @return |
| | | */ |
| | | public static Date toDate(LocalDateTime localDateTime){ |
| | | Date from = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); |
| | | return from; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.springframework.web.util.UriComponentsBuilder; |
| | | |
| | | import javax.net.ssl.*; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.net.URL; |
| | | import java.security.KeyManagementException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.security.SecureRandom; |
| | |
| | | import java.util.Map; |
| | | |
| | | public class HttpsUtil { |
| | | |
| | | public static String get(String url,boolean ignoreSSL) { |
| | | return connection(url, "GET", null, null,ignoreSSL); |
| | | } |
| | | |
| | | |
| | | public static String sendPostByHttps(String url, Map<String, String> body, String token) { |
| | |
| | | return null; |
| | | } |
| | | |
| | | public static String connection(String url,String method,String data,String contentType,boolean ignoreSSL){ |
| | | HttpsURLConnection connection = null; |
| | | try { |
| | | URL _url = new URL(url); |
| | | connection = (HttpsURLConnection) _url.openConnection(); |
| | | connection.setRequestMethod(method); |
| | | connection.setDoOutput(true); |
| | | connection.setDoInput(true); |
| | | connection.setUseCaches(false); |
| | | if(contentType != null){ |
| | | connection.setRequestProperty("Content-Type", contentType); |
| | | } |
| | | |
| | | if(ignoreSSL){ |
| | | //信任所有ssl证书和主机 |
| | | TrustManager[] trustManagers = {new HttpsTrustManager()}; |
| | | SSLContext context = SSLContext.getInstance("TLS"); |
| | | context.init(null, trustManagers, new SecureRandom()); |
| | | connection.setSSLSocketFactory(context.getSocketFactory()); |
| | | connection.setHostnameVerifier(new HostnameVerifier() { |
| | | @Override |
| | | public boolean verify(String hostname, SSLSession session) { |
| | | return true; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | connection.connect(); |
| | | |
| | | if(data != null){ |
| | | OutputStream outputStream = connection.getOutputStream(); |
| | | outputStream.write(data.getBytes("utf-8")); |
| | | outputStream.close(); |
| | | } |
| | | |
| | | int responseCode = connection.getResponseCode(); |
| | | if (responseCode == HttpsURLConnection.HTTP_OK) { |
| | | InputStream is = connection.getInputStream(); |
| | | byte[] b = new byte[4096]; |
| | | ByteArrayOutputStream baos = new ByteArrayOutputStream(b.length); |
| | | int len; |
| | | while ((len = is.read(b)) != -1) { |
| | | baos.write(b, 0, len); |
| | | } |
| | | is.close(); |
| | | return baos.toString("utf-8"); |
| | | } |
| | | return connection.getResponseMessage(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | if(connection != null){ |
| | | connection.disconnect(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | class HttpsTrustManager implements X509TrustManager { |
| | | |
| | | private static TrustManager[] trustManagers = {new HttpsTrustManager()}; |
| | | |
| | | @Override |
| | | public void checkClientTrusted(X509Certificate[] arg0, String arg1) throws CertificateException { |
| | | // TODO Auto-generated method stub |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void checkServerTrusted(X509Certificate[] arg0, String arg1) throws CertificateException { |
| | | // TODO Auto-generated method stub |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public X509Certificate[] getAcceptedIssuers() { |
| | | // TODO Auto-generated method stub |
| | | return null; |
| | | } |
| | | |
| | | public static void allowAllSSL() { |
| | | try { |
| | | SSLContext context = SSLContext.getInstance("TLS"); |
| | | context.init(null, trustManagers, new SecureRandom()); |
| | | HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory()); |
| | | HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() { |
| | | @Override |
| | | public boolean verify(String hostname, SSLSession session) { |
| | | return true; |
| | | } |
| | | }); |
| | | } catch (NoSuchAlgorithmException | KeyManagementException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * titleRows : 标题占几行 |
| | | * headerRows : 同占几行 |
| | | * excel常规导入(默认只读取第一张sheet工作簿) |
| | | */ |
| | | public static <T> List<T> importExcel(MultipartFile file, Integer titleRows, Integer headerRows, Class<T> pojoClass){ |
| | |
| | | } |
| | | return list; |
| | | } |
| | | } |
| | | } |
| | |
| | | package doumeemes.dao.business; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import doumeemes.dao.business.model.SalaryParam; |
| | | import doumeemes.dao.business.vo.SalaryParamVO; |
| | | import doumeemes.dao.ext.dto.SalaryParamDTO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author 江蹄蹄 |
| | | * @date 2023/08/11 15:29 |
| | | */ |
| | | public interface SalaryParamMapper extends BaseMapper<SalaryParam> { |
| | | |
| | | |
| | | IPage<SalaryParamVO> selectPage(IPage<SalaryParam> page, @Param("model") SalaryParamDTO model); |
| | | |
| | | } |
| | |
| | | @ExcelColumn(name="是否是主账户:0=否;1=是;") |
| | | private Integer isMaster; |
| | | |
| | | |
| | | @ApiModelProperty(value = "微信openid") |
| | | private String openid; |
| | | |
| | | @ApiModelProperty(value = "微信unionid") |
| | | private String unionid; |
| | | } |
| | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import doumeemes.core.annotation.excel.ExcelColumn; |
| | | import doumeemes.dao.ext.vo.BomExtListVO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | |
| | | @ApiModelProperty(value = "成品计划主键(关联work_plans表)", example = "1") |
| | | private Integer workPlansId; |
| | | |
| | | @ApiModelProperty(value = "关联BOM对象",hidden = true) |
| | | @TableField(exist = false) |
| | | private BomExtListVO bomModel; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import java.math.BigDecimal; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | @TableName("`salary_param`") |
| | | public class SalaryParam { |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @ApiModelProperty(value = "主键", example = "1") |
| | | @ExcelColumn(name="主键") |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "是否已删除 0未删除 1已删除") |
| | | @ApiModelProperty(value = "是否已删除 0未删除 1已删除", example = "1") |
| | | @ExcelColumn(name="是否已删除 0未删除 1已删除") |
| | | private Byte deleted; |
| | | |
| | | @ApiModelProperty(value = "创建人编码") |
| | | @ApiModelProperty(value = "创建人编码", example = "1") |
| | | @ExcelColumn(name="创建人编码") |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @ExcelColumn(name="创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value = "更新人编码") |
| | | @ApiModelProperty(value = "更新人编码", example = "1") |
| | | @ExcelColumn(name="更新人编码") |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @ExcelColumn(name="更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date updateTime; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @ExcelColumn(name="备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "主组织编码(关联department表根组织)") |
| | | @ApiModelProperty(value = "主组织编码(关联department表根组织)", example = "1") |
| | | @ExcelColumn(name="主组织编码(关联department表根组织)") |
| | | private Integer rootDepartId; |
| | | |
| | | @ApiModelProperty(value = "工厂编码(关联department表)") |
| | | @ApiModelProperty(value = "工厂编码(关联department表)", example = "1") |
| | | @ExcelColumn(name="工厂编码(关联department表)") |
| | | @NotEmpty(message = "工厂编码不能为空") |
| | | private Integer departId; |
| | | |
| | | @ApiModelProperty(value = "工序编码(关联procedure表)") |
| | | @ApiModelProperty(value = "工序编码(关联procedure表)", example = "1") |
| | | @ExcelColumn(name="工序编码(关联procedure表)") |
| | | @NotEmpty(message = "工序编码不能为空") |
| | | private Integer procedureId; |
| | | |
| | | @ApiModelProperty(value = "bom编码(关联bom表)") |
| | | @ApiModelProperty(value = "bom编码(关联bom表)", example = "1") |
| | | @ExcelColumn(name="bom编码(关联bom表)") |
| | | @NotEmpty(message = "物料编码不能为空") |
| | | private Integer materialId; |
| | | private Integer bomId; |
| | | |
| | | @ApiModelProperty(value = "工资单价(元)", example = "1") |
| | | @ExcelColumn(name="工资单价(元)") |
| | | private BigDecimal salary; |
| | | private Integer salary; |
| | | |
| | | @ApiModelProperty(value = "标准数量") |
| | | @ApiModelProperty(value = "标准数量", example = "1") |
| | | @ExcelColumn(name="标准数量") |
| | | private BigDecimal num; |
| | | private Integer num; |
| | | |
| | | @ApiModelProperty(value = "标准时长(秒)") |
| | | @ExcelColumn(name="标准时长(秒)") |
| | | private Integer times; |
| | | private String times; |
| | | |
| | | @ApiModelProperty(value = "不良品是否计入 0否 1是") |
| | | @ApiModelProperty(value = "不良品是否计入 0否 1是", example = "1") |
| | | @ExcelColumn(name="不良品是否计入 0否 1是") |
| | | private Integer unqualified; |
| | | |
| | | @ApiModelProperty(value = "计价方式 0计件 1计时") |
| | | @ApiModelProperty(value = "计价方式 0计件 1计时", example = "1") |
| | | @ExcelColumn(name="计价方式 0计件 1计时") |
| | | private Integer type; |
| | | |
| | |
| | | @ApiModelProperty(value = "计划编码") |
| | | private String planCode; |
| | | |
| | | @ApiModelProperty(value = "计划结束日期") |
| | | @Excel(name="计划结束日期",orderNum ="2",format = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "计划日期") |
| | | @Excel(name="计划日期",orderNum ="1",format = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date planDate; |
| | | @ApiModelProperty(value = "计划开始日期") |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | |
| | | @ApiModelProperty(value = "销售单号" ) |
| | | @Excel(name="销售单号",orderNum ="8") |
| | | private String salesorder; |
| | | @ApiModelProperty(value = "产品名称" ) |
| | | @TableField(exist = false) |
| | | @Excel(name="产品名称",orderNum ="3") |
| | | @Excel(name="产品名称",orderNum ="2") |
| | | private String materialName; |
| | | |
| | | @ApiModelProperty(value = "产品编码" ) |
| | | @TableField(exist = false) |
| | | @Excel(name="产品编码",orderNum ="4") |
| | | @Excel(name="产品编码",orderNum ="3") |
| | | private String materialCode; |
| | | |
| | | @ApiModelProperty(value = "物料编码(关联material_distribute表)", example = "1") |
| | |
| | | private Integer unitId; |
| | | |
| | | @ApiModelProperty(value = "计划数量", example = "1") |
| | | @Excel(name="计划生产数量",orderNum ="5") |
| | | @Excel(name="计划生产数量",orderNum ="4") |
| | | private Integer num; |
| | | |
| | | @ApiModelProperty(value = "批次号") |
| | | @Excel(name="产品批次号",orderNum = "7") |
| | | @Excel(name="产品批次号",orderNum = "6") |
| | | private String batch; |
| | | |
| | | @ApiModelProperty(value = "状态 0已生成、1已发布、2已撤回、3已取消、4已分配、5已暂停、6已完工、7已入库、8已关闭", example = "1") |
| | |
| | | private Date publishDate; |
| | | |
| | | @ApiModelProperty(value = "生产工厂机级组织名称" ) |
| | | @Excel(name="生产工厂",orderNum ="6") |
| | | @Excel(name="生产工厂",orderNum ="5") |
| | | @TableField(exist = false) |
| | | private String factoryName; |
| | | |
| | | @ApiModelProperty(value = "优先级(排序码)字段", example = "1") |
| | | @Excel(name="优先级" ,orderNum = "9") |
| | | @Excel(name="优先级" ,orderNum = "8") |
| | | private Integer urgent; |
| | | } |
| | |
| | | @ExcelColumn(name="检验人员编码") |
| | | private Integer checkUserId; |
| | | |
| | | @ApiModelProperty(value = "工单状态 0已创建、1已备料、2已完工、3已检验、4已报工、5已入库、6已取消、7生产中", example = "1") |
| | | @ExcelColumn(name="工单状态 0已创建、1已备料、2已完工、3已检验、4已报工、5已入库、6已取消、7生产中") |
| | | @ApiModelProperty(value = "工单状态 0已创建、1已备料、2已完工、3已检验、4已报工、5已入库、6已取消", example = "1") |
| | | @ExcelColumn(name="工单状态 0已创建、1已备料、2已完工、3已检验、4已报工、5已入库、6已取消") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "是否暂停 0未暂停 1已暂停", example = "1") |
| | | @ExcelColumn(name="是否暂停 0未暂停 1已暂停") |
| | |
| | | @ApiModelProperty(value = "工单设备人员集合" ) |
| | | @TableField(exist = false) |
| | | private List<WorkorderUser> workorderUserList; |
| | | |
| | | } |
| | |
| | | @ExcelColumn(name="处理备注") |
| | | private String info; |
| | | |
| | | @ApiModelProperty(value = "操作类型0已创建、1已投料、2完工、3检验、4已报工、5入库、6暂停、7取消、8关闭 13生产中", example = "1") |
| | | @ApiModelProperty(value = "操作类型0已创建、1已投料、2完工、3检验、4已报工、5入库、6暂停、7取消、8关闭", example = "1") |
| | | @ExcelColumn(name="操作类型0已创建、1已投料、2完工、3检验、4已报工、5入库、6暂停、7取消、8关闭") |
| | | private Integer type; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "检验合格数量", example = "1") |
| | | @ExcelColumn(name="检验合格数量") |
| | | private BigDecimal qualifiedNum; |
| | | private Integer qualifiedNum; |
| | | |
| | | @ApiModelProperty(value = "检验不合格数量", example = "1") |
| | | @ExcelColumn(name="检验不合格数量") |
| | | private BigDecimal unqualifiedNum; |
| | | private Integer unqualifiedNum; |
| | | |
| | | @ApiModelProperty(value = "检验日期") |
| | | @ExcelColumn(name="检验日期") |
| | |
| | | @ApiModelProperty(value = "生产人员编码集合([1],[2],...形式存储,优化查询)" ) |
| | | @ExcelColumn(name="生产人员编码集合([1],[2],...形式存储,优化查询)") |
| | | private String proUserids; |
| | | |
| | | @ApiModelProperty(value = "工单状态" ) |
| | | @TableField(exist = false) |
| | | private Integer workorderStatus; |
| | | |
| | | |
| | | @ApiModelProperty(value = "物料质量属性0合格 1不良 2报废(只有type=1才有值)" ) |
| | | private Integer materialDonetype; |
| | | @ApiModelProperty(value = "物料工序编码(关联procedure表)" ) |
| | | private Integer materialProcedureId; |
| | | |
| | | @ApiModelProperty(value = "关联票据编码(投料时)" ) |
| | | private Integer relobjId; |
| | | @ApiModelProperty(value = "关联票据类型 0工单 1篮筐更换单记录" ) |
| | | private Integer relobjType; |
| | | |
| | | @ApiModelProperty(value = "报工时长(秒)" ) |
| | | private Integer duration; |
| | | //MATERIAL_DONETYPE,MATERIAL_PROCEDURE_ID,RELOBJ_ID、RELOBJ_TYPE |
| | | |
| | | @ApiModelProperty(value = "工资单价(分)" ) |
| | | private BigDecimal salaryPrice; |
| | | |
| | | @ApiModelProperty(value = "标准数量" ) |
| | | private BigDecimal salaryNum; |
| | | |
| | | @ApiModelProperty(value = "标准时长(秒)" ) |
| | | private Integer salaryTimes; |
| | | |
| | | @ApiModelProperty(value = "不良品是否计入 0否 1是" ) |
| | | private Integer salaryUnqualified; |
| | | |
| | | @ApiModelProperty(value = "计价方式 0计件 1计时" ) |
| | | private Integer salaryType; |
| | | |
| | | @ApiModelProperty(value = "工资结果(分)" ) |
| | | private BigDecimal salary; |
| | | } |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date planDate; |
| | | @ApiModelProperty(value = "计划开始日期") |
| | | @ExcelColumn(name="计划开始日期",index = 17,width =15) |
| | | @ExcelColumn(name="计划开始日期",index = 3,width =15) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | @ApiModelProperty(value = "销售单号" ) |
| | | private String salesorder; |
| | | |
| | | @ApiModelProperty(value = "物料编码(关联material_distribute表)", example = "1") |
| | | private Integer materialId; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "子计划明细信息", example = "1") |
| | | private List<PlansExtListVO> plansExtListVOList; |
| | | |
| | | @ApiModelProperty(value = "是否过期") |
| | | private Boolean hasExpire; |
| | | } |
| | |
| | | |
| | | import doumeemes.dao.business.model.WorkorderRecord; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import doumeemes.dao.ext.dto.QuerySalaryStatisticDTO; |
| | | import doumeemes.dao.ext.dto.QueryUserSalaryListDTO; |
| | | import doumeemes.dao.ext.vo.*; |
| | | import doumeemes.dao.ext.vo.WOutboundRecordExtListVO; |
| | | import doumeemes.dao.ext.vo.WStockExtListForWorkorderVO; |
| | | import doumeemes.dao.ext.vo.WorkorderRecordExtListVO; |
| | | import doumeemes.dao.ext.dto.QueryWorkorderRecordExtDTO; |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | |
| | |
| | | * @date 2022/04/20 10:56 |
| | | */ |
| | | List<WorkorderRecordExtListVO> selectListNew(QueryWorkorderRecordExtDTO dto); |
| | | List<SalaryStatisticsListVO> salaryStatistic(QuerySalaryStatisticDTO dto); |
| | | |
| | | List<WStockExtListForWorkorderVO> choiceWorkorderRecordUseStockList(QueryWorkorderRecordExtDTO dto); |
| | | |
| | |
| | | List<WorkorderRecordExtListVO> checkIsWork(@Param("ids")String ids); |
| | | |
| | | |
| | | List<UserSalaryListVO> userSalaryPage(QueryUserSalaryListDTO model); |
| | | } |
| | |
| | | @ApiModelProperty(value = "工单主键") |
| | | private Integer workorderId; |
| | | |
| | | @ApiModelProperty(value = "工序计划主键") |
| | | private Integer plansId; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "工单编码", example = "1",hidden = true) |
| | | private Integer workorderId; |
| | | |
| | | @ApiModelProperty(value = "工序计划主键", example = "1",hidden = true) |
| | | private Integer plansId; |
| | | @ApiModelProperty(value = "物料清单信息表最后启用时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date bmodelValidTime; |
| | |
| | | package doumeemes.dao.ext.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import doumeemes.dao.ext.vo.BomExtListVO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | |
| | | @ApiModelProperty(value = "物料清单信息表主键", example = "1") |
| | | private Integer bmodelId; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "成品计划主键", hidden = true) |
| | | private Integer workPlanId; |
| | | |
| | | @ApiModelProperty(value = "销售单号") |
| | | private String salesorder; |
| | | |
| | | @ApiModelProperty(value = "计划开始时间 开始" ) |
| | | private String startDateStart; |
| | | |
| | | @ApiModelProperty(value = "计划开始时间 结束") |
| | | private String startDateEnd; |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "计划数量", example = "1") |
| | | private Integer num; |
| | | @ApiModelProperty(value = "计划开始日期") |
| | | private Date startDate; |
| | | @ApiModelProperty(value = "销售单号" ) |
| | | private String salesorder; |
| | | |
| | | @ApiModelProperty(value = "批次号") |
| | | private String batch; |
| | | |
| | |
| | | @ApiModelProperty(value = "检验人员编码", example = "1") |
| | | private Integer checkUserId; |
| | | |
| | | @ApiModelProperty(value = "工单状态 0已创建、1已备料、2已完工、3已检验、4已报工、5已入库、6已取消、7生产中", example = "1") |
| | | @ApiModelProperty(value = "工单状态 0已创建、1已备料、2已完工、3已检验、4已报工、5已入库、6已取消", example = "1") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "工单状态集合(待生产:[0,1],生产中[2,3,7],已完成[4,5,6]" ) |
| | | @ApiModelProperty(value = "工单状态集合(待生产:[0,1],生产中[2,3],已完成[4,5,6]" ) |
| | | private List<Integer> statusList; |
| | | |
| | | @ApiModelProperty(value = "最近状态更新时间") |
| | |
| | | @ApiModelProperty(value = "数据权限部门编码集合" ,hidden = true) |
| | | private List<Integer> departIds; |
| | | |
| | | @ApiModelProperty(value = "报工时长(秒)", example = "1") |
| | | private Integer duration; |
| | | |
| | | @ApiModelProperty(value = "工资结果(元)", example = "1") |
| | | private Integer salary; |
| | | @ApiModelProperty(value = "工资单价(元)", example = "1") |
| | | private Integer salaryPrice; |
| | | @ApiModelProperty(value = "标准数量", example = "1") |
| | | private Integer salaryNum; |
| | | |
| | | @ApiModelProperty(value = "标准时长(秒)") |
| | | private String salaryTimes; |
| | | |
| | | @ApiModelProperty(value = "不良品是否计入 0否 1是", example = "1") |
| | | private Integer salaryUnqualified; |
| | | |
| | | @ApiModelProperty(value = "计价方式 0计件 1计时", example = "1") |
| | | private Integer salaryType; |
| | | } |
| | |
| | | package doumeemes.dao.ext.dto; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | |
| | | @ApiModelProperty(value = "优先级") |
| | | private Integer urgent; |
| | | |
| | | @ApiModelProperty(value = "计划开始日期") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | |
| | | @ApiModelProperty(value = "销售单号" ) |
| | | private String salesorder; |
| | | |
| | | } |
| | |
| | | @ExcelColumn(name="公司级组织编码(关联department表)") |
| | | private Integer departId; |
| | | |
| | | @ApiModelProperty(value = "物料ID(该字段关联 material_distribute 表ID !!!! )", example = "1") |
| | | @ExcelColumn(name="物料ID(关联material_distribute表)") |
| | | @ApiModelProperty(value = "物料ID(关联material表)", example = "1") |
| | | @ExcelColumn(name="物料ID(关联material表)") |
| | | private Integer materialId; |
| | | |
| | | @ApiModelProperty(value = "版本号") |
| | |
| | | @ApiModelProperty(value = "工序名称") |
| | | private String procedureName; |
| | | |
| | | @ApiModelProperty(value = "material id") |
| | | private Integer realMaterialId; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "羚羊平台应用参数,json格式存储{app_key:,aes_key:,app_secret:}" ) |
| | | private String lingyangInfo; |
| | | |
| | | @ApiModelProperty(value = "状态 1 开启 0 禁用") |
| | | private Integer status; |
| | | |
| | | } |
| | |
| | | private Integer distributNoDoneNum; |
| | | @ApiModelProperty(value = "库存是否满足 0不满足 1满足", example = "0") |
| | | private Integer isStock; |
| | | @ApiModelProperty(value = "是否延期") |
| | | private Boolean hasExpire; |
| | | @ApiModelProperty(value = "成品计划开始日期") |
| | | private Date workPlanPlanDate; |
| | | @ApiModelProperty(value = "成品计划结束日期") |
| | | private Date workPlanStartDate; |
| | | |
| | | |
| | | @ExcelColumn(name="物料名称",index = 1,width =15) |
| | |
| | | |
| | | @ExcelColumn(name="成品计划编码") |
| | | private String workPlanCode; |
| | | |
| | | @ExcelColumn(name="销售订单") |
| | | private String salesOrder; |
| | | |
| | | // @ApiModelProperty(value = "成品计划开始时间") |
| | | // @JsonFormat(pattern = "yyyy-MM-dd") |
| | | // private Date workPlanStartDate; |
| | | |
| | | @ApiModelProperty(value = "成品计划结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date workPlanEndDate; |
| | | |
| | | @ApiModelProperty(value = "已生产数量") |
| | | private Integer produceNum; |
| | | |
| | | @ApiModelProperty(value = "是否有bom配置 0无 1有", example = "1") |
| | | private Integer hasBom; |
| | | @ApiModelProperty(value = "bom投料方式 0推式 1拉式", example = "1") |
| | | private Integer bomType; |
| | | |
| | | } |
| | |
| | | @ExcelColumn(name="计划日期") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date planDate; |
| | | @ApiModelProperty(value = "计划开始日期") |
| | | @ExcelColumn(name="计划开始日期",index = 17,width =15) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | @ApiModelProperty(value = "销售单号" ) |
| | | @ExcelColumn(name="销售单号",index = 16,width =15) |
| | | private String salesorder; |
| | | |
| | | @ApiModelProperty(value = "物料编码(关联material_distribute表)", example = "1") |
| | | @ExcelColumn(name="物料编码(关联material_distribute表)") |
| | | private Integer materialId; |
| | |
| | | @ApiModelProperty(value = "创建人编码", example = "1") |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "创建人编码名称", example = "1") |
| | | private String createUserName; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date createTime; |
| | |
| | | @ApiModelProperty(value = "检验人员编码", example = "1") |
| | | private Integer checkUserId; |
| | | |
| | | @ApiModelProperty(value = "工单状态 0已创建、1已备料、2已完工、3已检验、4已报工、5已入库、6已取消、7生产中", example = "1") |
| | | @ExcelColumn(name="工单状态",valueMapping = "0=已创建;1=已备料;2=已完工;3=已检验;4=已报工;5=已入库;6=已取消;7=生产中;",index = 14,width =15) |
| | | @ApiModelProperty(value = "工单状态 0已创建、1已备料、2已完工、3已检验、4已报工、5已入库、6已取消", example = "1") |
| | | @ExcelColumn(name="工单状态",valueMapping = "0=已创建;1=已备料;2=已完工;3=已检验;4=已报工;5=已入库;6=已取消;",index = 14,width =15) |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "最近状态更新时间") |
| | |
| | | @ApiModelProperty(value = "投料列表") |
| | | private List<MaterialModelVo> materialList; |
| | | |
| | | @ApiModelProperty(value = "工单状态 0已创建、1已备料、2已完工、3已检验、4已报工、5已入库、6已取消、7生产中", example = "1") |
| | | @ApiModelProperty(value = "工单状态 0已创建、1已备料、2已完工、3已检验、4已报工、5已入库、6已取消", example = "1") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "优先级(排序码)字段", example = "1") |
| | |
| | | |
| | | @ApiModelProperty(value = "生产人员分配集合" ) |
| | | private List<WorkorderUserExtListVO> proUserList; |
| | | |
| | | @ApiModelProperty(value = "创建人") |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "创建人名称") |
| | | private String createUserName; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "字典表对应lables") |
| | | private String smodelLabel; |
| | | |
| | | @ApiModelProperty(value = "报工时长(秒)", example = "1") |
| | | @ExcelColumn(name="报工时长(秒)") |
| | | private Integer duration; |
| | | |
| | | @ApiModelProperty(value = "工资结果(元)", example = "1") |
| | | @ExcelColumn(name="工资结果(元)") |
| | | private Integer salary; |
| | | @ApiModelProperty(value = "工资单价(元)", example = "1") |
| | | @ExcelColumn(name="工资单价(元)") |
| | | private Integer salaryPrice; |
| | | |
| | | @ApiModelProperty(value = "标准数量", example = "1") |
| | | @ExcelColumn(name="标准数量") |
| | | private Integer salaryNum; |
| | | |
| | | @ApiModelProperty(value = "标准时长(秒)") |
| | | @ExcelColumn(name="标准时长(秒)") |
| | | private String salaryTimes; |
| | | |
| | | @ApiModelProperty(value = "不良品是否计入 0否 1是", example = "1") |
| | | @ExcelColumn(name="不良品是否计入 0否 1是") |
| | | private Integer salaryUnqualified; |
| | | |
| | | @ApiModelProperty(value = "计价方式 0计件 1计时", example = "1") |
| | | @ExcelColumn(name="计价方式 0计件 1计时") |
| | | private Integer salaryType; |
| | | |
| | | } |
| | |
| | | @NotBlank(message = "姓名不能为空", groups = {OperaType.Create.class/*, OperaType.Update.class*/}) |
| | | private String realname; |
| | | |
| | | // @NotBlank(message = "工号不能为空", groups = {OperaType.Create.class/*, OperaType.Update.class*/}) |
| | | @NotBlank(message = "工号不能为空", groups = {OperaType.Create.class/*, OperaType.Update.class*/}) |
| | | @ApiModelProperty(value = "总账号工号") |
| | | private String empNo; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "更新人信息") |
| | | private SystemUser updateUserInfo; |
| | | |
| | | @ApiModelProperty(value = "文件访问前缀") |
| | | private String resourcePath; |
| | | } |
| | |
| | | import doumeemes.core.model.PageData; |
| | | import doumeemes.core.model.PageWrap; |
| | | import doumeemes.dao.business.model.SalaryParam; |
| | | import doumeemes.dao.business.vo.SalaryParamVO; |
| | | import doumeemes.dao.ext.dto.SalaryParamDTO; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 创建 |
| | | * |
| | | * |
| | | * @param salaryParam 实体对象 |
| | | * @return Integer |
| | | */ |
| | |
| | | */ |
| | | void updateById(SalaryParam salaryParam); |
| | | |
| | | |
| | | /** |
| | | * 主键更新 |
| | | * |
| | | * @param salaryParam 实体对象 |
| | | */ |
| | | void update(SalaryParam salaryParam); |
| | | |
| | | /** |
| | | * 批量主键更新 |
| | | * |
| | |
| | | * @return List<SalaryParam> |
| | | */ |
| | | List<SalaryParam> findList(SalaryParam salaryParam); |
| | | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param pageWrap 分页对象 |
| | | * @return PageData<SalaryParam> |
| | | */ |
| | | PageData<SalaryParamVO> findPage(PageWrap<SalaryParamDTO> pageWrap); |
| | | PageData<SalaryParam> findPage(PageWrap<SalaryParam> pageWrap); |
| | | |
| | | /** |
| | | * 条件统计 |
| | |
| | | * @return long |
| | | */ |
| | | long count(SalaryParam salaryParam); |
| | | |
| | | /** |
| | | * |
| | | * @param file |
| | | */ |
| | | void importPlans(MultipartFile file); |
| | | } |
| | |
| | | import doumeemes.dao.business.model.Company; |
| | | import doumeemes.dao.business.model.CompanyLog; |
| | | import doumeemes.dao.business.model.CompanyOpen; |
| | | import doumeemes.dao.ext.vo.CompanyExtListVO; |
| | | import doumeemes.service.business.CompanyLogService; |
| | | import doumeemes.service.business.CompanyOpenService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import doumeemes.service.ext.DepartmentExtService; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | |
| | | @Autowired |
| | | CompanyLogService companyLogService; |
| | | |
| | | @Autowired |
| | | @Lazy |
| | | private DepartmentExtService departmentExtService; |
| | | |
| | | @Override |
| | | public Integer create(CompanyOpen companyOpen) { |
| | |
| | | company.setOepnValidDate(companyOpen.getValidDate()); |
| | | company.setOepnType(companyOpen.getOepnType()); |
| | | companyMapper.updateById(company); |
| | | Company company1 = companyMapper.selectById(companyOpen.getCompanyId()); |
| | | |
| | | |
| | | CompanyLog companyLog = new CompanyLog(); |
| | | companyLog.setDeleted((byte) Constants.ZERO); |
| | |
| | | companyLog.setUpdateType(Constants.CompanyUpdateType.UPDATE_VAIL_DATE.getKey()); |
| | | companyLog.setDetail("有效期从"+format.format(cyResult.getOepnValidDate())+"日调整至"+format.format(companyOpen.getValidDate())); |
| | | companyLogService.create(companyLog); |
| | | |
| | | initRedisCache(company1); |
| | | } |
| | | |
| | | private void initRedisCache(Company com) { |
| | | CompanyExtListVO c = new CompanyExtListVO(); |
| | | BeanUtils.copyProperties(com,c); |
| | | departmentExtService.loadComDepart(c); |
| | | departmentExtService.initCompnayCodesByCom(com); |
| | | } |
| | | |
| | | @Override |
| | |
| | | QueryWrapper<CompanyOpen> wrapper = new QueryWrapper<>(companyOpen); |
| | | return companyOpenMapper.selectList(wrapper); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public PageData<CompanyOpen> findPage(PageWrap<CompanyOpen> pageWrap) { |
| | | IPage<CompanyOpen> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | |
| | | import doumeemes.dao.business.model.CompanyLog; |
| | | import doumeemes.dao.business.model.Multifiles; |
| | | import doumeemes.dao.ext.dto.DingDingConfig; |
| | | import doumeemes.dao.ext.vo.CompanyExtListVO; |
| | | import doumeemes.service.business.CompanyLogService; |
| | | import doumeemes.service.business.CompanyService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import doumeemes.service.business.MultifilesService; |
| | | import doumeemes.service.ext.DepartmentExtService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | |
| | | @Autowired |
| | | private CompanyLogService companyLogService; |
| | | |
| | | @Autowired |
| | | @Lazy |
| | | private DepartmentExtService departmentExtService; |
| | | |
| | | |
| | | @Override |
| | |
| | | update.setStatus(company.getStatus()); |
| | | update.setDingdingInfo(company.getDingdingInfo()); |
| | | companyMapper.updateById(update); |
| | | |
| | | // 更新记录 |
| | | CompanyLog companyLog = new CompanyLog(); |
| | | companyLog.setDeleted((byte)Constants.ZERO); |
| | | companyLog.setUpdateUser(principal.getId()); |
| | | companyLog.setCreateUser(principal.getId()); |
| | | companyLog.setCreateTime(new Date()); |
| | | companyLog.setUpdateTime(new Date()); |
| | | companyLog.setCompanyId(company.getId()); |
| | | |
| | | if(Objects.nonNull(company.getStatus())){ |
| | | CompanyLog companyLog = new CompanyLog(); |
| | | companyLog.setDeleted((byte)Constants.ZERO); |
| | | companyLog.setUpdateUser(principal.getId()); |
| | | companyLog.setCreateUser(principal.getId()); |
| | | companyLog.setCreateTime(new Date()); |
| | | companyLog.setUpdateTime(new Date()); |
| | | companyLog.setRemark(company.getStatus() == 1 ? "数据启用" : "数据禁用"); |
| | | companyLog.setCompanyId(company.getId()); |
| | | companyLog.setUpdateType(company.getStatus() == 1 ? Constants.CompanyUpdateType.UPDATE_ENABLE.getKey() |
| | | : Constants.CompanyUpdateType.UPDATE_DISABLE.getKey()); |
| | | companyLog.setDetail(company.getStatus() == 1 ? "数据启用" : "数据禁用"); |
| | | companyLogService.create(companyLog); |
| | | }else { |
| | | CompanyLog companyLog = new CompanyLog(); |
| | | companyLog.setDeleted((byte)Constants.ZERO); |
| | | companyLog.setUpdateUser(principal.getId()); |
| | | companyLog.setCreateUser(principal.getId()); |
| | | companyLog.setCreateTime(new Date()); |
| | | companyLog.setUpdateTime(new Date()); |
| | | companyLog.setRemark("更新企业数据"); |
| | | companyLog.setCompanyId(company.getId()); |
| | | companyLog.setUpdateType(Constants.CompanyUpdateType.UPDATE_CONTENT.getKey()); |
| | | companyLog.setDetail("更新企业数据"); |
| | | companyLogService.create(companyLog); |
| | | } |
| | | companyLogService.create(companyLog); |
| | | Company company1 = companyMapper.selectById(company.getId()); |
| | | initRedisCache(company1); |
| | | } |
| | | |
| | | |
| | | private void initRedisCache(Company com) { |
| | | CompanyExtListVO c = new CompanyExtListVO(); |
| | | BeanUtils.copyProperties(com,c); |
| | | departmentExtService.loadComDepart(c); |
| | | departmentExtService.initCompnayCodesByCom(com); |
| | | } |
| | | |
| | | private Boolean isParseObject(String dingdingInfo){ |
| | |
| | | QueryWrapper<Company> wrapper = new QueryWrapper<>(company); |
| | | return companyMapper.selectList(wrapper); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public PageData<Company> findPage(PageWrap<Company> pageWrap) { |
| | | IPage<Company> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | |
| | | package doumeemes.service.business.impl; |
| | | |
| | | import doumeemes.core.constants.ResponseStatus; |
| | | import doumeemes.core.exception.BusinessException; |
| | | import doumeemes.core.model.LoginUserInfo; |
| | | import doumeemes.core.model.PageData; |
| | | import doumeemes.core.model.PageWrap; |
| | | import doumeemes.core.utils.Constants; |
| | | import doumeemes.core.utils.Utils; |
| | | import doumeemes.core.utils.excel.EasyExcelUtil; |
| | | import doumeemes.dao.business.DepartmentMapper; |
| | | import doumeemes.dao.business.MaterialMapper; |
| | | import doumeemes.dao.business.ProceduresMapper; |
| | | import doumeemes.dao.business.SalaryParamMapper; |
| | | import doumeemes.dao.business.model.*; |
| | | import doumeemes.dao.business.vo.SalaryParamVO; |
| | | import doumeemes.dao.ext.dto.SalaryParamDTO; |
| | | import doumeemes.dao.ext.dto.SalaryParamImportDTO; |
| | | import doumeemes.service.business.DepartmentService; |
| | | import doumeemes.dao.business.model.SalaryParam; |
| | | import doumeemes.service.business.SalaryParamService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 设置类-绩效工资配置表Service实现 |
| | |
| | | @Autowired |
| | | private SalaryParamMapper salaryParamMapper; |
| | | |
| | | @Autowired |
| | | private DepartmentMapper departmentMapper; |
| | | |
| | | @Autowired |
| | | private MaterialMapper materialMapper; |
| | | |
| | | @Autowired |
| | | private ProceduresMapper proceduresMapper; |
| | | |
| | | @Override |
| | | public Integer create(SalaryParam salaryParam) { |
| | | |
| | | |
| | | LoginUserInfo principal = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | |
| | | SalaryParam insert = new SalaryParam(); |
| | | insert.setRootDepartId(salaryParam.getRootDepartId()); |
| | | insert.setDepartId(salaryParam.getDepartId()); |
| | | insert.setProcedureId(salaryParam.getProcedureId()); |
| | | insert.setMaterialId(salaryParam.getMaterialId()); |
| | | insert.setDeleted((byte) Constants.ZERO); |
| | | if(findOne(insert )!=null){ |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(),"同一个物料在相同工序不能重复配置哦!"); |
| | | } |
| | | insert.setCreateUser(principal.getId()); |
| | | insert.setCreateTime(new Date()); |
| | | insert.setUpdateUser(principal.getId()); |
| | | insert.setUpdateTime(new Date()); |
| | | insert.setRemark(salaryParam.getRemark()); |
| | | insert.setSalary(salaryParam.getSalary()); |
| | | insert.setNum(salaryParam.getNum()); |
| | | insert.setTimes(salaryParam.getTimes()); |
| | | insert.setUnqualified(salaryParam.getUnqualified()); |
| | | insert.setType(salaryParam.getType()); |
| | | salaryParamMapper.insert(insert); |
| | | salaryParamMapper.insert(salaryParam); |
| | | return salaryParam.getId(); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void update(SalaryParam salaryParam) { |
| | | LoginUserInfo principal = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | UpdateWrapper<SalaryParam> wrapper = new UpdateWrapper<>(); |
| | | wrapper.lambda() |
| | | .eq(SalaryParam::getId,salaryParam.getId()) |
| | | .set(SalaryParam::getUpdateTime,new Date()) |
| | | .set(SalaryParam::getUpdateUser,principal.getId()) |
| | | .set(SalaryParam::getType,salaryParam.getType()) |
| | | .set(SalaryParam::getDepartId,salaryParam.getDepartId()) |
| | | .set(SalaryParam::getMaterialId,salaryParam.getMaterialId()) |
| | | .set(SalaryParam::getProcedureId,salaryParam.getProcedureId()) |
| | | .set(SalaryParam::getSalary,salaryParam.getSalary()) |
| | | .set(SalaryParam::getNum,salaryParam.getNum()) |
| | | .set(SalaryParam::getTimes,salaryParam.getTimes()) |
| | | .set(SalaryParam::getUnqualified,salaryParam.getUnqualified()); |
| | | salaryParamMapper.update(null,wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void updateByIdInBatch(List<SalaryParam> salaryParams) { |
| | | if (CollectionUtils.isEmpty(salaryParams)) { |
| | | return; |
| | |
| | | QueryWrapper<SalaryParam> wrapper = new QueryWrapper<>(salaryParam); |
| | | return salaryParamMapper.selectList(wrapper); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public PageData<SalaryParamVO> findPage(PageWrap<SalaryParamDTO> pageWrap) { |
| | | public PageData<SalaryParam> findPage(PageWrap<SalaryParam> pageWrap) { |
| | | IPage<SalaryParam> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | SalaryParamDTO model = pageWrap.getModel(); |
| | | return PageData.from(salaryParamMapper.selectPage(page, model)); |
| | | QueryWrapper<SalaryParam> queryWrapper = new QueryWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.lambda().eq(SalaryParam::getId, pageWrap.getModel().getId()); |
| | | } |
| | | if (pageWrap.getModel().getDeleted() != null) { |
| | | queryWrapper.lambda().eq(SalaryParam::getDeleted, pageWrap.getModel().getDeleted()); |
| | | } |
| | | if (pageWrap.getModel().getCreateUser() != null) { |
| | | queryWrapper.lambda().eq(SalaryParam::getCreateUser, pageWrap.getModel().getCreateUser()); |
| | | } |
| | | if (pageWrap.getModel().getCreateTime() != null) { |
| | | queryWrapper.lambda().ge(SalaryParam::getCreateTime, Utils.Date.getStart(pageWrap.getModel().getCreateTime())); |
| | | queryWrapper.lambda().le(SalaryParam::getCreateTime, Utils.Date.getEnd(pageWrap.getModel().getCreateTime())); |
| | | } |
| | | if (pageWrap.getModel().getUpdateUser() != null) { |
| | | queryWrapper.lambda().eq(SalaryParam::getUpdateUser, pageWrap.getModel().getUpdateUser()); |
| | | } |
| | | if (pageWrap.getModel().getUpdateTime() != null) { |
| | | queryWrapper.lambda().ge(SalaryParam::getUpdateTime, Utils.Date.getStart(pageWrap.getModel().getUpdateTime())); |
| | | queryWrapper.lambda().le(SalaryParam::getUpdateTime, Utils.Date.getEnd(pageWrap.getModel().getUpdateTime())); |
| | | } |
| | | if (pageWrap.getModel().getRemark() != null) { |
| | | queryWrapper.lambda().eq(SalaryParam::getRemark, pageWrap.getModel().getRemark()); |
| | | } |
| | | if (pageWrap.getModel().getRootDepartId() != null) { |
| | | queryWrapper.lambda().eq(SalaryParam::getRootDepartId, pageWrap.getModel().getRootDepartId()); |
| | | } |
| | | if (pageWrap.getModel().getDepartId() != null) { |
| | | queryWrapper.lambda().eq(SalaryParam::getDepartId, pageWrap.getModel().getDepartId()); |
| | | } |
| | | if (pageWrap.getModel().getProcedureId() != null) { |
| | | queryWrapper.lambda().eq(SalaryParam::getProcedureId, pageWrap.getModel().getProcedureId()); |
| | | } |
| | | if (pageWrap.getModel().getBomId() != null) { |
| | | queryWrapper.lambda().eq(SalaryParam::getBomId, pageWrap.getModel().getBomId()); |
| | | } |
| | | if (pageWrap.getModel().getSalary() != null) { |
| | | queryWrapper.lambda().eq(SalaryParam::getSalary, pageWrap.getModel().getSalary()); |
| | | } |
| | | if (pageWrap.getModel().getNum() != null) { |
| | | queryWrapper.lambda().eq(SalaryParam::getNum, pageWrap.getModel().getNum()); |
| | | } |
| | | if (pageWrap.getModel().getTimes() != null) { |
| | | queryWrapper.lambda().eq(SalaryParam::getTimes, pageWrap.getModel().getTimes()); |
| | | } |
| | | if (pageWrap.getModel().getUnqualified() != null) { |
| | | queryWrapper.lambda().eq(SalaryParam::getUnqualified, pageWrap.getModel().getUnqualified()); |
| | | } |
| | | if (pageWrap.getModel().getType() != null) { |
| | | queryWrapper.lambda().eq(SalaryParam::getType, pageWrap.getModel().getType()); |
| | | } |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | | } else { |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | } |
| | | } |
| | | return PageData.from(salaryParamMapper.selectPage(page, queryWrapper)); |
| | | } |
| | | |
| | | @Override |
| | | public long count(SalaryParam salaryParam) { |
| | | QueryWrapper<SalaryParam> wrapper = new QueryWrapper<>(salaryParam); |
| | | return salaryParamMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | @Override |
| | | public void importPlans(MultipartFile file) { |
| | | |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!Constants.equalsInteger(user.getType(),Constants.USERTYPE.COM)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,您无权限进行该操作!"); |
| | | } |
| | | //解析excel |
| | | List<SalaryParamImportDTO> plansList = EasyExcelUtil.importExcel(file, 1, 1, SalaryParamImportDTO.class); |
| | | if(plansList == null || plansList.size()==0){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "导入数据内容有误!"); |
| | | } |
| | | |
| | | plansList.forEach(s->{ |
| | | if (Objects.isNull(s.getType()) |
| | | || Objects.isNull(s.getDepartName()) |
| | | || Objects.isNull(s.getMaterialCode()) |
| | | || Objects.isNull(s.getProcedureName()) |
| | | || Objects.isNull(s.getNum())){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "导入数据内容有误!"); |
| | | } |
| | | }); |
| | | |
| | | |
| | | for (int i = 0; i < plansList.size(); i++) { |
| | | SalaryParamImportDTO salaryParamImportDTO = plansList.get(i); |
| | | |
| | | QueryWrapper<Department> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | | .eq(Department::getName,salaryParamImportDTO.getDepartName()) |
| | | .eq(Department::getType,Constants.DEPART_TYPE.factory) |
| | | .last("limit 1"); |
| | | Department department = departmentMapper.selectOne(wrapper); |
| | | if (Objects.isNull(department)){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "导入数据内容【公司名称】有误!"); |
| | | } |
| | | |
| | | QueryWrapper<Material> materialWrapper = new QueryWrapper<>(); |
| | | materialWrapper.lambda() |
| | | .eq(Material::getCode,salaryParamImportDTO.getMaterialCode()) |
| | | .eq(Material::getRootDepartId,department.getRootId()) |
| | | .last("limit 1"); |
| | | Material material = materialMapper.selectOne(materialWrapper); |
| | | |
| | | if (Objects.isNull(material)){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "导入数据内容【产品编码】有误!"); |
| | | } |
| | | if (Objects.nonNull(material) && Objects.equals(material.getName(),salaryParamImportDTO.getMaterialName())){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "导入数据内容【产品名称】有误!"); |
| | | } |
| | | QueryWrapper<Procedures> proceduresWrapper = new QueryWrapper<>(); |
| | | proceduresWrapper.lambda() |
| | | .eq(Procedures::getName,salaryParamImportDTO.getProcedureName()) |
| | | .eq(Procedures::getRootDepartId,department.getRootId()) |
| | | .eq(Procedures::getOrgId,department.getId()) |
| | | .last("limit 1"); |
| | | Procedures procedures = proceduresMapper.selectOne(proceduresWrapper); |
| | | if (Objects.isNull(procedures)){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "导入数据内容【工序名称】有误!"); |
| | | } |
| | | SalaryParam salaryParam = new SalaryParam(); |
| | | salaryParam.setRootDepartId(department.getRootId()); |
| | | salaryParam.setDepartId(department.getId()); |
| | | salaryParam.setProcedureId(procedures.getId()); |
| | | salaryParam.setMaterialId(material.getId()); |
| | | salaryParam.setSalary(salaryParamImportDTO.getSalary()); |
| | | salaryParam.setNum(new BigDecimal(salaryParamImportDTO.getNum())); |
| | | salaryParam.setTimes(getIntegerTimes(salaryParamImportDTO.getTimesName())); |
| | | Integer unqualified = Optional.ofNullable(salaryParamImportDTO.getUnqualified()).map(s -> { |
| | | if ("否".equals(s)) { |
| | | return 0; |
| | | } else { |
| | | return 1; |
| | | } |
| | | }).orElse(0); |
| | | salaryParam.setUnqualified(unqualified); |
| | | |
| | | Integer type = Optional.ofNullable(salaryParamImportDTO.getUnqualified()).map(s -> { |
| | | if ("计件".equals(s)) { |
| | | return 0; |
| | | } else { |
| | | return 1; |
| | | } |
| | | }).orElse(0); |
| | | salaryParam.setType(type); |
| | | create(salaryParam); |
| | | } |
| | | |
| | | } |
| | | |
| | | private Integer getIntegerTimes(String a) { |
| | | int h =0,m=0,s=0; |
| | | try{ |
| | | int hIndex =a.lastIndexOf("小时"); |
| | | int mIndex=a.lastIndexOf("分钟"); |
| | | int sIndex =a.lastIndexOf("秒"); |
| | | if( hIndex>0){ |
| | | h = Integer.parseInt(a.substring(0,hIndex)); |
| | | } |
| | | if(mIndex > hIndex){ |
| | | m = Integer.parseInt(a.substring(hIndex >=0?hIndex+2:0,mIndex)); |
| | | } |
| | | if(sIndex > mIndex){ |
| | | s = Integer.parseInt(a.substring(mIndex >= 0 ? mIndex+2 : 0, sIndex)); |
| | | } |
| | | return h*3600+m*60+s; |
| | | }catch (Exception e){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,时长【"+a+"】格式不正确!" ); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | WOutboundInBodyBean wOutboundInBodyBean = wOutboundInBodyBeans.get(Constants.ZERO); |
| | | //累计入库数量 |
| | | wOutboundInBodyBean.setNum(wOutboundInBodyBeans.stream().map(s -> s.getNum()).reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | if(wOutboundInBodyBean.getNum().compareTo(BigDecimal.ZERO)<=Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "数量异常,请检查数量!"); |
| | | } |
| | | WOutboundDetail wOutboundDetail = new WOutboundDetail(); |
| | | //查询物料数据 |
| | | MaterialDistribute materialDistribute = materialDistributeMapper.selectById(wOutboundInBodyBean.getMaterialId()); |
| | |
| | | |
| | | //工单对象 |
| | | Workorder workorder=workorderExtMapper.selectById(wc.getWorkorderId()); |
| | | if(workorder==null |
| | | || workorder.getStatus()==Constants.WORKORDER_STATUS.done |
| | | ||workorder.getStatus()==Constants.WORKORDER_STATUS.baogong |
| | | ||workorder.getStatus()==Constants.WORKORDER_STATUS.instock |
| | | ||workorder.getStatus()==Constants.WORKORDER_STATUS.cancel){ |
| | | if(workorder==null || workorder.getStatus()==Constants.WORKORDER_STATUS.done||workorder.getStatus()==Constants.WORKORDER_STATUS.baogong |
| | | ||workorder.getStatus()==Constants.WORKORDER_STATUS.instock ||workorder.getStatus()==Constants.WORKORDER_STATUS.cancel){ |
| | | return ApiResponse.failed("工单不允许检验"); |
| | | } |
| | | if(workorder.getPlanNum()!=null){ |
| | |
| | | |
| | | //工单对象 |
| | | Workorder workorder=workorderExtMapper.selectById(wc.getWorkorderId()); |
| | | if(workorder==null || workorder.getStatus()==Constants.WORKORDER_STATUS.done || workorder.getStatus()==Constants.WORKORDER_STATUS.done||workorder.getStatus()==Constants.WORKORDER_STATUS.baogong |
| | | if(workorder==null || workorder.getStatus()==Constants.WORKORDER_STATUS.done||workorder.getStatus()==Constants.WORKORDER_STATUS.baogong |
| | | ||workorder.getStatus()==Constants.WORKORDER_STATUS.instock ||workorder.getStatus()==Constants.WORKORDER_STATUS.cancel){ |
| | | return ApiResponse.failed("工单不允许检验"); |
| | | } |
| | |
| | | import doumeemes.core.model.LoginUserInfo; |
| | | import doumeemes.core.model.PageData; |
| | | import doumeemes.core.model.PageWrap; |
| | | import doumeemes.dao.business.dto.AutoWorkReportDTO; |
| | | import doumeemes.dao.business.model.Plans; |
| | | import doumeemes.dao.business.model.Workorder; |
| | | import doumeemes.dao.ext.vo.PlansExtListCountVO; |
| | |
| | | void pauseByIdForStandard(Plans model,LoginUserInfo userInfo); |
| | | void regainByIdForStandard(Plans model, LoginUserInfo userInfo); |
| | | List<PlansExtListVO> getListByWorkPlan(Integer workPlanId); |
| | | |
| | | /** |
| | | * 一键报工 |
| | | * @param user |
| | | * @param autoWorkReportDTO |
| | | */ |
| | | void autoWorkReport(LoginUserInfo user, AutoWorkReportDTO autoWorkReportDTO); |
| | | } |
| | |
| | | import doumeemes.dao.business.model.Workorder; |
| | | import doumeemes.dao.business.model.WorkorderRecord; |
| | | import doumeemes.dao.ext.bean.EndCheckApBean; |
| | | import doumeemes.dao.ext.dto.QuerySalaryStatisticDTO; |
| | | import doumeemes.dao.ext.dto.QueryUserSalaryListDTO; |
| | | import doumeemes.dao.ext.dto.QueryWorkorderRecordExtDTO; |
| | | import doumeemes.dao.ext.vo.SalaryStatisticsListVO; |
| | | import doumeemes.dao.ext.vo.UserSalaryListVO; |
| | | import doumeemes.dao.ext.vo.WorkorderRecordExtListVO; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | |
| | | void exportExcel(PageWrap<QueryWorkorderRecordExtDTO> pageWrap ,HttpServletResponse response); |
| | | |
| | | PageData<SalaryStatisticsListVO> salaryStatistic(PageWrap<QuerySalaryStatisticDTO> pageWrap); |
| | | |
| | | PageData<UserSalaryListVO> userSalaryPage(PageWrap<QueryUserSalaryListDTO> pageWrap); |
| | | |
| | | void exportUserSalary(PageWrap<QueryUserSalaryListDTO> pageWrap, HttpServletResponse response); |
| | | |
| | | void exportSalaryStatistics(PageWrap<QuerySalaryStatisticDTO> pageWrap, HttpServletResponse response); |
| | | } |
| | |
| | | import doumeemes.core.model.PageData; |
| | | import doumeemes.core.model.PageWrap; |
| | | import doumeemes.dao.business.dto.CreateMaterialDTO; |
| | | import doumeemes.dao.business.dto.CreateWorkorderRecordDTO; |
| | | import doumeemes.dao.business.dto.DealWorkorderRecordDTO; |
| | | import doumeemes.dao.business.model.Workorder; |
| | | import doumeemes.dao.business.model.WorkorderRecord; |
| | |
| | | |
| | | WorkorderRecord dealWorkorderRecord(DealWorkorderRecordDTO dealWorkorderRecordDTO, LoginUserInfo loginUserInfo); |
| | | |
| | | WorkorderRecord createWorkorderRecord(CreateWorkorderRecordDTO createWorkorderRecordDTO, LoginUserInfo loginUserInfo); |
| | | |
| | | List<WorkorderRecord> getWorkorderRecordList(Integer workorderId); |
| | | |
| | | PageData<WStockExtListVO> choiceStockPageForWorkorder(PageWrap<QueryWStockDto> pageWrap, LoginUserInfo userInfo); |
| | | |
| | | PageData<WStockExtListVO> choiceStockPageForPlans(PageWrap<QueryWStockDto> pageWrap,LoginUserInfo userInfo); |
| | | } |
| | |
| | | return companyInfoListVO; |
| | | } |
| | | String rPath =systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+systemDictDataBiz.queryByCode(Constants.OSS,Constants.MENU_IMG).getCode(); |
| | | companyInfoListVO.setFileurlfull(rPath+companyInfoListVO.getFileStoreAddr()); |
| | | companyInfoListVO.setFileurlfull(rPath+"/"+companyInfoListVO.getFileStoreAddr()); |
| | | |
| | | companyInfoListVO.setSystemUrl( systemDictDataBiz.queryByCode(Constants.EDGP_PARAM,Constants.SYSTEM_URL).getCode()+companyInfoListVO.getId()); |
| | | |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | //加入redis缓存,存储企业信息 |
| | | RedisUtil.addObject(redisTemplate,Constants.RedisKeys.COM_DEPART_TREE_KEY+com.getId(),rootDepart); |
| | | } |
| | | @PostConstruct |
| | | @Override |
| | | public void loadAllDepart() { |
| | | QueryCompanyExtDTO dto = new QueryCompanyExtDTO(); |
| | |
| | | for (Department department:departmentList ) { |
| | | this.dealDepartmentData(department,user); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void dealDepartmentData(Department department,LoginUserInfo user){ |
| | |
| | | import doumeemes.core.utils.excel.EasyExcelUtil; |
| | | import doumeemes.core.utils.redis.RedisUtil; |
| | | import doumeemes.dao.business.PlansMapper; |
| | | import doumeemes.dao.business.WorkorderMapper; |
| | | import doumeemes.dao.business.dto.*; |
| | | import doumeemes.dao.business.model.*; |
| | | import doumeemes.dao.ext.*; |
| | | import doumeemes.dao.ext.dto.*; |
| | | import doumeemes.dao.ext.vo.*; |
| | | import doumeemes.service.ext.*; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 生产计划Service实现 |
| | |
| | | private WorkorderHistoryExtMapper workorderHistoryExtMapper; |
| | | @Autowired |
| | | private WorkorderRecordExtMapper workorderRecordExtMapper; |
| | | @Autowired |
| | | private WorkorderMapper workorderMapper; |
| | | |
| | | @Autowired |
| | | private RouteProcedureExtMapper routeProcedureExtMapper; |
| | | @Autowired |
| | |
| | | private MaterialDistributeExtMapper materialDistributeExtMapper; |
| | | @Autowired |
| | | private WStockExtService wStockExtService; |
| | | @Autowired |
| | | private WorkorderRecordStandardService workorderRecordStandardService; |
| | | |
| | | @Override |
| | | public PlansExtListVO findById(Integer id){ |
| | |
| | | // //统计已完工数量 |
| | | // param.setStatus(Constants.WORKORDER_STATUS.done); |
| | | // plan.setDoneNum(workorderExtMapper.sumOrderNum(param)); |
| | | QueryBomExtDTO bb = new QueryBomExtDTO(); |
| | | bb.setDepartId(plan.getDepartId()); |
| | | bb.setDeleted(Constants.ZERO); |
| | | bb.setRootDepartId(user.getRootDepartment().getId()); |
| | | bb.setMaterialId(plan.getMaterialId()); |
| | | bb.setProcedureId(plan.getProcedureId()); |
| | | BomExtListVO versionBom = bomExtMapper.selectByModel( bb); |
| | | if(versionBom == null || StringUtils.isBlank(versionBom.getVersion()) || versionBom.getBomVersionId() == null){ |
| | | plan.setHasBom(Constants.ZERO); |
| | | }else { |
| | | plan.setBomType(Constants.formatIntegerNum(versionBom.getType())); |
| | | plan.setHasBom(Constants.ONE); |
| | | } |
| | | return plan; |
| | | } |
| | | |
| | |
| | | // p.setDistributNum(tp.getDistributNum()); |
| | | // p.setDoneNum(tp.getDoneNum()); |
| | | p.setIsStock(wStockExtService.isStockForPlan(p)); |
| | | p.setHasExpire(false); |
| | | p.setStatus(Constants.formatIntegerNum(p.getStatus())); |
| | | if ( !p.getStatus().equals(Constants.PLAN_STATUS.done) && |
| | | !p.getStatus().equals(Constants.PLAN_STATUS.close)){ |
| | | if (Objects.nonNull(p.getPlanDate())){ |
| | | p.setHasExpire(DateUtil.toDateLocalDateTime(p.getWorkPlanPlanDate()).toLocalDate().isBefore(LocalDate.now())); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return PageData.from(new PageInfo<>(result)); |
| | |
| | | distributeDone(user, param,param.getPlanNum()); |
| | | } |
| | | |
| | | private Workorder distributeDone(LoginUserInfo user, Workorder param,int thisPlanNum) { |
| | | private void distributeDone(LoginUserInfo user, Workorder param,int thisPlanNum) { |
| | | if(param.getPlanId()== null |
| | | ||param.getPlanDate() == null |
| | | || param.getProGroupId()==null |
| | |
| | | if(Constants.equalsInteger(mp.getPaused(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,计划已暂停!"); |
| | | } |
| | | if(Constants.formatIntegerNum(mp.getWorkorderDistributNum())+thisPlanNum > Constants.formatIntegerNum(mp.getNum())){ |
| | | if(Constants.formatIntegerNum(mp.getDistributNum())+thisPlanNum > Constants.formatIntegerNum(mp.getNum())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,累计分配数量大于计划数量!"); |
| | | } |
| | | if(!Constants.equalsInteger(mp.getStatus(),Constants.PLAN_STATUS.publish)&&!Constants.equalsInteger(mp.getStatus(),Constants.PLAN_STATUS.distribute)){ |
| | |
| | | //生产人员记录 |
| | | workorderUserExtMapper.insert(wu); |
| | | } |
| | | return order; |
| | | |
| | | } |
| | | |
| | | private void checkUserAndGroup(Workorder param, PlansExtListVO model,LoginUserInfo user) throws BusinessException{ |
| | |
| | | } |
| | | /** |
| | | * 恢复计划 |
| | | * @param |
| | | * @param p |
| | | */ |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | @Override |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 一键报工 |
| | | * @param user |
| | | */ |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | @Override |
| | | public void autoWorkReport(LoginUserInfo user, AutoWorkReportDTO autoWorkReportDTO){ |
| | | //查询工工序计划状态 |
| | | Plans plans = plansExtMapper.selectById(autoWorkReportDTO.getPlansId()); |
| | | if(Objects.isNull(plans)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到工序计划数据"); |
| | | } |
| | | if(!(plans.getStatus().equals(Constants.PLAN_STATUS.create)||plans.getStatus().equals(Constants.PLAN_STATUS.distribute))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"工序计划已流转,无法操作"); |
| | | } |
| | | if(plans.getPaused().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"工序计划已暂停,无法操作"); |
| | | } |
| | | if(Objects.isNull(autoWorkReportDTO.getCreateWorkorderRecordDTO())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"参数错误:产出数据"); |
| | | } |
| | | //查询工序计划已分配数量 |
| | | List<Workorder> workorderList = workorderMapper.selectList(new QueryWrapper<Workorder>().eq("PLAN_ID",plans.getId()) |
| | | .notIn("STATUS",7,8)); |
| | | //本次产出数量 |
| | | BigDecimal num = autoWorkReportDTO.getCreateWorkorderRecordDTO().getQualifiedNum().add(autoWorkReportDTO.getCreateWorkorderRecordDTO().getUnQualifiedNum()); |
| | | if(num.compareTo(BigDecimal.ZERO)<=Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"参数错误:产出数据"); |
| | | } |
| | | //工单已分配数量 |
| | | Integer produceNum = workorderList.stream().map(s -> s.getPlanNum()).reduce(Constants.ZERO, Integer::sum); |
| | | Integer surplusNum = plans.getNum() - produceNum; |
| | | if(num.compareTo(BigDecimal.valueOf(surplusNum))>0){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"参数错误:超出工单剩余可分配数量"); |
| | | } |
| | | Workorder param = new Workorder(); |
| | | param.setPlanId(autoWorkReportDTO.getPlansId()); |
| | | param.setPlanDate(new Date()); |
| | | param.setProGroupId(autoWorkReportDTO.getProGroupId()); |
| | | param.setProUserList(autoWorkReportDTO.getProUserList()); |
| | | param.setPlanNum(plans.getNum()); |
| | | //生成工单信息 |
| | | Workorder workorder = this.distributeDone(user,param,plans.getNum()); |
| | | //工单投料记录 |
| | | CreateMaterialDTO createMaterialDTO = new CreateMaterialDTO(); |
| | | if(!Objects.isNull(autoWorkReportDTO.getRecordList())&&autoWorkReportDTO.getRecordList().size()>Constants.ZERO){ |
| | | createMaterialDTO.setId(workorder.getId()); |
| | | createMaterialDTO.setRecordList(autoWorkReportDTO.getRecordList()); |
| | | workorderRecordStandardService.createMaterialStandard(createMaterialDTO); |
| | | } |
| | | //工单产出记录 |
| | | autoWorkReportDTO.getCreateWorkorderRecordDTO().setWorkorderId(workorder.getId()); |
| | | workorderRecordStandardService.createWorkorderRecord(autoWorkReportDTO.getCreateWorkorderRecordDTO(),user); |
| | | //工单报工 |
| | | workorderRecordStandardService.comfirmDone(workorder); |
| | | //更新工单状态 |
| | | if(num.compareTo(BigDecimal.valueOf(surplusNum))==Constants.ZERO){ |
| | | plans.setStatus(Constants.PLAN_STATUS.done); |
| | | }else{ |
| | | if(plans.getStatus().equals(Constants.PLAN_STATUS.create)){ |
| | | plans.setStatus(Constants.PLAN_STATUS.distribute); |
| | | } |
| | | } |
| | | plansExtMapper.updateById(plans); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | || Objects.isNull(workPlansSaveDTO.getNum()) |
| | | || Objects.isNull(workPlansSaveDTO.getFactoryId()) |
| | | || Objects.isNull(workPlansSaveDTO.getUnitId()) |
| | | || Objects.isNull(workPlansSaveDTO.getMaterialId()) |
| | | || Objects.isNull(workPlansSaveDTO.getStartDate()) |
| | | || workPlansSaveDTO.getStartDate().getTime() > workPlansSaveDTO.getPlanDate().getTime()){ |
| | | || Objects.isNull(workPlansSaveDTO.getMaterialId())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | WorkPlans workPlans = new WorkPlans(); |
| | |
| | | i.setFinishUnQualifiedNum(Objects.isNull(plansExtListVO.getUnqulifiedNum())?Constants.ZERO:plansExtListVO.getUnqulifiedNum()); |
| | | i.setFinishNum(Objects.isNull(plansExtListVO.getDoneNum())?Constants.ZERO:plansExtListVO.getDoneNum()); |
| | | } |
| | | i.setHasExpire(false); |
| | | i.setStatus(Constants.formatIntegerNum(i.getStatus())); |
| | | if ( !i.getStatus().equals(Constants.WORKPLANHISTORY_TYPE.done) && |
| | | !i.getStatus().equals(Constants.WORKPLANHISTORY_TYPE.close)){ |
| | | if (Objects.nonNull(i.getPlanDate())){ |
| | | i.setHasExpire(DateUtil.toDateLocalDateTime(i.getPlanDate()).toLocalDate().isBefore(LocalDate.now())); |
| | | } |
| | | } |
| | | |
| | | |
| | | }); |
| | | } |
| | | return PageData.from(new PageInfo<>(result)); |
| | |
| | | if(Constants.formatIntegerNum(p.getNum())<=0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,第【"+(index+2)+"】行【计划生产数量】数据错误!"); |
| | | } |
| | | if(p.getStartDate() == null){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,第【"+(index+2)+"】行【计划开始日期】数据错误,正确格式为:yyyy-MM-dd(如2022-06-07)!"); |
| | | } |
| | | if(p.getPlanDate() == null){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,第【"+(index+2)+"】行【计划结束日期】数据错误,正确格式为:yyyy-MM-dd(如2022-06-07)!"); |
| | | } |
| | | if(p.getPlanDate().getTime() <= p.getStartDate().getTime()){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,第【"+(index+2)+"】行【计划开始日期】要早于【计划结束日期】!"); |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,第【"+(index+2)+"】行【计划日期】数据错误,正确格式为:yyyy-MM-dd(如2022-06-07)!"); |
| | | } |
| | | if(StringUtils.isBlank(p.getMaterialCode())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,第【"+(index+2)+"】行【产品编码】数据错误!"); |
| | |
| | | result.setStartNum(workorderExtMapper.selectCount(param)); |
| | | param.setStatusList(new ArrayList<>()); |
| | | param.getStatusList().add(Constants.WORKORDER_STATUS.done); |
| | | param.getStatusList().add(Constants.WORKORDER_STATUS.producing); |
| | | param.getStatusList().add(Constants.WORKORDER_STATUS.check); |
| | | //进行中数量 |
| | | result.setIngNum(workorderExtMapper.selectCount(param)); |
| | |
| | | tModle.setUnqualifiedNum(0); |
| | | tModle.setProUserId(w.getProUserId()); |
| | | tModle.setProUserName(w.getProUserName()); |
| | | tModle.setProUserName(w.getProUserName()); |
| | | tModle.setCreateUser(w.getCreateUser()); |
| | | if(w.getProUserId()!=null){ |
| | | //查询班组信息 |
| | | QueryCompanyUserExtDTO queryCompanyUserExtDTO = new QueryCompanyUserExtDTO(); |
| | |
| | | } |
| | | return PageData.from(new PageInfo<>(result)); |
| | | } |
| | | @Override |
| | | public PageData<SalaryStatisticsListVO> salaryStatistic(PageWrap<QuerySalaryStatisticDTO> pageWrap) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!Constants.equalsInteger(user.getType(),Constants.USERTYPE.COM)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,您无权限进行该操作!"); |
| | | } |
| | | //只能查看当前根组织的数据 |
| | | pageWrap.getModel().setRootDepartId(user.getRootDepartment().getId()); |
| | | PageHelper.startPage(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | List<SalaryStatisticsListVO> result = workorderRecordExtMapper.salaryStatistic(pageWrap.getModel()); |
| | | if(result!=null){ |
| | | List<DepartmentExtListVO> allDepartList = RedisUtil.getObject(redisTemplate,Constants.RedisKeys.COM_DEPART_LIST_KEY+user.getCompany().getId(),ArrayList.class); |
| | | for(SalaryStatisticsListVO model : result){ |
| | | //查询生产人员姓名 |
| | | // model.setUserName(initProUser(user,model.getUserId(),allDepartList)); |
| | | model.setUserInfo(initProUser(user,model.getUserId(),allDepartList)); |
| | | } |
| | | } |
| | | return PageData.from(new PageInfo<>(result)); |
| | | } |
| | | @Override |
| | | public PageData<UserSalaryListVO> userSalaryPage(PageWrap<QueryUserSalaryListDTO> pageWrap) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!Constants.equalsInteger(user.getType(),Constants.USERTYPE.COM)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,您无权限进行该操作!"); |
| | | } |
| | | //只能查看当前根组织的数据 |
| | | pageWrap.getModel().setRootDepartId(user.getRootDepartment().getId()); |
| | | pageWrap.getModel().setRootDepartId(user.getRootDepartment().getId()); |
| | | PageHelper.startPage(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | |
| | | //数据权限 |
| | | // List<Integer> dataPermission = user.getDepartPermissionList(); |
| | | List<UserSalaryListVO> result = workorderRecordExtMapper.userSalaryPage(pageWrap.getModel()); |
| | | if(result!=null){ |
| | | List<DepartmentExtListVO> allDepartList = RedisUtil.getObject(redisTemplate,Constants.RedisKeys.COM_DEPART_LIST_KEY+user.getCompany().getId(),ArrayList.class); |
| | | for(UserSalaryListVO model : result){ |
| | | //查询生产人员姓名 |
| | | model.setUserInfo(initProUser(user,model.getUserId(),allDepartList)); |
| | | if(Constants.formatBigdecimal4Float(model.getNum()).compareTo(new BigDecimal(0))>0){ |
| | | model.setRate(Constants.formatBigdecimal4Float(model.getQualifiedNum()).divide(model.getNum(),4).multiply(new BigDecimal(100))); |
| | | } |
| | | } |
| | | } |
| | | return PageData.from(new PageInfo<>(result)); |
| | | } |
| | | |
| | | private void initProUser(LoginUserInfo user, WorkorderRecordExtListVO data, List<DepartmentExtListVO> allDepartList) { |
| | | if(data.getCreateUser() ==null){ |
| | |
| | | String dName =d==null?"":StringUtils.defaultString(d.getName(),""); |
| | | data.setProcedureName(comp.getName()+"-"+dName); |
| | | } |
| | | } |
| | | private UserBaseInfoVO initProUser(LoginUserInfo user, Integer userId, List<DepartmentExtListVO> allDepartList) { |
| | | if(userId ==null){ |
| | | return null; |
| | | } |
| | | |
| | | CompanyUser query=new CompanyUser(); |
| | | query.setUserId(userId); |
| | | query.setRootDepartId(user.getRootDepartment().getId()); |
| | | query.setDeleted(Constants.ZERO); |
| | | CompanyUser comp= companyUserExtMapper.selectOne(new QueryWrapper<>(query).last(" limit 1")); |
| | | if(comp!=null){ |
| | | UserBaseInfoVO userinfo = new UserBaseInfoVO(); |
| | | DepartmentExtListVO d = departmentExtService.getModelById(user.getCompany().getId(),comp.getDepartmentId(),allDepartList); |
| | | String dName =d==null?"":StringUtils.defaultString(d.getName(),""); |
| | | userinfo.setNameAndDepart (comp.getName()+"-"+dName); |
| | | userinfo.setDepartId(d.getId()); |
| | | userinfo.setUserId(userId); |
| | | userinfo.setUserName(comp.getName()); |
| | | userinfo.setDepartName(d.getName()); |
| | | return userinfo; |
| | | } |
| | | return null; |
| | | } |
| | | @Override |
| | | public List<WorkorderRecordExtListVO> findAll(QueryWorkorderRecordExtDTO pageWrap) { |
| | |
| | | order.setStatus(Constants.WORKORDER_STATUS.material); |
| | | }else if(status ==Constants.WORKORDER_HISTORY_STATUS.done){ |
| | | order.setStatus(Constants.WORKORDER_STATUS.done); |
| | | }else if(status ==Constants.WORKORDER_HISTORY_STATUS.produce){ |
| | | //投料操作 |
| | | if(Constants.equalsInteger(mp.getStatus(),Constants.WORKORDER_STATUS.create) |
| | | ||Constants.equalsInteger(mp.getStatus(),Constants.WORKORDER_STATUS.material)){ |
| | | //如果是已创建或者已备料状态的工单,修改其状态为【生产中】 |
| | | order.setStatus(Constants.WORKORDER_STATUS.producing); |
| | | } |
| | | } |
| | | workorderExtMapper.updateById(order); |
| | | workorderHistoryExtMapper.insertBatch(whList); |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void exportUserSalary(PageWrap<QueryUserSalaryListDTO> pageWrap, HttpServletResponse response) { |
| | | List<UserSalaryListVO> result=this.userSalaryPage(pageWrap).getRecords(); |
| | | for(UserSalaryListVO model : result) { |
| | | if(model.getUserInfo()!=null){ |
| | | model.setUserName(model.getUserInfo().getUserName()); |
| | | model.setDepartName(model.getUserInfo().getDepartName()); |
| | | } |
| | | } |
| | | ExcelExporter.build(UserSalaryListVO.class).export(result, "员工绩效明细"+System.currentTimeMillis(), response); |
| | | |
| | | } |
| | | @Override |
| | | public void exportSalaryStatistics(PageWrap<QuerySalaryStatisticDTO> pageWrap, HttpServletResponse response){ |
| | | List<SalaryStatisticsListVO> result=this.salaryStatistic(pageWrap).getRecords(); |
| | | for(SalaryStatisticsListVO model : result) { |
| | | if(model.getUserInfo()!=null){ |
| | | model.setUserName(model.getUserInfo().getUserName()); |
| | | model.setDepartName(model.getUserInfo().getDepartName()); |
| | | } |
| | | } |
| | | ExcelExporter.build(SalaryStatisticsListVO.class).export(result, "工资报表"+System.currentTimeMillis(), response); |
| | | |
| | | } |
| | | @Override |
| | | public void exportExcel(PageWrap<QueryWorkorderRecordExtDTO> pageWrap, HttpServletResponse response) { |
| | | List<WorkorderRecordExtListVO> result=this.findPage(pageWrap).getRecords(); |
| | |
| | | import doumeemes.core.utils.redis.RedisUtil; |
| | | import doumeemes.dao.business.BackOrderDetailMapper; |
| | | import doumeemes.dao.business.BackorderMapper; |
| | | import doumeemes.dao.business.SalaryParamMapper; |
| | | import doumeemes.dao.business.dto.CreateMaterialDTO; |
| | | import doumeemes.dao.business.dto.CreateWorkorderRecordDTO; |
| | | import doumeemes.dao.business.dto.DealWorkorderRecordDTO; |
| | | import doumeemes.dao.business.dto.MaterialListDTO; |
| | | import doumeemes.dao.business.model.*; |
| | |
| | | private WOutboundRecordExtMapper wOutboundRecordExtMapper; |
| | | @Autowired |
| | | private MaterialExtMapper materialExtMapper; |
| | | @Autowired |
| | | private SalaryParamMapper salaryParamMapper; |
| | | @Autowired |
| | | private PlansExtMapper plansExtMapper; |
| | | @Autowired |
| | | private DeviceExtMapper deviceExtMapper; |
| | | |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | @Override |
| | |
| | | recordList.add(getWorkrecordModel(user,wStock,mp,materialListDTO.getNum())); |
| | | } |
| | | } |
| | | |
| | | //批量插入投料记录 |
| | | workorderRecordExtMapper.insertBatch(recordList); |
| | | //单添加历史记录(判断更新为生产中) |
| | | //单添加历史记录(不更新状态) |
| | | updateOrderInfo(user,mp,Constants.WORKORDER_HISTORY_STATUS.material); |
| | | return param.getId(); |
| | | } |
| | |
| | | return mp; |
| | | } |
| | | |
| | | private void getPlansAndValid(LoginUserInfo user, Plans mp) throws BusinessException{ |
| | | if(mp== null){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "对不起,该记录不存在!"); |
| | | } |
| | | if(Constants.equalsInteger(mp.getPaused(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,工单已暂停!"); |
| | | } |
| | | } |
| | | |
| | | private QueryBomDetailExtDTO initBomParam(LoginUserInfo user, Workorder mp) throws BusinessException{ |
| | | QueryBomExtDTO bb = new QueryBomExtDTO(); |
| | |
| | | bom.setBomId(versionBom.getBomVersionId()); |
| | | // bom.setProcedureId(mp.getProcedureId()); |
| | | bom.setWorkorderId(mp.getId()); |
| | | return bom; |
| | | } |
| | | |
| | | private QueryBomDetailExtDTO initBomParamForPlans(LoginUserInfo user, Plans plans) throws BusinessException{ |
| | | QueryBomExtDTO bb = new QueryBomExtDTO(); |
| | | bb.setDepartId(plans.getDepartId()); |
| | | bb.setDeleted(Constants.ZERO); |
| | | bb.setRootDepartId(user.getRootDepartment().getId()); |
| | | bb.setMaterialId(plans.getMaterialId()); |
| | | bb.setProcedureId(plans.getProcedureId()); |
| | | BomExtListVO versionBom = bomExtMapper.selectByModel( bb); |
| | | if(versionBom == null || StringUtils.isBlank(versionBom.getVersion()) || versionBom.getBomVersionId() == null){ |
| | | return null; |
| | | // throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "对不起,该工单物料BOM信息配置有误,请联系管理员!"); |
| | | } |
| | | plans.setBomModel(versionBom); |
| | | QueryBomDetailExtDTO bom = new QueryBomDetailExtDTO(); |
| | | bom.setDeleted(Constants.ZERO); |
| | | bom.setBomId(versionBom.getBomVersionId()); |
| | | // bom.setProcedureId(mp.getProcedureId()); |
| | | bom.setPlansId(plans.getId()); |
| | | return bom; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | private void updateOrderInfo(LoginUserInfo user, Workorder mp,int status) { |
| | | |
| | | List<WorkorderHistory> whList = new ArrayList<>(); |
| | | //工单历史数据 |
| | | Workorder order = new Workorder(); |
| | |
| | | order.setStatus(Constants.WORKORDER_STATUS.material); |
| | | }else if(status ==Constants.WORKORDER_HISTORY_STATUS.done){ |
| | | order.setStatus(Constants.WORKORDER_STATUS.done); |
| | | }else if(status ==Constants.WORKORDER_HISTORY_STATUS.material ||status ==Constants.WORKORDER_HISTORY_STATUS.produce){ |
| | | //投料操作 |
| | | if(Constants.equalsInteger(mp.getStatus(),Constants.WORKORDER_STATUS.create) |
| | | ||Constants.equalsInteger(mp.getStatus(),Constants.WORKORDER_STATUS.material)){ |
| | | //如果是已创建或者已备料状态的工单,修改其状态为【生产中】 |
| | | order.setStatus(Constants.WORKORDER_STATUS.producing); |
| | | } |
| | | } |
| | | workorderExtMapper.updateById(order); |
| | | workorderHistoryExtMapper.insertBatch(whList); |
| | |
| | | //处理产出数据 |
| | | dealAppliancePro(mp,user,allRecordList,updateApplianceList,updateApplianceProList, outboundDetailList,stockList); |
| | | } |
| | | |
| | | |
| | | //如果有没bom配置,检查产出(包含检验的不良和报废品)和投料数量是否相等匹配,不一致提示错误 |
| | | if(bdparam==null){ |
| | |
| | | //如果需要投料的物料集合,在库存中寻找投料来源 |
| | | for(WStock model : materialList){ |
| | | for(WStock ts : allList){ |
| | | |
| | | if(Constants.equalsInteger(model.getMaterialId(),ts.getMaterialId())){ |
| | | //还需要投料数量 |
| | | BigDecimal actNum = Constants.formatBigdecimal(model.getNum()).subtract(Constants.formatBigdecimal(model.getTNum())); |
| | |
| | | //如果已经满足剩余需求量 |
| | | isfull =true; |
| | | } |
| | | |
| | | //添加投料记录 |
| | | workorderRecordExtMapper.insert(getWorkrecordModel(user,ts,mp,actNum)); |
| | | |
| | | //更新已经投料数量 |
| | | model.setTNum(Constants.formatBigdecimal(model.getTNum()).add(actNum)); |
| | | WOutbound outbound = getFromOutboundList(ts.getWarehouseId(),outboundList); |
| | |
| | | if (bomDetailList == null || bomDetailList.size() == 0) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,该生产物料的bom配置有误,请联系管理员!"); |
| | | } |
| | | // for (BomDetailExtListVO i :bomDetailList) { |
| | | // //查询是否投料 |
| | | // if(workorderRecordExtMapper.selectCount(new QueryWrapper<WorkorderRecord>() |
| | | // .eq("DELETED",Constants.ZERO).eq("MATERIAL_ID",i.getMaterialId()).eq("TYPE",Constants.ZERO))<=0){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"存在未投料BOM物料,无法进行报工"); |
| | | // } |
| | | // } |
| | | for (BomDetailExtListVO i :bomDetailList) { |
| | | //查询是否投料 |
| | | if(workorderRecordExtMapper.selectCount(new QueryWrapper<WorkorderRecord>() |
| | | .eq("DELETED",Constants.ZERO).eq("MATERIAL_ID",i.getMaterialId()).eq("TYPE",Constants.ZERO))<=0){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"存在未投料BOM物料,无法进行报工"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | WOutbound outbound = new WOutbound(); |
| | |
| | | } |
| | | //如果是产出 |
| | | mp.setHasProduceNum(Constants.formatBigdecimal(tModel.getNum()).intValue()+Constants.formatIntegerNum(mp.getHasProduceNum())); |
| | | // if(tModel.getDoneType() == null){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,工装器具【"+tModel.getAmodel().getCode()+"】产出质量属性为空,无法报工!"); |
| | | // } |
| | | // if(!Constants.equalsInteger(tModel.getDoneType(),Constants.ZERO)){ |
| | | // //如果不良,累计工单的不良产出 |
| | | // mp.setUnqualifiedNum(Constants.formatIntegerNum(mp.getUnqualifiedNum())+(Constants.formatBigdecimal(tModel.getNum()).intValue())); |
| | | // }else{ |
| | | // //如果是合格,累计工单的合格数量 |
| | | // mp.setQualifiedNum(Constants.formatIntegerNum(mp.getQualifiedNum())+(Constants.formatBigdecimal(tModel.getNum()).intValue())); |
| | | // } |
| | | if(tModel.getDoneType() == null){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,工装器具【"+tModel.getAmodel().getCode()+"】产出质量属性为空,无法报工!"); |
| | | } |
| | | if(!Constants.equalsInteger(tModel.getDoneType(),Constants.ZERO)){ |
| | | //如果不良,累计工单的不良产出 |
| | | mp.setUnqualifiedNum(Constants.formatIntegerNum(mp.getUnqualifiedNum())+(Constants.formatBigdecimal(tModel.getNum()).intValue())); |
| | | }else{ |
| | | //如果是合格,累计工单的合格数量 |
| | | mp.setQualifiedNum(Constants.formatIntegerNum(mp.getQualifiedNum())+(Constants.formatBigdecimal(tModel.getNum()).intValue())); |
| | | } |
| | | |
| | | //物料+批次+工序+质量属性去重 |
| | | WOutboundDetail detail =getWoutbondDetailByList(tModel,detailList); |
| | |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,该工单信息!"); |
| | | } |
| | | if(Objects.isNull(dealWorkorderRecordDTO.getDownType()) |
| | | ||Objects.isNull(dealWorkorderRecordDTO.getWorkorderId()) |
| | | ||Objects.isNull(dealWorkorderRecordDTO.getNum()) |
| | | ||Objects.isNull(dealWorkorderRecordDTO.getWorkorderId()) |
| | | ||Objects.isNull(dealWorkorderRecordDTO.getNum()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | WorkorderRecord workorderRecord = new WorkorderRecord(); |
| | | if(Objects.isNull(dealWorkorderRecordDTO.getRecordId())){ |
| | | //查询工单下是否存在对应记录 |
| | | workorderRecord = workorderRecordExtMapper.selectOne(new QueryWrapper<WorkorderRecord>() |
| | | workorderRecord = workorderRecordExtMapper.selectOne(new QueryWrapper<WorkorderRecord>() |
| | | .eq("WORKORDER_ID",dealWorkorderRecordDTO.getWorkorderId()) |
| | | .eq("DONE_TYPE",dealWorkorderRecordDTO.getDownType()) |
| | | .eq("TYPE",Constants.ONE) |
| | |
| | | return PageData.from(new PageInfo<>(result)); |
| | | } |
| | | |
| | | @Override |
| | | public PageData<WStockExtListVO> choiceStockPageForPlans(PageWrap<QueryWStockDto> pageWrap,LoginUserInfo userInfo) { |
| | | Plans plans =plansExtMapper.selectById(pageWrap.getModel().getPlansId()); |
| | | if(Objects.isNull(plans)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,未查询到工序计划信息!"); |
| | | } |
| | | Device device = deviceExtMapper.selectById(pageWrap.getModel().getDeviceId()); |
| | | if(Objects.isNull(plans)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,未查询到设备信息!"); |
| | | } |
| | | //查询并验证工单信息 |
| | | this.getPlansAndValid(userInfo,plans); |
| | | //查询全部bom组成数据,如果有BOM配置,按照BOM组成进行投料,如果没有BOM配置,则投料物料为待生产库位的物料本身 |
| | | QueryBomDetailExtDTO bdparam = initBomParamForPlans(userInfo,plans); |
| | | List<BomDetailExtListVO> bomDetailList = null; |
| | | if(bdparam!=null){ |
| | | bomDetailList = bomDetailExtMapper.selectList(bdparam); |
| | | List<Integer> materialDistributeId = bomDetailList.stream().map(BomDetailExtListVO::getMaterialId).collect(Collectors.toList()); |
| | | pageWrap.getModel().setMaterialDistributeId(materialDistributeId); |
| | | }else{ |
| | | //查询物料BOM信息 |
| | | Bom bom = bomExtMapper.selectOne(new QueryWrapper<Bom>().eq("MATERIAL_ID",plans.getMaterialId()).eq("DELETED",Constants.ZERO).last(" limit 1 ")); |
| | | if(Objects.isNull(bom)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,未查询到BOM信息!"); |
| | | } |
| | | RouteProcedure currentRouteProcedure = routeProcedureExtMapper.selectOne(new QueryWrapper<RouteProcedure>() |
| | | .eq("ROUTE_ID",bom.getRouteId()) |
| | | .eq("PROCEDURE_ID",plans.getProcedureId()) |
| | | .last(" limit 1 ") |
| | | ); |
| | | if(currentRouteProcedure!=null){ |
| | | RouteProcedure routeProcedure = routeProcedureExtMapper.selectOne(new QueryWrapper<RouteProcedure>() |
| | | .eq("ROUTE_ID",currentRouteProcedure.getRouteId()).apply(" SORTNUM < " + currentRouteProcedure.getSortnum() ).eq("STATUS",Constants.ONE).orderByDesc(" SORTNUM ").last(" limit 1 ") |
| | | ); |
| | | if(Objects.isNull(routeProcedure)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,未查询到生产物料上一步工序信息!"); |
| | | } |
| | | pageWrap.getModel().setProcedureId(routeProcedure.getProcedureId()); |
| | | pageWrap.getModel().setMaterialId(plans.getMaterialId()); |
| | | } |
| | | } |
| | | pageWrap.getModel().setLocationId(device.getProduceWarehouseLocationId()); |
| | | PageHelper.startPage(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | List<WStockExtListVO> result = wStockExtMapper.choiceStockList(pageWrap.getModel()); |
| | | return PageData.from(new PageInfo<>(result)); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public WorkorderRecord createWorkorderRecord(CreateWorkorderRecordDTO createWorkorderRecordDTO, LoginUserInfo loginUserInfo){ |
| | | Workorder workorder = workorderExtMapper.selectById(createWorkorderRecordDTO.getWorkorderId()); |
| | | if(Objects.isNull(workorder)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,未查询到该工单信息!"); |
| | | } |
| | | if(Objects.isNull(createWorkorderRecordDTO.getUnQualifiedNum()) |
| | | ||Objects.isNull(createWorkorderRecordDTO.getUnQualifiedNum()) |
| | | ||Objects.isNull(createWorkorderRecordDTO.getWorkorderId()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | BigDecimal num = createWorkorderRecordDTO.getQualifiedNum().add(createWorkorderRecordDTO.getUnQualifiedNum()); |
| | | WorkorderRecord workorderRecord = new WorkorderRecord(); |
| | | //查询工单下是否存在对应记录 |
| | | workorderRecord = workorderRecordExtMapper.selectOne(new QueryWrapper<WorkorderRecord>() |
| | | .eq("WORKORDER_ID",createWorkorderRecordDTO.getWorkorderId()) |
| | | .eq("TYPE",Constants.ONE) |
| | | .eq("DELETED",Constants.ZERO) |
| | | .last(" limit 1 ") |
| | | ); |
| | | if(!Objects.isNull(workorderRecord)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,该工单的该类产出记录已存在!"); |
| | | } |
| | | if(num.compareTo(BigDecimal.valueOf(workorder.getPlanNum()))>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,该工单的产出数量不能大于工单计划数量!"); |
| | | } |
| | | //数据存储 |
| | | workorderRecord = new WorkorderRecord(); |
| | | workorderRecord.setDeleted(Constants.ZERO); |
| | | workorderRecord.setCreateUser(loginUserInfo.getId()); |
| | | workorderRecord.setCreateTime(new Date()); |
| | | workorderRecord.setNum(num); |
| | | workorderRecord.setRootDepartId(loginUserInfo.getRootDepartment().getId()); |
| | | workorderRecord.setDepartId(loginUserInfo.getCurComDepartment().getId()); |
| | | workorderRecord.setPlanId(workorder.getPlanId()); |
| | | workorderRecord.setWorkorderId(createWorkorderRecordDTO.getWorkorderId()); |
| | | workorderRecord.setBatch(workorder.getBatch()); |
| | | workorderRecord.setFactoryId(workorder.getFactoryId()); |
| | | workorderRecord.setProcedureId(workorder.getProcedureId()); |
| | | workorderRecord.setProDate(new Date()); |
| | | workorderRecord.setType(Constants.ONE); |
| | | workorderRecord.setMaterialId(workorder.getMaterialId()); |
| | | workorderRecord.setUnitId(workorder.getUnitId()); |
| | | workorderRecord.setMaterialBatch(workorder.getBatch()); |
| | | workorderRecord.setUnqualifiedNum(createWorkorderRecordDTO.getUnQualifiedNum()); |
| | | workorderRecord.setQualifiedNum(createWorkorderRecordDTO.getQualifiedNum()); |
| | | //计算工资信息 |
| | | SalaryParam salaryParam = salaryParamMapper.selectOne(new QueryWrapper<SalaryParam>().eq("DELETED",Constants.ZERO).eq("MATERIAL_ID",workorderRecord.getMaterialId()) |
| | | .eq("DEPART_ID",workorderRecord.getFactoryId()).eq("PROCEDURE_ID",workorderRecord.getProcedureId()).last(" limit 1 ")); |
| | | if(Objects.isNull(salaryParam)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未配置工资绩效配置!"); |
| | | } |
| | | workorderRecord.setSalaryPrice(salaryParam.getSalary()); |
| | | workorderRecord.setSalaryType(salaryParam.getType()); |
| | | workorderRecord.setSalaryUnqualified(salaryParam.getUnqualified()); |
| | | |
| | | //计件工资 |
| | | if(salaryParam.getType().equals(Constants.ZERO)){ |
| | | workorderRecord.setSalaryNum(salaryParam.getNum()); |
| | | workorderRecord.setSalary(salaryParam.getSalary().multiply(salaryParam.getUnqualified()==Constants.ZERO?num:createWorkorderRecordDTO.getUnQualifiedNum())); |
| | | }else{ |
| | | workorderRecord.setDuration(createWorkorderRecordDTO.getDuration()); |
| | | workorderRecord.setSalary(BigDecimal.valueOf(createWorkorderRecordDTO.getDuration()).multiply(salaryParam.getSalary()).divide(new BigDecimal(3600))); |
| | | } |
| | | |
| | | //插入工单操作记录,并且判断是否更改为工单的状态【生产中】 |
| | | updateOrderInfo(loginUserInfo,workorder,Constants.WORKORDER_HISTORY_STATUS.produce); |
| | | workorderRecordExtMapper.insert(workorderRecord); |
| | | return workorderRecord; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | * @date 2022/04/18 18:12 |
| | | */ |
| | | String loginByPassword (LoginDTO dto, HttpServletRequest request); |
| | | |
| | | String platformLogin(LoginDTO dto, HttpServletRequest request); |
| | | String loginByDingdingCode(Integer companyId ,String code, HttpServletRequest request); |
| | | String loginAutoBylingyangToken( String token, HttpServletRequest request,boolean isDemo); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.iflytek.antelope.other.client.dto.resp.UserDTO; |
| | | import doumeemes.biz.system.SystemDictDataBiz; |
| | | import doumeemes.config.shiro.ShiroToken; |
| | |
| | | throw e; |
| | | } |
| | | } |
| | | |
| | | // 校验用户名和密码 |
| | | Subject subject = SecurityUtils.getSubject(); |
| | | ShiroToken token = new ShiroToken(dto.getCompanyId(),dto.getUsername(), dto.getPassword(),false,false); |
| | | ShiroToken token = new ShiroToken(dto.getCompanyId(),dto.getUsername(), dto.getPassword(),false); |
| | | try { |
| | | subject.login(token); |
| | | LoginUserInfo loginUser = ((LoginUserInfo)subject.getPrincipal()); |
| | |
| | | } |
| | | // 校验用户名和密码 |
| | | Subject subject = SecurityUtils.getSubject(); |
| | | ShiroToken token = new ShiroToken(dto.getCompanyId(),dto.getUsername(), dto.getPassword(),false,false); |
| | | ShiroToken token = new ShiroToken(dto.getCompanyId(),dto.getUsername(), dto.getPassword(),false); |
| | | try { |
| | | subject.login(token); |
| | | LoginUserInfo loginUser = ((LoginUserInfo)subject.getPrincipal()); |
| | |
| | | // 校验用户名和密码 |
| | | Subject subject = SecurityUtils.getSubject(); |
| | | // 钉钉登录 |
| | | ShiroToken token = new ShiroToken(companyId,mobile, null,true,false); |
| | | ShiroToken token = new ShiroToken(companyId,mobile, null,true); |
| | | |
| | | subject.login(token); |
| | | LoginUserInfo loginUser =(LoginUserInfo)subject.getPrincipal(); |
| | |
| | | // 校验用户名和密码 |
| | | Subject subject = SecurityUtils.getSubject(); |
| | | // 钉钉登录 |
| | | ShiroToken atoken = new ShiroToken(companyId,mobile, null,true,false); |
| | | ShiroToken atoken = new ShiroToken(companyId,mobile, null,true); |
| | | subject.login(atoken); |
| | | LoginUserInfo loginUser =(LoginUserInfo)subject.getPrincipal(); |
| | | loginUser.getCompanyUser().setName(user.getName()); |
| | |
| | | // 校验用户名和密码 |
| | | Subject subject = SecurityUtils.getSubject(); |
| | | // 钉钉登录 |
| | | ShiroToken atoken = new ShiroToken(companyId,mobile, null,true,false); |
| | | ShiroToken atoken = new ShiroToken(companyId,mobile, null,true); |
| | | subject.login(atoken); |
| | | LoginUserInfo loginUser =(LoginUserInfo)subject.getPrincipal(); |
| | | loginLog.setUserId(loginUser.getId()); |
| | |
| | | // 校验用户名和密码 |
| | | Subject subject = SecurityUtils.getSubject(); |
| | | // 钉钉登录 |
| | | ShiroToken atoken = new ShiroToken(com.getId(),mobile, null,true,false); |
| | | ShiroToken atoken = new ShiroToken(com.getId(),mobile, null,true); |
| | | subject.login(atoken); |
| | | LoginUserInfo loginUser =(LoginUserInfo)subject.getPrincipal(); |
| | | loginUser.getCompanyUser().setName(user.getName()); |
| | |
| | | // 校验用户名和密码 |
| | | Subject subject = SecurityUtils.getSubject(); |
| | | // 钉钉登录 |
| | | ShiroToken atoken = new ShiroToken(com.getId(),mobile, null,true,false); |
| | | ShiroToken atoken = new ShiroToken(com.getId(),mobile, null,true); |
| | | subject.login(atoken); |
| | | LoginUserInfo loginUser =(LoginUserInfo)subject.getPrincipal(); |
| | | loginUser.getCompanyUser().setName(user.getName()); |
| | |
| | | throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | }else{ |
| | | pageWrap.getModel().setType(Constants.USERTYPE.PLAT); |
| | | } |
| | | |
| | | } |
| | | PageHelper.startPage(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | return PageData.from(new PageInfo<>(systemPermissionMapper.selectManageList(pageWrap.getModel(), pageWrap.getOrderByClause()))); |
| | |
| | | wxLoginVO.setLoginStatus(Constants.ZERO); |
| | | wxLoginVO.setSession(session); |
| | | return wxLoginVO; |
| | | }catch (BusinessException e) { |
| | | wxLoginVO.setLoginStatus(Constants.ONE); |
| | | return wxLoginVO; |
| | | }catch (AuthenticationException e) { |
| | | BusinessException ee = null; |
| | | loginLog.setSuccess(Boolean.FALSE); |
| | |
| | | # application: |
| | | # name: doumeemes |
| | | profiles: |
| | | active: standard |
| | | active: standardPro |
| | | # JSON返回配置 |
| | | jackson: |
| | | # 默认时区 |
| | |
| | | <select id="selectByModel" parameterType="doumeemes.dao.ext.dto.QueryPlansExtDTO" resultMap="PlansExtListVO"> |
| | | SELECT |
| | | `a`.* |
| | | ,ifnull(( SELECT sum( b.PLAN_NUM ) FROM workorder b WHERE b.deleted = 0 AND b.PLAN_ID = a.id and b.status not in (7,8) ),0) AS workorderDistributNum |
| | | ,( SELECT sum( b.PLAN_NUM ) FROM workorder b WHERE b.deleted = 0 AND b.PLAN_ID = a.id and b.status !=6) AS workorderDistributNum |
| | | from plans a |
| | | <where> |
| | | <if test="id != null"> |
| | |
| | | `usermodel`.`SYSTEMID` AS USERMODEL_SYSTEMID, |
| | | `usermodel`.`INVALID_TIME` AS USERMODEL_INVALID_TIME, |
| | | `usermodel`.`TYPE` AS USERMODEL_TYPE |
| | | , ifnull(( SELECT sum( b.PLAN_NUM ) FROM workorder b WHERE b.deleted = 0 AND b.PLAN_ID = a.id and b.status !=6),0) AS workorderDistributNum , |
| | | ,( SELECT sum( b.PLAN_NUM ) FROM workorder b WHERE b.deleted = 0 AND b.PLAN_ID = a.id and b.status !=6) AS workorderDistributNum , |
| | | `mmodel`.name as materialName , `mmodel`.code as materialCode ,`fmodel`.name as factoryName , `pmodel`.name as produceName , |
| | | concat(`usermodel`.realname,' ',`usermodel`.mobile) as planUserName , `umodel`.name as unitName , |
| | | w.PLAN_CODE as workPlanCode , w.SALESORDER as salesOrder , |
| | | w.START_DATE as workPlanStartDate , w.PLAN_DATE as workPlanEndDate, |
| | | w.`PLAN_DATE` as workPlanPlanDate, |
| | | ifnull((select sum(worder.PLAN_NUM) from workorder worder where worder.PLAN_ID = a.id and worder.STATUS not in (7,8) ),0) as produceNum |
| | | w.PLAN_CODE as workPlanCode |
| | | |
| | | FROM `plans` `a` |
| | | LEFT JOIN `department` `dmodel` ON a.DEPART_ID=dmodel.ID |
| | |
| | | <if test="beginDate != null and beginDate != '' "> |
| | | AND `w`.`VALID_DATE` >= CONCAT(#{beginDate},' 00:00:00') |
| | | </if> |
| | | |
| | | <if test="rootDepartId != null"> |
| | | AND `w`.`ROOT_DEPART_ID` = #{rootDepartId} |
| | | </if> |
| | | |
| | | <if test="departId != null"> |
| | | AND `w`.`DEPART_ID` = #{departId} |
| | | </if> |
| | | |
| | | <if test="endDate != null and endDate != '' "> |
| | | AND CONCAT(#{endDate},' 23:59:59') >= `w`.`VALID_DATE` |
| | | </if> |
| | |
| | | `workPlans`.`IMPORT_ID`, |
| | | `workPlans`.`PAUSED`, |
| | | `workPlans`.`USER_ID`, |
| | | `workPlans`.`SALESORDER`, |
| | | `workPlans`.`PUBLISH_DATE` |
| | | FROM `work_plans` `workPlans` |
| | | <where> |
| | |
| | | <if test="publishDate != null"> |
| | | AND `workPlans`.`PUBLISH_DATE` = #{publishDate} |
| | | </if> |
| | | <if test="salesorder != null"> |
| | | AND `workPlans`.`SALESORDER` = #{salesorder} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | FROM `work_plans` `a` |
| | | LEFT JOIN `department` `dmodel` ON a.DEPART_ID=dmodel.ID |
| | | LEFT JOIN `material_distribute` `mdmodel` ON a.MATERIAL_ID=mdmodel.ID |
| | | LEFT JOIN `material` `mmodel` ON mdmodel.MATERIAL_ID=mmodel.ID |
| | | LEFT JOIN `material` `mmodel` ON mdmodel.MATERIAL_ID=mmodel.ID |
| | | LEFT JOIN `department` `fmodel` ON a.FACTORY_ID=fmodel.ID |
| | | LEFT JOIN `unit` `umodel` ON a.UNIT_ID=umodel.ID |
| | | LEFT JOIN `system_user` `usermodel` ON a.USER_ID=usermodel.ID |
| | |
| | | <if test="batch != null and batch != ''"> |
| | | AND `a`.`batch` like concat('%',#{batch},'%') |
| | | </if> |
| | | <if test="salesorder != null and salesorder != ''"> |
| | | AND `a`.`SALESORDER` like concat('%',#{salesorder},'%') |
| | | </if> |
| | | <if test="startDateStart != null and startDateStart != ''"> |
| | | AND `a`.`START_DATE` >= concat(#{planDateStart},' 00:00:00') |
| | | </if> |
| | | <if test="startDateEnd != null and startDateEnd != ''"> |
| | | AND concat(#{planDateEnd},' 23:59:59') >= `a`.`START_DATE` |
| | | </if> |
| | | <if test="planDateStart != null and planDateStart != ''"> |
| | | AND `a`.`PLAN_DATE` >= concat(#{planDateStart},' 00:00:00') |
| | | </if> |
| | |
| | | AND concat(#{planDateEnd},' 23:59:59') >= `a`.`PLAN_DATE` |
| | | </if> |
| | | </where> |
| | | order by a.START_DATE desc, a.CREATE_TIME desc |
| | | order by a.PLAN_DATE desc, a.CREATE_TIME desc |
| | | </select> |
| | | |
| | | |
| | |
| | | </where> |
| | | limit 1 |
| | | </select> |
| | | <select id="userSalaryPage" parameterType="doumeemes.dao.ext.dto.QueryUserSalaryListDTO" resultType="doumeemes.dao.ext.vo.UserSalaryListVO"> |
| | | select a.WORKORDER_ID,b.`CODE` as workorderCode,c.`NAME` as materialName,c.code as materialCode |
| | | ,d.name as unitName,a.PROCEDURE_ID,f.`NAME` as procedureName,a.CREATE_USER as userId |
| | | ,sum(a.QUALIFIED_NUM) as qualifiedNum |
| | | ,sum(a.UNQUALIFIED_NUM) as unQualifiedNum |
| | | ,sum(a.num) as NUM |
| | | from `workorder_record` a |
| | | left join workorder b on a.WORKORDER_ID=b.id |
| | | left join material_distribute m on b.MATERIAL_ID = m.ID |
| | | left join material c on m.MATERIAL_ID = c.ID |
| | | left join unit d on a.UNIT_ID = d.ID |
| | | left join procedures f on a.PROCEDURE_ID =f.ID |
| | | where a.DELETED = 0 |
| | | <if test="rootDepartId != null"> |
| | | AND a.`ROOT_DEPART_ID` = #{rootDepartId} |
| | | </if> |
| | | <if test="procedureId != null"> |
| | | AND a.`PROCEDURE_ID` = #{procedureId} |
| | | </if> |
| | | <if test="materialName != null and materialName !=''"> |
| | | AND (c.`name` like concat('%', #{materialName},'%') or c.`code` like concat('%', #{materialName},'%')) |
| | | </if> |
| | | <if test="startDate != null"> |
| | | AND a.`CREATE_TIME` >= #{startDate} |
| | | </if> |
| | | <if test="endDate != null"> |
| | | AND #{endDate} >= a.`CREATE_TIME` |
| | | </if> |
| | | <if test="userId != null"> |
| | | AND a.`CREATE_USER` = #{userId} |
| | | </if> |
| | | group by a.`WORKORDER_ID` |
| | | order by a.CREATE_TIME desc |
| | | </select> |
| | | <select id="salaryStatistic" parameterType="doumeemes.dao.ext.dto.QuerySalaryStatisticDTO" resultType="doumeemes.dao.ext.vo.SalaryStatisticsListVO"> |
| | | select `CREATE_USER` as userId ,sum(CASE WHEN salary_type=0 THEN salary ELSE 0 END ) as jijianSalary |
| | | ,sum(CASE WHEN salary_type=0 THEN 0 ELSE salary END ) as jishiSalary |
| | | ,count(id) as num |
| | | ,sum(salary) as totalSalary |
| | | from `workorder_record` |
| | | where `DELETED` =0 and `SALARY` >0 |
| | | <if test="rootDepartId != null"> |
| | | AND `ROOT_DEPART_ID` = #{rootDepartId} |
| | | </if> |
| | | <if test="userId != null"> |
| | | AND `CREATE_USER` = #{userId} |
| | | </if> |
| | | <if test="startDate != null"> |
| | | AND `CREATE_TIME` >= #{startDate} |
| | | </if> |
| | | <if test="endDate != null"> |
| | | AND #{endDate} >= `CREATE_TIME` |
| | | </if> |
| | | group by `CREATE_USER` |
| | | <!-- order by `CREATE_TIME` desc--> |
| | | </select> |
| | | <select id="selectListNew" parameterType="doumeemes.dao.ext.dto.QueryWorkorderRecordExtDTO" resultMap="WorkorderRecordExtListVO"> |
| | | SELECT |
| | | `a`.`ID`, |
| | |
| | | MATERIAL_DONETYPE, |
| | | MATERIAL_PROCEDURE_ID, |
| | | RELOBJ_ID, |
| | | RELOBJ_TYPE, |
| | | `DURATION`, |
| | | `SALARY`, |
| | | `SALARY_PRICE`, |
| | | `SALARY_NUM`, |
| | | `SALARY_TIMES`, |
| | | `SALARY_UNQUALIFIED`, |
| | | `SALARY_TYPE` |
| | | RELOBJ_TYPE |
| | | ) |
| | | values <foreach collection="list" separator="," item="item"> |
| | | ( |
| | |
| | | #{item.materialDonetype}, |
| | | #{item.materialProcedureId}, |
| | | #{item.relobjId}, |
| | | #{item.relobjType}, |
| | | #{item.duration}, |
| | | #{item.salary}, |
| | | #{item.salaryPrice}, |
| | | #{item.salaryNum}, |
| | | #{item.salaryTimes}, |
| | | #{item.salaryUnqualified}, |
| | | #{item.salaryType} |
| | | #{item.relobjType} |
| | | ) |
| | | </foreach> |
| | | </insert> |