package com.dk.mdm.service.common; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.dk.common.infrastructure.constant.Constant; import com.dk.common.mapper.BaseMapper; import com.dk.common.model.pojo.PageList; import com.dk.common.model.vo.core.UserVO; import com.dk.common.response.ResponseCodeEnum; import com.dk.common.response.ResponseResultUtil; import com.dk.common.response.ResponseResultVO; import com.dk.common.service.BaseService; import com.dk.mdm.mapper.common.CommonMapper; import com.dk.mdm.infrastructure.util.AuthUtils; import lombok.extern.slf4j.Slf4j; import org.postgresql.util.PGobject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.*; import java.util.stream.Collectors; /** * @author : 周兴 * @desc : 控件数据源API * @date : 2023/1/3 17:21 */ @Service @Slf4j public class CommonService extends BaseService> { @Override public BaseMapper> getRepository() { return commonMapper; } @Autowired private CommonMapper commonMapper; @Autowired private AuthUtils authUtils; /** * @desc : 获取编码/单号 * @author : 周兴 * @date : 2024/3/1 11:41 */ public Map getUniqueNoteCode(String docName,Boolean codeFlag) { Map param = new HashMap<>(); param.put("docName",docName); // TODO 公司Id param.put("cpId",1); Map map = null; // 获取系统基础数据 if(codeFlag){ map = commonMapper.getUniqueCode(param); }else{ map = commonMapper.getUniqueNote(param); } return map; } /** * @desc : 获取数据字典项目 * @author : 王英杰 * @date : 2023/1/6 11:41 */ public ResponseResultVO>> getDictionaryItemData(Map param) { // 获取系统基础数据 List> list = commonMapper.getDictionaryItemData(param); return ResponseResultUtil.success(list); } /** * @desc : 刷新基础数据 * @author : 周兴 * @date : 2023/5/11 10:19 */ public ResponseResultVO refreshBasicData(Map param) { UserVO user = authUtils.getUser(); if (param.get("appCode") != null) { user.setAppCode(param.get("appCode").toString()); } Map userMap = new HashMap(); userMap.put("userId", user.getUserId()); userMap.put("appCode", user.getAppCode()); return ResponseResultUtil.success(new HashMap(3) {{ put("menu", commonMapper.getMenuByUser(user.getAppCode(), user.getUserId())); put("function", (user.getRoleIds() != null && user.getRoleIds().indexOf(-1) >= 0) ? commonMapper.getUserFunctionAdmin(userMap) : commonMapper.getUserFunction(userMap)); put("userTableSetting", commonMapper.getUserTableInfo(userMap)); }}); } /** * @desc : 获取序号最大值 * @author : 周兴 * @date : 2023/1/6 11:41t_user_right */ public ResponseResultVO getMaxDisplayNo(Map param) { // 获取系统基础数据 Integer maxDisplayNo = commonMapper.getMaxDisplayNo(param); maxDisplayNo = maxDisplayNo == null ? 1 : (maxDisplayNo + 1); return ResponseResultUtil.success(maxDisplayNo); } /** * @desc : 获取系统表数据种类 * @author : 周兴 * @date : 2023/1/6 11:41 */ public ResponseResultVO>> getDataKind(Map param) { // 获取系统基础数据 List> list = commonMapper.getDataKind(param); return ResponseResultUtil.success(list); } /** * @desc : 获取型号分类 * @author : 周兴 * @date : 2023/1/6 11:41 */ public ResponseResultVO>> getModelCategory(Map param) { // 获取系统基础数据 List> list = commonMapper.getModelCategory(param); return ResponseResultUtil.success(list); } /** * @desc : 获取型号分类分类 * @author : 洪旭东 * @date : 2023-03-28 16:11 */ public ResponseResultVO>> getModelCategoryByPage(Map param) { this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getModelCategory(param), commonMapper.countModelCategory(param)); } /** * @desc : 获取工种 * @author : 姜宁 * @date : 2023/1/9 13:22 */ public ResponseResultVO>> getJob(Map param) { // 获取系统基础数据 List> list = commonMapper.getJob(param); return ResponseResultUtil.success(list); } /** * @desc : 获取职务 * @author : 姜宁 * @date : 2023/1/9 13:43 */ public ResponseResultVO>> getPost(Map param) { // 获取系统基础数据 List> list = commonMapper.getPost(param); return ResponseResultUtil.success(list); } /** * @desc : 获取组织部门 * @author : 姜宁 * @date : 2023/1/9 13:50 */ public ResponseResultVO>> getOrg(Map param) { // 获取系统基础数据 List> list = commonMapper.getOrg(param); return ResponseResultUtil.success(list); } /** * @desc : 获取部门 * @author : 姜宁 * @date : 2023/1/29 17:01 */ public ResponseResultVO>> getOrgByPage(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getOrg(param), commonMapper.getOrgCountByPage(param)); } /** * @desc : 获取商品品牌 * @author : 夏常明 * @date : 2023/1/10 14:24 */ public ResponseResultVO>> getBrand(Map param) { // 获取系统基础数据 List> list = commonMapper.getBrand(param); return ResponseResultUtil.success(list); } /** * @desc : 获取缺陷分类 * @author : 夏常明 * @date : 2023/1/12 9:09 */ public ResponseResultVO>> getDefectType(Map param) { // 获取系统基础数据 List> list = commonMapper.getDefectType(param); return ResponseResultUtil.success(list); } /** * @desc : 获取角色 * @author : 姜宁 * @date : 2023/1/29 14:28 */ public ResponseResultVO>> getRole(Map param) { // 获取系统基础数据 List> list = commonMapper.getRole(param); return ResponseResultUtil.success(list); } /** * @desc : 获取员工信息 * @author : 周兴 * @date : 2023/2/2 13:11 */ public ResponseResultVO>> getStaff(Map param) { // 获取员工 List> list = commonMapper.getStaffByPage(param); return ResponseResultUtil.success(list); } /** * @desc : 获取员工 * @author : 姜宁 * @date : 2023/1/29 17:01 */ public ResponseResultVO>> getStaffByPage(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getStaffByPage(param), commonMapper.getStaffCountByPage(param)); } /** * @desc : 查询系统参数 * @author : 周兴 * @date : 2023/1/29 17:04 */ public ResponseResultVO getSettingValue(Map param) { if (param.get("code").getClass().getName() == "java.util.ArrayList") { param.put("codes", param.get("code")); // 如果是数组,那么调用多个的查询 Map> settingMap = commonMapper.getSettingValues(param); // 定义返回值 JSONObject object = JSONObject.parseObject(((PGobject) settingMap.get("f_get_setting_values")).getValue()); return ResponseResultUtil.success(object); } else { // 单个 String setting = commonMapper.getSettingValue(param); // 定义返回值 return ResponseResultUtil.success(setting); } } /** * @desc : 获取工厂区域 * @author : 常皓宁 * @date : 2023/1/30 11:33 */ public ResponseResultVO>> getFactorySpace(Map param) { // 获取工厂区域 List> list = commonMapper.getFactorySpace(param); return ResponseResultUtil.success(list); } /** * @desc : 查询系统参数分类 * @author : 夏常明 * @date : 2023/1/30 16:05 */ public ResponseResultVO>> getSettingKind(Map param) { // 获取系统基础数据 List> list = commonMapper.getSettingKind(param); return ResponseResultUtil.success(list); } /** * @desc : 设置分页参数 * @author : 姜宁 * @date : 2023/2/1 14:00 */ private Map getLimit(Map param) { if (param.get("limit") != null) { param.put("currentPage", 1); param.put("pageSize", param.get("limit")); } param.put("start", ((int) param.get("currentPage") - 1) * (int) param.get("pageSize")); param.put("end", param.get("pageSize")); return param; } /** * @desc : 获取组织部门 * @author : 姜宁 * @date : 2023/2/1 14:09 */ public ResponseResultVO>> getOrganizationByPage(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getOrganizationByPage(param), commonMapper.getOrganizationCountByPage(param)); } /** * @desc : 获取窑炉 * @author : 常皓宁 * @date : 2023/2/1 16:21 */ public ResponseResultVO>> getKiln(Map param) { // 获取窑炉 List> list = commonMapper.getKiln(param); return ResponseResultUtil.success(list); } /** * @desc : 获取窑炉分页 * @author : 洪旭东 * @date : 2023-03-07 09:34 */ public ResponseResultVO>> getKilnByPage(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getKiln(param), commonMapper.countKiln(param)); } /** * @desc : 查询模具型号 * @author : 洪旭东 * @date : 2023-02-03 10:35 */ public ResponseResultVO>> getModelMould(Map param) { // 查询模具型号 List> list = commonMapper.getModelMould(param); return ResponseResultUtil.success(list); } /** * @desc : 获取窑车位置 * @author : 常皓宁 * @date : 2023/2/2 13:08 */ public ResponseResultVO>> getKilnCarPlace(Map param) { // 获取窑车位置 List> list = commonMapper.getKilnCarPlace(param); return ResponseResultUtil.success(list); } /** * @desc : 获取用户 * @author : 洪旭东 * @date : 2023-02-03 11:45 */ public ResponseResultVO>> getUserByPage(Map param) { this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getUser(param), commonMapper.countUser(param)); } /** * @desc : 获取产品视图 * @author : 夏常明 * @date : 2023/2/3 9:44 */ public ResponseResultVO>> getProductView(Map param) { // 获取产品视图 List> list = commonMapper.getProductView(param); return ResponseResultUtil.success(list); } /** * @desc : 获取产品商标 * @author : 夏常明 * @date : 2023/2/3 10:23 */ public ResponseResultVO>> getProductLogo(Map param) { // 获取产品商标 List> list = commonMapper.getProductLogo(param); return ResponseResultUtil.success(list); } /** * @desc : 获取产品釉色 * @author : 夏常明 * @date : 2023/2/3 13:14 */ public ResponseResultVO>> getProductColour(Map param) { // 获取产品商标 List> list = commonMapper.getProductColour(param); return ResponseResultUtil.success(list); } /** * @desc : 查询产品ERP物料 * @author : 洪旭东 * @date : 2023-05-12 13:48 */ public ResponseResultVO>> getProductErpSku(Map param) { List> list = commonMapper.getProductErpSku(param); return ResponseResultUtil.success(list); } /** * @desc : 获取模具档案 * @author : 洪旭东 * @date : 2023-02-07 13:05 */ public ResponseResultVO>> getMouldByPage(Map param) { this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getMould(param), commonMapper.countMould(param)); } /** * @desc : 获取数据字典 * @author : 姜宁 * @date : 2023/2/7 14:47 */ public ResponseResultVO>> getDictionaryData(Map param) { // 获取数据字典 List> list = commonMapper.getDictionaryData(param); return ResponseResultUtil.success(list); } /** * @desc : 获取最大窑车序号 * @author : 常皓宁 * @date : 2023/2/7 14:36 */ public ResponseResultVO getMaxCarNo(Map param) { // 获取系统基础数据 Integer maxCarNo = commonMapper.getMaxCarNo(param); maxCarNo = maxCarNo == null ? 1 : (maxCarNo + 1); return ResponseResultUtil.success(maxCarNo); } /** * @desc : 获取产品位置 * @date : 2023/2/8 14:22 * @author : 寇珊珊 */ public ResponseResultVO>> getProductPlace(Map param) { List> list = commonMapper.getProductPlace(param); return ResponseResultUtil.success(list); } /** * @desc : 获取模具型号 * @author : 姜宁 * @date : 2023/2/8 15:43 */ public ResponseResultVO>> getModelMouldByPage(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getModelMouldByPage(param), commonMapper.getModelMouldCountByPage(param)); } /** * @desc : 获取产品型号数量 * @author : 洪旭东 * @date : 2023-02-08 11:21 */ public ResponseResultVO>> getModelProduct(Map param) { this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getModelProduct(param), commonMapper.countModelProduct(param)); } /** * @desc : 获取获取载具型号 * @author : 常皓宁 * @date : 2023/2/7 14:36 */ public ResponseResultVO>> getModelCarrier(Map param) { // 获取获取载具型号 List> list = commonMapper.getModelCarrier(param); return ResponseResultUtil.success(list); } /** * @desc : 获取获取设备型号 * @author : 常皓宁 * @date : 2023/2/7 14:36 */ public ResponseResultVO>> getModelEquipment(Map param) { // 获取获取载具型号 List> list = commonMapper.getModelEquipment(param); return ResponseResultUtil.success(list); } /** * @desc : 根据模具型号id 查询模具产出型号和可变更产品型号 * @author : 夏常明 * @date : 2023/2/9 10:09 */ public ResponseResultVO>> getMouldOutputById(Map param) { //模具产出型号 List> MouldOutputList = commonMapper.getMouldOutputById(param); // 返回的staffList需要重新赋值 if (!CollectionUtils.isEmpty(MouldOutputList)) { for (Map stringObjectMap : MouldOutputList) { if (stringObjectMap.get("modelProductList") != null) { String labelString = ((PGobject) stringObjectMap.get("modelProductList")).getValue(); JSONArray object = JSONArray.parseArray(labelString); stringObjectMap.replace("modelProductList", object); } } } return ResponseResultUtil.success(MouldOutputList); } /** * @desc : 根据模具型号id 查询模具产出型号和可变更产品型号 * @author : 夏常明 * @date : 2023/2/9 10:09 */ public ResponseResultVO>> getModelPdt(Map param) { //模具产出型号 List> ModelPdtList = commonMapper.getModelPdt(param); return ResponseResultUtil.success(ModelPdtList); } /** * @desc : 查询产品缺陷扣罚数据 * @author : 夏常明 * @date : 2023/2/10 11:46 */ public ResponseResultVO>> getDefectFines(Map param) { // 查询产品缺陷扣罚数据 List> list = commonMapper.getDefectFines(param); return ResponseResultUtil.success(list); } /** * @desc : 查询打印模板分类 * @author : 常皓宁 * @date : 2023/2/14 14:35 */ public ResponseResultVO>> getLabelPrintType(Map param) { // 查询产品缺陷扣罚数据 List> list = commonMapper.getLabelPrintType(param); return ResponseResultUtil.success(list); } /** * @desc : 获取成型线分组 * @author : 洪旭东 * @date : 2023-02-15 13:34 */ public ResponseResultVO>> getMoldlineGroupByPage(Map param) { this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getMoldlineGroup(param), commonMapper.countMoldlineGroup(param)); } /** * @desc : 查询工位 * @author : 夏常明 * @date : 2023/2/15 14:44 */ public ResponseResultVO>> getWorkStation(Map param) { // 查询工位 List> list = commonMapper.getWorkStation(param); return ResponseResultUtil.success(list); } /** * @desc : 查询工位 分页 * @author : 洪旭东 * @date : 2023-03-01 14:45 */ public ResponseResultVO>> getWorkStationByPage(Map param) { this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getWorkStation(param), commonMapper.countWorkStation(param)); } /** * @desc : 获取工艺节点 * @author : 常皓宁 * @date : 2023/2/15 16:12 */ public ResponseResultVO>> getProcessNodeByPage(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getProcessNodeByPage(param), commonMapper.getProcessNodeCountByPage(param)); } /** * @desc : 获取工号 * @author : 常皓宁 * @date : 2023/2/17 15:41 */ public ResponseResultVO>> getWorkStationUser(Map param) { // 查询工位 List> list = commonMapper.getWorkStationUser(param); return ResponseResultUtil.success(list); } /** * @desc : 获取工号(分页) * @author : 周兴 * @date : 2023/2/20 10:39 */ public ResponseResultVO>> getWorkStationUserPage(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getWorkStationUser(param), commonMapper.getWorkStationUserCount(param)); } /** * @desc : 根据成型线Id获取成型记录信息 * @author : 周兴 * @date : 2023/2/18 19:47 */ public ResponseResultVO>> getMoldingItemByMoldlineId(Map param) { // 查询成型记录信息 List> list = commonMapper.getMoldingItemByMoldlineId(param); return ResponseResultUtil.success(list); } /** * @desc : 产品信息(条码变更) * @author : 夏常明 * @date : 2023/2/20 10:39 */ public ResponseResultVO>> getProductForChange(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getProductForChange(param), commonMapper.getProductForChangeCount(param)); } /** * @desc : 查询损坯原因/产品缺陷/未成型原因 * @author : 周兴 * @date : 2023/2/18 19:47 */ public ResponseResultVO>> getProductDefect(Map param) { // 查询损坯原因/产品缺陷/未成型原因 List> list = commonMapper.getProductDefect(param); return ResponseResultUtil.success(list); } /** * @desc : 产品信息(条码变更) * @author : 夏常明 * @date : 2023/2/20 10:39 */ public ResponseResultVO>> getColourForSet(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getColourForSet(param), commonMapper.getColourForSetCount(param)); } /** * @desc : 产品信息(商标釉色) * @author : 夏常明 * @date : 2023/2/20 10:39 */ public ResponseResultVO>> getLogoForSet(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getLogoForSet(param), commonMapper.getColourForSetCount(param)); } /** * @desc : 查询成型产品型号 * @author : 洪旭东 * @date : 2023-04-19 13:00 */ public ResponseResultVO>> getProductModel(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getProductModel(param), commonMapper.getColourForSetCount(param)); } /** * @desc : 根据工号编码值等查询工号 * @date : 2023/2/21 16:46 * @author : 寇珊珊 */ public ResponseResultVO>> getUserByCode(Map param) { List> list = commonMapper.getUserByCode(param); return ResponseResultUtil.success(list); } /** * @desc : 根据工号编码值等查询工号分页 * @date : 2023/2/21 16:46 * @author : 寇珊珊 */ public ResponseResultVO>> getUserByCodePage(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); param.put("userType", Constant.IntegerConstant.USER_TYPE_WORK_TEAM.getValue()); return super.mergeListWithCount(param, commonMapper.getUserByCode(param), commonMapper.getUserByCodeCount(param)); } /** * @desc : 获取工艺节点 * @author : 常皓宁 * @date : 2023/2/15 16:12 */ public ResponseResultVO>> getProcessNode(Map param) { // 查询工艺节点数据 List> list = commonMapper.getProcessNode(param); return ResponseResultUtil.success(list); } /** * @desc : 产品信息(条码变更) * @author : 夏常明 * @date : 2023/2/20 10:39 */ public ResponseResultVO>> getMoldLinePage(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getMoldLinePage(param), commonMapper.getMoldLinePageCount(param)); } /** * @desc : 工位工号(工位打卡选择工位) * @author : 夏常明 * @date : 2023/2/27 14:52 */ public ResponseResultVO>> getWsStation(Map param) { // 查询工艺节点数据 List> list = commonMapper.getWsStation(param); return ResponseResultUtil.success(list); } /** * @desc : 根据用户Id获取班组信息 * @author : 周兴 * @date : 2023/2/27 14:52 */ public ResponseResultVO>> getWorkTeamByUserId(Map param) { List> list = commonMapper.getWorkTeamByUserId(param); return ResponseResultUtil.success(list); } /** * @desc : 查询产品分级 分页 * @author : 洪旭东 * @date : 2023-03-03 09:17 */ public ResponseResultVO>> getProductGradeByPage(Map param) { this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getProductGrade(param), commonMapper.countProductGrade(param)); } /** * @desc : 查询产品分级 * @author : 洪旭东 * @date : 2023-03-03 09:17 */ public ResponseResultVO>> getProductGrade(Map param) { return ResponseResultUtil.success(commonMapper.getProductGrade(param)); } /** * @desc : 查询工艺流程(分页) * @author : 夏常明 * @date : 2023/3/3 14:05 */ public ResponseResultVO>> getProcessFlow(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getProcessFlow(param), commonMapper.getProcessFlowCount(param)); } /** * @desc : 查询产品分类(分页) * @author : 夏常明 * @date : 2023/3/3 14:05 */ public ResponseResultVO>> getModelCategoryPage(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getModelCategoryPage(param), commonMapper.getModelCategoryCount(param)); } /** * @desc : 查询打印机 * @author : 夏常明 * @date : 2023/3/7 10:41 */ public ResponseResultVO>> getLabelPrinter(Map param) { return ResponseResultUtil.success(commonMapper.getLabelPrinter(param)); } /** * @desc : 查询打印模板 * @author : 夏常明 * @date : 2023/3/7 10:41 */ public ResponseResultVO>> getLabelPrintLayout(Map param) { return ResponseResultUtil.success(commonMapper.getLabelPrintLayout(param)); } /** * @desc : 获取用户 * @author : 姜宁 * @date : 2023/3/14 9:51 */ public ResponseResultVO>> getUser(Map param) { return ResponseResultUtil.success(commonMapper.getUser(param)); } /** * @desc : 查询工种 分页 * @author : 洪旭东 * @date : 2023-03-20 11:23 */ public ResponseResultVO>> getJobByPage(Map param) { this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getJob(param), commonMapper.countJob(param)); } /** * @desc : 查询班组员工 * @author : 洪旭东 * @date : 2023-03-20 13:13 */ public ResponseResultVO>> getTeamStaff(Map param) { return super.mergeListWithCount(param, commonMapper.getTeamStaff(param), commonMapper.countTeamStaff(param)); } /** * @desc : 获取结转账务日期 * @author : 姜宁 * @date : 2023/3/21 9:24 */ public ResponseResultVO getCarryoverAccountDate(Map param) { // 获取系统参数默认结转账务日 Map sysParam = new HashMap<>(); sysParam.put("code", Constant.StringConstant.SYS_PDM_001.getName()); sysParam.put("ftyId", param.get("ftyId")); String accountDay = commonMapper.getSettingValue(sysParam); // 获取账务日开始和结束 Map accountParam = new HashMap<>(); accountParam.put("accountDay", accountDay.equals("") ? null : Integer.parseInt(accountDay)); accountParam.put("month", param.get("month")); String accountDate = commonMapper.selectAccountDate(accountParam); // 获取开始日和结束日 List stringDate = Arrays.asList(accountDate.split(String.valueOf(','))); if (CollectionUtils.isEmpty(stringDate) || stringDate.size() < 4) { return ResponseResultUtil.error(ResponseCodeEnum.SELECT_ACCOUNDATE_FAIL); } return ResponseResultUtil.success(accountDate); } /** * @desc : 获取工位(工位打卡选择工位) * @author : 姜宁 * @date : 2023/3/30 10:38 */ public ResponseResultVO>> getWsStationByUser(Map param) { List> list = new ArrayList<>(); //获取工位工号 List> list1 = commonMapper.getWsStation(param); //获取工位(工位打卡选择工位,工号未绑定工位时,获取工序工号绑定的工位) List> list2 = commonMapper.getWsStationByNode(param); //获取工位(工位打卡选择工位,工位未绑定工序和用户) List> list3 = commonMapper.getWsStationNoUser(param); list.addAll(list1); list.addAll(list2); list.addAll(list3); list = list.stream().distinct().collect(Collectors.toList()); return ResponseResultUtil.success(list); } /** * @desc : 获取湿温度计分页 * @date : 2023/4/3 10:39 * @author : 寇珊珊 */ public ResponseResultVO>> thmeterRecordByPage(Map param) { // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.thmeterRecordByPage(param), commonMapper.getThmeterRecordByCount(param)); } /** * @desc : 获取湿温度计 * @date : 2023/4/3 14:29 * @author : 寇珊珊 */ public ResponseResultVO>> getThmeterRecord(Map param) { return ResponseResultUtil.success(commonMapper.getThmeterRecord(param)); } /** * @desc : 获取用户隐藏列信息 * @author : 周兴 * @date : 2023/4/4 15:05 */ public ResponseResultVO>> getUserTableInfo(Map param) { return ResponseResultUtil.success(commonMapper.getUserTableInfo(param)); } /** * @desc : 获取用户功能 * @author : 周兴 * @date : 2023/4/4 15:05 */ public ResponseResultVO>> getUserFunction(Map param) { return ResponseResultUtil.success(commonMapper.getUserFunction(param)); } /** * @desc : 查导航菜单(自定义报表用) * @author : 周兴 * @date : 2023/4/4 15:05 */ public ResponseResultVO>> getMenuNavigation(Map param) { return ResponseResultUtil.success(commonMapper.getMenuNavigation(param)); } /** * @desc : 查询标签打印项目 * @author : 洪旭东 * @date : 2023-04-12 13:24 */ public ResponseResultVO>> getLabelPrintItem(Map param) { return ResponseResultUtil.success(commonMapper.getLabelPrintItem(param)); } /** * @desc : 获取员工用于报工记录查询 * @date : 2023/4/17 15:07 * @author : 寇珊珊 */ public ResponseResultVO>> getStaffWithWork(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getStaffWithWorkByPage(param), commonMapper.getStaffWithWorkByCount(param)); } /** * @desc : 查询标签分类的类型 * @author : 洪旭东 * @date : 2023-05-08 17:03 */ public ResponseResultVO>> getLabelPrintTypeKind() { return ResponseResultUtil.success(commonMapper.getLabelPrintTypeKind(new HashMap<>())); } /** * @desc : 查询产品型号标签 * @author : 洪旭东 * @date : 2023-05-11 15:00 */ public ResponseResultVO>> getModelProductLabelType() { return ResponseResultUtil.success(commonMapper.getModelProductLabelType(new HashMap<>())); } /** * @desc : 获取窑炉类型 * @author : 洪旭东 * @date : 2023-05-19 10:38 */ public ResponseResultVO>> getKilnType(Map param) { return ResponseResultUtil.success(commonMapper.getKilnType(param)); } /** * @desc : 获取成型线类型 * @author : 洪旭东 * @date : 2023-05-19 10:38 */ public ResponseResultVO>> getMoldlineType(Map param) { return ResponseResultUtil.success(commonMapper.getMoldlineType(param)); } /** * @desc : 获取物料编码 * @date : 2023/5/24 14:05 * @author : 寇珊珊 */ public ResponseResultVO>> getModelMaterialByPage(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getModelMaterialByPage(param), commonMapper.getModelMaterialCountByPage(param)); } /** * @desc : 获取物料编码 * @date : 2023/6/30 9:51 * @author : 寇珊珊 */ public ResponseResultVO>> getModelMaterial(Map param) { return ResponseResultUtil.success(commonMapper.getModelMaterial(param)); } /** * @desc : 产品信息数量 * @date : 2023/5/26 13:48 * @author : 寇珊珊 */ public ResponseResultVO>> getProductForChangeNoPage(Map param) { return ResponseResultUtil.success(commonMapper.getProductForChangeNoPage(param)); } /** * @desc : 获取数据类型 * @author : 周兴 * @date : 2023/6/2 11:01 */ public ResponseResultVO>> getValueKind(Map param) { return ResponseResultUtil.success(commonMapper.getValueKind(param)); } /** * @desc : 获取计量单位 * @author : 常皓宁 * @date : 2023/6/15 8:46 */ public ResponseResultVO>> getModelUnits(Map param) { return ResponseResultUtil.success(commonMapper.getModelUnits(param)); } /** * @desc : 获取产品型号、物料型号 * @author : 常皓宁 * @date : 2023/6/15 13:37 */ public ResponseResultVO>> getModelBase(Map param) { return ResponseResultUtil.success(commonMapper.getModelBase(param)); } /** * @desc : 获取产品型号、物料型号分页 * @author : 常皓宁 * @date : 2023/6/15 13:37 */ public ResponseResultVO>> getModelBaseByPage(Map param) { this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getModelBase(param), commonMapper.countModelBase(param)); } /** * @desc : 获取报工项目 * @author : 付斌 * @date : 2023/6/19 9:12 */ public ResponseResultVO>> getWorkProject(Map param) { // 查询工艺节点数据 List> list = commonMapper.getWorkProject(param); return ResponseResultUtil.success(list); } /** * @desc : 获取报工项目 * @author : 付斌 * @date : 2023/6/19 9:12 */ public ResponseResultVO>> getWorkProjectByPage(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getWorkProjectByPage(param), commonMapper.getWorkProjectCountByPage(param)); } /** * @desc : 查询产品缺陷 * @author : 常皓宁 * @date : 2023/6/25 10:05 */ public ResponseResultVO>> getProductDefectsByPage(Map param) { this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getProductDefects(param), commonMapper.countProductDefects(param)); } /** * @desc : 查询产品缺陷 * @author : 常皓宁 * @date : 2023/6/25 10:05 */ public ResponseResultVO>> getProductDefects(Map param) { return ResponseResultUtil.success(commonMapper.getProductDefects(param)); } /** * @desc : 获取应用 * @author : 洪旭东 * @date : 2023-06-30 14:56 */ public ResponseResultVO>> getApplication() { return ResponseResultUtil.success(commonMapper.getApplication()); } /** * @desc : 获取产品 * @date : 2023/7/14 14:44 * @author : 寇珊珊 */ public ResponseResultVO> getProduct(Map param) { return ResponseResultUtil.success(commonMapper.getProduct(param)); } /** * @desc : 获取工位打印机 * @date : 2023/7/14 14:44 * @author : 寇珊珊 */ public ResponseResultVO>> getWsPrinter(Map param) { return ResponseResultUtil.success(commonMapper.getWsPrinter(param)); } /** * @desc : 获取仓库 * @author : 洪旭东 * @date : 2023-08-09 14:31 */ public ResponseResultVO>> getWarehouseByPage(Map param) { this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getWarehouseByPage(param), commonMapper.countWarehouseByPage(param)); } /** * @desc : 获取仓位 * @author : 洪旭东 * @date : 2023-08-09 14:31 */ public ResponseResultVO>> getWarehousePlaceByPage(Map param) { this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getWarehousePlaceByPage(param), commonMapper.countWarehousePlaceByPage(param)); } /** * @desc : 获取单据 * @author : 周兴 * @date : 2023/9/14 11:06 */ public ResponseResultVO>> getDoc(Map param) { return ResponseResultUtil.success(commonMapper.getDoc(param)); } /** * @desc : 获取下拉选 * @author : 洪旭东 * @date : 2023-09-25 09:03 */ public ResponseResultVO>> getSelectType(Map param) { return ResponseResultUtil.success(commonMapper.getSelectType(param)); } /** * @desc : 获取放大镜 * @author : 洪旭东 * @date : 2023-09-25 09:03 */ public ResponseResultVO>> getSelectMagnifier(Map param) { return ResponseResultUtil.success(commonMapper.getSelectMagnifier(param)); } /** * @desc : 获取理化检验单 * @author : 洪旭东 * @date : 2023-12-01 16:39 */ public ResponseResultVO>> getPhysicalCollectByPage(Map param) { this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getPhysicalCollectByPage(param), commonMapper.countPhysicalCollectByPage(param)); } /** * @desc : 获取生产工单 * @author : 洪旭东 * @date : 2023-12-25 10:59 */ public ResponseResultVO>> getSheetProduceByPage(Map param) { this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getSheetProduceByPage(param), commonMapper.countSheetProduceByPage(param)); } /** * @desc : 获取载具型号分页查询 * @author : 姜宁 * @date : 2024/1/3 10:53 */ public ResponseResultVO>> getModelCarrierByPage(Map param) { this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getModelCarrierByPage(param), commonMapper.countModelCarrierByPage(param)); } /** * @desc : 获取商品 * @author : 姜宁 * @date : 2023/1/9 13:50 */ public ResponseResultVO>> getGoods(Map param) { // 获取系统基础数据 List> list = commonMapper.getGoods(param); return ResponseResultUtil.success(list); } /** * @desc : 获取商品数量 * @author : 姜宁 * @date : 2023/1/29 17:01 */ public ResponseResultVO>> getGoodsPage(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getGoods(param), commonMapper.getGoodsCountByPage(param)); } /** * @desc : 获取商品 * @author : 姜宁 * @date : 2023/1/9 13:50 */ public ResponseResultVO>> getCustomer(Map param) { // 获取系统基础数据 List> list = commonMapper.getCustomer(param); return ResponseResultUtil.success(list); } /** * @desc : 获取商品数量 * @author : 姜宁 * @date : 2023/1/29 17:01 */ public ResponseResultVO>> GetCustomerByPage(Map param) { // 校验分页参数 if (param.get("pageSize") == null || param.get("currentPage") == null) { return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!"); } // 分页参数赋值 param = this.getLimit(param); return super.mergeListWithCount(param, commonMapper.getCustomer(param), commonMapper.getCustomerCountByPage(param)); } }