| | |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.InputStream; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | |
| | | import com.consum.model.po.FinSysTenantUser; |
| | |
| | | return this.getFinSysTenantUserCache().get(String.valueOf(userInfo.getId())); |
| | | } |
| | | |
| | | protected String downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) throws Exception { |
| | | protected String downLoadExcel(String fileName, Workbook workbook) throws Exception { |
| | | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| | | workbook.write(byteArrayOutputStream); |
| | | |
| | |
| | | CommonUtil.copyProperties(baseCategory, param2); |
| | | baseCategory = param2; |
| | | |
| | | if (baseCategory == null || baseCategory.getId() == null || baseCategory.getStates() == null) { |
| | | if (baseCategory.getId() == null || baseCategory.getStates() == null) { |
| | | return ResponseValue.error("参数错误"); |
| | | } |
| | | // 根据分类id和状态查询物品模版 |
| | |
| | | CommonUtil.copyProperties(models, param2); |
| | | models = param2; |
| | | |
| | | if (models == null || models.getId() == null || models.getStates() == null) { |
| | | if (models.getId() == null || models.getStates() == null) { |
| | | return ResponseValue.error("参数错误"); |
| | | } |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.EasyExcelFactory; |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.excel.exception.ExcelDataConvertException; |
| | |
| | | CommonUtil.copyProperties(goodsTemplate, param2); |
| | | goodsTemplate = param2; |
| | | |
| | | if (goodsTemplate == null || goodsTemplate.getId() == null || goodsTemplate.getStates() == null) { |
| | | if (goodsTemplate.getId() == null || goodsTemplate.getStates() == null) { |
| | | return ResponseValue.error("参数错误"); |
| | | } |
| | | |
| | |
| | | @PostMapping("/import") |
| | | public ResponseValue upload(MultipartFile file) throws IOException { |
| | | String originalFilename = file.getOriginalFilename(); |
| | | if (!originalFilename.endsWith(".xls")) { |
| | | if (!".xls".endsWith(originalFilename)) { |
| | | return ResponseValue.error("文件格式有误!"); |
| | | } |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("当前登录用户为空"); |
| | | } |
| | | EasyExcel.read(file.getInputStream(), ImportGoodsInfoTemplate.class, |
| | | EasyExcelFactory.read(file.getInputStream(), ImportGoodsInfoTemplate.class, |
| | | new AnalysisEventListener<ImportGoodsInfoTemplate>() { |
| | | List<BaseGoodsTemplateParam> list = Lists.newArrayList(); |
| | | |
| | |
| | | return ResponseValue.success(depFormScrappedService.listByModel2(param)); |
| | | } |
| | | |
| | | // public static void main(String[] args) { |
| | | // TemplateExportParams exportParams = new |
| | | // TemplateExportParams("D:\\MyProjects\\jmy\\低值易耗品\\low-consum-manage\\deploy-jar-single\\src\\main\\resources\\import\\deptScrapped.xlsx"); |
| | | // exportParams.setHeadingStartRow(2); |
| | | // |
| | | // List<Map<String, Object>> export = new ArrayList<>(); |
| | | // |
| | | // // 创建第一条数据 |
| | | // Map<String, Object> data1 = new HashMap<>(); |
| | | // data1.put("agencyName", 1); |
| | | // data1.put("baseGoodsTemplateName", "Bob"); |
| | | // data1.put("scrappedName", "Bob"); |
| | | // data1.put("bz", "Bob"); |
| | | // data1.put("baseGoodsModelsName", 30); |
| | | // data1.put("counts", 30); |
| | | // data1.put("totalPrice", 30); |
| | | // export.add(data1); |
| | | // |
| | | // // 创建第二条数据 |
| | | // Map<String, Object> data2 = new HashMap<>(); |
| | | // data2.put("agencyName", 2); |
| | | // data2.put("baseGoodsTemplateName", "Bob"); |
| | | // data2.put("scrappedName", "Bob"); |
| | | // data2.put("bz", "Bob"); |
| | | // data2.put("baseGoodsModelsName", 30); |
| | | // data2.put("counts", 30); |
| | | // data2.put("totalPrice", 30); |
| | | // export.add(data2); |
| | | // |
| | | // |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // map.put("code", "2023"); |
| | | // map.put("date", "2023"); |
| | | // map.put("name", "operatorName"); |
| | | // map.put("countNum", 0); |
| | | // map.put("totalAmount", 0); |
| | | // map.put("maplist", export); |
| | | // |
| | | // Workbook workbook = ExcelExportUtil.exportExcel(exportParams, map); |
| | | // |
| | | // File file = new File("C:\\Users\\cy\\Desktop\\新建文件夹"); |
| | | // OutputStream stream = null; |
| | | // try { |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyy_MM_dd"); |
| | | // stream = new FileOutputStream(new File(file, "机构客户信息表.xls")); |
| | | // //document.write(stream); |
| | | // workbook.write(stream); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } finally { |
| | | // if (stream != null) ; |
| | | // try { |
| | | // stream.close(); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | |
| | | public ResponseValue selectByDataScope(Integer dataScope) { |
| | | List<S_role> roleList = finSysServerServiceImpl.getByDataScope(dataScope); |
| | | // 过滤仓库管理员的显示 |
| | | roleList.removeIf(role -> role.getRole_name().equals("仓库管理员")); |
| | | roleList.removeIf(role -> "仓库管理员".equals(role.getRole_name())); |
| | | return ResponseValue.success(roleList); |
| | | } |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.EasyExcelFactory; |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.excel.exception.ExcelDataConvertException; |
| | |
| | | @PostMapping("import") |
| | | public ResponseValue upload(@RequestParam Long pid, MultipartFile file) throws IOException { |
| | | String originalFilename = file.getOriginalFilename(); |
| | | if (!originalFilename.endsWith("xls")) { |
| | | if (!"xls".endsWith(originalFilename)) { |
| | | return ResponseValue.error("文件格式有误!"); |
| | | } |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | |
| | | return ResponseValue.error("不能创建县(区)级以下机构"); |
| | | } |
| | | |
| | | EasyExcel |
| | | EasyExcelFactory |
| | | .read(file.getInputStream(), ImportTenantTemplate.class, new AnalysisEventListener<ImportTenantTemplate>() { |
| | | LinkedList<FinSysTenantParam> finSysTenantParams = new LinkedList<>(); |
| | | |
| | |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | // FinSysTenant finSysTenant1 = this.finSysTenantService.selectByTenantId(sysInfo.getTenantCode()); |
| | | // if (finSysTenant1.getLv() != 1) { |
| | | // return ResponseValue.error("暂无修改权限"); |
| | | // } |
| | | |
| | | int num = this.finSysTenantService.updateFinSysTenant(param, this.getSysInfo()); |
| | | return num > 0 ? ResponseValue.success(1) : ResponseValue.error("编辑失败!"); |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.EasyExcelFactory; |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.excel.exception.ExcelDataConvertException; |
| | |
| | | String tel = finSysTenantUser.getUserPhone() != null |
| | | ? AESUtils.decryptStrAES(finSysTenantUser.getUserPhone(), PlatformRSAUtils.AES_KEY) : null; |
| | | finSysTenantUser.setUserPhone(StringUtils.isNotEmpty(tel) ? PhoneNumberUtils.maskMobile(tel) : ""); |
| | | |
| | | // 列表不需要查询角色,只显示列表所需要的信息 |
| | | /*List<S_role> list = finSysTenantUserService.getByUserId(finSysTenantUser.getSysUserId()); |
| | | StringBuilder roleStr = new StringBuilder(); |
| | | list.forEach(s_role -> roleStr.append(s_role.getRole_name()).append(" ")); |
| | | finSysTenantUser.setRoleStr(roleStr.toString()); |
| | | finSysTenantUser.setIsSupplier(finSysTenantUser.getSupplierId() != null ? "是" : "否");*/ |
| | | |
| | | } |
| | | return ResponseValue.success(pager); |
| | |
| | | List<S_role> roles = this.roleService.select(new S_role()); |
| | | ArrayList<FinSysTenantUser> finSysTenantUsers = new ArrayList<>(); |
| | | |
| | | EasyExcel.read(file.getInputStream(), ImportUserParam.class, new AnalysisEventListener<ImportUserParam>() { |
| | | @Override |
| | | public void invoke(ImportUserParam data, AnalysisContext context) { |
| | | if (StringUtils.isEmpty(data.getUserName()) || StringUtils.isEmpty(data.getUserCode()) |
| | | || StringUtils.isEmpty(data.getUserPhone()) || null == data.getSex() |
| | | || StringUtils.isEmpty(data.getEmail()) || null == data.getSeq() |
| | | || StringUtils.isEmpty(data.getRoleName())) { |
| | | throw new ImportUserParamVerifyException("单元格不能为空!"); |
| | | } |
| | | // 根据员工编号查询,如果存在则提示 |
| | | if (finSysTenantUserService.getByUserCode(data.getUserCode()) != null) { |
| | | throw new ImportUserParamVerifyException("员工编号为空或已存在!"); |
| | | } |
| | | if (data.getSex() < 1 && data.getSex() > 0) { |
| | | throw new ImportUserParamVerifyException("性别码只能为 0 或 1"); |
| | | } |
| | | FinSysTenantUser user = new FinSysTenantUser(); |
| | | user.setUserName(data.getUserName()); |
| | | user.setUserCode(data.getUserCode()); |
| | | user.setUserPhone(data.getUserPhone()); |
| | | user.setSex(data.getSex()); |
| | | user.setEmail(data.getEmail()); |
| | | user.setSeq(data.getSeq()); |
| | | user.setTenantId(tenantId); |
| | | user.setTenantCode(tenantCode); |
| | | // 设置角色 |
| | | Optional<S_role> sRole = |
| | | roles.stream().filter(role -> role.getRole_name().equals(data.getRoleName())).findFirst(); |
| | | user.setRoleList(Arrays.asList(sRole.orElse(new S_role()).getRole_id())); |
| | | |
| | | user.setId(NumberGenerator.getLongSequenceNumber()); |
| | | user.setCreateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | user.setCreateBy(currentUser.getUser_name()); |
| | | user.setUpdateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | user.setUpdateBy(currentUser.getUser_name()); |
| | | user.setStatus(1);// 0禁用 1启用 |
| | | user.setIsDelete(0);// 是否删除 0是 1否 |
| | | user.setSysUserId(NumberGenerator.getLongSequenceNumber()); |
| | | user.setRemark("批量导入"); |
| | | // 加密手机号 |
| | | setUserPhone(user, data.getUserPhone()); |
| | | |
| | | user.setIsDelete(1); |
| | | // 怎么获取左侧机构树数据 |
| | | user.setSysDeptId(3L); // 对应平台机构id 默认为平台管理 |
| | | finSysTenantUsers.add(user); |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext context) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onException(Exception exception, AnalysisContext context) throws Exception { |
| | | if (exception != null) { |
| | | // 如果是某一个单元格的转换异常 能获取到具体行号 封装时异常 |
| | | if (exception instanceof ExcelDataConvertException) { |
| | | ExcelDataConvertException excelDataConvertException = (ExcelDataConvertException)exception; |
| | | logger.error("第{}行,第{}列解析异常,数据为:{}", excelDataConvertException.getRowIndex(), |
| | | excelDataConvertException.getColumnIndex() + 1, |
| | | excelDataConvertException.getCellData().getStringValue()); |
| | | throw new IllegalStateException("第" + (excelDataConvertException.getRowIndex() + 1) + "行,第" |
| | | + (excelDataConvertException.getColumnIndex() + 1) + "列解析异常,异常数据为:[ " |
| | | + excelDataConvertException.getCellData().getStringValue() + " ]"); |
| | | EasyExcelFactory |
| | | .read(file.getInputStream(), ImportUserParam.class, new AnalysisEventListener<ImportUserParam>() { |
| | | @Override |
| | | public void invoke(ImportUserParam data, AnalysisContext context) { |
| | | if (StringUtils.isEmpty(data.getUserName()) || StringUtils.isEmpty(data.getUserCode()) |
| | | || StringUtils.isEmpty(data.getUserPhone()) || null == data.getSex() |
| | | || StringUtils.isEmpty(data.getEmail()) || null == data.getSeq() |
| | | || StringUtils.isEmpty(data.getRoleName())) { |
| | | throw new ImportUserParamVerifyException("单元格不能为空!"); |
| | | } |
| | | if (exception instanceof ImportUserParamVerifyException) { |
| | | throw new IllegalStateException("第" + context.readSheetHolder().getRowIndex() + "行, 解析错误:[ " |
| | | + exception.getMessage() + " ]"); |
| | | // 根据员工编号查询,如果存在则提示 |
| | | if (finSysTenantUserService.getByUserCode(data.getUserCode()) != null) { |
| | | throw new ImportUserParamVerifyException("员工编号为空或已存在!"); |
| | | } |
| | | throw exception; |
| | | if (data.getSex() < 1 && data.getSex() > 0) { |
| | | throw new ImportUserParamVerifyException("性别码只能为 0 或 1"); |
| | | } |
| | | FinSysTenantUser user = new FinSysTenantUser(); |
| | | user.setUserName(data.getUserName()); |
| | | user.setUserCode(data.getUserCode()); |
| | | user.setUserPhone(data.getUserPhone()); |
| | | user.setSex(data.getSex()); |
| | | user.setEmail(data.getEmail()); |
| | | user.setSeq(data.getSeq()); |
| | | user.setTenantId(tenantId); |
| | | user.setTenantCode(tenantCode); |
| | | // 设置角色 |
| | | Optional<S_role> sRole = |
| | | roles.stream().filter(role -> role.getRole_name().equals(data.getRoleName())).findFirst(); |
| | | user.setRoleList(Arrays.asList(sRole.orElse(new S_role()).getRole_id())); |
| | | |
| | | user.setId(NumberGenerator.getLongSequenceNumber()); |
| | | user.setCreateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | user.setCreateBy(currentUser.getUser_name()); |
| | | user.setUpdateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | user.setUpdateBy(currentUser.getUser_name()); |
| | | user.setStatus(1);// 0禁用 1启用 |
| | | user.setIsDelete(0);// 是否删除 0是 1否 |
| | | user.setSysUserId(NumberGenerator.getLongSequenceNumber()); |
| | | user.setRemark("批量导入"); |
| | | // 加密手机号 |
| | | setUserPhone(user, data.getUserPhone()); |
| | | |
| | | user.setIsDelete(1); |
| | | // 怎么获取左侧机构树数据 |
| | | user.setSysDeptId(3L); // 对应平台机构id 默认为平台管理 |
| | | finSysTenantUsers.add(user); |
| | | } |
| | | } |
| | | }).sheet().doRead(); |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext context) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onException(Exception exception, AnalysisContext context) throws Exception { |
| | | if (exception != null) { |
| | | // 如果是某一个单元格的转换异常 能获取到具体行号 封装时异常 |
| | | if (exception instanceof ExcelDataConvertException) { |
| | | ExcelDataConvertException excelDataConvertException = (ExcelDataConvertException)exception; |
| | | logger.error("第{}行,第{}列解析异常,数据为:{}", excelDataConvertException.getRowIndex(), |
| | | excelDataConvertException.getColumnIndex() + 1, |
| | | excelDataConvertException.getCellData().getStringValue()); |
| | | throw new IllegalStateException("第" + (excelDataConvertException.getRowIndex() + 1) + "行,第" |
| | | + (excelDataConvertException.getColumnIndex() + 1) + "列解析异常,异常数据为:[ " |
| | | + excelDataConvertException.getCellData().getStringValue() + " ]"); |
| | | } |
| | | if (exception instanceof ImportUserParamVerifyException) { |
| | | throw new IllegalStateException("第" + context.readSheetHolder().getRowIndex() + "行, 解析错误:[ " |
| | | + exception.getMessage() + " ]"); |
| | | } |
| | | throw exception; |
| | | } |
| | | } |
| | | }).sheet().doRead(); |
| | | |
| | | insertUserAndUserCoreBatch(finSysTenantUsers); |
| | | |
| | |
| | | Long sysUserId = finSysTenantUser.getSysUserId(); |
| | | List<S_role> roleList = finSysTenantUserService.getRoleBySysUserId(sysUserId); |
| | | // 过滤仓库管理员的显示 |
| | | roleList.removeIf(role -> role.getRole_name().equals("仓库管理员")); |
| | | roleList.removeIf(role -> "仓库管理员".equals(role.getRole_name())); |
| | | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("list", roleList); |
| | |
| | | return ResponseValue.success(1); |
| | | } |
| | | |
| | | private Set<String> picFormatArr = new HashSet<String>() { |
| | | private final Set<String> picFormatArr = new HashSet<String>() { |
| | | { |
| | | add(".pjp"); |
| | | add(".svgz"); |
| | |
| | | }); |
| | | try { |
| | | Field fieldDatas = GenericPager.class.getDeclaredField("datas"); |
| | | // fieldDatas.setAccessible(true); |
| | | // fieldDatas.set(genericPager, result); |
| | | ReflectUtil.setFieldValue(genericPager, fieldDatas, result); |
| | | } catch (Exception e) { |
| | | logger.error(e.getMessage(), e); |
| | |
| | | map.put("monitorName", monitorName); |
| | | map.put("name", operatorName); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(params, InventoryExcelTemplate.class, exportList, map); |
| | | String filePath = downLoadExcel("低值易耗品盘点表", response, workbook); |
| | | String filePath = downLoadExcel("低值易耗品盘点表", workbook); |
| | | return ResponseValue.success("导出成功", filePath); |
| | | } |
| | | |
| | |
| | | } |
| | | try { |
| | | Field fieldDatas = GenericPager.class.getDeclaredField("datas"); |
| | | // fieldDatas.setAccessible(true); |
| | | // fieldDatas.set(genericPager, resultList); |
| | | ReflectUtil.setFieldValue(genericPager, fieldDatas, resultList); |
| | | } catch (Exception e) { |
| | | logger.error("查询出库单列表失败", e); |
| | |
| | | @ApiOperation(value = "根据id查询详情", notes = "根据id查询详情") |
| | | @ApiImplicitParam(name = "id", value = "出库单id", required = true, dataType = "Long", paramType = "query") |
| | | @GetMapping("/detail") |
| | | public ResponseValue getById(Long id) throws IllegalAccessException { |
| | | public ResponseValue getById(Long id) throws Exception { |
| | | if (id == null) { |
| | | return ResponseValue.error("出库单id为空"); |
| | | } |
| | |
| | | map.put("totalAmount", totalAmount); |
| | | |
| | | Workbook workbook = ExcelExportUtil.exportExcel(params, OutputExcelTemplate.class, exportList, map); |
| | | String filePath = downLoadExcel("出库单", response, workbook); |
| | | String filePath = downLoadExcel("出库单", workbook); |
| | | return ResponseValue.success("导出成功", filePath); |
| | | |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.EasyExcelFactory; |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.excel.exception.ExcelDataConvertException; |
| | |
| | | * 根据id查询详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | public ResponseValue getById(Long id) throws IllegalAccessException { |
| | | public ResponseValue getById(Long id) throws Exception { |
| | | if (id == null) { |
| | | return ResponseValue.error("采购单id为空"); |
| | | } |
| | |
| | | map.put("totalAmount", totalAmount); |
| | | |
| | | Workbook workbook = ExcelExportUtil.exportExcel(params, ProcureExcelTemplate.class, exportList, map); |
| | | String filePath = downLoadExcel("采购入库单", response, workbook); |
| | | String filePath = downLoadExcel("采购入库单", workbook); |
| | | return ResponseValue.success("导出成功", filePath); |
| | | |
| | | } |
| | |
| | | @PostMapping("/import") |
| | | public ResponseValue upload(MultipartFile file) throws IOException { |
| | | String originalFilename = file.getOriginalFilename(); |
| | | if (!originalFilename.endsWith(".xls")) { |
| | | if (!".xls".endsWith(originalFilename)) { |
| | | return ResponseValue.error("文件格式有误!"); |
| | | } |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("当前登录用户为空"); |
| | | } |
| | | EasyExcel.read(file.getInputStream(), ImportProcureOrderTemplate.class, |
| | | EasyExcelFactory.read(file.getInputStream(), ImportProcureOrderTemplate.class, |
| | | new AnalysisEventListener<ImportProcureOrderTemplate>() { |
| | | List<LWhFormProcureParam> list = Lists.newArrayList(); |
| | | |
| | |
| | | map.put("totalAmount", totalAmount); |
| | | |
| | | Workbook sheets = ExcelExportUtil.exportExcel(exportParams, ScrappedInfoExcelTemplate.class, export, map); |
| | | String filePath = downLoadExcel("报废登记单", response, sheets); |
| | | String filePath = downLoadExcel("报废登记单", sheets); |
| | | return ResponseValue.success("导出成功", filePath); |
| | | |
| | | } |
| | |
| | | lWhFormTransfer.setOutWarehouseName(warehouseName); |
| | | lWhFormTransferService.update(lWhFormTransfer); |
| | | // lWhFormTransferCoreService.doTransferOutPut(id, getCurrentUser()); |
| | | lWhFormTransferCoreService.doTransferOutPutNew(id, getCurrentUser(),WhBusinessEnum.DIAOBO); |
| | | lWhFormTransferCoreService.doTransferOutPutNew(id, getCurrentUser(), WhBusinessEnum.DIAOBO); |
| | | return ResponseValue.success(); |
| | | } |
| | | |
| | |
| | | map.put("totalAmount", totalAmount); |
| | | |
| | | Workbook workbook = ExcelExportUtil.exportExcel(params, TransferExcelTemplate.class, export, map); |
| | | String filePath = downLoadExcel(fileName, response, workbook); |
| | | String filePath = downLoadExcel(fileName, workbook); |
| | | return ResponseValue.success("导出成功", filePath); |
| | | |
| | | } |
| | |
| | | // 1=调增;2=调减 |
| | | Short flowThisType = null; |
| | | // 单据类型。0仓库调拨;1部门分发;2部门物品回退 |
| | | Short transferBusinessType = null; |
| | | switch (flowType) { |
| | | // 1采购入库 |
| | | case 1: |
| | |
| | | // 1=调增;2=调减 |
| | | Short flowThisType = null; |
| | | // 单据类型。0仓库调拨;1部门分发;2部门物品回退 |
| | | Short transferBusinessType = null; |
| | | switch (deptFlowType) { |
| | | // 物品申领 |
| | | case 1: |
| | |
| | | if (price == null) { |
| | | return 0; |
| | | } |
| | | return new BigDecimal(price).divide(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN).doubleValue(); |
| | | return BigDecimal.valueOf(price).divide(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN).doubleValue(); |
| | | } |
| | | } |
| | |
| | | public FinSysTenantUtils() { |
| | | } |
| | | |
| | | public static final List<TreeNode> getFinSysTenantTree(List<FinSysTenant> finSysTenantList) { |
| | | public static List<TreeNode> getFinSysTenantTree(List<FinSysTenant> finSysTenantList) { |
| | | FinSysTenantGenerator finSysTenantGenerator = new FinSysTenantGenerator((String)null); |
| | | finSysTenantGenerator.setEntityList(finSysTenantList); |
| | | List<TreeNode> treeNodeList = finSysTenantGenerator.getTreeRootList(); |
| | | return treeNodeList; |
| | | } |
| | | |
| | | public static final List<TreeNode> getFinSysTenantTreeTow(List<FinSysTenantRegion> finSysTenantList) { |
| | | public static List<TreeNode> getFinSysTenantTreeTow(List<FinSysTenantRegion> finSysTenantList) { |
| | | FinSysTenantGeneratorTow finSysTenantGenerator = new FinSysTenantGeneratorTow((String)null); |
| | | finSysTenantGenerator.setEntityList(finSysTenantList); |
| | | List<TreeNode> treeNodeList = finSysTenantGenerator.getTreeRootList(); |
| | |
| | | package com.consum.base.core.utils; |
| | | |
| | | import com.walker.db.page.GenericPager; |
| | | import java.util.List; |
| | | |
| | | import com.walker.db.page.GenericPager; |
| | | |
| | | /** |
| | | * @author asus |
| | |
| | | |
| | | public PageUtil(GenericPager mapGenericPager) { |
| | | super(mapGenericPager.getDatas(), mapGenericPager.getPageIndex(), mapGenericPager.getPageSize(), |
| | | (int) mapGenericPager.getTotalRows()); |
| | | (int)mapGenericPager.getTotalRows()); |
| | | } |
| | | |
| | | @Override |
| | | protected Class<?> buildData() { |
| | | return List.class; |
| | | } |
| | | |
| | | @Override |
| | | public PageUtil<T> setDatas(List<T> data) { |
| | | if (data != null) { |
| | | this.data = data; |
| | |
| | | return this; |
| | | } |
| | | |
| | | @Override |
| | | public List<T> getDatas() { |
| | | return this.data; |
| | | } |
| | |
| | | package com.consum.base.pojo; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName DepFormScrappedGoodsParam |
| | |
| | | @ApiModelProperty("物品模版编号") |
| | | private Long baseGoodsTemplateId; |
| | | private String goodsTemplateName; |
| | | |
| | | // @ApiModelProperty("调拨单编码") |
| | | // private String businessFormCode; |
| | | |
| | | @ApiModelProperty("调拨单Id") |
| | | private Long transBusinessId; |
| | |
| | | private Long baseGoodsModelsId; |
| | | |
| | | @ApiModelProperty("价值类型") |
| | | private String classification;//"B类" |
| | | private String classification;// "B类" |
| | | |
| | | @ApiModelProperty("报废数量") |
| | | private Integer counts; |
| | |
| | | |
| | | @ApiModelProperty("使用人员名称(可不填)") |
| | | private String nowUserName; |
| | | |
| | | // @ApiModelProperty("使用人员名称(可不填)") |
| | | // private String nowUserPhone; |
| | | |
| | | @ApiModelProperty("报废原因CODE") |
| | | private Long scrappedCode; |
| | |
| | | @ApiModelProperty(value = "状态 (0禁用1启用)") |
| | | private Integer status; |
| | | |
| | | // private String createBy; |
| | | // |
| | | // private Long createTime; |
| | | // |
| | | // private String updateBy; |
| | | // |
| | | // private Long updateTime; |
| | | // |
| | | // private Integer sex; |
| | | // |
| | | // private Long seq; |
| | | // |
| | | // private Long sysUserId; |
| | | // |
| | | // private Long sysDeptId; |
| | | // |
| | | // private String tenantCode; |
| | | // |
| | | // private Integer isDelete; |
| | | // |
| | | // private Long supplierId; |
| | | // |
| | | // |
| | | // |
| | | // private String roleStr; |
| | | // |
| | | // private List<Long> roleList; |
| | | // |
| | | // // 是否为运维商 如果有运维商id 则代表是,反之不是 |
| | | // private String isSupplier; |
| | | |
| | | |
| | | } |
| | |
| | | @Service |
| | | public class FinWarehouseLedgerServiceImpl extends BaseServiceImpl { |
| | | |
| | | private String LEDGER_LIST_QUERY_PREFIX = "SELECT ware.AGENCY_NAME ,ware.WAREHOUSE_NAME ,goodsTemp.CATEGORY_NAME ,CASE goods.COST_TYPE WHEN 1 THEN 'A类' WHEN 2 THEN 'B类' WHEN 3 THEN 'C类' END AS cost_Type,goods.GOODS_TEMPLATE_NAME ,goods.BASE_GOODS_MODELS_NAME ,goods.UNIT unit,COUNt(goods.id) kucun FROM L_WH_GOODS goods LEFT JOIN BASE_GOODS_TEMPLATE goodsTemp ON goods.BASE_GOODS_TEMPLATE_ID=goodsTemp.id LEFT JOIN BASE_WAREHOUSE ware ON ware.id=goods.WAREHOUSE_ID where 1=1 "; |
| | | private String LEDGER_LIST_QUERY_GROUP = " GROUP BY ware.AGENCY_NAME,ware.WAREHOUSE_NAME,goodsTemp.CATEGORY_NAME,goods.COST_TYPE,goods.GOODS_TEMPLATE_NAME,goods.BASE_GOODS_MODELS_NAME,goods.UNIT"; |
| | | private final String LEDGER_LIST_QUERY_PREFIX = "SELECT ware.AGENCY_NAME ,ware.WAREHOUSE_NAME ,goodsTemp.CATEGORY_NAME ,CASE goods.COST_TYPE WHEN 1 THEN 'A类' WHEN 2 THEN 'B类' WHEN 3 THEN 'C类' END AS cost_Type,goods.GOODS_TEMPLATE_NAME ,goods.BASE_GOODS_MODELS_NAME ,goods.UNIT unit,COUNt(goods.id) kucun FROM L_WH_GOODS goods LEFT JOIN BASE_GOODS_TEMPLATE goodsTemp ON goods.BASE_GOODS_TEMPLATE_ID=goodsTemp.id LEFT JOIN BASE_WAREHOUSE ware ON ware.id=goods.WAREHOUSE_ID where 1=1 "; |
| | | private final String LEDGER_LIST_QUERY_GROUP = " GROUP BY ware.AGENCY_NAME,ware.WAREHOUSE_NAME,goodsTemp.CATEGORY_NAME,goods.COST_TYPE,goods.GOODS_TEMPLATE_NAME,goods.BASE_GOODS_MODELS_NAME,goods.UNIT"; |
| | | |
| | | public GenericPager<Map<String, Object>> ledgerList(LWhLedgerQry param) { |
| | | StringBuilder sql = new StringBuilder(LEDGER_LIST_QUERY_PREFIX); |
| | |
| | | return selectSplit(sql.toString(), paramts, param.getPageNum(), param.getPageSize(), new MapperUtil()); |
| | | } |
| | | |
| | | private String DEPT_LEDGER_LIST_QUERY_PREFIX = "SELECT tenant.`name` AS AGENCY_NAME,ware.`name` depart_name,goodsTemp.CATEGORY_NAME,CASE goods.COST_TYPE WHEN 1 THEN 'A类' WHEN 2 THEN 'B类' WHEN 3 THEN 'C类' END AS cost_Type,goods.GOODS_TEMPLATE_NAME,goods.BASE_GOODS_MODELS_NAME,goods.UNIT unit,COUNt(goods.id) kucun FROM L_WH_GOODS goods LEFT JOIN BASE_GOODS_TEMPLATE goodsTemp ON goods.BASE_GOODS_TEMPLATE_ID=goodsTemp.id LEFT JOIN fin_sys_tenant_department ware ON ware.id=goods.WAREHOUSE_ID LEFT JOIN fin_sys_tenant tenant ON ware.TENANT_ID=tenant.id WHERE 1=1 "; |
| | | private String DEPT_LEDGER_LIST_QUERY_GROUP = " GROUP BY tenant.`name`,ware.`name`,goodsTemp.CATEGORY_NAME,goods.COST_TYPE,goods.GOODS_TEMPLATE_NAME,goods.BASE_GOODS_MODELS_NAME,goods.UNIT"; |
| | | private final String DEPT_LEDGER_LIST_QUERY_PREFIX = "SELECT tenant.`name` AS AGENCY_NAME,ware.`name` depart_name,goodsTemp.CATEGORY_NAME,CASE goods.COST_TYPE WHEN 1 THEN 'A类' WHEN 2 THEN 'B类' WHEN 3 THEN 'C类' END AS cost_Type,goods.GOODS_TEMPLATE_NAME,goods.BASE_GOODS_MODELS_NAME,goods.UNIT unit,COUNt(goods.id) kucun FROM L_WH_GOODS goods LEFT JOIN BASE_GOODS_TEMPLATE goodsTemp ON goods.BASE_GOODS_TEMPLATE_ID=goodsTemp.id LEFT JOIN fin_sys_tenant_department ware ON ware.id=goods.WAREHOUSE_ID LEFT JOIN fin_sys_tenant tenant ON ware.TENANT_ID=tenant.id WHERE 1=1 "; |
| | | private final String DEPT_LEDGER_LIST_QUERY_GROUP = " GROUP BY tenant.`name`,ware.`name`,goodsTemp.CATEGORY_NAME,goods.COST_TYPE,goods.GOODS_TEMPLATE_NAME,goods.BASE_GOODS_MODELS_NAME,goods.UNIT"; |
| | | |
| | | public GenericPager<Map<String, Object>> depLedgerList(LWhLedgerQry param) { |
| | | StringBuilder sql = new StringBuilder(DEPT_LEDGER_LIST_QUERY_PREFIX); |
| | |
| | | return selectSplit(sql.toString(), paramts, param.getPageNum(), param.getPageSize(), new MapperUtil()); |
| | | } |
| | | |
| | | private String DEPART_LEDGER_LIST_QUERY_PREFIX = "SELECT tenant.id tenantId,tenant.NAME AS AGENCY_NAME,ware.NAME AS depart_name,goodsTemp.CATEGORY_NAME,CASE goods.COST_TYPE WHEN 1 THEN 'A类' WHEN 2 THEN 'B类' WHEN 3 THEN 'C类' END AS cost_Type,goods.GOODS_TEMPLATE_NAME,goods.BASE_GOODS_MODELS_NAME,goods.UNIT unit,COUNt(goods.id) kucun FROM L_WH_GOODS goods LEFT JOIN BASE_GOODS_TEMPLATE goodsTemp ON goods.BASE_GOODS_TEMPLATE_ID=goodsTemp.id LEFT JOIN fin_sys_tenant_department ware ON ware.id=goods.WAREHOUSE_ID AND goods.WAREHOUSE_TYPE=1 LEFT JOIN fin_sys_tenant tenant ON tenant.id=ware.TENANT_ID WHERE 1=1 "; |
| | | private String DEPART_LEDGER_LIST_QUERY_GROUP = " GROUP BY tenant.id,tenant.NAME,ware.NAME,goodsTemp.CATEGORY_NAME,goods.COST_TYPE,goods.GOODS_TEMPLATE_NAME,goods.BASE_GOODS_MODELS_NAME,goods.UNIT"; |
| | | private final String DEPART_LEDGER_LIST_QUERY_PREFIX = "SELECT tenant.id tenantId,tenant.NAME AS AGENCY_NAME,ware.NAME AS depart_name,goodsTemp.CATEGORY_NAME,CASE goods.COST_TYPE WHEN 1 THEN 'A类' WHEN 2 THEN 'B类' WHEN 3 THEN 'C类' END AS cost_Type,goods.GOODS_TEMPLATE_NAME,goods.BASE_GOODS_MODELS_NAME,goods.UNIT unit,COUNt(goods.id) kucun FROM L_WH_GOODS goods LEFT JOIN BASE_GOODS_TEMPLATE goodsTemp ON goods.BASE_GOODS_TEMPLATE_ID=goodsTemp.id LEFT JOIN fin_sys_tenant_department ware ON ware.id=goods.WAREHOUSE_ID AND goods.WAREHOUSE_TYPE=1 LEFT JOIN fin_sys_tenant tenant ON tenant.id=ware.TENANT_ID WHERE 1=1 "; |
| | | private final String DEPART_LEDGER_LIST_QUERY_GROUP = " GROUP BY tenant.id,tenant.NAME,ware.NAME,goodsTemp.CATEGORY_NAME,goods.COST_TYPE,goods.GOODS_TEMPLATE_NAME,goods.BASE_GOODS_MODELS_NAME,goods.UNIT"; |
| | | |
| | | public GenericPager<Map<String, Object>> departLedgerList(LWhLedgerQry param) { |
| | | StringBuilder sql = new StringBuilder(DEPART_LEDGER_LIST_QUERY_PREFIX); |
| | |
| | | @Service |
| | | @Slf4j |
| | | public class LOrgSupplierServiceImpl extends BaseServiceImpl { |
| | | private static String SUPPLIER_IS_CONTAIN = "SELECT*FROM L_ORG_SUPPLIER WHERE 1=1"; |
| | | private static final String SUPPLIER_IS_CONTAIN = "SELECT*FROM L_ORG_SUPPLIER WHERE 1=1"; |
| | | |
| | | /** |
| | | * 判断供应商是否存在 |
| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | DepFormScrapped depFormScrapped = new DepFormScrapped(lWhFormScrappedId); |
| | | depFormScrapped = goodsBaseService.get(depFormScrapped); |
| | | // 状态 1=待报废;2=已报废 |
| | | if (depFormScrapped == null || depFormScrapped.getStates() != 1) { |
| | | if (Objects.isNull(depFormScrapped) || depFormScrapped.getStates() != 1) { |
| | | return ResponseValue.error("请检查报废单"); |
| | | } |
| | | |
| | |
| | | sameGoodsInsertMore(warehouseFlowId, warehouseType, warehouseId, whGoodsRecordId, (short)1, |
| | | warehouseName, classification, tempGoodsId, goodsName, baseGoodsModelsId, modelName, supplier, |
| | | buyType, goodsUnit, price, procureTime, 1, dealTime, counts); |
| | | } ; |
| | | } |
| | | whGoodsRecord.setTotalPrice(totalPrice); |
| | | } |
| | | lWhGoodsRecordServiceImpl.insert(whGoodsRecord); |
| | |
| | | lWhFormTransferService.update(lWhFormTransfer); |
| | | |
| | | log.info("调拨单:{} 出库完成", whFormTransferId); |
| | | return; |
| | | |
| | | } |
| | | |
| | |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | |
| | | // 分类名称 |
| | | sql.append("and category_name =:category_name "); |
| | | paramts.put("category_name", categoryName); |
| | | sql.append("and category_name =:categoryName "); |
| | | paramts.put("categoryName", categoryName); |
| | | // 父类id |
| | | sql.append("and father_category_id =:father_category_id "); |
| | | paramts.put("father_category_id", fatherCategoryId); |
| | | sql.append("and father_category_id =:fatherCategoryId "); |
| | | paramts.put("fatherCategoryId", fatherCategoryId); |
| | | sql.append("and states = 1 "); |
| | | return this.get(sql.toString(), paramts, new BaseCategory()); |
| | | } |
| | |
| | | package com.consum.base.service.impl; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | public List<BaseGoodsModels> selectByModelsIdList(List<Long> idList) { |
| | | if (CollectionUtils.isEmpty(idList)) { |
| | | log.error("参数错误"); |
| | | return null; |
| | | return Collections.emptyList(); |
| | | } |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM base_goods_models WHERE 1 = 1 "); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | |
| | | return this.select(sql.toString(), paramts, new BaseGoodsModels()); |
| | | } |
| | | |
| | | private String QUERY_GOODS_MODEL_INFO = |
| | | "SELECT CLASSIFICATION type, goodsTemp.CATEGORY_ID,goodsTemp.CATEGORY_NAME,goodsTemp.id goods_Id,goodsTemp.GOODS_NAME,model.MODEL_NAME,model.id base_Goods_Models_Id,model.UNIT FROM BASE_GOODS_MODELS model LEFT JOIN BASE_GOODS_TEMPLATE goodsTemp ON model.GOODS_TEMPLATES_ID=goodsTemp.id"; |
| | | |
| | | /** |
| | | * 根据物品型号id 查询物品信息 |
| | | * |
| | |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryGoodsModelInfo(Long baseGoodsModelsId) { |
| | | StringBuilder sql = new StringBuilder(QUERY_GOODS_MODEL_INFO); |
| | | StringBuilder sql = new StringBuilder( |
| | | "SELECT CLASSIFICATION type, goodsTemp.CATEGORY_ID,goodsTemp.CATEGORY_NAME,goodsTemp.id goods_Id," |
| | | + "goodsTemp.GOODS_NAME,model.MODEL_NAME,model.id base_Goods_Models_Id,model.UNIT " |
| | | + "FROM BASE_GOODS_MODELS model LEFT JOIN BASE_GOODS_TEMPLATE goodsTemp ON model.GOODS_TEMPLATES_ID=goodsTemp.id "); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | sql.append(" where model.id=:baseGoodsModelsId"); |
| | | paramts.put("baseGoodsModelsId", baseGoodsModelsId); |
| | |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import java.util.Collections; |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | |
| | |
| | | |
| | | // 分类id |
| | | if (categoryId != null) { |
| | | sql.append(" and category_id =:category_id "); |
| | | paramts.put("category_id", categoryId); |
| | | sql.append(" and category_id =:categoryId "); |
| | | paramts.put("categoryId", categoryId); |
| | | } |
| | | sql.append(" and states =1 "); |
| | | |
| | |
| | | * @return |
| | | */ |
| | | |
| | | private static String QUERY_GOODSINFO_BY_MODELID = |
| | | private static final String QUERY_GOODSINFO_BY_MODELID = |
| | | "SELECT model.MODEL_NAME modelName,model.UNIT,temp.id goodsId, temp.GOODS_CODE goodsCode,temp.GOODS_NAME goodsName,temp.CLASSIFICATION classification,temp.CATEGORY_ID categoryId FROM BASE_GOODS_MODELS model LEFT JOIN BASE_GOODS_TEMPLATE temp ON model.GOODS_TEMPLATES_ID=temp.id WHERE 1=1 "; |
| | | |
| | | @Override |
| | |
| | | } |
| | | List<Map<String, Object>> tempGoodsInfo = this.select(sqlStr.toString(), params); |
| | | if (CollectionUtils.isEmpty(tempGoodsInfo)) { |
| | | return null; |
| | | return Collections.emptyMap(); |
| | | } |
| | | return tempGoodsInfo.get(0); |
| | | } |
| | |
| | | if (param.getAgencyId() != null) { |
| | | Integer lv = currentUser.getLv(); |
| | | if (lv != 1) { |
| | | sql.append(" and AGENCY_ID =:AGENCY_ID "); |
| | | paramts.put("AGENCY_ID", param.getAgencyId()); |
| | | sql.append(" and AGENCY_ID =:agencyId "); |
| | | paramts.put("agencyId", param.getAgencyId()); |
| | | } else { |
| | | sql.append(" and AGENCY_ID like :AGENCY_ID "); |
| | | paramts.put("AGENCY_ID", param.getAgencyId() + StringUtils.CHAR_PERCENT); |
| | | sql.append(" and AGENCY_ID like :agencyId "); |
| | | paramts.put("agencyId", param.getAgencyId() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | } |
| | | // 状态 |
| | |
| | | /** |
| | | * @Description 列表查询 |
| | | */ |
| | | private static String QUERY_LIST = |
| | | private static final String QUERY_LIST = |
| | | "SELECT scrap.id,scrap.BUSINESS_FORM_CODE,scrap.AGENCY_NAME,scrap.DEPARTMENT_NAME,scrap.OPERATOR_NAME,scrap.DEAL_TIME,model.BASE_GOODS_TEMPLATE_ID,model.BASE_GOODS_TEMPLATE_NAME,SUM(model.COUNTS) total_Count,model.unit FROM DEP_FORM_SCRAPPED scrap LEFT JOIN DEP_FORM_SCRAPPED_MODEL model ON scrap.id=model.DEP_FORM_SCRAPPED_ID where 1=1"; |
| | | private static String QUERY_LIST_END = |
| | | private static final String QUERY_LIST_END = |
| | | " GROUP BY scrap.id,scrap.BUSINESS_FORM_CODE,scrap.DEPARTMENT_NAME,scrap.OPERATOR_NAME,scrap.DEAL_TIME,model.BASE_GOODS_TEMPLATE_ID,model.BASE_GOODS_TEMPLATE_NAME ORDER BY scrap.DEAL_TIME DESC"; |
| | | |
| | | @Override |
| | |
| | | return scrappedExtend; |
| | | } |
| | | |
| | | private static String EXPORT_SQL = |
| | | private static final String EXPORT_SQL = |
| | | "SELECT scrap.id,scrap.BUSINESS_FORM_CODE,model.BASE_GOODS_TEMPLATE_NAME,model.BASE_GOODS_MODELS_NAME,model.COUNTS,scrap.AGENCY_NAME,scrap.DEPARTMENT_NAME,scrap.OPERATOR_NAME,scrap.DEAL_TIME,scrap.OUT_WAREHOUSE_NAME,ROUND( IFNULL( TOTAL_AMOUNT, 0 )/ 100, 2 ) AS TOTAL_PRICE,model.SCRAPPED_NAME,NULL AS bz FROM DEP_FORM_SCRAPPED scrap LEFT JOIN DEP_FORM_SCRAPPED_MODEL model ON scrap.id=model.DEP_FORM_SCRAPPED_ID WHERE 1=1 "; |
| | | private static String EXPORT_SQL_END = "order by scrap.DEAL_TIME DESC"; |
| | | private static final String EXPORT_SQL_END = "order by scrap.DEAL_TIME DESC"; |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> export(Long id, String agencyId) { |
| | |
| | | private static final String SELECT_TREE_ALL = "select * from FIN_SYS_SERVER"; |
| | | private static final String SELECT_CHILD_BY_ID = "select * from FIN_SYS_SERVER where 1=1"; |
| | | |
| | | // private static final String S |
| | | |
| | | /** |
| | | * 查询所有服务目录 |
| | |
| | | if (finSysCategories != null) { |
| | | List<FinSysServerVo> finSysCategoryVos = finSysCategories.stream().map(category -> { |
| | | FinSysServerVo finSysCategoryVo = new FinSysServerVo(); |
| | | // BeanUtils.copyProperties(category, finSysCategoryVo); |
| | | finSysCategoryVo.setId(category.getId()); |
| | | finSysCategoryVo.setLabel(category.getName()); |
| | | finSysCategoryVo.setParentId(category.getParentId()); |
| | |
| | | @Service |
| | | public class FinSysTenantDepartmentServiceImpl extends BaseServiceImpl implements FinSysTenantDepartmentService { |
| | | |
| | | private static final String QUERY_BY_CODE = "SELECT * FROM fin_sys_tenant_department WHERE CODE = ?"; |
| | | |
| | | /** |
| | | * @Description 根据 部门名称和机构id 查询部门 |
| | | * @Author 卢庆阳 |
| | |
| | | } |
| | | // 机构id |
| | | if (tenantId != null) { |
| | | sql.append(" and TENANT_ID =:TENANT_ID "); |
| | | paramts.put("TENANT_ID", tenantId); |
| | | sql.append(" and TENANT_ID =:tenantId "); |
| | | paramts.put("tenantId", tenantId); |
| | | } |
| | | if (!StringUtils.isEmpty(code)) { |
| | | sql.append("and CODE = :code "); |
| | |
| | | } |
| | | // 机构id |
| | | if (param.getTenantId() != null) { |
| | | sql.append(" and TENANT_ID =:TENANT_ID "); |
| | | paramts.put("TENANT_ID", param.getTenantId()); |
| | | sql.append(" and TENANT_ID =:tenantId "); |
| | | paramts.put("tenantId", param.getTenantId()); |
| | | } else { |
| | | sql.append(" and TENANT_ID = 100 "); |
| | | } |
| | |
| | | |
| | | // 机构id |
| | | if (agencyId != null) { |
| | | sql.append(" and TENANT_ID =:TENANT_ID "); |
| | | paramts.put("TENANT_ID", agencyId); |
| | | sql.append(" and TENANT_ID =:tenantId "); |
| | | paramts.put("tenantId", agencyId); |
| | | } |
| | | return this.select(sql.toString(), paramts, new FinSysTenantDepartment()); |
| | | } |
| | |
| | | // 盘点结果(1=正常;2=盘盈;3=盘亏) |
| | | lWhFormInventoryGoods.setInventoryResult((errorCount > 0) ? InventoryResultType.SURPLUS.getValue() |
| | | : (errorCount < 0) ? InventoryResultType.LOSS.getValue() : InventoryResultType.NORMAL.getValue()); |
| | | // this.update(lWhFormInventoryGoods); |
| | | goodsList.add(lWhFormInventoryGoods); |
| | | } |
| | | |
| | |
| | | package com.consum.base.service.impl; |
| | | |
| | | import com.consum.base.service.core.LWhFormInventoryCoreService; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | import com.consum.base.service.LWhFormInventoryGoodsService; |
| | | import com.consum.base.service.LWhFormInventoryService; |
| | | import com.consum.base.service.LWhGoodsService; |
| | | import com.consum.base.service.core.LWhFormInventoryCoreService; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenant; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | |
| | | paramts.put("inventoryDateEnd", param.getEndTime() * 1000000 + 240000); |
| | | } |
| | | // 机构 |
| | | sql.append("and AGENCY_ID =:AGENCY_ID "); |
| | | paramts.put("AGENCY_ID", sysInfo.getTenantId()); |
| | | sql.append("and AGENCY_ID =:agencyId "); |
| | | paramts.put("agencyId", sysInfo.getTenantId()); |
| | | |
| | | sql.append("ORDER BY CREATE_TIME DESC "); |
| | | return selectSplit(sql.toString(), paramts, new LWhFormInventory()); |
| | |
| | | HashMap<String, Object> param = new HashMap<>(); |
| | | param.put("warehouseId", warehouseId); |
| | | |
| | | // String sql = |
| | | // "select bgt.id baseGoodsTemplateId,bgm.id baseGoodsModelId,bgt.GOODS_NAME goodsTemplateName,bgm.MODEL_NAME |
| | | // baseGoodsModelsName,bgt.CLASSIFICATION type,bgm.UNIT " |
| | | // + "from base_goods_models bgm left join base_goods_template bgt on bgm.GOODS_TEMPLATES_ID = bgt.id " |
| | | // + "where bgt.AGENCY_ID = :agencyId"; |
| | | // HashMap<String, Object> param = new HashMap<>(); |
| | | // param.put("agencyId", inventory.getAgencyId()); |
| | | List<Map<String, Object>> result = this.select(sql, param, new MapperUtil()); |
| | | List<FormInventoryGoodsVO> goodsVOList = Lists.newArrayList(); |
| | | result.forEach(item -> { |
| | |
| | | param.put("id", id); |
| | | List<Map<String, Object>> select = this.select(sql, param, new MapperUtil()); |
| | | if (CollectionUtils.isEmpty(select)) { |
| | | return null; |
| | | return Collections.emptyList(); |
| | | } |
| | | List<InventoryExcelTemplate> list = Lists.newArrayList(); |
| | | select.forEach(item -> { |
| | |
| | | procureGood.setWhFormProcureId(whFormProcureId); |
| | | procureGood.setBaseCategoryId(baseCategoryId); |
| | | procureGood.setBaseGoodsTemplateId(baseGoodsTemplateId); |
| | | // TODO 物品历史版本 |
| | | procureGood.setGoodsTemplateName(procureGoodT.getGoodsTemplateName()); |
| | | procureGood.setSupplier(supplier); |
| | | procureGood.setSort(i); |
| | |
| | | } |
| | | // 查询型号信息 |
| | | Map<String, Object> tempGoodsInfo = baseGoodsTemplateService.queryGoodsInfoByModelId(baseGoodsModelsId); |
| | | if (tempGoodsInfo == null) { |
| | | if (CollectionUtils.isEmpty(tempGoodsInfo)) { |
| | | throw new RuntimeException("采购的价型号未找到"); |
| | | } |
| | | String modelName = (String)tempGoodsInfo.get("modelname"); |
| | |
| | | FinSysTenant finSysTenant = finSysTenantService.get(new FinSysTenant(param.getOutAgencyId())); |
| | | if (finSysTenant == null) { |
| | | log.error("调拨机构不存在"); |
| | | throw new Exception("调拨机构不存在"); |
| | | } |
| | | Long outAgencyId = finSysTenant.getId(); |
| | | lWhFormTransfer.setOutAgencyId(outAgencyId); |
| | |
| | | goodsTemplateInfoList.add(goodsTemplateInfoVO); |
| | | } |
| | | result.setFormTransferGoods(goodsTemplateInfoList); |
| | | |
| | | // String sql = "SELECT bgt.id, CATEGORY_ID, CATEGORY_NAME, GOODS_NAME,bgt.CLASSIFICATION type " |
| | | // + "FROM l_wh_procure_model pm LEFT JOIN base_goods_models bgm ON bgm.id = pm.BASE_GOODS_MODELS_ID " |
| | | // + "LEFT JOIN base_goods_template bgt ON bgt.id = bgm.GOODS_TEMPLATES_ID " |
| | | // + "WHERE pm.BUSINESS_ID =:id GROUP BY bgt.id "; |
| | | // Map<String, Object> paramMap = new HashMap<>(); |
| | | // paramMap.put("id", result.getId()); |
| | | // List<Map<String, Object>> procureModelList = this.select(sql, paramMap, new MapperUtil()); |
| | | // |
| | | // String queryRecord = |
| | | // "SELECT * FROM l_wh_procure_model_user_record where TRANS_BUSINESS_ID = :id order by DEAL_TIME desc limit 1"; |
| | | // LWhProcureModelUserRecord lWhProcureModelUserRecord = |
| | | // lWhProcureModelUserRecordService.get(queryRecord, paramMap, new LWhProcureModelUserRecord()); |
| | | // List<FormTransferGoodsVO> formTransferGoods = Lists.newArrayList(); |
| | | // for (Map<String, Object> map : procureModelList) { |
| | | // FormTransferGoodsVO procureTemplateInfoVO = MapUtils.convertMapToObj(map, FormTransferGoodsVO.class); |
| | | // Long baseGoodsTemplateId = procureTemplateInfoVO.getId(); |
| | | // // 查询型号数量 |
| | | // List<GoodsModelVO> goodsModelVOList = Lists.newArrayList(); |
| | | // String sql2 = "SELECT pm.id,pm.BASE_GOODS_MODELS_NAME,bgm.UNIT,COUNTS,total_amount " |
| | | // + "FROM l_wh_procure_model pm LEFT JOIN base_goods_models bgm ON bgm.id = pm.BASE_GOODS_MODELS_ID " |
| | | // + "LEFT JOIN base_goods_template bgt ON bgt.id = bgm.GOODS_TEMPLATES_ID " |
| | | // + "WHERE pm.BUSINESS_ID =:id and bgt.id =:baseGoodsTemplateId"; |
| | | // Map<String, Object> goodsModelParamMap = new HashMap<>(); |
| | | // goodsModelParamMap.put("id", result.getId()); |
| | | // goodsModelParamMap.put("baseGoodsTemplateId", baseGoodsTemplateId); |
| | | // List<Map<String, Object>> modelList = this.select(sql2, goodsModelParamMap, new MapperUtil()); |
| | | // modelList.forEach(item -> { |
| | | // GoodsModelVO goodsModelVO = MapUtils.convertMapToObj(item, GoodsModelVO.class); |
| | | // Integer businessType = result.getBusinessType(); |
| | | // String type = procureTemplateInfoVO.getType(); |
| | | // // 部门分发需要查询使用信息 |
| | | // if (businessType == 1 && "A".equals(type)) { |
| | | // Long procureModelId = goodsModelVO.getId(); |
| | | // LWhProcureModelUser lWhProcureModelUser = new LWhProcureModelUser(); |
| | | // lWhProcureModelUser.setWhProcureModelId(procureModelId); |
| | | // lWhProcureModelUser.setProcureModelUserRecordId(lWhProcureModelUserRecord.getId()); |
| | | // List<LWhProcureModelUser> procureModelUserList = |
| | | // this.lWhProcureModelUserService.select(lWhProcureModelUser); |
| | | // if (!CollectionUtils.isEmpty(procureModelUserList)) { |
| | | // List<DepartGoodsUseInfo> departGoodsUseInfoList = Lists.newArrayList(); |
| | | // procureModelUserList.forEach(useInfo -> { |
| | | // Integer goodsNum = useInfo.getGoodsNum(); |
| | | // Long nowUserPhone = useInfo.getNowUserPhone(); |
| | | // String nowUserName = useInfo.getNowUserName(); |
| | | // DepartGoodsUseInfo departGoodsUseInfo = new DepartGoodsUseInfo(); |
| | | // departGoodsUseInfo.setName(nowUserName); |
| | | // departGoodsUseInfo.setNum(goodsNum); |
| | | // departGoodsUseInfo.setTel(nowUserPhone); |
| | | // departGoodsUseInfoList.add(departGoodsUseInfo); |
| | | // }); |
| | | // goodsModelVO.setUseInfo(departGoodsUseInfoList); |
| | | // } |
| | | // |
| | | // } |
| | | // goodsModelVOList.add(goodsModelVO); |
| | | // procureTemplateInfoVO.setModels(goodsModelVOList); |
| | | // }); |
| | | // formTransferGoods.add(procureTemplateInfoVO); |
| | | // } |
| | | // result.setFormTransferGoods(formTransferGoods); |
| | | |
| | | return result; |
| | | } |
| | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: TODO |
| | | * @description: LWhProcureModelUserServiceImpl |
| | | * @date 2023/11/2 16:21 |
| | | */ |
| | | @Service |
| | |
| | | package com.consum.model.po; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import com.walker.jdbc.BaseMapper; |
| | | import com.walker.jdbc.ResultSetUtils; |
| | | import com.walker.jdbc.SqlAndParameters; |
| | |
| | | import com.walker.jdbc.sqlgen.InsertBuilder; |
| | | import com.walker.jdbc.sqlgen.SelectBuilder; |
| | | import com.walker.jdbc.sqlgen.UpdateBuilder; |
| | | import com.walker.jdbc.util.StringUtils; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 表名:BASE_CATEGORY * |
| | | * |
| | | * @author genrator |
| | | */ |
| | | public class BaseCategory_mapper extends BaseCategory implements BaseMapper<BaseCategory> { |
| | |
| | | if (baseCategory == null) { |
| | | throw new IllegalArgumentException("po参数不允许为空!"); |
| | | } |
| | | //主键 |
| | | // 主键 |
| | | if (baseCategory.isset_id) { |
| | | this.setId(baseCategory.getId()); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | if (baseCategory.isset_categoryName) { |
| | | this.setCategoryName(baseCategory.getCategoryName()); |
| | | } |
| | |
| | | public String getTableName_() { |
| | | String tableName = "base_category"; |
| | | /** |
| | | if (StringUtils.isNotEmpty(this.getDatabaseName_())) { |
| | | return this.getDatabaseName_() + "." + tableName; |
| | | } else { |
| | | return tableName; |
| | | } |
| | | */ |
| | | * if (StringUtils.isNotEmpty(this.getDatabaseName_())) { return this.getDatabaseName_() + "." + tableName; } |
| | | * else { return tableName; } |
| | | */ |
| | | return tableName; |
| | | } |
| | | |
| | |
| | | return sb.genMapSql(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取查询语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, category_name, classification, order_number, states, levels, father_category_id, create_user_id, create_time, create_user_name, d_time, d_user_id, d_user_name from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, category_name, classification, order_number, states, levels, father_category_id, create_user_id, create_time, create_user_name, d_time, d_user_id, d_user_name from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, category_name, classification, order_number, states, levels, father_category_id, create_user_id, create_time, create_user_name, d_time, d_user_id, d_user_name from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, category_name, classification, order_number, states, levels, father_category_id, create_user_id, create_time, create_user_name, d_time, d_user_id, d_user_name from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | ResultSetUtils resultSetUtils = new ResultSetUtils(); |
| | | BaseCategory base_category = new BaseCategory(); |
| | | Integer columnIndex; |
| | | //主键 |
| | | // 主键 |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseCategory_mapper.Id); |
| | | if (columnIndex > 0) { |
| | | base_category.setId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseCategory_mapper.CategoryName); |
| | | if (columnIndex > 0) { |
| | | base_category.setCategoryName(rs.getString(columnIndex)); |
| | |
| | | package com.consum.model.po; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import com.walker.jdbc.BaseMapper; |
| | | import com.walker.jdbc.ResultSetUtils; |
| | | import com.walker.jdbc.SqlAndParameters; |
| | |
| | | import com.walker.jdbc.sqlgen.InsertBuilder; |
| | | import com.walker.jdbc.sqlgen.SelectBuilder; |
| | | import com.walker.jdbc.sqlgen.UpdateBuilder; |
| | | import com.walker.jdbc.util.StringUtils; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 表名:BASE_CODE_INDEXING * |
| | | * |
| | | * @author genrator |
| | | */ |
| | | public class BaseCodeIndexing_mapper extends BaseCodeIndexing implements BaseMapper<BaseCodeIndexing> { |
| | |
| | | if (baseCodeIndexing == null) { |
| | | throw new IllegalArgumentException("po参数不允许为空!"); |
| | | } |
| | | //主键 |
| | | // 主键 |
| | | if (baseCodeIndexing.isset_id) { |
| | | this.setId(baseCodeIndexing.getId()); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | if (baseCodeIndexing.isset_yearIndex) { |
| | | this.setYearIndex(baseCodeIndexing.getYearIndex()); |
| | | } |
| | |
| | | public String getTableName_() { |
| | | String tableName = "base_code_indexing"; |
| | | /** |
| | | if (StringUtils.isNotEmpty(this.getDatabaseName_())) { |
| | | return this.getDatabaseName_() + "." + tableName; |
| | | } else { |
| | | return tableName; |
| | | } |
| | | */ |
| | | * if (StringUtils.isNotEmpty(this.getDatabaseName_())) { return this.getDatabaseName_() + "." + tableName; } |
| | | * else { return tableName; } |
| | | */ |
| | | return tableName; |
| | | } |
| | | |
| | |
| | | return sb.genMapSql(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取查询语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, year_index, month_index, day_index, code_index, code_prefix from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>("select id, year_index, month_index, day_index, code_index, code_prefix from " |
| | | + this.getTableName_() + " " + where, parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, year_index, month_index, day_index, code_index, code_prefix from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>("select id, year_index, month_index, day_index, code_index, code_prefix from " |
| | | + this.getTableName_() + " " + where, parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | ResultSetUtils resultSetUtils = new ResultSetUtils(); |
| | | BaseCodeIndexing base_code_indexing = new BaseCodeIndexing(); |
| | | Integer columnIndex; |
| | | //主键 |
| | | // 主键 |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseCodeIndexing_mapper.Id); |
| | | if (columnIndex > 0) { |
| | | base_code_indexing.setId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseCodeIndexing_mapper.YearIndex); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | |
| | | package com.consum.model.po; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import com.walker.jdbc.BaseMapper; |
| | | import com.walker.jdbc.ResultSetUtils; |
| | | import com.walker.jdbc.SqlAndParameters; |
| | |
| | | import com.walker.jdbc.sqlgen.InsertBuilder; |
| | | import com.walker.jdbc.sqlgen.SelectBuilder; |
| | | import com.walker.jdbc.sqlgen.UpdateBuilder; |
| | | import com.walker.jdbc.util.StringUtils; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 表名:BASE_GOODS_MODELS * |
| | | * |
| | | * @author genrator |
| | | */ |
| | | public class BaseGoodsModels_mapper extends BaseGoodsModels implements BaseMapper<BaseGoodsModels> { |
| | |
| | | if (baseGoodsModels == null) { |
| | | throw new IllegalArgumentException("po参数不允许为空!"); |
| | | } |
| | | //主键 |
| | | // 主键 |
| | | if (baseGoodsModels.isset_id) { |
| | | this.setId(baseGoodsModels.getId()); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | if (baseGoodsModels.isset_modelName) { |
| | | this.setModelName(baseGoodsModels.getModelName()); |
| | | } |
| | |
| | | public String getTableName_() { |
| | | String tableName = "base_goods_models"; |
| | | /** |
| | | if (StringUtils.isNotEmpty(this.getDatabaseName_())) { |
| | | return this.getDatabaseName_() + "." + tableName; |
| | | } else { |
| | | return tableName; |
| | | } |
| | | */ |
| | | * if (StringUtils.isNotEmpty(this.getDatabaseName_())) { return this.getDatabaseName_() + "." + tableName; } |
| | | * else { return tableName; } |
| | | */ |
| | | return tableName; |
| | | } |
| | | |
| | |
| | | return sb.genMapSql(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取查询语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, model_name, states, goods_templates_id, unit, order_number, create_time from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, model_name, states, goods_templates_id, unit, order_number, create_time from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, model_name, states, goods_templates_id, unit, order_number, create_time from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, model_name, states, goods_templates_id, unit, order_number, create_time from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | ResultSetUtils resultSetUtils = new ResultSetUtils(); |
| | | BaseGoodsModels base_goods_models = new BaseGoodsModels(); |
| | | Integer columnIndex; |
| | | //主键 |
| | | // 主键 |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseGoodsModels_mapper.Id); |
| | | if (columnIndex > 0) { |
| | | base_goods_models.setId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseGoodsModels_mapper.ModelName); |
| | | if (columnIndex > 0) { |
| | | base_goods_models.setModelName(rs.getString(columnIndex)); |
| | |
| | | package com.consum.model.po; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import com.walker.jdbc.BaseMapper; |
| | | import com.walker.jdbc.ResultSetUtils; |
| | | import com.walker.jdbc.SqlAndParameters; |
| | |
| | | import com.walker.jdbc.sqlgen.InsertBuilder; |
| | | import com.walker.jdbc.sqlgen.SelectBuilder; |
| | | import com.walker.jdbc.sqlgen.UpdateBuilder; |
| | | import com.walker.jdbc.util.StringUtils; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 表名:BASE_GOODS_TEMPLATE * |
| | | * |
| | | * @author genrator |
| | | */ |
| | | public class BaseGoodsTemplate_mapper extends BaseGoodsTemplate implements BaseMapper<BaseGoodsTemplate> { |
| | |
| | | if (baseGoodsTemplate == null) { |
| | | throw new IllegalArgumentException("po参数不允许为空!"); |
| | | } |
| | | //主键 |
| | | // 主键 |
| | | if (baseGoodsTemplate.isset_id) { |
| | | this.setId(baseGoodsTemplate.getId()); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | if (baseGoodsTemplate.isset_goodsCode) { |
| | | this.setGoodsCode(baseGoodsTemplate.getGoodsCode()); |
| | | } |
| | |
| | | public String getTableName_() { |
| | | String tableName = "base_goods_template"; |
| | | /** |
| | | if (StringUtils.isNotEmpty(this.getDatabaseName_())) { |
| | | return this.getDatabaseName_() + "." + tableName; |
| | | } else { |
| | | return tableName; |
| | | } |
| | | */ |
| | | * if (StringUtils.isNotEmpty(this.getDatabaseName_())) { return this.getDatabaseName_() + "." + tableName; } |
| | | * else { return tableName; } |
| | | */ |
| | | return tableName; |
| | | } |
| | | |
| | |
| | | return sb.genMapSql(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取查询语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, goods_code, goods_name, classification, states, category_id, category_name, f_agency_id, s_agency_id, t_agency_id, parent_agency_id, agency_level, agency_id, agency_name, create_date, d_time, d_user_id, d_user_name from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, goods_code, goods_name, classification, states, category_id, category_name, f_agency_id, s_agency_id, t_agency_id, parent_agency_id, agency_level, agency_id, agency_name, create_date, d_time, d_user_id, d_user_name from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, goods_code, goods_name, classification, states, category_id, category_name, f_agency_id, s_agency_id, t_agency_id, parent_agency_id, agency_level, agency_id, agency_name, create_date, d_time, d_user_id, d_user_name from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, goods_code, goods_name, classification, states, category_id, category_name, f_agency_id, s_agency_id, t_agency_id, parent_agency_id, agency_level, agency_id, agency_name, create_date, d_time, d_user_id, d_user_name from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | ResultSetUtils resultSetUtils = new ResultSetUtils(); |
| | | BaseGoodsTemplate base_goods_template = new BaseGoodsTemplate(); |
| | | Integer columnIndex; |
| | | //主键 |
| | | // 主键 |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseGoodsTemplate_mapper.Id); |
| | | if (columnIndex > 0) { |
| | | base_goods_template.setId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseGoodsTemplate_mapper.GoodsCode); |
| | | if (columnIndex > 0) { |
| | | base_goods_template.setGoodsCode(rs.getString(columnIndex)); |
| | |
| | | package com.consum.model.po; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import com.walker.jdbc.BaseMapper; |
| | | import com.walker.jdbc.ResultSetUtils; |
| | | import com.walker.jdbc.SqlAndParameters; |
| | |
| | | import com.walker.jdbc.sqlgen.InsertBuilder; |
| | | import com.walker.jdbc.sqlgen.SelectBuilder; |
| | | import com.walker.jdbc.sqlgen.UpdateBuilder; |
| | | import com.walker.jdbc.util.StringUtils; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 表名:BASE_WAREHOUSE_MANAGER * |
| | | * |
| | | * @author genrator |
| | | */ |
| | | public class BaseWarehouseManager_mapper extends BaseWarehouseManager implements BaseMapper<BaseWarehouseManager> { |
| | |
| | | if (baseWarehouseManager == null) { |
| | | throw new IllegalArgumentException("po参数不允许为空!"); |
| | | } |
| | | //主键 |
| | | // 主键 |
| | | if (baseWarehouseManager.isset_id) { |
| | | this.setId(baseWarehouseManager.getId()); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | if (baseWarehouseManager.isset_managerId) { |
| | | this.setManagerId(baseWarehouseManager.getManagerId()); |
| | | } |
| | |
| | | public String getTableName_() { |
| | | String tableName = "base_warehouse_manager"; |
| | | /** |
| | | if (StringUtils.isNotEmpty(this.getDatabaseName_())) { |
| | | return this.getDatabaseName_() + "." + tableName; |
| | | } else { |
| | | return tableName; |
| | | } |
| | | */ |
| | | * if (StringUtils.isNotEmpty(this.getDatabaseName_())) { return this.getDatabaseName_() + "." + tableName; } |
| | | * else { return tableName; } |
| | | */ |
| | | return tableName; |
| | | } |
| | | |
| | |
| | | return sb.genMapSql(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取查询语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, manager_id, manager_name, base_warehouse_id from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, manager_id, manager_name, base_warehouse_id from " + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, manager_id, manager_name, base_warehouse_id from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, manager_id, manager_name, base_warehouse_id from " + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | ResultSetUtils resultSetUtils = new ResultSetUtils(); |
| | | BaseWarehouseManager base_warehouse_manager = new BaseWarehouseManager(); |
| | | Integer columnIndex; |
| | | //主键 |
| | | // 主键 |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseWarehouseManager_mapper.Id); |
| | | if (columnIndex > 0) { |
| | | base_warehouse_manager.setId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseWarehouseManager_mapper.ManagerId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | |
| | | package com.consum.model.po; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import com.walker.jdbc.BaseMapper; |
| | | import com.walker.jdbc.ResultSetUtils; |
| | | import com.walker.jdbc.SqlAndParameters; |
| | |
| | | import com.walker.jdbc.sqlgen.InsertBuilder; |
| | | import com.walker.jdbc.sqlgen.SelectBuilder; |
| | | import com.walker.jdbc.sqlgen.UpdateBuilder; |
| | | import com.walker.jdbc.util.StringUtils; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 表名:BASE_WAREHOUSE * |
| | | * |
| | | * @author genrator |
| | | */ |
| | | public class BaseWarehouse_mapper extends BaseWarehouse implements BaseMapper<BaseWarehouse> { |
| | |
| | | if (baseWarehouse == null) { |
| | | throw new IllegalArgumentException("po参数不允许为空!"); |
| | | } |
| | | //主键 |
| | | // 主键 |
| | | if (baseWarehouse.isset_id) { |
| | | this.setId(baseWarehouse.getId()); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | if (baseWarehouse.isset_warehouseType) { |
| | | this.setWarehouseType(baseWarehouse.getWarehouseType()); |
| | | } |
| | |
| | | public String getTableName_() { |
| | | String tableName = "base_warehouse"; |
| | | /** |
| | | if (StringUtils.isNotEmpty(this.getDatabaseName_())) { |
| | | return this.getDatabaseName_() + "." + tableName; |
| | | } else { |
| | | return tableName; |
| | | } |
| | | */ |
| | | * if (StringUtils.isNotEmpty(this.getDatabaseName_())) { return this.getDatabaseName_() + "." + tableName; } |
| | | * else { return tableName; } |
| | | */ |
| | | return tableName; |
| | | } |
| | | |
| | |
| | | return sb.genMapSql(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取查询语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, warehouse_type, warehouse_code, warehouse_name, adress, parent_agency_id, agency_id, agency_name, classification_code, classification_name, is_default, states from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, warehouse_type, warehouse_code, warehouse_name, adress, parent_agency_id, agency_id, agency_name, classification_code, classification_name, is_default, states from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, warehouse_type, warehouse_code, warehouse_name, adress, parent_agency_id, agency_id, agency_name, classification_code, classification_name, is_default, states from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, warehouse_type, warehouse_code, warehouse_name, adress, parent_agency_id, agency_id, agency_name, classification_code, classification_name, is_default, states from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | ResultSetUtils resultSetUtils = new ResultSetUtils(); |
| | | BaseWarehouse base_warehouse = new BaseWarehouse(); |
| | | Integer columnIndex; |
| | | //主键 |
| | | // 主键 |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseWarehouse_mapper.Id); |
| | | if (columnIndex > 0) { |
| | | base_warehouse.setId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseWarehouse_mapper.WarehouseType); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | |
| | | package com.consum.model.po; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import com.walker.jdbc.BaseMapper; |
| | | import com.walker.jdbc.ResultSetUtils; |
| | | import com.walker.jdbc.SqlAndParameters; |
| | |
| | | import com.walker.jdbc.sqlgen.InsertBuilder; |
| | | import com.walker.jdbc.sqlgen.SelectBuilder; |
| | | import com.walker.jdbc.sqlgen.UpdateBuilder; |
| | | import com.walker.jdbc.util.StringUtils; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 表名:DEP_FORM_BACK_GOODS * |
| | | * |
| | | * @author genrator |
| | | */ |
| | | public class DepFormBackGoods_mapper extends DepFormBackGoods implements BaseMapper<DepFormBackGoods> { |
| | |
| | | if (depFormBackGoods == null) { |
| | | throw new IllegalArgumentException("po参数不允许为空!"); |
| | | } |
| | | //主键 |
| | | // 主键 |
| | | if (depFormBackGoods.isset_id) { |
| | | this.setId(depFormBackGoods.getId()); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | if (depFormBackGoods.isset_depFormBackId) { |
| | | this.setDepFormBackId(depFormBackGoods.getDepFormBackId()); |
| | | } |
| | |
| | | public String getTableName_() { |
| | | String tableName = "dep_form_back_goods"; |
| | | /** |
| | | if (StringUtils.isNotEmpty(this.getDatabaseName_())) { |
| | | return this.getDatabaseName_() + "." + tableName; |
| | | } else { |
| | | return tableName; |
| | | } |
| | | */ |
| | | * if (StringUtils.isNotEmpty(this.getDatabaseName_())) { return this.getDatabaseName_() + "." + tableName; } |
| | | * else { return tableName; } |
| | | */ |
| | | return tableName; |
| | | } |
| | | |
| | |
| | | return sb.genMapSql(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取查询语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, dep_form_back_id, unit, back_counts, init_count, dep_form_lending_goods_id, end_count, dep_form_lending_id, warehouse_id from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, dep_form_back_id, unit, back_counts, init_count, dep_form_lending_goods_id, end_count, dep_form_lending_id, warehouse_id from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, dep_form_back_id, unit, back_counts, init_count, dep_form_lending_goods_id, end_count, dep_form_lending_id, warehouse_id from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, dep_form_back_id, unit, back_counts, init_count, dep_form_lending_goods_id, end_count, dep_form_lending_id, warehouse_id from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | ResultSetUtils resultSetUtils = new ResultSetUtils(); |
| | | DepFormBackGoods dep_form_back_goods = new DepFormBackGoods(); |
| | | Integer columnIndex; |
| | | //主键 |
| | | // 主键 |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormBackGoods_mapper.Id); |
| | | if (columnIndex > 0) { |
| | | dep_form_back_goods.setId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormBackGoods_mapper.DepFormBackId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | |
| | | package com.consum.model.po; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import com.walker.jdbc.BaseMapper; |
| | | import com.walker.jdbc.ResultSetUtils; |
| | | import com.walker.jdbc.SqlAndParameters; |
| | |
| | | import com.walker.jdbc.sqlgen.InsertBuilder; |
| | | import com.walker.jdbc.sqlgen.SelectBuilder; |
| | | import com.walker.jdbc.sqlgen.UpdateBuilder; |
| | | import com.walker.jdbc.util.StringUtils; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 表名:DEP_FORM_BACK_MODEL * |
| | | * |
| | | * @author genrator |
| | | */ |
| | | public class DepFormBackModel_mapper extends DepFormBackModel implements BaseMapper<DepFormBackModel> { |
| | |
| | | if (depFormBackModel == null) { |
| | | throw new IllegalArgumentException("po参数不允许为空!"); |
| | | } |
| | | //主键 |
| | | // 主键 |
| | | if (depFormBackModel.isset_id) { |
| | | this.setId(depFormBackModel.getId()); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | if (depFormBackModel.isset_depFormBackGoodsId) { |
| | | this.setDepFormBackGoodsId(depFormBackModel.getDepFormBackGoodsId()); |
| | | } |
| | |
| | | public String getTableName_() { |
| | | String tableName = "dep_form_back_model"; |
| | | /** |
| | | if (StringUtils.isNotEmpty(this.getDatabaseName_())) { |
| | | return this.getDatabaseName_() + "." + tableName; |
| | | } else { |
| | | return tableName; |
| | | } |
| | | */ |
| | | * if (StringUtils.isNotEmpty(this.getDatabaseName_())) { return this.getDatabaseName_() + "." + tableName; } |
| | | * else { return tableName; } |
| | | */ |
| | | return tableName; |
| | | } |
| | | |
| | |
| | | return sb.genMapSql(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取查询语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, dep_form_back_goods_id, dep_form_back_id, wh_goods_details_id, using_goods_his_id, wh_goods_id, counts, dep_form_lending_model_id, dep_form_lending_goods_id, dep_form_lending_id, warehouse_id from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, dep_form_back_goods_id, dep_form_back_id, wh_goods_details_id, using_goods_his_id, wh_goods_id, counts, dep_form_lending_model_id, dep_form_lending_goods_id, dep_form_lending_id, warehouse_id from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, dep_form_back_goods_id, dep_form_back_id, wh_goods_details_id, using_goods_his_id, wh_goods_id, counts, dep_form_lending_model_id, dep_form_lending_goods_id, dep_form_lending_id, warehouse_id from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, dep_form_back_goods_id, dep_form_back_id, wh_goods_details_id, using_goods_his_id, wh_goods_id, counts, dep_form_lending_model_id, dep_form_lending_goods_id, dep_form_lending_id, warehouse_id from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | ResultSetUtils resultSetUtils = new ResultSetUtils(); |
| | | DepFormBackModel dep_form_back_model = new DepFormBackModel(); |
| | | Integer columnIndex; |
| | | //主键 |
| | | // 主键 |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormBackModel_mapper.Id); |
| | | if (columnIndex > 0) { |
| | | dep_form_back_model.setId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormBackModel_mapper.DepFormBackGoodsId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | |
| | | package com.consum.model.po; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import com.walker.jdbc.BaseMapper; |
| | | import com.walker.jdbc.ResultSetUtils; |
| | | import com.walker.jdbc.SqlAndParameters; |
| | |
| | | import com.walker.jdbc.sqlgen.InsertBuilder; |
| | | import com.walker.jdbc.sqlgen.SelectBuilder; |
| | | import com.walker.jdbc.sqlgen.UpdateBuilder; |
| | | import com.walker.jdbc.util.StringUtils; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 表名:DEP_FORM_BACK * |
| | | * |
| | | * @author genrator |
| | | */ |
| | | public class DepFormBack_mapper extends DepFormBack implements BaseMapper<DepFormBack> { |
| | |
| | | if (depFormBack == null) { |
| | | throw new IllegalArgumentException("po参数不允许为空!"); |
| | | } |
| | | //主键 |
| | | // 主键 |
| | | if (depFormBack.isset_id) { |
| | | this.setId(depFormBack.getId()); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | if (depFormBack.isset_businessFormCode) { |
| | | this.setBusinessFormCode(depFormBack.getBusinessFormCode()); |
| | | } |
| | |
| | | public String getTableName_() { |
| | | String tableName = "dep_form_back"; |
| | | /** |
| | | if (StringUtils.isNotEmpty(this.getDatabaseName_())) { |
| | | return this.getDatabaseName_() + "." + tableName; |
| | | } else { |
| | | return tableName; |
| | | } |
| | | */ |
| | | * if (StringUtils.isNotEmpty(this.getDatabaseName_())) { return this.getDatabaseName_() + "." + tableName; } |
| | | * else { return tableName; } |
| | | */ |
| | | return tableName; |
| | | } |
| | | |
| | |
| | | return sb.genMapSql(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取查询语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, business_form_code, warehouse_id, warehouse_name, operator_id, operator_name, deal_time, department_id, department_name, agency_id, agency_name, states, beiz, dep_form_lending_id from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, business_form_code, warehouse_id, warehouse_name, operator_id, operator_name, deal_time, department_id, department_name, agency_id, agency_name, states, beiz, dep_form_lending_id from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, business_form_code, warehouse_id, warehouse_name, operator_id, operator_name, deal_time, department_id, department_name, agency_id, agency_name, states, beiz, dep_form_lending_id from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, business_form_code, warehouse_id, warehouse_name, operator_id, operator_name, deal_time, department_id, department_name, agency_id, agency_name, states, beiz, dep_form_lending_id from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | ResultSetUtils resultSetUtils = new ResultSetUtils(); |
| | | DepFormBack dep_form_back = new DepFormBack(); |
| | | Integer columnIndex; |
| | | //主键 |
| | | // 主键 |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormBack_mapper.Id); |
| | | if (columnIndex > 0) { |
| | | dep_form_back.setId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormBack_mapper.BusinessFormCode); |
| | | if (columnIndex > 0) { |
| | | dep_form_back.setBusinessFormCode(rs.getString(columnIndex)); |
| | |
| | | package com.consum.model.po; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import com.walker.jdbc.BaseMapper; |
| | | import com.walker.jdbc.ResultSetUtils; |
| | | import com.walker.jdbc.SqlAndParameters; |
| | |
| | | import com.walker.jdbc.sqlgen.InsertBuilder; |
| | | import com.walker.jdbc.sqlgen.SelectBuilder; |
| | | import com.walker.jdbc.sqlgen.UpdateBuilder; |
| | | import com.walker.jdbc.util.StringUtils; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 表名:DEP_FORM_SCRAPPED_MODEL |
| | |
| | | if (depFormScrappedModel == null) { |
| | | throw new IllegalArgumentException("po参数不允许为空!"); |
| | | } |
| | | //主键 |
| | | // 主键 |
| | | if (depFormScrappedModel.isset_id) { |
| | | this.setId(depFormScrappedModel.getId()); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | if (depFormScrappedModel.isset_depFormScrappedId) { |
| | | this.setDepFormScrappedId(depFormScrappedModel.getDepFormScrappedId()); |
| | | } |
| | |
| | | public String getTableName_() { |
| | | String tableName = "dep_form_scrapped_model"; |
| | | /** |
| | | if (StringUtils.isNotEmpty(this.getDatabaseName_())) { |
| | | return this.getDatabaseName_() + "." + tableName; |
| | | } else { |
| | | return tableName; |
| | | } |
| | | */ |
| | | * if (StringUtils.isNotEmpty(this.getDatabaseName_())) { return this.getDatabaseName_() + "." + tableName; } |
| | | * else { return tableName; } |
| | | */ |
| | | return tableName; |
| | | } |
| | | |
| | |
| | | return sb.genMapSql(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取查询语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, dep_form_scrapped_id, dep_form_scrapped_goods_id, scrapped_code, scrapped_name, base_goods_template_id, base_goods_template_name, classification, unit, base_goods_models_id, base_goods_models_name, procure_model_user_id, initial_count, use_count, counts, goods_user_name, beiz, total_amount from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, dep_form_scrapped_id, dep_form_scrapped_goods_id, scrapped_code, scrapped_name, base_goods_template_id, base_goods_template_name, classification, unit, base_goods_models_id, base_goods_models_name, procure_model_user_id, initial_count, use_count, counts, goods_user_name, beiz, total_amount from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, dep_form_scrapped_id, dep_form_scrapped_goods_id, scrapped_code, scrapped_name, base_goods_template_id, base_goods_template_name, classification, unit, base_goods_models_id, base_goods_models_name, procure_model_user_id, initial_count, use_count, counts, goods_user_name, beiz, total_amount from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, dep_form_scrapped_id, dep_form_scrapped_goods_id, scrapped_code, scrapped_name, base_goods_template_id, base_goods_template_name, classification, unit, base_goods_models_id, base_goods_models_name, procure_model_user_id, initial_count, use_count, counts, goods_user_name, beiz, total_amount from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public DepFormScrappedModel mapRow(ResultSet rs, int i) throws SQLException { |
| | | ResultSetUtils resultSetUtils = new ResultSetUtils(); |
| | | DepFormScrappedModel dep_form_scrapped_model = new DepFormScrappedModel(); |
| | | DepFormScrappedModel dep_form_scrapped_model = new DepFormScrappedModel(); |
| | | Integer columnIndex; |
| | | //主键 |
| | | // 主键 |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.Id); |
| | | if (columnIndex > 0) { |
| | | dep_form_scrapped_model.setId(rs.getLong(columnIndex)); |
| | | dep_form_scrapped_model.setId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.DepFormScrappedId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | dep_form_scrapped_model.setDepFormScrappedId(null); |
| | | dep_form_scrapped_model.setDepFormScrappedId(null); |
| | | } else { |
| | | dep_form_scrapped_model.setDepFormScrappedId(rs.getLong(columnIndex)); |
| | | dep_form_scrapped_model.setDepFormScrappedId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.DepFormScrappedGoodsId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | dep_form_scrapped_model.setDepFormScrappedGoodsId(null); |
| | | dep_form_scrapped_model.setDepFormScrappedGoodsId(null); |
| | | } else { |
| | | dep_form_scrapped_model.setDepFormScrappedGoodsId(rs.getLong(columnIndex)); |
| | | dep_form_scrapped_model.setDepFormScrappedGoodsId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.ScrappedCode); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | dep_form_scrapped_model.setScrappedCode(null); |
| | | dep_form_scrapped_model.setScrappedCode(null); |
| | | } else { |
| | | dep_form_scrapped_model.setScrappedCode(rs.getLong(columnIndex)); |
| | | dep_form_scrapped_model.setScrappedCode(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.ScrappedName); |
| | | if (columnIndex > 0) { |
| | | dep_form_scrapped_model.setScrappedName(rs.getString(columnIndex)); |
| | | dep_form_scrapped_model.setScrappedName(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.BaseGoodsTemplateId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | dep_form_scrapped_model.setBaseGoodsTemplateId(null); |
| | | dep_form_scrapped_model.setBaseGoodsTemplateId(null); |
| | | } else { |
| | | dep_form_scrapped_model.setBaseGoodsTemplateId(rs.getLong(columnIndex)); |
| | | dep_form_scrapped_model.setBaseGoodsTemplateId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.BaseGoodsTemplateName); |
| | | if (columnIndex > 0) { |
| | | dep_form_scrapped_model.setBaseGoodsTemplateName(rs.getString(columnIndex)); |
| | | dep_form_scrapped_model.setBaseGoodsTemplateName(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.Classification); |
| | | if (columnIndex > 0) { |
| | | dep_form_scrapped_model.setClassification(rs.getString(columnIndex)); |
| | | dep_form_scrapped_model.setClassification(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.Unit); |
| | | if (columnIndex > 0) { |
| | | dep_form_scrapped_model.setUnit(rs.getString(columnIndex)); |
| | | dep_form_scrapped_model.setUnit(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.BaseGoodsModelsId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | dep_form_scrapped_model.setBaseGoodsModelsId(null); |
| | | dep_form_scrapped_model.setBaseGoodsModelsId(null); |
| | | } else { |
| | | dep_form_scrapped_model.setBaseGoodsModelsId(rs.getLong(columnIndex)); |
| | | dep_form_scrapped_model.setBaseGoodsModelsId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.BaseGoodsModelsName); |
| | | if (columnIndex > 0) { |
| | | dep_form_scrapped_model.setBaseGoodsModelsName(rs.getString(columnIndex)); |
| | | dep_form_scrapped_model.setBaseGoodsModelsName(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.ProcureModelUserId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | dep_form_scrapped_model.setProcureModelUserId(null); |
| | | dep_form_scrapped_model.setProcureModelUserId(null); |
| | | } else { |
| | | dep_form_scrapped_model.setProcureModelUserId(rs.getLong(columnIndex)); |
| | | dep_form_scrapped_model.setProcureModelUserId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.InitialCount); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | dep_form_scrapped_model.setInitialCount(null); |
| | | dep_form_scrapped_model.setInitialCount(null); |
| | | } else { |
| | | dep_form_scrapped_model.setInitialCount(rs.getInt(columnIndex)); |
| | | dep_form_scrapped_model.setInitialCount(rs.getInt(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.UseCount); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | dep_form_scrapped_model.setUseCount(null); |
| | | dep_form_scrapped_model.setUseCount(null); |
| | | } else { |
| | | dep_form_scrapped_model.setUseCount(rs.getInt(columnIndex)); |
| | | dep_form_scrapped_model.setUseCount(rs.getInt(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.Counts); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | dep_form_scrapped_model.setCounts(null); |
| | | dep_form_scrapped_model.setCounts(null); |
| | | } else { |
| | | dep_form_scrapped_model.setCounts(rs.getInt(columnIndex)); |
| | | dep_form_scrapped_model.setCounts(rs.getInt(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.GoodsUserName); |
| | | if (columnIndex > 0) { |
| | | dep_form_scrapped_model.setGoodsUserName(rs.getString(columnIndex)); |
| | | dep_form_scrapped_model.setGoodsUserName(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.Beiz); |
| | | if (columnIndex > 0) { |
| | | dep_form_scrapped_model.setBeiz(rs.getString(columnIndex)); |
| | | dep_form_scrapped_model.setBeiz(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, DepFormScrappedModel_mapper.TotalAmount); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | dep_form_scrapped_model.setTotalAmount(null); |
| | | dep_form_scrapped_model.setTotalAmount(null); |
| | | } else { |
| | | dep_form_scrapped_model.setTotalAmount(rs.getInt(columnIndex)); |
| | | dep_form_scrapped_model.setTotalAmount(rs.getInt(columnIndex)); |
| | | } |
| | | } |
| | | return dep_form_scrapped_model; |
| | |
| | | fin_sys_org.setOrderNum(rs.getInt(columnIndex)); |
| | | } |
| | | } |
| | | // System.out.println("==========>"+fin_sys_org.getName()); |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysOrg_mapper.ParentId); |
| | | if (columnIndex > 0) { |
| | | // System.out.println("columnIndex=== "+columnIndex); |
| | | if (rs.getString(columnIndex) == null) { |
| | | fin_sys_org.setParentId(null); |
| | | } else { |
| | |
| | | package com.consum.generator; |
| | | |
| | | import com.iplatform.generator.JdbcGeneratorEngine; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import com.walker.web.ResponseValue; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.iplatform.generator.JdbcGeneratorEngine; |
| | | import com.walker.web.ResponseValue; |
| | | |
| | | /** |
| | | * @ClassName GenerateController |
| | |
| | | |
| | | @GetMapping("/sc") |
| | | public ResponseValue allocatedList(String tableName) throws Exception { |
| | | this.jdbcGeneratorEngine.generatePoFile("%", "","d:/tmp/" + tableName + ".zip"); |
| | | this.jdbcGeneratorEngine.generatePoFile("%", "", "d:/tmp/" + tableName + ".zip"); |
| | | return ResponseValue.success(); |
| | | } |
| | | |