| | |
| | | package com.consum.base.controller; |
| | | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.pojo.BaseCategoryParam; |
| | | import com.consum.base.pojo.ProjectTreeResult; |
| | | import com.consum.base.service.BaseCategoryServiceImpl; |
| | |
| | | import com.walker.infrastructure.tree.TreeNode; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.web.ResponseValue; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.TreeMap; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @Description 物品分类 |
| | |
| | | * @Date 2023/10/30 |
| | | */ |
| | | @GetMapping("/select/tree") |
| | | public ResponseValue tree(String categoryName) { |
| | | public ResponseValue trees() { |
| | | List<ProjectTreeResult> tree = this.baseCategoryService.tree(); |
| | | return ResponseValue.success(tree); |
| | | } |
| | |
| | | * @Date 2023/10/23 |
| | | */ |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody BaseCategoryParam param) { |
| | | public ResponseValue add() { |
| | | BaseCategoryParam param = CommonUtil.getObjFromReqBody(BaseCategoryParam.class); |
| | | BaseCategoryParam param2 = new BaseCategoryParam(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | if (StringUtils.isEmpty(param.getCategoryName())) { |
| | | return ResponseValue.error("分类名称为空"); |
| | | } |
| | |
| | | * @Date 2023/10/23 |
| | | */ |
| | | @GetMapping("/list") |
| | | public ResponseValue queryBaseCategoryList(BaseCategoryParam param) { |
| | | public ResponseValue queryBaseCategoryList() { |
| | | BaseCategoryParam param = CommonUtil.getObjFromReq(BaseCategoryParam.class); |
| | | BaseCategoryParam param2 = new BaseCategoryParam(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | |
| | | * @Date 2023/10/23 |
| | | */ |
| | | @PostMapping("/edit") |
| | | public ResponseValue edit(@RequestBody BaseCategory baseCategory) { |
| | | public ResponseValue edit() { |
| | | BaseCategory baseCategory = CommonUtil.getObjFromReqBody(BaseCategory.class); |
| | | BaseCategory param2 = new BaseCategory(); |
| | | CommonUtil.copyProperties(baseCategory, param2); |
| | | baseCategory = param2; |
| | | |
| | | Long id = baseCategory.getId(); |
| | | if (id == null || id.longValue() <= 0) { |
| | | return ResponseValue.error("编辑的物品分类不存在"); |
| | |
| | | */ |
| | | //分类下有正常状态的物品时,不允许禁用 |
| | | @PostMapping("/updStatus") |
| | | public ResponseValue updateStatus(@RequestBody BaseCategory baseCategory) { |
| | | public ResponseValue updateStatus() { |
| | | BaseCategory baseCategory = CommonUtil.getObjFromReqBody(BaseCategory.class); |
| | | BaseCategory param2 = new BaseCategory(); |
| | | CommonUtil.copyProperties(baseCategory, param2); |
| | | baseCategory = param2; |
| | | |
| | | if (baseCategory == null || baseCategory.getId() == null || baseCategory.getStates() == null) { |
| | | return ResponseValue.error("参数错误"); |
| | | } |
| | |
| | | * @Date 2023/10/23 |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public ResponseValue updateById(@RequestBody BaseCategory baseCategory) { |
| | | public ResponseValue updateById() { |
| | | BaseCategory baseCategory = CommonUtil.getObjFromReqBody(BaseCategory.class); |
| | | BaseCategory param2 = new BaseCategory(); |
| | | CommonUtil.copyProperties(baseCategory, param2); |
| | | baseCategory = param2; |
| | | |
| | | if (baseCategory.getId() == null) { |
| | | return ResponseValue.error("分类id为空"); |
| | | } |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.service.BaseGoodsModelsServiceImpl; |
| | | import com.consum.model.po.BaseGoodsModels; |
| | | import com.iplatform.model.po.S_user_core; |
| | |
| | | * @Date 2023/10/23 |
| | | */ |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody BaseGoodsModels models) { |
| | | public ResponseValue add() { |
| | | BaseGoodsModels models = CommonUtil.getObjFromReqBody(BaseGoodsModels.class); |
| | | BaseGoodsModels param2 = new BaseGoodsModels(); |
| | | CommonUtil.copyProperties(models, param2); |
| | | models = param2; |
| | | |
| | | if (models.getGoodsTemplatesId() == null || StringUtils.isEmpty(models.getModelName()) || StringUtils.isEmpty(models.getUnit()) || models.getStates() == null) { |
| | | return ResponseValue.error("参数错误"); |
| | | } |
| | |
| | | * @date 2023/10/25 |
| | | */ |
| | | @PostMapping("/updStatus") |
| | | public ResponseValue updateStatus(@RequestBody BaseGoodsModels models) { |
| | | public ResponseValue updateStatus() { |
| | | BaseGoodsModels models = CommonUtil.getObjFromReqBody(BaseGoodsModels.class); |
| | | BaseGoodsModels param2 = new BaseGoodsModels(); |
| | | CommonUtil.copyProperties(models, param2); |
| | | models = param2; |
| | | |
| | | if (models == null || models.getId() == null || models.getStates() == null) { |
| | | return ResponseValue.error("参数错误"); |
| | | } |
| | |
| | | * @Date 2023/10/25 |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public ResponseValue updateById(@RequestBody BaseGoodsModels models) { |
| | | public ResponseValue updateById() { |
| | | BaseGoodsModels models = CommonUtil.getObjFromReqBody(BaseGoodsModels.class); |
| | | BaseGoodsModels param2 = new BaseGoodsModels(); |
| | | CommonUtil.copyProperties(models, param2); |
| | | models = param2; |
| | | |
| | | if (models.getId() == null) { |
| | | return ResponseValue.error("规格型号id为空"); |
| | | } |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.core.utils.MapUtils; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.consum.base.pojo.BaseGoodsTemplateParam; |
| | |
| | | import com.consum.base.service.BaseGoodsTemplateServiceImpl; |
| | | import com.consum.base.service.BaseWarehouseServiceImpl; |
| | | import com.consum.base.service.LWhGoodsService; |
| | | import com.consum.model.po.BaseGoodsModels; |
| | | import com.consum.model.po.BaseGoodsTemplate; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.SDictData; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.vo.BaseGoodsTemplateVo; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description 物品模板 |
| | |
| | | * @Date 2023/10/24 |
| | | */ |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody BaseGoodsTemplateParam param) { |
| | | public ResponseValue add() { |
| | | BaseGoodsTemplateParam param = CommonUtil.getObjFromReqBody(BaseGoodsTemplateParam.class); |
| | | BaseGoodsTemplateParam param2 = new BaseGoodsTemplateParam(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (param.getCategoryId() == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | |
| | | * @Date 2023/10/24 |
| | | */ |
| | | @GetMapping("/list") |
| | | public ResponseValue queryList(BaseGoodsTemplateParam param) { |
| | | public ResponseValue queryList() { |
| | | BaseGoodsTemplateParam param = CommonUtil.getObjFromReq(BaseGoodsTemplateParam.class); |
| | | BaseGoodsTemplateParam param2 = new BaseGoodsTemplateParam(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | |
| | | * @Date 2023/10/24 |
| | | */ |
| | | @PostMapping("/edit") |
| | | public ResponseValue edit(@RequestBody BaseGoodsTemplateParam param) { |
| | | public ResponseValue edit() { |
| | | BaseGoodsTemplateParam param = CommonUtil.getObjFromReqBody(BaseGoodsTemplateParam.class); |
| | | BaseGoodsTemplateParam param2 = new BaseGoodsTemplateParam(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | if (StringUtils.isEmpty(param.getGoodsName())) { |
| | | return ResponseValue.error("物品名称为空"); |
| | | } |
| | |
| | | */ |
| | | //TODO 物品的禁用或删除,不影响已经采购入过库的物品信息。 |
| | | @PostMapping("/updStatus") |
| | | public ResponseValue updateStatus(@RequestBody BaseGoodsTemplate goodsTemplate) { |
| | | public ResponseValue updateStatus() { |
| | | BaseGoodsTemplate goodsTemplate = CommonUtil.getObjFromReqBody(BaseGoodsTemplate.class); |
| | | BaseGoodsTemplate param2 = new BaseGoodsTemplate(); |
| | | CommonUtil.copyProperties(goodsTemplate, param2); |
| | | goodsTemplate = param2; |
| | | |
| | | if (goodsTemplate == null || goodsTemplate.getId() == null || goodsTemplate.getStates() == null) { |
| | | return ResponseValue.error("参数错误"); |
| | | } |
| | |
| | | */ |
| | | //TODO 物品的禁用或删除,不影响已经采购入过库的物品信息。 |
| | | @DeleteMapping("/del") |
| | | public ResponseValue updateById(@RequestBody BaseGoodsTemplate goodsTemplate) { |
| | | public ResponseValue updateById() { |
| | | BaseGoodsTemplate goodsTemplate = CommonUtil.getObjFromReqBody(BaseGoodsTemplate.class); |
| | | BaseGoodsTemplate param2 = new BaseGoodsTemplate(); |
| | | CommonUtil.copyProperties(goodsTemplate, param2); |
| | | goodsTemplate = param2; |
| | | |
| | | if (goodsTemplate.getId() == null) { |
| | | return ResponseValue.error("物品id为空"); |
| | | } |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.pojo.BaseWarehouseParam; |
| | | import com.consum.base.pojo.query.WarehouseQry; |
| | | import com.consum.base.service.BaseWarehouseServiceImpl; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description 仓库管理 |
| | |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody BaseWarehouseParam param) { |
| | | public ResponseValue add() { |
| | | BaseWarehouseParam param = CommonUtil.getObjFromReqBody(BaseWarehouseParam.class); |
| | | BaseWarehouseParam param2 = new BaseWarehouseParam(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | if (StringUtils.isEmpty(param.getWarehouseName())) { |
| | | return ResponseValue.error("仓库名称为空"); |
| | | } |
| | |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @GetMapping("/list") |
| | | public ResponseValue queryList(BaseWarehouseParam param) { |
| | | public ResponseValue queryList() { |
| | | BaseWarehouseParam param = CommonUtil.getObjFromReq(BaseWarehouseParam.class); |
| | | BaseWarehouseParam param2 = new BaseWarehouseParam(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @PostMapping("/edit") |
| | | public ResponseValue edit(@RequestBody BaseWarehouse baseWarehouse) { |
| | | public ResponseValue edit() { |
| | | BaseWarehouse baseWarehouse = CommonUtil.getObjFromReqBody(BaseWarehouse.class); |
| | | BaseWarehouse param2 = new BaseWarehouse(); |
| | | CommonUtil.copyProperties(baseWarehouse, param2); |
| | | baseWarehouse = param2; |
| | | |
| | | Long id = baseWarehouse.getId(); |
| | | if (id == null || id <= 0) { |
| | | return ResponseValue.error("编辑的仓库不存在"); |
| | |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public ResponseValue updateById(@RequestBody BaseWarehouse baseWarehouse) { |
| | | public ResponseValue updateById() { |
| | | BaseWarehouse baseWarehouse = CommonUtil.getObjFromReqBody(BaseWarehouse.class); |
| | | BaseWarehouse param2 = new BaseWarehouse(); |
| | | CommonUtil.copyProperties(baseWarehouse, param2); |
| | | baseWarehouse = param2; |
| | | |
| | | if (baseWarehouse.getId() == null) { |
| | | return ResponseValue.error("仓库id为空"); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "warehouseQry", value = "仓库id和型号id", required = true, dataType = "WarehouseQry", paramType = "query") |
| | | }) |
| | | @GetMapping("/select/number") |
| | | public ResponseValue selectNumber(@Validated WarehouseQry warehouseQry) { |
| | | public ResponseValue selectNumber() { |
| | | WarehouseQry warehouseQry = CommonUtil.getObjFromReq(WarehouseQry.class); |
| | | WarehouseQry param2 = new WarehouseQry(); |
| | | CommonUtil.copyProperties(warehouseQry, param2); |
| | | warehouseQry = param2; |
| | | |
| | | Long warehouseId = warehouseQry.getWarehouseId(); |
| | | if (warehouseId == null) { |
| | | Long agencyId = warehouseQry.getAgencyId(); |
New file |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.TemplateExportParams; |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.pojo.query.LWhLedgerQry; |
| | | import com.consum.base.service.FinWarehouseLedgerServiceImpl; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.web.ResponseValue; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.net.URLEncoder; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 部门台账 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/pc/fin/warehouse/departLedger") |
| | | public class FinDepartLedgerController extends BaseController { |
| | | @Resource |
| | | private FinWarehouseLedgerServiceImpl finWarehouseLedgerService; |
| | | |
| | | /** |
| | | * @Description 分页列表查询 |
| | | * @Author wh |
| | | * @Date 2023/7/11 13:59 |
| | | */ |
| | | @RequestMapping("/getList") |
| | | public ResponseValue getLedgerList() { |
| | | LWhLedgerQry param = CommonUtil.getObjFromReq(LWhLedgerQry.class); |
| | | LWhLedgerQry query = new LWhLedgerQry(); |
| | | CommonUtil.copyProperties(param, query); |
| | | param = query; |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | /*当前登录人只能看到自己机构下的列表*/ |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | String tenantId = sysInfo.getTenantId(); |
| | | Long paramAgencyId = param.getAgencyId(); |
| | | if (paramAgencyId == null || !paramAgencyId.toString().startsWith(tenantId)) { |
| | | param.setAgencyId(Long.valueOf(tenantId)); |
| | | } |
| | | param.setStates((short) 1); |
| | | param.setWarehouseType((short) 1); |
| | | GenericPager pager = finWarehouseLedgerService.departLedgerList(param); |
| | | return ResponseValue.success(pager); |
| | | } |
| | | |
| | | @RequestMapping("/getListExport") |
| | | public void getListExport(HttpServletResponse response) throws Exception { |
| | | LWhLedgerQry param = CommonUtil.getObjFromReq(LWhLedgerQry.class); |
| | | LWhLedgerQry query = new LWhLedgerQry(); |
| | | CommonUtil.copyProperties(param, query); |
| | | param = query; |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return; |
| | | } |
| | | /*当前登录人只能看到自己机构下的列表*/ |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | String tenantId = sysInfo.getTenantId(); |
| | | Long paramAgencyId = param.getAgencyId(); |
| | | if (paramAgencyId == null || !paramAgencyId.toString().startsWith(tenantId)) { |
| | | param.setAgencyId(Long.valueOf(tenantId)); |
| | | } |
| | | param.setStates((short) 1); |
| | | param.setWarehouseType((short) 1); |
| | | param.setPageNum(1); |
| | | param.setPageSize(Integer.MAX_VALUE); |
| | | GenericPager<Map<String, Object>> pager = finWarehouseLedgerService.departLedgerList(param); |
| | | List<Map<String, Object>> datas = pager.getDatas(); |
| | | org.springframework.core.io.Resource resource = new ClassPathResource("import/depTaiZhangExpTemp.xlsx"); |
| | | // 获取文件输入流 |
| | | InputStream inputStream = resource.getInputStream(); |
| | | Workbook wb = new XSSFWorkbook(inputStream); |
| | | TemplateExportParams params = new TemplateExportParams(); |
| | | params.setTemplateWb(wb); |
| | | |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | map.put("dataList", datas); |
| | | |
| | | Workbook workbook = ExcelExportUtil.exportExcel(params, map); |
| | | // 设置响应头 |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + URLEncoder.encode("库存查询.xlsx", "utf-8")); |
| | | try (OutputStream outputStream = response.getOutputStream()) { |
| | | workbook.write(outputStream); |
| | | workbook.close(); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import cn.hutool.core.util.ReflectUtil; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | |
| | | import com.iplatform.model.po.S_role; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.NumberGenerator; |
| | | import com.walker.infrastructure.utils.PhoneNumberUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.infrastructure.utils.*; |
| | | import com.walker.web.ResponseValue; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Field; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | import java.util.Set; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Field; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description 系统用户 |
| | |
| | | |
| | | try { |
| | | Field fieldDatas = GenericPager.class.getDeclaredField("datas"); |
| | | fieldDatas.setAccessible(true); |
| | | fieldDatas.set(pager, resultList); |
| | | // fieldDatas.setAccessible(true); |
| | | // fieldDatas.set(pager, resultList); |
| | | ReflectUtil.setFieldValue(pager, fieldDatas, resultList); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | user.setSysUserId(NumberGenerator.getLongSequenceNumber()); |
| | | // 加密手机号 |
| | | String key = PlatformRSAUtils.AES_KEY; |
| | | String pwdPhone = ""; |
| | | String encPhone = ""; |
| | | if (user.getUserPhone() != null) { |
| | | pwdPhone = AESUtils.encryptStrAES(user.getUserPhone(), key); |
| | | encPhone = AESUtils.encryptStrAES(user.getUserPhone(), key); |
| | | } |
| | | user.setUserPhone(pwdPhone); |
| | | user.setUserPhone(encPhone); |
| | | //怎么获取左侧机构树数据 |
| | | user.setSysDeptId(3L); //对应平台机构id 默认为平台管理 |
| | | this.finSysTenantUserService.insert(user); |
| | |
| | | userCore.setNick_name(user.getUserName()); |
| | | //用户类型 先默认设置为2 |
| | | userCore.setUser_type(2); |
| | | userCore.setPhonenumber(pwdPhone); |
| | | userCore.setPhonenumber(encPhone); |
| | | userCore.setSex(user.getSex().toString()); |
| | | //初始化密码 123456 |
| | | String pws = this.getArgumentVariable(ArgumentsConstants.KEY_SECURITY_PASSWORD_INIT).getStringValue(); |
| | |
| | | user.setRemark("批量导入"); |
| | | // 加密手机号 |
| | | String key = PlatformRSAUtils.AES_KEY; |
| | | String pwdPhone = AESUtils.encryptStrAES(data.getUserPhone(), key); |
| | | user.setUserPhone(pwdPhone); |
| | | String encPhone = AESUtils.encryptStrAES(data.getUserPhone(), key); |
| | | user.setUserPhone(encPhone); |
| | | |
| | | user.setIsDelete(1); |
| | | //怎么获取左侧机构树数据 |
| | |
| | | return ResponseValue.error("参数为空"); |
| | | } |
| | | String key = PlatformRSAUtils.AES_KEY; |
| | | String pwdPhone = ""; |
| | | String encPhone = ""; |
| | | if (user.getUserPhone() != null) { |
| | | pwdPhone = AESUtils.encryptStrAES(user.getUserPhone(), key); |
| | | encPhone = AESUtils.encryptStrAES(user.getUserPhone(), key); |
| | | } |
| | | user.setUserPhone(pwdPhone); |
| | | user.setUserPhone(encPhone); |
| | | // 1.更新系统用户 FIN_SYS_TENANT_USER |
| | | finSysTenantUserService.update(user); |
| | | // 2.更新平台用户 S_USER_CORE |
| | |
| | | // 加密手机号 |
| | | String key = PlatformRSAUtils.AES_KEY; |
| | | String userPhone = user.getUserPhone(); |
| | | String pwdPhone = ""; |
| | | String encPhone = ""; |
| | | if (userPhone != null) { |
| | | pwdPhone = AESUtils.encryptStrAES(userPhone, key); |
| | | user.setUserPhone(pwdPhone); |
| | | encPhone = AESUtils.encryptStrAES(userPhone, key); |
| | | user.setUserPhone(encPhone); |
| | | } |
| | | |
| | | this.finSysTenantUserService.insert(user); |
| | |
| | | updUser.setEmail(user.getEmail()); |
| | | updUser.setUserName(user.getUserName()); |
| | | updUser.setSex(user.getSex()); |
| | | String pwdPhone = ""; |
| | | String encPhone = ""; |
| | | if (user.getUserPhone() != null) { |
| | | String key = PlatformRSAUtils.AES_KEY; |
| | | pwdPhone = AESUtils.encryptStrAES(user.getUserPhone(), key); |
| | | encPhone = AESUtils.encryptStrAES(user.getUserPhone(), key); |
| | | } |
| | | updUser.setUserPhone(pwdPhone); |
| | | updUser.setUserPhone(encPhone); |
| | | // 1.更新系统用户 FIN_SYS_TENANT_USER |
| | | finSysTenantUserService.update(updUser); |
| | | // 2.更新平台用户 S_USER_CORE |
| | |
| | | @RequestMapping("/getList") |
| | | public ResponseValue getLedgerList() { |
| | | LWhLedgerQry param = CommonUtil.getObjFromReq(LWhLedgerQry.class); |
| | | LWhLedgerQry query = new LWhLedgerQry(); |
| | | CommonUtil.copyProperties(param, query); |
| | | param = query; |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | |
| | | @RequestMapping("/getListExport") |
| | | public void getListExport(HttpServletResponse response) throws Exception { |
| | | LWhLedgerQry param = CommonUtil.getObjFromReq(LWhLedgerQry.class); |
| | | LWhLedgerQry query = new LWhLedgerQry(); |
| | | CommonUtil.copyProperties(param, query); |
| | | param = query; |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return; |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import cn.hutool.core.util.ReflectUtil; |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.core.utils.MapUtils; |
| | |
| | | private LWarehouseFlowService lWarehouseFlowService; |
| | | |
| | | @GetMapping("/list") |
| | | public ResponseValue queryFormProcureList(LWarehouseFlowParam param) { |
| | | public ResponseValue queryFormProcureList() { |
| | | LWarehouseFlowParam param = CommonUtil.getObjFromReq(LWarehouseFlowParam.class); |
| | | LWarehouseFlowParam param2 = new LWarehouseFlowParam(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | |
| | | }); |
| | | try { |
| | | Field fieldDatas = GenericPager.class.getDeclaredField("datas"); |
| | | fieldDatas.setAccessible(true); |
| | | fieldDatas.set(genericPager, result); |
| | | // fieldDatas.setAccessible(true); |
| | | // fieldDatas.set(genericPager, result); |
| | | ReflectUtil.setFieldValue(genericPager, fieldDatas, result); |
| | | } catch (Exception e) { |
| | | logger.error(e.getMessage(), e); |
| | | } |
| | |
| | | |
| | | |
| | | @GetMapping("/detail/list") |
| | | public ResponseValue queryFormProcureList1(LWarehouseFlowParam param) { |
| | | public ResponseValue queryFormProcureList1() { |
| | | LWarehouseFlowParam param = CommonUtil.getObjFromReq(LWarehouseFlowParam.class); |
| | | LWarehouseFlowParam param2 = new LWarehouseFlowParam(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | LWarehouseFlowParam param = CommonUtil.getObjFromReq(LWarehouseFlowParam.class); |
| | | LWarehouseFlowParam param2 = new LWarehouseFlowParam(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | /*当前登录人只能看到自己机构下的列表*/ |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | String tenantId = sysInfo.getTenantId(); |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import cn.hutool.core.util.ReflectUtil; |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.core.utils.MapUtils; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.consum.base.pojo.LWhFormOutputParam; |
| | | import com.consum.base.pojo.query.LWhFormOutputQry; |
| | | import com.consum.base.pojo.response.FormOutputGoodsVO; |
| | | import com.consum.base.pojo.response.FormOutputTemplateInfoVO; |
| | | import com.consum.base.pojo.response.FormOutputVO; |
| | | import com.consum.base.pojo.response.GoodsModelVO; |
| | | import com.consum.base.pojo.response.LWhFormOutputExtendVO; |
| | | import com.consum.base.pojo.response.*; |
| | | import com.consum.base.service.LWarehouseFlowService; |
| | | import com.consum.base.service.LWhFormOutputServiceImpl; |
| | | import com.consum.base.service.LWhGoodsService; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.lang.reflect.Field; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.annotation.Resource; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.lang.reflect.Field; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description 出库单 |
| | |
| | | } |
| | | try { |
| | | Field fieldDatas = GenericPager.class.getDeclaredField("datas"); |
| | | fieldDatas.setAccessible(true); |
| | | fieldDatas.set(genericPager, resultList); |
| | | // fieldDatas.setAccessible(true); |
| | | // fieldDatas.set(genericPager, resultList); |
| | | ReflectUtil.setFieldValue(genericPager, fieldDatas, resultList); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import cn.hutool.core.util.ReflectUtil; |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.CodeGeneratorEnum; |
| | | import com.consum.base.core.CodeGeneratorService; |
| | |
| | | import com.consum.base.pojo.LWhFormProcureParam; |
| | | import com.consum.base.pojo.LWhProcureModelParam; |
| | | import com.consum.base.pojo.query.FormProcureQry; |
| | | import com.consum.base.pojo.response.FormProcureVO; |
| | | import com.consum.base.pojo.response.FromProcureTemplateInfoVO; |
| | | import com.consum.base.pojo.response.GoodsModelVO; |
| | | import com.consum.base.pojo.response.LWhFormProcureExtendVO; |
| | | import com.consum.base.pojo.response.LWhFormProcureGoodsVO; |
| | | import com.consum.base.service.BaseGoodsTemplateServiceImpl; |
| | | import com.consum.base.service.BaseWarehouseServiceImpl; |
| | | import com.consum.base.service.FinSysTenantServiceImpl; |
| | | import com.consum.base.service.LOrgSupplierServiceImpl; |
| | | import com.consum.base.service.LWhFormProcureCoreService; |
| | | import com.consum.base.service.LWhFormProcureGoodsService; |
| | | import com.consum.base.service.LWhFormProcureService; |
| | | import com.consum.base.service.LWhGoodsService; |
| | | import com.consum.base.service.LWhProcureModelService; |
| | | import com.consum.model.po.BaseGoodsTemplate; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LOrgSupplier; |
| | | import com.consum.model.po.LWhFormProcure; |
| | | import com.consum.model.po.LWhFormProcureGoods; |
| | | import com.consum.model.po.LWhProcureModel; |
| | | import com.consum.base.pojo.response.*; |
| | | import com.consum.base.service.*; |
| | | import com.consum.model.po.*; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.lang.reflect.Field; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import javax.annotation.Resource; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.lang.reflect.Field; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @ClassName LWhFormProcureController |
| | |
| | | * @Description 新增 |
| | | */ |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody LWhFormProcureParam param) { |
| | | public ResponseValue add() { |
| | | LWhFormProcureParam param = CommonUtil.getObjFromReqBody(LWhFormProcureParam.class); |
| | | LWhFormProcureParam param2 = new LWhFormProcureParam(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | return this.add(param); |
| | | } |
| | | |
| | | private ResponseValue add(LWhFormProcureParam param) { |
| | | Long warehouseId = param.getWarehouseId(); |
| | | if (param.getWarehouseId() == null) { |
| | | return ResponseValue.error("仓库ID不能为空"); |
| | |
| | | */ |
| | | @ApiOperation(value = "采购单列表查询", notes = "采购单列表查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "param", value = "采购查询条件", required = true, dataType = "FormProcureQryDto", paramType = "query") |
| | | @ApiImplicitParam(name = "param", value = "采购查询条件", required = true, dataType = "FormProcureQryDto", paramType = "query") |
| | | }) |
| | | @GetMapping("/list") |
| | | public ResponseValue queryFormProcureList(FormProcureQry param) { |
| | | public ResponseValue queryFormProcureList() { |
| | | FormProcureQry param = CommonUtil.getObjFromReq(FormProcureQry.class); |
| | | FormProcureQry param2 = new FormProcureQry(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | |
| | | |
| | | // 查询型号数量 |
| | | String sql = "select fpg.id,BASE_CATEGORY_ID ,BASE_GOODS_TEMPLATE_ID ,GOODS_TEMPLATE_NAME ,sum(counts) count " |
| | | + "from L_WH_FORM_PROCURE_GOODS fpg left join L_WH_PROCURE_MODEL pm on fpg.id = pm.FROM_PROCURE_GOODS_ID " |
| | | + "where fpg.WH_FORM_PROCURE_ID =:id group by pm.FROM_PROCURE_GOODS_ID"; |
| | | + "from L_WH_FORM_PROCURE_GOODS fpg left join L_WH_PROCURE_MODEL pm on fpg.id = pm.FROM_PROCURE_GOODS_ID " |
| | | + "where fpg.WH_FORM_PROCURE_ID =:id group by pm.FROM_PROCURE_GOODS_ID"; |
| | | Map<String, Object> paramMap = new HashMap<>(); |
| | | paramMap.put("id", item.getId()); |
| | | List<Map<String, Object>> procureModelList = lWhProcureModelService.select(sql, paramMap, new MapperUtil()); |
| | |
| | | } |
| | | try { |
| | | Field fieldDatas = GenericPager.class.getDeclaredField("datas"); |
| | | fieldDatas.setAccessible(true); |
| | | fieldDatas.set(genericPager, result); |
| | | // fieldDatas.setAccessible(true); |
| | | // fieldDatas.set(genericPager, result); |
| | | ReflectUtil.setFieldValue(genericPager, fieldDatas, result); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | * @Description 编辑 |
| | | */ |
| | | @PostMapping("/edit") |
| | | public ResponseValue edit(@RequestBody LWhFormProcureParam param) { |
| | | public ResponseValue edit() { |
| | | LWhFormProcureParam param = CommonUtil.getObjFromReqBody(LWhFormProcureParam.class); |
| | | LWhFormProcureParam param2 = new LWhFormProcureParam(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | ResponseValue delFlag = delById(param.getId()); |
| | | if (delFlag.getCode() == ResponseValue.CODE_SUCCESS) { |
| | | return this.add(param); |
| | |
| | | lWhFormProcureGoods.setWhFormProcureId(id); |
| | | List<LWhFormProcureGoods> formProcureGoods = lWhFormProcureGoodsService.select(lWhFormProcureGoods); |
| | | |
| | | Field fieldModels = null; |
| | | try { |
| | | fieldModels = LWhFormProcureGoodsVO.class.getDeclaredField("models"); |
| | | } catch (NoSuchFieldException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | fieldModels.setAccessible(true); |
| | | // Field fieldModels = null; |
| | | // try { |
| | | // fieldModels = LWhFormProcureGoodsVO.class.getDeclaredField("models"); |
| | | // } catch (NoSuchFieldException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // fieldModels.setAccessible(true); |
| | | ArrayList<LWhFormProcureGoodsVO> procureGoodsVOList = new ArrayList<>(); |
| | | for (LWhFormProcureGoods formProcureGood : formProcureGoods) { |
| | | LWhFormProcureGoodsVO lWhFormProcureGoodsVO = new LWhFormProcureGoodsVO(); |
| | |
| | | Map<String, Object> paramMap = new HashMap<>(); |
| | | paramMap.put("formProcureGoodId", formProcureGood.getId()); |
| | | String sql = "SELECT\n" + "pm.BASE_GOODS_MODELS_ID,pm.BASE_GOODS_MODELS_NAME,pm.PRICE,pm.COUNTS,pm.WOREHOUSE_COUNT,bgm.unit " + "FROM\n" |
| | | + "\tl_wh_procure_model pm\n" |
| | | + "\tLEFT JOIN base_goods_models bgm on pm.BASE_GOODS_MODELS_ID = bgm.id where pm.FROM_PROCURE_GOODS_ID =:formProcureGoodId"; |
| | | + "\tl_wh_procure_model pm\n" |
| | | + "\tLEFT JOIN base_goods_models bgm on pm.BASE_GOODS_MODELS_ID = bgm.id where pm.FROM_PROCURE_GOODS_ID =:formProcureGoodId"; |
| | | List<Map<String, Object>> procureModelList = lWhProcureModelService.select(sql, paramMap, new MapperUtil()); |
| | | List<GoodsModelVO> goodsModelVOList = Lists.newArrayList(); |
| | | procureModelList.forEach(item -> { |
| | | GoodsModelVO goodsModelVO = MapUtils.convertMapToObj(item, GoodsModelVO.class); |
| | | goodsModelVOList.add(goodsModelVO); |
| | | }); |
| | | fieldModels.set(lWhFormProcureGoodsVO, goodsModelVOList); |
| | | // fieldModels.set(lWhFormProcureGoodsVO, goodsModelVOList); |
| | | ReflectUtil.setFieldValue(lWhFormProcureGoodsVO, "models", goodsModelVOList); |
| | | |
| | | procureGoodsVOList.add(lWhFormProcureGoodsVO); |
| | | } |
| | | lWhFormProcureExtendVO.setProcureGoods(procureGoodsVOList); |
| | |
| | | @GetMapping("detail/list") |
| | | public ResponseValue queryFormProcureDetailList() { |
| | | FormProcureQry formProcureQry = CommonUtil.getObjFromReq(FormProcureQry.class); |
| | | FormProcureQry param2 = new FormProcureQry(); |
| | | CommonUtil.copyProperties(formProcureQry, param2); |
| | | formProcureQry = param2; |
| | | |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import cn.hutool.core.util.ReflectUtil; |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.base.core.utils.MapUtils; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.consum.base.pojo.GoodsUseRecordVO; |
| | | import com.consum.base.pojo.LWhFormTransferGoodsInfoParam; |
| | | import com.consum.base.pojo.request.ProcureModelInfoParam; |
| | | import com.consum.base.pojo.RecordUserInfoVO; |
| | | import com.consum.base.pojo.UseRecordSkuVO; |
| | | import com.consum.base.pojo.dto.UseRecordDTO; |
| | | import com.consum.base.pojo.query.TransferQry; |
| | | import com.consum.base.pojo.request.LWhFormTransferParam; |
| | | import com.consum.base.pojo.request.ProcureModelInfoParam; |
| | | import com.consum.base.pojo.response.FormTransferVO; |
| | | import com.consum.base.pojo.response.FromTransferTemplateInfoVO; |
| | | import com.consum.base.pojo.response.LWHFromTransferExtendVO; |
| | | import com.consum.base.pojo.response.TransferInfoVO; |
| | | import com.consum.base.service.BaseGoodsModelsServiceImpl; |
| | | import com.consum.base.service.BaseWarehouseServiceImpl; |
| | | import com.consum.base.service.LWhFormTransferCoreService; |
| | | import com.consum.base.service.LWhFormTransferServiceImpl; |
| | | import com.consum.base.service.LWhProcureModelService; |
| | | import com.consum.base.service.LWhProcureModelUserRecordServiceImpl; |
| | | import com.consum.base.service.LWhProcureModelUserServiceImpl; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormTransfer; |
| | | import com.consum.model.po.LWhProcureModelUser; |
| | | import com.consum.model.po.LWhProcureModelUserRecord; |
| | | import com.consum.base.service.*; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.vo.LWhFormOutputVo; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.lang.reflect.Field; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Description 调拨管理 |
| | |
| | | } |
| | | try { |
| | | Field fieldDatas = GenericPager.class.getDeclaredField("datas"); |
| | | fieldDatas.setAccessible(true); |
| | | fieldDatas.set(genericPager, result); |
| | | // fieldDatas.setAccessible(true); |
| | | // fieldDatas.set(genericPager, result); |
| | | ReflectUtil.setFieldValue(genericPager, fieldDatas, result); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
New file |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.service.LWhGoodsService; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.walker.web.ResponseValue; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @ClassName LWhHomeStatisticsController |
| | | * @Author cy |
| | | * @Date 2023/11/27 |
| | | * @Description |
| | | * @Version 1.0 |
| | | **/ |
| | | |
| | | @RestController |
| | | @RequestMapping("/pc/warehouse/homeStatistics") |
| | | @Api(value = "首页统计", tags = "首页统计") |
| | | public class LWhHomeStatisticsController extends BaseController { |
| | | @Resource |
| | | private LWhGoodsService lWhGoodsService; |
| | | |
| | | /** |
| | | * 物品数量金额统计 |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping("getGoodsNumPrice") |
| | | public ResponseValue goodsNumPrice() { |
| | | /*当前登录人只能看到自己机构下的列表*/ |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | String tenantId = sysInfo.getTenantId(); |
| | | List<Map<String, Object>> goodsNumPrice = lWhGoodsService.getGoodsNumPrice(Convert.toLong(tenantId, 0l)); |
| | | return ResponseValue.success(goodsNumPrice.get(0)); |
| | | } |
| | | } |
| | |
| | | @PostMapping("/add") |
| | | public ResponseValue add() throws Exception { |
| | | WhWarningConfigParam param = CommonUtil.getObjFromReqBody(WhWarningConfigParam.class); |
| | | WhWarningConfigParam param2 = new WhWarningConfigParam(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | String modelConfigStr = param.getModelConfigStr(); |
| | | Long baseWarehouseId = param.getBaseWarehouseId(); |
| | | Long baseGoodsTemplateId = param.getBaseGoodsTemplateId(); |
| | |
| | | @PostMapping("/upd") |
| | | public ResponseValue upd() { |
| | | WhWarningConfig param = CommonUtil.getObjFromReqBody(WhWarningConfig.class); |
| | | WhWarningConfig param2 = new WhWarningConfig(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | if (param.getId() == null || (param.getUpperLimit() == null && param.getLowerLimit() == null)) { |
| | | return ResponseValue.error("库存上限、下限不能全为空!"); |
| | | } |
| | |
| | | @DeleteMapping("del") |
| | | public ResponseValue delById() { |
| | | WhWarningConfig param = CommonUtil.getObjFromReqBody(WhWarningConfig.class); |
| | | WhWarningConfig param2 = new WhWarningConfig(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | if (param.getId() == null) { |
| | | return ResponseValue.error("id为空"); |
| | | } |
| | |
| | | @GetMapping("/getList") |
| | | public ResponseValue getConfigList() { |
| | | WhWarningConfigQry param = CommonUtil.getObjFromReq(WhWarningConfigQry.class); |
| | | WhWarningConfigQry param2 = new WhWarningConfigQry(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | /*当前登录人只能看到自己机构下的列表*/ |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | String tenantId = sysInfo.getTenantId(); |
| | |
| | | @GetMapping("/getById") |
| | | public ResponseValue getById() { |
| | | WhWarningConfig param = CommonUtil.getObjFromReq(WhWarningConfig.class); |
| | | WhWarningConfig param2 = new WhWarningConfig(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | WhWarningConfig whWarningConfig = lWhWarningConfigService.get(param); |
| | | return ResponseValue.success(whWarningConfig); |
| | | } |
| | | |
| | | @GetMapping("/getConfigList") |
| | | public ResponseValue getConfigList(WhWarningConfig param) { |
| | | public ResponseValue getWarnConfigList() { |
| | | WhWarningConfig param = CommonUtil.getObjFromReq(WhWarningConfig.class); |
| | | WhWarningConfig param2 = new WhWarningConfig(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | if (param.getBaseWarehouseId() == null || param.getWarehouseType() == null || (param.getBaseGoodsModelsId() == null || param.getBaseGoodsTemplateId() == null)) { |
| | | return ResponseValue.error("缺少必要参数"); |
| | | } |
| | |
| | | @GetMapping("/getList") |
| | | public ResponseValue getList() { |
| | | WhWarningQry param = CommonUtil.getObjFromReq(WhWarningQry.class); |
| | | WhWarningQry param2 = new WhWarningQry(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | /*当前登录人只能看到自己机构下的列表*/ |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | String tenantId = sysInfo.getTenantId(); |
| | |
| | | @GetMapping("/handerChenKuCun") |
| | | public ResponseValue handerChenKuCun() { |
| | | WhWarningQry param = CommonUtil.getObjFromReq(WhWarningQry.class); |
| | | WhWarningQry param2 = new WhWarningQry(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | long dealTime = DateUtils.getDateTimeNumber(System.currentTimeMillis()); |
| | | |
| | |
| | | package com.consum.base.core.utils; |
| | | |
| | | import cn.hutool.core.util.ReflectUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.util.HashMap; |
| | | import java.util.Iterator; |
| | | import java.util.Map; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | @Slf4j |
| | | public class MapUtils { |
| | |
| | | T obj = clazz.newInstance(); |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | Field field = clazz.getDeclaredField(entry.getKey()); |
| | | field.setAccessible(true); |
| | | field.set(obj, entry.getValue()); |
| | | // field.setAccessible(true); |
| | | // field.set(obj, entry.getValue()); |
| | | ReflectUtil.setFieldValue(obj, field, entry.getValue()); |
| | | } |
| | | return obj; |
| | | } catch (InstantiationException | IllegalAccessException | NoSuchFieldException e) { |
| | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.util.List; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "新增报废单信息") |
| | |
| | | */ |
| | | @ApiModelProperty(value = "机构id") |
| | | private Long agencyId; |
| | | |
| | | @ApiModelProperty(value = "部门id") |
| | | private Long departmentId; |
| | | |
| | | /** |
| | | * 仓库编号 |
| | | */ |
| | |
| | | private Long agencyId; |
| | | |
| | | @ApiModelProperty("仓库类型") |
| | | private Long warehouseType; |
| | | private Short warehouseType; |
| | | |
| | | @ApiModelProperty("仓库id") |
| | | private Long warehouseId; |
| | |
| | | @ApiModelProperty("状态(1=未查看;2=已查看)") |
| | | private Integer states; |
| | | |
| | | @ApiModelProperty("预警类型(1=超上限;2=超下限)") |
| | | private Short warningType; |
| | | |
| | | @ApiModelProperty(value = "每页显示条数") |
| | | private Integer pageSize = 10; |
| | | |
| | |
| | | @Service |
| | | public class FinWarehouseLedgerServiceImpl extends BaseServiceImpl { |
| | | |
| | | private static 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_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"; |
| | | |
| | | public GenericPager<Map<String, Object>> ledgerList(LWhLedgerQry param) { |
| | | StringBuilder sql = new StringBuilder(LEDGER_LIST_QUERY_PREFIX); |
| | |
| | | sql.append(" AND goods.COST_TYPE=:costType"); |
| | | paramts.put("costType", param.getCostType()); |
| | | } |
| | | sql.append(" 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"); |
| | | sql.append(LEDGER_LIST_QUERY_GROUP); |
| | | 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"; |
| | | |
| | | public GenericPager<Map<String, Object>> departLedgerList(LWhLedgerQry param) { |
| | | StringBuilder sql = new StringBuilder(DEPART_LEDGER_LIST_QUERY_PREFIX); |
| | | Map<String, Object> paramts = new HashMap<>(); |
| | | //状态(0=在途调拨;1=入库未分发;2=已下发;3=报废 4 零星出库) |
| | | if (param.getStates() != null) { |
| | | sql.append(" and goods.states = :states"); |
| | | paramts.put("states", param.getStates()); |
| | | } |
| | | //机构 |
| | | if (param.getAgencyId() != null) { |
| | | sql.append(" and left(ware.AGENCY_ID, length(:lengthAgencyId)) = :agencyId"); |
| | | paramts.put("lengthAgencyId", param.getAgencyId()); |
| | | paramts.put("agencyId", param.getAgencyId()); |
| | | } |
| | | //仓库类型 |
| | | if (param.getWarehouseType() != null) { |
| | | sql.append(" AND goods.WAREHOUSE_TYPE = :warehouseType"); |
| | | paramts.put("warehouseType", param.getWarehouseType()); |
| | | } |
| | | if (param.getWarehouseId() != null) { |
| | | sql.append(" AND goods.WAREHOUSE_ID = :warehouseId"); |
| | | paramts.put("warehouseId", param.getWarehouseId()); |
| | | } |
| | | //物品名称 |
| | | if (StringUtils.isNotEmpty(param.getGoodsTemplateName())) { |
| | | sql.append(" AND goods.GOODS_TEMPLATE_NAME like :goodsTemplateName"); |
| | | paramts.put("goodsTemplateName", StringUtils.CHAR_PERCENT + param.getGoodsTemplateName() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | if (param.getGoodsTemplateId() != null) { |
| | | sql.append(" AND goods.BASE_GOODS_TEMPLATE_ID=:goodsTemplateId"); |
| | | paramts.put("goodsTemplateId", param.getGoodsTemplateId()); |
| | | } |
| | | //分类 |
| | | if (param.getCategoryId() != null) { |
| | | sql.append(" AND goodsTemp.CATEGORY_ID=:categoryId"); |
| | | paramts.put("categoryId", param.getCategoryId()); |
| | | } |
| | | //价值类型 |
| | | if (param.getCostType() != null) { |
| | | sql.append(" AND goods.COST_TYPE=:costType"); |
| | | paramts.put("costType", param.getCostType()); |
| | | } |
| | | sql.append(DEPART_LEDGER_LIST_QUERY_GROUP); |
| | | return selectSplit(sql.toString(), paramts, param.getPageNum(), param.getPageSize(), new MapperUtil()); |
| | | } |
| | | } |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | return update(sql.toString(), params.toArray()); |
| | | } |
| | | |
| | | private static String GOODS_NUM_PRICE = "SELECT t.tenantId,count(id) total_Num,count(CASE WHEN STATES=2 THEN 1 END) xia_fa_num,IFNULL(round(sum(PRICE)/1000000,2),0) total_price,IFNULL(ROUND(count(CASE WHEN STATES=2 THEN 1 END)/count(id),4),0)*100 AS zhan_you_percent,count(CASE COST_TYPE WHEN 1 THEN 1 END) a_total_Num,count(CASE COST_TYPE WHEN 2 THEN 1 END) b_total_Num,count(CASE COST_TYPE WHEN 3 THEN 1 END) c_total_Num FROM (SELECT tCangKu.tenantId,tKuCun.id,tKuCun.STATES,tKuCun.COST_TYPE,tKuCun.price FROM (SELECT tenant.id tenantId,tenant.NAME AS org_name,ware.*FROM fin_sys_tenant tenant RIGHT JOIN ( SELECT 0 WAREHOUSE_TYPE,id,AGENCY_ID,WAREHOUSE_NAME FROM BASE_WAREHOUSE UNION ALL SELECT 1 WAREHOUSE_TYPE,id,TENANT_ID AGENCY_ID,`NAME` WAREHOUSE_NAME FROM fin_sys_tenant_department) ware ON tenant.id=ware.AGENCY_ID WHERE 1=1 "; |
| | | private static String GOODS_NUM_PRICE_END = ") tCangKu LEFT JOIN L_WH_GOODS tKuCun ON tCangKu.WAREHOUSE_TYPE=tKuCun.WAREHOUSE_TYPE AND tCangKu.id=tKuCun.WAREHOUSE_ID AND tKuCun.STATES BETWEEN 1 AND 2) t GROUP BY t.tenantId"; |
| | | |
| | | //机构 |
| | | public List<Map<String, Object>> getGoodsNumPrice(Long agencyId) { |
| | | StringBuilder sql = new StringBuilder(GOODS_NUM_PRICE); |
| | | Map<String, Object> paramts = new HashMap<>(); |
| | | sql.append(" and tenant.id=:agencyId"); |
| | | paramts.put("agencyId", agencyId); |
| | | return select(sql.append(GOODS_NUM_PRICE_END).toString(), paramts, new MapperUtil()); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | //机构 |
| | | if (param.getAgencyId() != null) { |
| | | sql.append(" and left(ware.AGENCY_ID, length(:lengthAgencyId)) = :agencyId"); |
| | | paramts.put("lengthAgencyId", param.getAgencyId()); |
| | | sql.append(" and ware.AGENCY_ID=:agencyId"); |
| | | // paramts.put("lengthAgencyId", param.getAgencyId()); |
| | | paramts.put("agencyId", param.getAgencyId()); |
| | | } |
| | | //仓库类型 |
| | |
| | | sql.append(" AND cate.CLASSIFICATION=':costType'"); |
| | | paramts.put("costType", costType); |
| | | } |
| | | if (param.getWarningType() != null) { |
| | | sql.append(" AND wareWarn.WARNING_TYPE=:warningType"); |
| | | paramts.put("warningType", param.getWarningType()); |
| | | } |
| | | |
| | | sql.append(" ORDER BY wareWarn.DEAL_TIME DESC "); |
| | | |
| | |
| | | public static final String AgentJid = "agent_jid"; |
| | | public static final String WorkgroupJid = "workgroup_jid"; |
| | | public static final String ClientNumber = "client_number"; |
| | | public static final String ClientPwd = "client_pwd"; |
| | | public static final String ClientPd = "client_pwd"; |
| | | public static final String TenantName = "tenant_name"; |
| | | public static final String Lv = "lv"; |
| | | public static final String SupplierId = "supplier_Id"; |
| | |
| | | ib.set(AgentJid, this.getAgentJid(), this.isset_agentJid); |
| | | ib.set(WorkgroupJid, this.getWorkgroupJid(), this.isset_workgroupJid); |
| | | ib.set(ClientNumber, this.getClientNumber(), this.isset_clientNumber); |
| | | ib.set(ClientPwd, this.getClientPwd(), this.isset_clientPwd); |
| | | ib.set(ClientPd, this.getClientPwd(), this.isset_clientPwd); |
| | | return ib.genMapSql(); |
| | | } |
| | | |
| | |
| | | ub.set(AgentJid, this.getAgentJid(), this.isset_agentJid); |
| | | ub.set(WorkgroupJid, this.getWorkgroupJid(), this.isset_workgroupJid); |
| | | ub.set(ClientNumber, this.getClientNumber(), this.isset_clientNumber); |
| | | ub.set(ClientPwd, this.getClientPwd(), this.isset_clientPwd); |
| | | ub.set(ClientPd, this.getClientPwd(), this.isset_clientPwd); |
| | | ub.where(this.getPkName_(), this.getPkValue_()); |
| | | return ub.genMapSql(); |
| | | } |
| | |
| | | ub.set(AgentJid, this.getAgentJid(), this.isset_agentJid); |
| | | ub.set(WorkgroupJid, this.getWorkgroupJid(), this.isset_workgroupJid); |
| | | ub.set(ClientNumber, this.getClientNumber(), this.isset_clientNumber); |
| | | ub.set(ClientPwd, this.getClientPwd(), this.isset_clientPwd); |
| | | ub.set(ClientPd, this.getClientPwd(), this.isset_clientPwd); |
| | | return ub.genMapSql(where, parameters); |
| | | } |
| | | |
| | |
| | | ub.set(AgentJid, this.getAgentJid(), this.isset_agentJid); |
| | | ub.set(WorkgroupJid, this.getWorkgroupJid(), this.isset_workgroupJid); |
| | | ub.set(ClientNumber, this.getClientNumber(), this.isset_clientNumber); |
| | | ub.set(ClientPwd, this.getClientPwd(), this.isset_clientPwd); |
| | | ub.set(ClientPd, this.getClientPwd(), this.isset_clientPwd); |
| | | return ub.genArraySql(where, parameters); |
| | | } |
| | | |
| | |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_user.setClientNumber(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantUser_mapper.ClientPwd); |
| | | columnIndex = resultSetUtils.findColumn(rs, FinSysTenantUser_mapper.ClientPd); |
| | | if (columnIndex > 0) { |
| | | fin_sys_tenant_user.setClientPwd(rs.getString(columnIndex)); |
| | | } |
| | |
| | | <!-- <groupId>com.iplatform</groupId>--> |
| | | <!-- <artifactId>iplatform-report</artifactId>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!-- 配置文件加密 --> |
| | | <dependency> |
| | | <groupId>com.github.ulisesbocchio</groupId> |
| | | <artifactId>jasypt-spring-boot-starter</artifactId> |
| | | <version>2.1.0</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | package com.consum.test; |
| | | |
| | | import com.consum.ConsumApplication; |
| | | import com.consum.base.core.CodeGeneratorEnum; |
| | | import com.consum.base.core.CodeGeneratorService; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = {ConsumApplication.class}) |
| | | public class CodeGeneratorServiceTest { |
| | | |
| | | @Autowired |
| | | private CodeGeneratorService service; |
| | | |
| | | @Test |
| | | public void createWarehouseCode(){ |
| | | for (int i=0;i<5;i++){ |
| | | String code =service.createWarehouseCode(); |
| | | System.out.println(code); |
| | | } |
| | | } |
| | | |
| | | //package com.consum.test; |
| | | // |
| | | //import com.consum.ConsumApplication; |
| | | //import com.consum.base.core.CodeGeneratorEnum; |
| | | //import com.consum.base.core.CodeGeneratorService; |
| | | //import org.junit.Test; |
| | | //import org.junit.runner.RunWith; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.boot.test.context.SpringBootTest; |
| | | //import org.springframework.test.context.junit4.SpringRunner; |
| | | // |
| | | // |
| | | //@RunWith(SpringRunner.class) |
| | | //@SpringBootTest(classes = {ConsumApplication.class}) |
| | | //public class CodeGeneratorServiceTest { |
| | | // |
| | | // @Autowired |
| | | // private CodeGeneratorService service; |
| | | // |
| | | // @Test |
| | | // public void createGoodsTemplateCode(){ |
| | | // String[] prefixs = new String[] {"A","B","C","A","B"}; |
| | | // int[] leis = new int[]{1,2,2,1,2}; |
| | | // public void createWarehouseCode(){ |
| | | // for (int i=0;i<5;i++){ |
| | | // String code =service.createWarehouseCode(); |
| | | // System.out.println(code); |
| | | // } |
| | | // } |
| | | // |
| | | //// @Test |
| | | //// public void createGoodsTemplateCode(){ |
| | | //// String[] prefixs = new String[] {"A","B","C","A","B"}; |
| | | //// int[] leis = new int[]{1,2,2,1,2}; |
| | | //// for (int i=0;i<5;i++){ |
| | | //// String code =service.createGoodsTemplateCode(prefixs[i],leis[i]); |
| | | //// System.out.println(code); |
| | | //// } |
| | | //// } |
| | | // |
| | | // @Test |
| | | // public void createBusinessFormCode(){ |
| | | // for (int i=0;i<5;i++){ |
| | | // String code =service.createGoodsTemplateCode(prefixs[i],leis[i]); |
| | | // String code =service.createBusinessFormCode(CodeGeneratorEnum.Transfer); |
| | | // System.out.println(code); |
| | | // } |
| | | // } |
| | | |
| | | @Test |
| | | public void createBusinessFormCode(){ |
| | | for (int i=0;i<5;i++){ |
| | | String code =service.createBusinessFormCode(CodeGeneratorEnum.Transfer); |
| | | System.out.println(code); |
| | | } |
| | | } |
| | | |
| | | } |
| | | // |
| | | //} |
| | |
| | | package com.consum.test.base; |
| | | |
| | | import com.consum.ConsumApplication; |
| | | import com.consum.base.core.data.Base_CategoryService; |
| | | import com.consum.model.po.BaseCategory; |
| | | import com.walker.infrastructure.utils.NumberGenerator; |
| | | import com.walker.jdbc.BaseDao; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = {ConsumApplication.class}) |
| | | public class Base_Category { |
| | | @Autowired |
| | | private Base_CategoryService service; |
| | | |
| | | @Test |
| | | public void addFirstCategory(){ |
| | | for (int ii =0;ii <10;ii++){ |
| | | Long id = NumberGenerator.getLongSequenceNumber(); |
| | | for (int i=0;i<1000;i++){ |
| | | service.addFirstCategory(id); |
| | | } |
| | | } |
| | | } |
| | | @Test |
| | | public void addSecondCategory(){ |
| | | service.addSecondCategory(12624043866144l); |
| | | } |
| | | @Test |
| | | public void addThirdCategory(){ |
| | | service.addThirdCategory(12838134761035l); |
| | | } |
| | | } |
| | | //package com.consum.test.base; |
| | | // |
| | | //import com.consum.ConsumApplication; |
| | | //import com.consum.base.core.data.Base_CategoryService; |
| | | //import com.consum.model.po.BaseCategory; |
| | | //import com.walker.infrastructure.utils.NumberGenerator; |
| | | //import com.walker.jdbc.BaseDao; |
| | | //import org.junit.Test; |
| | | //import org.junit.runner.RunWith; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.boot.test.context.SpringBootTest; |
| | | //import org.springframework.test.context.junit4.SpringRunner; |
| | | // |
| | | //@RunWith(SpringRunner.class) |
| | | //@SpringBootTest(classes = {ConsumApplication.class}) |
| | | //public class Base_Category { |
| | | // @Autowired |
| | | // private Base_CategoryService service; |
| | | // |
| | | // @Test |
| | | // public void addFirstCategory(){ |
| | | // for (int ii =0;ii <10;ii++){ |
| | | // Long id = NumberGenerator.getLongSequenceNumber(); |
| | | // for (int i=0;i<1000;i++){ |
| | | // service.addFirstCategory(id); |
| | | // } |
| | | // } |
| | | // } |
| | | // @Test |
| | | // public void addSecondCategory(){ |
| | | // service.addSecondCategory(12624043866144l); |
| | | // } |
| | | // @Test |
| | | // public void addThirdCategory(){ |
| | | // service.addThirdCategory(12838134761035l); |
| | | // } |
| | | //} |
| | |
| | | package com.consum.test; |
| | | |
| | | /** |
| | | * 测试多线程并发 |
| | | */ |
| | | public class synchronizedCode implements Runnable { |
| | | |
| | | static synchronizedCode instance = new synchronizedCode(); |
| | | static int i = 0; |
| | | |
| | | static String key = "1"; |
| | | |
| | | public static void main(String[] args) throws InterruptedException { |
| | | for (int j=0;j<5;j++){ |
| | | Thread t1 = new Thread(instance); |
| | | t1.start(); |
| | | } |
| | | |
| | | System.out.println("线程执行结束"); |
| | | } |
| | | |
| | | @Override |
| | | public void run() { |
| | | |
| | | String myKey; |
| | | if (key == "1"){ |
| | | myKey = "def"; |
| | | key = "2"; |
| | | } else { |
| | | myKey = "abc"; |
| | | key="1"; |
| | | } |
| | | |
| | | System.out.println(Thread.currentThread().getName() + ":" + myKey); |
| | | |
| | | synchronized (myKey){ |
| | | System.out.println(Thread.currentThread().getName() + "开始运行"); |
| | | try { |
| | | Thread.sleep(3000); |
| | | } catch (InterruptedException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | System.out.println("我叫"+ Thread.currentThread().getName()+"运行结束"); |
| | | } |
| | | } |
| | | } |
| | | //package com.consum.test; |
| | | // |
| | | ///** |
| | | // * 测试多线程并发 |
| | | // */ |
| | | //public class synchronizedCode implements Runnable { |
| | | // |
| | | // static synchronizedCode instance = new synchronizedCode(); |
| | | // static int i = 0; |
| | | // |
| | | // static String key = "1"; |
| | | // |
| | | // public static void main(String[] args) throws InterruptedException { |
| | | // for (int j=0;j<5;j++){ |
| | | // Thread t1 = new Thread(instance); |
| | | // t1.start(); |
| | | // } |
| | | // |
| | | // System.out.println("线程执行结束"); |
| | | // } |
| | | // |
| | | // @Override |
| | | // public void run() { |
| | | // |
| | | // String myKey; |
| | | // if (key == "1"){ |
| | | // myKey = "def"; |
| | | // key = "2"; |
| | | // } else { |
| | | // myKey = "abc"; |
| | | // key="1"; |
| | | // } |
| | | // |
| | | // System.out.println(Thread.currentThread().getName() + ":" + myKey); |
| | | // |
| | | // synchronized (myKey){ |
| | | // System.out.println(Thread.currentThread().getName() + "开始运行"); |
| | | // try { |
| | | // Thread.sleep(3000); |
| | | // } catch (InterruptedException e) { |
| | | // // TODO Auto-generated catch block |
| | | // e.printStackTrace(); |
| | | // } |
| | | // System.out.println("我叫"+ Thread.currentThread().getName()+"运行结束"); |
| | | // } |
| | | // } |
| | | //} |
| | |
| | | # 数据库链接 |
| | | dataBaseName: low_consum_manage_dev |
| | | username: root |
| | | password: Bjjmy_2020 |
| | | # Bjjmy_2020 |
| | | password: ENC(V7lFKlYcHfEzTbXsbBQhSUswgxLsbS5z) |
| | | url: jdbc:mysql://116.198.40.76:3306/${spring.datasource.dataBaseName}?useUnicode=true&characterEncoding=UTF-8&useSSL=false |
| | | # Druid连接池 |
| | | type: com.walker.jdbc.ds.MyDruidDataSource |
| | |
| | | host: 116.198.40.76 |
| | | port: 6379 |
| | | database: 11 |
| | | password: Jmy2019. |
| | | password: ENC(C40h1dp9Q1oLqdU+JUGSBOWUfOmj/ZO4) #Jmy2019. |
| | | |
| | | mvc: |
| | | pathmatch: |
| | |
| | | # - /api/** |
| | | |
| | | # 超级管理员密码,加密后的秘文 |
| | | supervisor-password: $2a$10$9lSwwUFMULR6/KhPsUbTj.0PTZfTnq0fB3OtS6PWoKAibpa8hL1cy |
| | | |
| | | supervisor-password: ENC(cDkgI4dm/vDXFDsDm5KJW23i5zAAUxIUW448ReA27tmgQ83ZLgO3k/YMK5+wIiuGDKPDIXUH9/irgKTLMKl7n7mP6XRgBnOf) |
| | | # supervisor-password: $2a$10$9lSwwUFMULR6/KhPsUbTj.0PTZfTnq0fB3OtS6PWoKAibpa8hL1cy |
| | | # 是否允许配置跨域响应头, true 启用, false 不启用。2022-12-28 |
| | | # 在Gateway模式中,需要关闭跨域配置,因为网关也会配置。 |
| | | cors-enabled: true |
| | |
| | | ip: 116.198.40.76 |
| | | port: 22 |
| | | user-name: mysftp |
| | | password: Bjjmy_2020 |
| | | password: ENC(kEQ43JzZv6yOOmbmKNLWmsU/wQKTwA9x) |
| | | private-key: |
| | | # ftp服务上面的存储根路径,只能是linux路径 |
| | | file-root: /progress/ |
| | |
| | | # 邮件通知发送信息配置,2023-04-26 |
| | | mail-server: smtp.126.com |
| | | mail-from: hnzzzhsl@126.com |
| | | mail-password: test |
| | | mail-password: ENC(hjRDRcQmmhpUICkAaJnXUQ==) |
| | |
| | | show-sql: true |
| | | # 数据库链接 |
| | | username: root |
| | | password: Bjjmy_2020 |
| | | dataBaseName: low_consum_manage_dev |
| | | password: ENC(Zw99rAYSpDE2VCWJjC+C8hFAOItlbiSZ) |
| | | dataBaseName: low_consum_manage |
| | | url: jdbc:mysql://192.200.0.49:3306/${spring.datasource.dataBaseName}?useUnicode=true&characterEncoding=UTF-8&useSSL=false |
| | | # Druid连接池 |
| | | type: com.walker.jdbc.ds.MyDruidDataSource |
| | |
| | | host: 192.200.0.49 |
| | | port: 6379 |
| | | database: 11 |
| | | password: Jmy2019. |
| | | password: ENC(1IxlpqZ3ykMIWVknDjVydrCpK/6nccv/) #Jmy2019. |
| | | |
| | | mvc: |
| | | pathmatch: |
| | |
| | | # - /api/** |
| | | |
| | | # 超级管理员密码,加密后的秘文 |
| | | supervisor-password: $2a$10$9lSwwUFMULR6/KhPsUbTj.0PTZfTnq0fB3OtS6PWoKAibpa8hL1cy |
| | | supervisor-password: ENC(cDkgI4dm/vDXFDsDm5KJW23i5zAAUxIUW448ReA27tmgQ83ZLgO3k/YMK5+wIiuGDKPDIXUH9/irgKTLMKl7n7mP6XRgBnOf) |
| | | # supervisor-password: $2a$10$9lSwwUFMULR6/KhPsUbTj.0PTZfTnq0fB3OtS6PWoKAibpa8hL1cy |
| | | |
| | | # 是否允许配置跨域响应头, true 启用, false 不启用。2022-12-28 |
| | | # 在Gateway模式中,需要关闭跨域配置,因为网关也会配置。 |
| | |
| | | ip: 192.200.0.28 |
| | | port: 22 |
| | | user-name: mysftp |
| | | password: Jmy@2023 |
| | | password: ENC(3o6p8lx7FWgH1Zi6gZ7ruZnt2geVGiC/) |
| | | private-key: |
| | | # ftp服务上面的存储根路径,只能是linux路径 |
| | | file-root: /lowconsum/ |
| | |
| | | # 邮件通知发送信息配置,2023-04-26 |
| | | mail-server: smtp.126.com |
| | | mail-from: hnzzzhsl@126.com |
| | | mail-password: test |
| | | mail-password: ENC(hjRDRcQmmhpUICkAaJnXUQ==) |