| | |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | // æºææ°å¢ |
| | | export function addTenant(data) { |
| | | return request({ |
| | | url: '/pc/fin/sys/tenant/add', |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | } |
| | | // æºæç¼è¾ |
| | | export function editTenant(data) { |
| | | return request({ |
| | | url: '/pc/fin/sys/tenant/edit', |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | } |
| | | |
| | |
| | | {title: 'ç¼å·', field: 'warehouseCode', align: 'center', width: 120}, |
| | | {title: 'ç±»å', field: 'classificationName', align: 'center', width: 120 }, |
| | | {title: 'å°å', field: 'adress', align: 'left', minWidth: 140 }, |
| | | // {title: 'æå±æºæ', field: 'summary', align: 'left',}, |
| | | {title: 'æå±æºæ', field: 'agencyName', align: 'left',minWidth: 140 }, |
| | | { |
| | | field: 'states', |
| | | title: 'ç¶æ', |
| | |
| | | dialogShow: false, |
| | | fileSettings: { |
| | | data: {}, |
| | | uploadUrl: getBaseUrl() + '/pc/fin/sys/tenant/import', // ä¸ä¼ å°å |
| | | uploadUrl: getBaseUrl() + '/pc/whForm/procure/import', // ä¸ä¼ å°å |
| | | accept: '.xls', // æ ¼å¼ |
| | | type: 'text', // åæ¾å½¢å¼ |
| | | loading: false, // 导å
¥ææ |
| | |
| | | /* 模æ¿ä¸è½½ */ |
| | | templateSettings: { |
| | | templateName: '导å
¥æ¨¡æ¿.xls', // åç§° |
| | | templateUrl: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/getImportTemplate', // ä¸è½½å°å |
| | | templateUrl: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/getImportTemplate?type=procure', // ä¸è½½å°å |
| | | }, |
| | | onSuccess: null, |
| | | }, |
| | |
| | | import winSm from '@/components/win/win-sm' |
| | | import myButton from '@/components/myButton/myButton' |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant' |
| | | import {addTenant, editTenant} from "@/api/baseSetting/finsystenant"; |
| | | |
| | | export default { |
| | | components: {winSm, myButton}, |
| | |
| | | name: '', |
| | | status: 1, |
| | | summary: '', |
| | | parentId: '', |
| | | }, |
| | | rules: { |
| | | code: [ |
| | |
| | | const params = Object.assign({}, this.formData) |
| | | if(this.setting.id){ |
| | | // ç¼è¾æ¥å£ |
| | | finsystenant.edit(params).then(res => { |
| | | finsystenant.editTenant(params).then(res => { |
| | | if (res) { |
| | | this.$message.success('ä¿åæåï¼') |
| | | this.close() |
| | |
| | | } |
| | | }) |
| | | }else{ |
| | | params.orgId = this.setting.orgId |
| | | finsystenant.add(params).then(res => { |
| | | params.parentId = this.setting.orgId |
| | | finsystenant.addTenant(params).then(res => { |
| | | if (res) { |
| | | this.$message.success('ä¿åæåï¼') |
| | | this.close() |
| | |
| | | // æç´¢æ¡ä»¶ |
| | | filterFrom: { |
| | | tenantCode: 0, |
| | | trnantId: 0, |
| | | userName: null, |
| | | userPhone: null, |
| | | userCode: null, |
| | | }, |
| | | curOrgId: null, |
| | | // æ·»å &ç¼è¾è®¾ç½® |
| | |
| | | reset() { |
| | | this.filterFrom.tenantCode = null; |
| | | this.filterFrom.userName = null; |
| | | this.filterFrom.userPhone = null; |
| | | this.filterFrom.userCode = null; |
| | | this.filterFrom.status = 1; |
| | | this.search(1); |
| | | }, |
| | |
| | | }, |
| | | { |
| | | type: 'text', |
| | | dataIndex: 'userPhone', |
| | | dataIndex: 'userCode', |
| | | label: 'ç¼å·', |
| | | placeholder: "请è¾å
¥", |
| | | defaultValue: '' |
| | |
| | | if (agencyId == null) { |
| | | return ResponseValue.success(new ArrayList<>()); |
| | | } |
| | | List<BaseWarehouse> list = baseWarehouseService.getBaseWareHouseList(agencyId, null); |
| | | List<BaseWarehouse> list = baseWarehouseService.getBaseWareHouseList(agencyId, StatesType.NORMAL.getValue()); |
| | | if (list == null) { |
| | | return ResponseValue.error("æ¥è¯¢å¤±è´¥ï¼"); |
| | | } |
| | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.excel.exception.ExcelDataConvertException; |
| | | import com.alibaba.excel.read.metadata.holder.ReadSheetHolder; |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.core.utils.FinSysTenantUtils; |
| | | import com.consum.base.pojo.FinSysTenantParam; |
| | | import com.consum.base.pojo.FinSysTenantSearchParam; |
| | | import com.consum.base.pojo.excel.ImportTenantTemplate; |
| | | import com.consum.base.service.FinSysTenantService; |
| | | import com.consum.base.service.FinSysTenantUserService; |
| | | import com.consum.model.po.FinSysTenant; |
| | |
| | | fileName = "æºæå¯¼å
¥æ¨¡æ¿.xls"; |
| | | } else if ("goods".equals(type)) { |
| | | fileName = "ç©åä¿¡æ¯.xls"; |
| | | } else if ("procure".equals(type)) { |
| | | fileName = "éè´å¯¼å
¥.xls"; |
| | | } |
| | | Resource resource = new ClassPathResource("import/" + fileName); |
| | | // è·åæä»¶è¾å
¥æµ |
| | |
| | | @PostMapping("import") |
| | | public ResponseValue upload(@RequestParam Long pid, MultipartFile file) throws IOException { |
| | | String originalFilename = file.getOriginalFilename(); |
| | | if (!"xls".equals(originalFilename.substring(originalFilename.lastIndexOf(".") + 1))) { |
| | | if (!originalFilename.endsWith("xls")) { |
| | | return ResponseValue.error("æä»¶æ ¼å¼æè¯¯!"); |
| | | } |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | |
| | | return ResponseValue.error("ä¸è½å建å¿ï¼åºï¼çº§ä»¥ä¸æºæ"); |
| | | } |
| | | |
| | | EasyExcel.read(file.getInputStream(), FinSysTenantParam.class, new AnalysisEventListener<FinSysTenantParam>() { |
| | | LinkedList<FinSysTenantParam> finSysTenantParams = new LinkedList<>(); |
| | | EasyExcel |
| | | .read(file.getInputStream(), ImportTenantTemplate.class, new AnalysisEventListener<ImportTenantTemplate>() { |
| | | LinkedList<FinSysTenantParam> finSysTenantParams = new LinkedList<>(); |
| | | |
| | | @Override |
| | | public void invoke(FinSysTenantParam finSysTenantParam, AnalysisContext analysisContext) { |
| | | if (StringUtils.isEmpty(finSysTenantParam.getCode()) || finSysTenantParam.getCode().length() > 20) { |
| | | IllegalStateException exception = new IllegalStateException( |
| | | "第" + analysisContext.readSheetHolder().getRowIndex() + "è¡,æºæç¼å·ä¸è½ä¸ºç©ºæé¿åº¦å¤§äº20"); |
| | | throw exception; |
| | | } |
| | | if (null != finSysTenantService.queryOneByCode(finSysTenantParam.getCode())) { |
| | | throw new IllegalStateException( |
| | | "第" + analysisContext.readSheetHolder().getRowIndex() + "è¡,æºæç¼å·å·²åå¨"); |
| | | } |
| | | if (StringUtils.isEmpty(finSysTenantParam.getName()) || finSysTenantParam.getName().length() > 100) { |
| | | IllegalStateException exception = new IllegalStateException( |
| | | "第" + analysisContext.readSheetHolder().getRowIndex() + "è¡,æºæåç§°ä¸è½ä¸ºç©ºæé¿åº¦å¤§äº100"); |
| | | throw exception; |
| | | } |
| | | finSysTenantParam.setParentId(pid); |
| | | finSysTenantParam.setStatus(1); |
| | | finSysTenantParam.setSummary("ç³»ç»å¯¼å
¥"); |
| | | finSysTenantParams.add(finSysTenantParam); |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
| | | finSysTenantService.insertFinSysTenantBatch(finSysTenantParams, sysInfo, lv); |
| | | } |
| | | |
| | | @Override |
| | | public void onException(Exception exception, AnalysisContext context) { |
| | | // å¦ææ¯æä¸ä¸ªåå
æ ¼ç转æ¢å¼å¸¸ è½è·åå°å
·ä½è¡å· |
| | | 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 IllegalStateException) { |
| | | throw (IllegalStateException)exception; |
| | | @Override |
| | | public void invoke(ImportTenantTemplate finSysTenantParam, AnalysisContext analysisContext) { |
| | | String code = finSysTenantParam.getCode(); |
| | | String tenantName = finSysTenantParam.getTenantName(); |
| | | ReadSheetHolder readSheetHolder = analysisContext.readSheetHolder(); |
| | | Integer rowIndex = readSheetHolder.getRowIndex() + 1; |
| | | if (StringUtils.isEmpty(code) || code.length() > 20) { |
| | | IllegalStateException exception = |
| | | new IllegalStateException("第" + rowIndex + "è¡,æºæç¼å·ä¸è½ä¸ºç©ºæé¿åº¦å¤§äº20"); |
| | | throw exception; |
| | | } |
| | | if (null != finSysTenantService.queryOneByCode(code)) { |
| | | throw new IllegalStateException("第" + rowIndex + "è¡,æºæç¼å·å·²åå¨"); |
| | | } |
| | | if (StringUtils.isEmpty(tenantName) || tenantName.length() > 100) { |
| | | IllegalStateException exception = |
| | | new IllegalStateException("第" + rowIndex + "è¡,æºæåç§°ä¸è½ä¸ºç©ºæé¿åº¦å¤§äº100"); |
| | | throw exception; |
| | | } |
| | | FinSysTenantParam tenantParam = new FinSysTenantParam(); |
| | | tenantParam.setParentId(pid); |
| | | tenantParam.setStatus(1); |
| | | tenantParam.setSummary("ç³»ç»å¯¼å
¥"); |
| | | tenantParam.setCode(code); |
| | | tenantParam.setName(tenantName); |
| | | finSysTenantParams.add(tenantParam); |
| | | } |
| | | |
| | | } |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
| | | finSysTenantService.insertFinSysTenantBatch(finSysTenantParams, sysInfo, lv); |
| | | } |
| | | |
| | | }).doReadAll(); |
| | | @Override |
| | | public void onException(Exception exception, AnalysisContext context) { |
| | | // å¦ææ¯æä¸ä¸ªåå
æ ¼ç转æ¢å¼å¸¸ è½è·åå°å
·ä½è¡å· |
| | | if (exception instanceof ExcelDataConvertException) { |
| | | ExcelDataConvertException excelDataConvertException = (ExcelDataConvertException)exception; |
| | | Integer rowIndex = excelDataConvertException.getRowIndex() + 1; |
| | | Integer columnIndex = excelDataConvertException.getColumnIndex(); |
| | | String stringValue = excelDataConvertException.getCellData().getStringValue(); |
| | | logger.error("第{}è¡ï¼ç¬¬{}åè§£æå¼å¸¸ï¼æ°æ®ä¸º:{}", rowIndex, columnIndex, stringValue); |
| | | throw new IllegalStateException( |
| | | "第" + rowIndex + "è¡ï¼ç¬¬" + columnIndex + "åè§£æå¼å¸¸,å¼å¸¸æ°æ®ä¸º:[ " + stringValue + " ]"); |
| | | } |
| | | if (exception instanceof IllegalStateException) { |
| | | throw (IllegalStateException)exception; |
| | | } |
| | | |
| | | } |
| | | |
| | | }).doReadAll(); |
| | | |
| | | return ResponseValue.success("导å
¥æå!", 1); |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.type.StatesType; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.pojo.FinSysTenantDepartmentParam; |
| | | import com.consum.base.service.FinSysTenantDepartmentService; |
| | |
| | | } |
| | | FinSysTenantDepartment finSysTenantDepartment = new FinSysTenantDepartment(); |
| | | finSysTenantDepartment.setTenantId(tenantId); |
| | | finSysTenantDepartment.setStatus(StatesType.NORMAL.getValue()); |
| | | List<FinSysTenantDepartment> finSysTenantDepartments = this.departmentService.select(finSysTenantDepartment); |
| | | return ResponseValue.success(finSysTenantDepartments); |
| | | } |
| | |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.excel.exception.ExcelDataConvertException; |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.type.StatesType; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.consum.base.core.utils.PageUtil; |
| | |
| | | finSysTenantUser.setStatus(user.getStatus()); |
| | | finSysTenantUserService.update(finSysTenantUser); |
| | | // 2.æ´æ°å¹³å°ç¨æ· S_USER_CORE |
| | | S_user_core userCore = buildUpdateUserCore(tenantUser); |
| | | S_user_core userCore = buildUpdateUserCore(finSysTenantUser); |
| | | this.userService.update(userCore); |
| | | return ResponseValue.success(1); |
| | | } |
| | |
| | | // é¨é¨ |
| | | FinSysTenantDepartment finSysTenantDepartment = new FinSysTenantDepartment(); |
| | | finSysTenantDepartment.setTenantId(agencyId); |
| | | finSysTenantDepartment.setStatus(StatesType.NORMAL.getValue()); |
| | | finSysTenantDepartment.setIsDelete(0); |
| | | List<FinSysTenantDepartment> tenantDepartmentList = |
| | | finSysTenantDepartmentService.select(finSysTenantDepartment); |
| | | List<DepartmentVO> departmentVOList = Lists.newArrayList(); |
| | |
| | | departmentVO.setName(department.getName()); |
| | | departmentVO.setType("department"); |
| | | |
| | | String sql = "SELECT SYS_USER_ID,USER_NAME FROM " + "fin_sys_tenant_user " |
| | | + "WHERE SYS_DEPT_ID =:deptId AND SYS_USER_ID NOT IN(SELECT MANAGER_ID FROM base_warehouse_manager)"; |
| | | String sql = "SELECT SYS_USER_ID,USER_NAME FROM fin_sys_tenant_user " |
| | | + "WHERE STATUS =1 and SYS_DEPT_ID =:deptId AND SYS_USER_ID NOT IN(SELECT MANAGER_ID FROM base_warehouse_manager)"; |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("deptId", id); |
| | | List<Map<String, Object>> select = finSysTenantUserService.select(sql, param, new MapperUtil()); |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Field; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.excel.exception.ExcelDataConvertException; |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.core.utils.PageUtil; |
| | | import com.consum.base.pojo.LWhFormProcureGoodsInfoParam; |
| | | import com.consum.base.pojo.LWhFormProcureParam; |
| | | import com.consum.base.pojo.dto.GoodModelInfoDTO; |
| | | import com.consum.base.pojo.excel.ImportProcureOrderTemplate; |
| | | import com.consum.base.pojo.excel.ProcureExcelTemplate; |
| | | import com.consum.base.pojo.query.FormProcureQry; |
| | | import com.consum.base.pojo.response.FormProcureVO; |
| | |
| | | import com.consum.base.pojo.response.GoodsTemplateCountVO; |
| | | import com.consum.base.pojo.response.GoodsTemplateInfoVO; |
| | | import com.consum.base.pojo.response.LWhFormProcureExtendVO; |
| | | import com.consum.base.service.BaseCategoryService; |
| | | import com.consum.base.service.LWhFormProcureGoodsService; |
| | | import com.consum.base.service.LWhFormProcureService; |
| | | import com.consum.base.service.LWhProcureModelService; |
| | | import com.consum.base.service.impl.LWhFormProcureCoreService; |
| | | import com.consum.model.po.BaseCategory; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormProcure; |
| | | import com.consum.model.po.LWhFormProcureGoods; |
| | |
| | | private LWhFormProcureCoreService lWhFormProcureCoreService; |
| | | @Resource |
| | | private LWhProcureModelService lWhProcureModelService; |
| | | @Resource |
| | | private BaseCategoryService baseCategoryService; |
| | | |
| | | /** |
| | | * @Description æ°å¢ |
| | |
| | | return ResponseValue.success("å¯¼åºæå", filePath); |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "éè´å导å
¥", notes = "éè´å导å
¥") |
| | | @PostMapping("/import") |
| | | public ResponseValue upload(MultipartFile file) throws IOException { |
| | | String originalFilename = file.getOriginalFilename(); |
| | | if (!originalFilename.endsWith(".xls")) { |
| | | return ResponseValue.error("æä»¶æ ¼å¼æè¯¯!"); |
| | | } |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("å½åç»å½ç¨æ·ä¸ºç©º"); |
| | | } |
| | | EasyExcel.read(file.getInputStream(), ImportProcureOrderTemplate.class, |
| | | new AnalysisEventListener<ImportProcureOrderTemplate>() { |
| | | List<LWhFormProcureParam> list = Lists.newArrayList(); |
| | | |
| | | @Override |
| | | public void invoke(ImportProcureOrderTemplate data, AnalysisContext analysisContext) { |
| | | String categoryOne = data.getCategoryOne(); |
| | | String categoryTwo = data.getCategoryTwo(); |
| | | String categoryThree = data.getCategoryThree(); |
| | | String goodsName = data.getGoodsName(); |
| | | String goodModelName = data.getGoodModelName(); |
| | | String unit = data.getUnit(); |
| | | String type = data.getType(); |
| | | String agencyName = data.getAgencyName(); |
| | | String warehouseName = data.getWarehouseName(); |
| | | String supplierName = data.getSupplierName(); |
| | | String price = data.getPrice(); |
| | | String num = data.getNum(); |
| | | |
| | | BaseCategory baseCategory = baseCategoryService.getByCategoryByName(categoryThree); |
| | | Long categoryId = baseCategory.getId(); |
| | | |
| | | // Optional<BaseGoodsTemplateParam> optional = |
| | | // list.stream().filter(item -> item.getCategoryId().equals(categoryId)).findFirst(); |
| | | // |
| | | // if (optional.isPresent()) { |
| | | // BaseGoodsModels baseGoodsModels = new BaseGoodsModels(); |
| | | // baseGoodsModels.setModelName(goodModelName); |
| | | // baseGoodsModels.setUnit(unit); |
| | | // optional.get().getModels().add(baseGoodsModels); |
| | | // } else { |
| | | // BaseGoodsTemplateParam baseGoodsTemplate = new BaseGoodsTemplateParam(); |
| | | // baseGoodsTemplate.setCategoryId(categoryId); |
| | | // baseGoodsTemplate.setGoodsName(goodsName); |
| | | // baseGoodsTemplate.setStates(1); |
| | | // FinSysTenant finSysTenant = finSysTenantService.selectByName(agencyName); |
| | | // baseGoodsTemplate.setAgencyId(finSysTenant.getId()); |
| | | // baseGoodsTemplate.setAgencyName(agencyName); |
| | | // |
| | | // List<BaseGoodsModels> models = new ArrayList<>(); |
| | | // BaseGoodsModels baseGoodsModels = new BaseGoodsModels(); |
| | | // baseGoodsModels.setModelName(goodModelName); |
| | | // baseGoodsModels.setUnit(unit); |
| | | // models.add(baseGoodsModels); |
| | | // baseGoodsTemplate.setModels(models); |
| | | // |
| | | // list.add(baseGoodsTemplate); |
| | | // } |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
| | | for (LWhFormProcureParam procureParam : list) { |
| | | // lWhFormProcureService.add(procureParam, null); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onException(Exception exception, AnalysisContext analysisContext) throws Exception { |
| | | if (exception instanceof ExcelDataConvertException) { |
| | | ExcelDataConvertException excelDataConvertException = (ExcelDataConvertException)exception; |
| | | Integer row = excelDataConvertException.getRowIndex() + 1; |
| | | Integer column = excelDataConvertException.getColumnIndex() + 1; |
| | | throw new RuntimeException("第" + row + "è¡ï¼ç¬¬" + column + "åè§£æå¼å¸¸ï¼è¯·æ£ç¡®å¡«å"); |
| | | } else { |
| | | throw new RuntimeException(exception.getMessage()); |
| | | } |
| | | } |
| | | }).sheet(0).doRead(); |
| | | |
| | | return ResponseValue.success("导å
¥æå!"); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.WhBusinessEnum; |
| | | import com.consum.base.core.type.StatesType; |
| | | import com.consum.base.core.type.TransferStatesType; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.base.pojo.GoodsUseRecordVO; |
| | |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("ç»å½ç¨æ·ä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | String tenantId = sysInfo.getTenantId(); |
| | | param.setInAgencyId(Long.valueOf(tenantId)); |
| | | GenericPager<Map<String, Object>> mapGenericPager = lWhFormTransferService.queryFormTransferDetailList(param); |
| | | |
| | | return ResponseValue.success(mapGenericPager); |
| | |
| | | if (id == null) { |
| | | return ResponseValue.error("åæ°é误"); |
| | | } |
| | | LWhFormTransfer lWhFormTransfer = lWhFormTransferService.selectById(id); |
| | | if (lWhFormTransfer.getStates() != TransferStatesType.OUT_PENDING.getValue()) { |
| | | return ResponseValue.error("ç¶æé误ï¼ä¸è½æ¤é"); |
| | | } |
| | | |
| | | int num = this.lWhFormTransferService.updateStatus(id); |
| | | return num > 0 ? ResponseValue.success(1) : ResponseValue.error("ä¿®æ¹å¤±è´¥ï¼"); |
New file |
| | |
| | | package com.consum.base.core.type; |
| | | |
| | | /** |
| | | * fff |
| | | * |
| | | * @author asus |
| | | * @version 2023/12/21 15:10 |
| | | **/ |
| | | public enum TransferStatesType { |
| | | |
| | | /** |
| | | * å¾
åºåº |
| | | */ |
| | | OUT_PENDING(0, "å¾
åºåº"), |
| | | /** |
| | | * å¾
æ¥æ¶ |
| | | */ |
| | | RECEIVE_ING(1, "å¾
æ¥æ¶"), |
| | | /** |
| | | * å·²å
¥åº |
| | | */ |
| | | SUCCESS(2, "å·²å
¥åº"), |
| | | /** |
| | | * å·²æ¤é |
| | | */ |
| | | CANCEL(4, "å·²æ¤é"); |
| | | |
| | | private Integer value; |
| | | |
| | | private String desc; |
| | | |
| | | TransferStatesType(Integer value, String desc) { |
| | | this.value = value; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public Integer getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(Integer value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | public void setDesc(String desc) { |
| | | this.desc = desc; |
| | | } |
| | | } |
New file |
| | |
| | | package com.consum.base.pojo.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: éè´å导å
¥ |
| | | * @date 2023/12/21 16:51 |
| | | */ |
| | | @Data |
| | | public class ImportProcureOrderTemplate { |
| | | |
| | | @ExcelProperty("å
¥åºæºæ") |
| | | private String agencyName; |
| | | @ExcelProperty("å
¥åºä»åº") |
| | | private String warehouseName; |
| | | @ExcelProperty("éè´ç±»å") |
| | | private String type; |
| | | @ExcelProperty("ç©åä¸çº§åç±»") |
| | | private String categoryOne; |
| | | @ExcelProperty("ç©åäºçº§åç±»") |
| | | private String categoryTwo; |
| | | @ExcelProperty("ç©åä¸çº§åç±»") |
| | | private String categoryThree; |
| | | @ExcelProperty("ç©ååç§°") |
| | | private String goodsName; |
| | | @ExcelProperty("è§æ ¼åå·") |
| | | private String goodModelName; |
| | | @ExcelProperty("ä¾è´§å") |
| | | private String supplierName; |
| | | @ExcelProperty("æ°éåä½") |
| | | private String unit; |
| | | @ExcelProperty("åä»·(å
)") |
| | | private String price; |
| | | @ExcelProperty("å
¥åºæ°é") |
| | | private String num; |
| | | } |
New file |
| | |
| | | package com.consum.base.pojo.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: æºæå¯¼å
¥æ¨¡æ¿ |
| | | * @date 2023/12/21 13:27 |
| | | */ |
| | | @Data |
| | | public class ImportTenantTemplate { |
| | | @ExcelProperty("æºæç¼å·") |
| | | private String code; |
| | | @ExcelProperty("æºæåç§°") |
| | | private String tenantName; |
| | | |
| | | } |
| | |
| | | |
| | | int addFinSysTenant(FinSysTenantParam param, FinSysTenantUser sysInfo, int lv); |
| | | |
| | | void setLvIdAndName(FinSysTenantParam param, FinSysTenant finSysTenant, long id, int lv); |
| | | |
| | | void insertFinSysTenantBatch(List<FinSysTenantParam> params, FinSysTenantUser sysInfo, int lv); |
| | | |
| | | int updateFinSysTenant(FinSysTenant finSysTenant, FinSysTenantUser sysInfo); |
| | |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | |
| | | @Service |
| | | public class FinSysTenantServiceImpl extends BaseServiceImpl implements FinSysTenantService { |
| | | |
| | |
| | | |
| | | List<Map<String, Object>> list = this.select(sql.toString(), paramts); |
| | | long id = 0L; |
| | | if (!CollectionUtils.isEmpty(list) && list.get(0).get("max(id)") != null) { |
| | | if (!CollectionUtils.isEmpty(list)) { |
| | | id = (Long)list.get(0).get("max(id)") + 1; |
| | | } else { |
| | | id = param.getParentId() * 1000 + 1; |
| | |
| | | finSysTenant.setCode(param.getCode()); |
| | | // 设置详ç»å°ååç»çº¬åº¦ |
| | | finSysTenant.setName(param.getName()); |
| | | finSysTenant.setCreateTime3(DateUtils.getDate("yyyy-MM-dd HH:mm:ss")); |
| | | finSysTenant.setCreateTime3(DateUtil.date()); |
| | | finSysTenant.setCreateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | finSysTenant.setSummary(param.getSummary()); |
| | | finSysTenant.setCreateBy(sysInfo.getUserName()); |
| | |
| | | * @author å¢åºé³ |
| | | * @date 2023/10/4 |
| | | */ |
| | | @Override |
| | | public void setLvIdAndName(FinSysTenantParam param, FinSysTenant finSysTenant, long id, int lv) { |
| | | if (lv == 2) { // æ°å¢å¸çº§æºæ |
| | | // æ¥è¯¢ä¸ä¸çº§ - ç级 |
| | |
| | | } else { |
| | | finSysTenant.setLv3Name(finSysTenant.getName()); |
| | | } |
| | | finSysTenant.setModified(DateUtils.getDate("yyyy-MM-dd HH:mm:ss")); |
| | | finSysTenant.setModified(DateUtil.date()); |
| | | finSysTenant.setUpdateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | finSysTenant.setUpdateBy(sysInfo.getUserName()); |
| | | return this.update(finSysTenant); |
| | |
| | | private static final String SQL_GET_USER = |
| | | "SELECT * FROM fin_sys_tenant_user WHERE IS_DELETE = 0 AND `STATUS` = 1 AND TENANT_ID = ?"; |
| | | private static final String SQL_QH_PAGE_USER_PREFIX = |
| | | "select fstu.id,fstu.USER_CODE,fstu.USER_NAME,fstu.USER_PHONE,fst.name tenantName,fstd.name sysDeptName,fst.STATUS from FIN_SYS_TENANT_USER fstu " |
| | | "select fstu.id,fstu.USER_CODE,fstu.USER_NAME,fstu.USER_PHONE,fst.name tenantName,fstd.name sysDeptName,fstu.STATUS from FIN_SYS_TENANT_USER fstu " |
| | | + "left join fin_sys_tenant fst on fst.id =fstu.TENANT_ID " |
| | | + "left join fin_sys_tenant_department fstd on fstd.id = fstu.SYS_DEPT_ID where fstu.IS_DELETE = 0 "; |
| | | |
| | |
| | | |
| | | import com.consum.base.core.WhBusinessEnum; |
| | | import com.consum.base.core.service.LWhWarningCoreServiceImpl; |
| | | import com.consum.base.core.type.TransferStatesType; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.base.core.utils.LockManage; |
| | | import com.consum.base.service.BaseGoodsTemplateService; |
| | |
| | | lWhFormTransfer = new LWhFormTransfer(whFormTransferId); |
| | | // è°æ¨åä¸åå
³èåºå
¥åºå |
| | | // lWhFormTransfer.setOutWarehouseFormId(outWarehouseFormId); |
| | | lWhFormTransfer.setStates(1); |
| | | lWhFormTransfer.setStates(TransferStatesType.RECEIVE_ING.getValue()); |
| | | lWhFormTransfer.setOutOperatorId(userId); |
| | | lWhFormTransfer.setOutOperatorName(nickName); |
| | | lWhFormTransfer.setOutputTime(dealTime); |
| | |
| | | lWhGoodsService.modGoodsTransfering(outGoodsIds, inWarehouseType, inWarehouseId, inWarehouseName, |
| | | goodsStatus); |
| | | |
| | | // éè¿ç©åidæ¥è¯¢ææååçæ»éé¢ |
| | | // long amount = lWhGoodsService.queryGoodsPriceById(outGoodsIds); |
| | | // LWhProcureModel lWhFormScrappedGoods = new LWhProcureModel(formScrappedGood.getId()); |
| | | // lWhFormScrappedGoods.setTotalAmount(amount); |
| | | // lWhFormTransferService.update(lWhFormScrappedGoods); |
| | | |
| | | whGoodsRecord.setInitialCount(goodsModelNum); |
| | | whGoodsRecord.setEndCount(goodsModelNum + whGoodsRecord.getThisCount()); |
| | | long totalAmount = lWhGoodsService.queryGoodsPriceById(outGoodsIds); |
| | |
| | | lWhFormTransfer = new LWhFormTransfer(whFormTransferId); |
| | | lWhFormTransfer.setInWarehouseFlowId(inWarehouseFlowId); |
| | | lWhFormTransfer.setInWarehouseFormId(null); |
| | | lWhFormTransfer.setStates(2); |
| | | lWhFormTransfer.setStates(TransferStatesType.SUCCESS.getValue()); |
| | | if (StringUtils.isEmpty(inOperatorName)) { |
| | | lWhFormTransfer.setInOperatorId(userId); |
| | | lWhFormTransfer.setInOperatorName(nickName); |
| | |
| | | import com.consum.base.core.type.CategoryType; |
| | | import com.consum.base.core.type.StatesType; |
| | | import com.consum.base.core.type.TransferBusinessType; |
| | | import com.consum.base.core.type.TransferStatesType; |
| | | import com.consum.base.core.type.WareHouseType; |
| | | import com.consum.base.core.utils.CurrencyUtil; |
| | | import com.consum.base.core.utils.IdUtil; |
| | |
| | | lWhFormTransfer.setOperatorName(sysInfo.getUserName()); |
| | | lWhFormTransfer.setCreateTime(param.getCreateTime()); |
| | | // 0=å¾
åºåºï¼1=å¾
æ¥æ¶ï¼2=å·²å
¥åºåº:4=å·²æ¤é |
| | | lWhFormTransfer.setStates(0); |
| | | lWhFormTransfer.setStates(TransferStatesType.OUT_PENDING.getValue()); |
| | | lWhFormTransfer.setProcureDoc(param.getProcureDoc()); |
| | | |
| | | int flag1 = this.insert(lWhFormTransfer); |
| | |
| | | */ |
| | | public int updateStatus(Long id) { |
| | | LWhFormTransfer lWhFormTransfer = new LWhFormTransfer(id); |
| | | lWhFormTransfer.setStates(4); |
| | | lWhFormTransfer.setStates(TransferStatesType.CANCEL.getValue()); |
| | | return this.update(lWhFormTransfer); |
| | | } |
| | | |
| | |
| | | } |
| | | if (param.getOutAgencyId() != null) { |
| | | sql.append("AND ft.OUT_AGENCY_ID like :outAgencyId "); |
| | | params.put("outAgencyId", param.getOutAgencyId()); |
| | | params.put("outAgencyId", param.getOutAgencyId() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | if (param.getOutAgencyId() != null) { |
| | | if (param.getInAgencyId() != null) { |
| | | sql.append("AND ft.IN_AGENCY_ID like :inAgencyId "); |
| | | params.put("inAgencyId", param.getInAgencyId()); |
| | | params.put("inAgencyId", param.getInAgencyId() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | if (StringUtils.isNotEmpty(param.getOperatorName())) { |
| | | sql.append("AND ft.OPERATOR_NAME = :operatorName "); |