| | |
| | | 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.vo.BaseGoodsTemplateVo; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.web.ResponseValue; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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.*; |
| | | |
| | | 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; |
| | | |
| | | /** |
| | | * @Description 物品模板 |
| | |
| | | */ |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody BaseGoodsTemplateParam param) { |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (param.getCategoryId() == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | if (param.getCategoryId() == null) { |
| | | return ResponseValue.error("分类为空"); |
| | | } |
| | |
| | | return ResponseValue.error("物品名称已存在"); |
| | | } |
| | | |
| | | int result = this.baseGoodsTemplateService.add(param, this.getCurrentUser()); |
| | | int result = this.baseGoodsTemplateService.add(param, sysInfo); |
| | | if (result > 0) { |
| | | return ResponseValue.success(1); |
| | | } |
| | |
| | | */ |
| | | @GetMapping("/list") |
| | | public ResponseValue queryList(BaseGoodsTemplateParam param) { |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | param.setAgencyId(Long.valueOf(sysInfo.getTenantId())); |
| | | GenericPager<BaseGoodsTemplate> pager = this.baseGoodsTemplateService.queryList(param); |
| | | return ResponseValue.success(pager); |
| | | } |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("categoryId", categoryId); |
| | | |
| | | List<BaseWarehouse> baseWarehouseList = baseWarehouseService.getByAgencyId(agencyId,(short)1,(short)1); |
| | | if (CollectionUtils.isEmpty(baseWarehouseList)){ |
| | | List<BaseWarehouse> baseWarehouseList = baseWarehouseService.getByAgencyId(agencyId, (short) 1, (short) 1); |
| | | if (CollectionUtils.isEmpty(baseWarehouseList)) { |
| | | return ResponseValue.error("机构无默认仓库!"); |
| | | |
| | | } |
| | |
| | | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.pojo.BaseWarehouseParam; |
| | | import com.consum.base.pojo.query.WarehouseQry; |
| | | import com.consum.base.service.BaseWarehouseServiceImpl; |
| | | import com.consum.base.service.LWhGoodsService; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.web.ResponseValue; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | 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; |
| | | |
| | | /** |
| | | * @Description 仓库管理 |
| | |
| | | |
| | | @Autowired |
| | | private BaseWarehouseServiceImpl baseWarehouseService; |
| | | @Autowired |
| | | private LWhGoodsService lWhGoodsService; |
| | | |
| | | |
| | | /** |
| | | * @Description 新增 |
| | |
| | | */ |
| | | @GetMapping("/list") |
| | | public ResponseValue queryList(BaseWarehouseParam param) { |
| | | // FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | // if (sysInfo == null) { |
| | | // return ResponseValue.error("登录用户信息不存在"); |
| | | // } |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | param.setAgencyId(Long.valueOf(sysInfo.getTenantId())); |
| | | GenericPager<BaseWarehouse> pager = this.baseWarehouseService.queryList(param); |
| | | return ResponseValue.success(pager); |
| | | } |
| | |
| | | // if (agencyId == null) { |
| | | // return ResponseValue.error("机构id为空"); |
| | | // } |
| | | List<BaseWarehouse> list = this.baseWarehouseService.getByAgencyId(agencyId,null,null); |
| | | List<BaseWarehouse> list = this.baseWarehouseService.getByAgencyId(agencyId, null, null); |
| | | if (list == null) { |
| | | return ResponseValue.error("查询失败!"); |
| | | } |
| | | return ResponseValue.success("查询成功!", list); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据仓库id和型号id 查询库存", notes = "根据仓库id和型号id 查询库存") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "warehouseQry", value = "仓库id和型号id", required = true, dataType = "WarehouseQry", paramType = "query") |
| | | }) |
| | | @GetMapping("/select/number") |
| | | public ResponseValue selectNumber(@Validated WarehouseQry warehouseQry) { |
| | | Long warehouseId = warehouseQry.getWarehouseId(); |
| | | if (warehouseId == null) { |
| | | Long agencyId = warehouseQry.getAgencyId(); |
| | | BaseWarehouse defaultWarehouseByAgencyId = this.baseWarehouseService.getDefaultWarehouseByAgencyId(agencyId); |
| | | warehouseId = defaultWarehouseByAgencyId.getId(); |
| | | } |
| | | Long baseGoodsModelsId = warehouseQry.getBaseGoodsModelsId(); |
| | | Integer warehouseType = warehouseQry.getWarehouseType(); |
| | | Integer states = warehouseQry.getStates(); |
| | | Integer buyType = warehouseQry.getBuyType(); |
| | | |
| | | int num = this.lWhGoodsService.queryGoodsModelNum(warehouseType, warehouseId, baseGoodsModelsId, 1, buyType); |
| | | return ResponseValue.success(num); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.pojo.WarehouseManagerParam; |
| | | import com.consum.base.service.BaseWarehouseManagerServiceImpl; |
| | | import com.consum.model.po.BaseWarehouseManager; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.walker.web.ResponseValue; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.List; |
| | | 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; |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | * <p> |
| | | * todo 库管员 |
| | | */ |
| | | @Api(value = "库管员", tags = "库管员") |
| | | @RestController |
| | | @RequestMapping("/pc/base/warehouse/manager") |
| | | public class BaseWarehouseManagerController extends BaseController { |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody BaseWarehouseManager baseWarehouseManager) { |
| | | int result = this.baseWarehouseManagerService.add(baseWarehouseManager); |
| | | if (result > 0) { |
| | | return ResponseValue.success(1); |
| | | @ApiOperation(value = "新增", notes = "新增") |
| | | @ApiImplicitParam(name = "warehouseManagerParam", value = "库管员信息", required = true, dataType = "WarehouseManagerParam", paramType = "body") |
| | | @PostMapping("/save") |
| | | public ResponseValue add(@RequestBody WarehouseManagerParam warehouseManagerParam) throws Exception { |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("请先登录"); |
| | | } |
| | | return ResponseValue.error("新增失败!"); |
| | | this.baseWarehouseManagerService.add(warehouseManagerParam); |
| | | return ResponseValue.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询", notes = "查询") |
| | | @ApiImplicitParam(name = "warehouseId", value = "仓库id", required = true, dataType = "Long") |
| | | @GetMapping("/list") |
| | | public ResponseValue select(Long warehouseId) { |
| | | BaseWarehouseManager baseWarehouseManager = new BaseWarehouseManager(); |
| | | baseWarehouseManager.setBaseWarehouseId(warehouseId); |
| | | List<BaseWarehouseManager> select = this.baseWarehouseManagerService.select(baseWarehouseManager); |
| | | return ResponseValue.success(select); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import com.consum.base.pojo.FinSysTenantDepartmentParam; |
| | | import com.consum.base.service.FinSysTenantDepartmentServiceImpl; |
| | | import com.consum.base.service.FinSysTenantServiceImpl; |
| | | import com.consum.model.po.BaseCategory; |
| | | import com.consum.model.po.FinSysTenant; |
| | | import com.consum.model.po.FinSysTenantDepartment; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | 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.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | 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 部门管理 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @Api(value = "部门管理", tags = "部门管理") |
| | | @RestController |
| | | @RequestMapping("/pc/fin/sys/tenant/department") |
| | | public class FinSysTenantDepartmentController extends BaseController { |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @ApiOperation(value = "新增", notes = "新增") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "param", value = "部门信息", required = true, dataType = "FinSysTenantDepartmentParam") |
| | | }) |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody FinSysTenantDepartmentParam param) { |
| | | if (StringUtils.isEmpty(param.getName())) { |
| | |
| | | return ResponseValue.error("部门编号已存在"); |
| | | } |
| | | //判断同一机构id下 部门名称 是否重复 |
| | | FinSysTenantDepartment department = this.departmentService.getByNameAndTenantId(param.getName(),param.getTenantId()); |
| | | FinSysTenantDepartment department = this.departmentService.getByNameAndTenantId(param.getName(), param.getTenantId()); |
| | | if (department != null) { |
| | | return ResponseValue.error("部门名称已存在"); |
| | | } |
| | | |
| | | int result = this.departmentService.add(param, this.getSysInfo()); |
| | | if (result > 0) return ResponseValue.success(1); |
| | | if (result > 0) { |
| | | return ResponseValue.success(); |
| | | } |
| | | return ResponseValue.error("新增失败!"); |
| | | } |
| | | |
| | |
| | | } |
| | | GenericPager<FinSysTenantDepartment> pager = this.departmentService.queryList(param); |
| | | return ResponseValue.success(pager); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "根据机构id查询所有部门列表信息", notes = "根据机构id查询所有部门列表信息") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "param", value = "部门信息", required = true, dataType = "FinSysTenantDepartmentParam") |
| | | }) |
| | | @GetMapping("/list/all") |
| | | public ResponseValue queryAllDepartment(Long tenantId) { |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | FinSysTenantDepartment finSysTenantDepartment = new FinSysTenantDepartment(); |
| | | finSysTenantDepartment.setTenantId(tenantId); |
| | | List<FinSysTenantDepartment> finSysTenantDepartments = this.departmentService.select(finSysTenantDepartment); |
| | | return ResponseValue.success(finSysTenantDepartments); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | |
| | | int num = this.departmentService.updateFinSysTenantDepartment(department,sysInfo); |
| | | return num > 0 ? ResponseValue.success(1) : ResponseValue.error("编辑失败!"); |
| | | FinSysTenantDepartment tenantDepartment = this.departmentService.selectByCode(department.getCode()); |
| | | if (tenantDepartment != null) { |
| | | return ResponseValue.error("部门编号已存在"); |
| | | } |
| | | int num = this.departmentService.updateFinSysTenantDepartment(department, sysInfo); |
| | | return num > 0 ? ResponseValue.success() : ResponseValue.error("编辑失败!"); |
| | | } |
| | | |
| | | /** |
| | | * 根据部门id查询部门详情 |
| | | * |
| | | * @author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | |
| | | return ResponseValue.error("部门id为空"); |
| | | } |
| | | FinSysTenantDepartment department = this.departmentService.getById(id); |
| | | if (department == null) return ResponseValue.error("查询失败!"); |
| | | if (department == null) { |
| | | return ResponseValue.error("查询失败!"); |
| | | } |
| | | return ResponseValue.success("查询成功!", department); |
| | | } |
| | | |
| | |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | int num = this.departmentService.updateById(department,sysInfo); |
| | | int num = this.departmentService.updateById(department, sysInfo); |
| | | |
| | | return num > 0 ? ResponseValue.success(1) : ResponseValue.error("删除失败!"); |
| | | } |
| | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.pojo.FinSysTenantUserSearchParam; |
| | | import com.consum.base.pojo.FinSysTenantUserUpdParam; |
| | | import com.consum.base.pojo.response.DepartmentVO; |
| | | import com.consum.base.pojo.response.FinSysTenantUserVO; |
| | | import com.consum.base.pojo.response.FinSysTenantVO; |
| | | import com.consum.base.pojo.response.UserVO; |
| | | import com.consum.base.service.FinSysTenantDepartmentServiceImpl; |
| | | import com.consum.base.service.FinSysTenantServiceImpl; |
| | | import com.consum.base.service.FinSysTenantUserServiceImpl; |
| | | import com.consum.model.po.FinSysTenant; |
| | | import com.consum.model.po.FinSysTenantDepartment; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.iplatform.base.ArgumentsConstants; |
| | | import com.iplatform.base.service.DeptServiceImpl; |
| | |
| | | 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.*; |
| | | 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.web.ResponseValue; |
| | | 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.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.*; |
| | | 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.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description 系统用户 |
| | |
| | | |
| | | private RoleServiceImpl roleService; |
| | | |
| | | @Autowired |
| | | private FinSysTenantDepartmentServiceImpl finSysTenantDepartmentService; |
| | | |
| | | |
| | | @Autowired |
| | | public void setUserService(UserServiceImpl userService) { |
| | |
| | | private S_config sConfig; |
| | | |
| | | @Autowired |
| | | public FinSysTenantUserController(FinSysTenantServiceImpl finSysTenantService, FinSysTenantUserServiceImpl finSysTenantUserService, RoleServiceImpl roleService) { |
| | | public FinSysTenantUserController(FinSysTenantServiceImpl finSysTenantService, FinSysTenantUserServiceImpl finSysTenantUserService, |
| | | RoleServiceImpl roleService) { |
| | | this.finSysTenantUserService = finSysTenantUserService; |
| | | this.finSysTenantService = finSysTenantService; |
| | | this.roleService = roleService; |
| | |
| | | } |
| | | GenericPager<FinSysTenantUser> pager = this.finSysTenantUserService.queryAllPageUser(param); |
| | | |
| | | List<FinSysTenantUserVO> resultList = Lists.newArrayList(); |
| | | List<FinSysTenantUser> datas = pager.getDatas(); |
| | | if (datas.size() > 0) { |
| | | for (FinSysTenantUser finSysTenantUser : datas) { |
| | | FinSysTenantUserVO userVO = new FinSysTenantUserVO(); |
| | | if (finSysTenantUser.getUserPhone() != null) { |
| | | // 解密并脱敏 |
| | | String tel = null; |
| | |
| | | } else { |
| | | finSysTenantUser.setIsSupplier("否"); |
| | | } |
| | | BeanUtils.copyProperties(finSysTenantUser, userVO); |
| | | Long sysDeptId = finSysTenantUser.getSysDeptId(); |
| | | FinSysTenantDepartment department = finSysTenantDepartmentService.getById(sysDeptId); |
| | | if (Objects.nonNull(department)) { |
| | | userVO.setSysDeptName(department.getName()); |
| | | } |
| | | resultList.add(userVO); |
| | | } |
| | | } |
| | | |
| | | try { |
| | | Field fieldDatas = GenericPager.class.getDeclaredField("datas"); |
| | | fieldDatas.setAccessible(true); |
| | | fieldDatas.set(pager, resultList); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return ResponseValue.success(pager); |
| | | } |
| | |
| | | user.setUpdateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | user.setUpdateBy(this.getCurrentUser().getUser_name()); |
| | | //user.setStatus(1);// 0禁用 1启用 |
| | | user.setIsDelete(0);// 是否删除 0是 1否 |
| | | user.setIsDelete(0); |
| | | user.setSysUserId(NumberGenerator.getLongSequenceNumber()); |
| | | // 加密手机号 |
| | | String key = PlatformRSAUtils.AES_KEY; |
| | |
| | | pwdPhone = AESUtils.encryptStrAES(user.getUserPhone(), key); |
| | | } |
| | | user.setUserPhone(pwdPhone); |
| | | user.setIsDelete(1); |
| | | //怎么获取左侧机构树数据 |
| | | user.setSysDeptId(3L); //对应平台机构id 默认为平台管理 |
| | | this.finSysTenantUserService.insert(user); |
| | |
| | | } |
| | | |
| | | |
| | | public static class ImportUserParam { |
| | | |
| | | public static class ImportUserParam{ |
| | | @ExcelProperty("用户姓名") |
| | | private String userName; |
| | | @ExcelProperty("用户编号") |
| | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | public String getUserCode() { |
| | | return userCode; |
| | | } |
| | | |
| | | public void setUserCode(String userCode) { |
| | | this.userCode = userCode; |
| | | } |
| | | |
| | | public String getUserPhone() { |
| | | return userPhone; |
| | | } |
| | | |
| | | public void setUserPhone(String userPhone) { |
| | | this.userPhone = userPhone; |
| | | } |
| | | |
| | | public Integer getSex() { |
| | | return sex; |
| | | } |
| | | |
| | | public void setSex(Integer sex) { |
| | | this.sex = sex; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public Long getSeq() { |
| | | return seq; |
| | | } |
| | | |
| | | public void setSeq(Long seq) { |
| | | this.seq = seq; |
| | | } |
| | | |
| | | public String getRoleName() { |
| | | return roleName; |
| | | } |
| | | |
| | | public void setRoleName(String roleName) { |
| | | this.roleName = roleName; |
| | | } |
| | |
| | | * @Date 2023/10/12 15:56 |
| | | */ |
| | | @PostMapping("/import") |
| | | public ResponseValue importUser(@RequestParam String tenantId,@RequestParam String tenantCode,MultipartFile file) throws IOException { |
| | | public ResponseValue importUser(@RequestParam String tenantId, @RequestParam String tenantCode, MultipartFile file) throws IOException { |
| | | String originalFilename = file.getOriginalFilename(); |
| | | if (!"xls".equals(originalFilename.substring(originalFilename.lastIndexOf(".") + 1))){ |
| | | if (!"xls".equals(originalFilename.substring(originalFilename.lastIndexOf(".") + 1))) { |
| | | return ResponseValue.error("文件格式有误!"); |
| | | } |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser==null){ |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("当前登录用户为空"); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(tenantId)||StringUtils.isEmpty(tenantCode)){ |
| | | if (StringUtils.isEmpty(tenantId) || StringUtils.isEmpty(tenantCode)) { |
| | | return ResponseValue.error("添加时请选择区县"); |
| | | } |
| | | |
| | | List<S_role> roles = this.roleService.select(new S_role()); |
| | | ArrayList<FinSysTenantUser> finSysTenantUsers = new ArrayList<>(); |
| | | |
| | | EasyExcel.read(file.getInputStream(), ImportUserParam.class, new AnalysisEventListener<ImportUserParam>(){ |
| | | EasyExcel.read(file.getInputStream(), ImportUserParam.class, new AnalysisEventListener<ImportUserParam>() { |
| | | @Override |
| | | public void invoke(ImportUserParam data, AnalysisContext context) { |
| | | if (StringUtils.isEmpty(data.getUserName()) || StringUtils.isEmpty(data.getUserCode()) || StringUtils.isEmpty(data.getUserPhone()) || null==data.getSex() |
| | | || StringUtils.isEmpty(data.getEmail()) || null==data.getSeq() || StringUtils.isEmpty(data.getRoleName())){ |
| | | if (StringUtils.isEmpty(data.getUserName()) || StringUtils.isEmpty(data.getUserCode()) || StringUtils.isEmpty(data.getUserPhone()) |
| | | || null == data.getSex() || StringUtils.isEmpty(data.getEmail()) || null == data.getSeq() || StringUtils.isEmpty(data.getRoleName())) { |
| | | throw new ImportUserParamVerifyException("单元格不能为空!"); |
| | | } |
| | | //根据员工编号查询,如果存在则提示 |
| | | if ( finSysTenantUserService.getByUserCode(data.getUserCode()) > 0) { |
| | | if (finSysTenantUserService.getByUserCode(data.getUserCode()) > 0) { |
| | | throw new ImportUserParamVerifyException("员工编号为空或已存在!"); |
| | | } |
| | | if (data.getSex()<1&&data.getSex()>0){ |
| | | if (data.getSex() < 1 && data.getSex() > 0) { |
| | | throw new ImportUserParamVerifyException("性别码只能为 0 或 1"); |
| | | } |
| | | FinSysTenantUser user = new FinSysTenantUser(); |
| | |
| | | user.setSysDeptId(3L); //对应平台机构id 默认为平台管理 |
| | | finSysTenantUsers.add(user); |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext context) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onException(Exception exception, AnalysisContext context) throws Exception { |
| | | if (exception!=null){ |
| | | if (exception != null) { |
| | | // 如果是某一个单元格的转换异常 能获取到具体行号 封装时异常 |
| | | if (exception instanceof ExcelDataConvertException) { |
| | | ExcelDataConvertException excelDataConvertException = (ExcelDataConvertException)exception; |
| | | logger.error("第{}行,第{}列解析异常,数据为:{}",excelDataConvertException.getRowIndex(), |
| | | excelDataConvertException.getColumnIndex()+1, excelDataConvertException.getCellData().getStringValue()); |
| | | throw new IllegalStateException("第"+(excelDataConvertException.getRowIndex()+1)+"行,第"+(excelDataConvertException.getColumnIndex()+1)+"列解析异常,异常数据为:[ "+excelDataConvertException.getCellData().getStringValue()+" ]"); |
| | | ExcelDataConvertException excelDataConvertException = (ExcelDataConvertException) exception; |
| | | logger.error("第{}行,第{}列解析异常,数据为:{}", excelDataConvertException.getRowIndex(), excelDataConvertException.getColumnIndex() + 1, |
| | | excelDataConvertException.getCellData().getStringValue()); |
| | | throw new IllegalStateException( |
| | | "第" + (excelDataConvertException.getRowIndex() + 1) + "行,第" + (excelDataConvertException.getColumnIndex() + 1) + "列解析异常,异常数据为:[ " |
| | | + excelDataConvertException.getCellData().getStringValue() + " ]"); |
| | | } |
| | | if (exception instanceof ImportUserParamVerifyException){ |
| | | throw new IllegalStateException("第"+context.readSheetHolder().getRowIndex()+"行, 解析错误:[ "+ exception.getMessage()+" ]"); |
| | | if (exception instanceof ImportUserParamVerifyException) { |
| | | throw new IllegalStateException("第" + context.readSheetHolder().getRowIndex() + "行, 解析错误:[ " + exception.getMessage() + " ]"); |
| | | } |
| | | throw exception; |
| | | } |
| | |
| | | * 批量插入用户表和平台用户表 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void insertUserAndUserCoreBatch(List<FinSysTenantUser> finSysTenantUsers){ |
| | | public void insertUserAndUserCoreBatch(List<FinSysTenantUser> finSysTenantUsers) { |
| | | ArrayList<S_user_core> sUserCores = new ArrayList<>(); |
| | | for (FinSysTenantUser user : finSysTenantUsers) { |
| | | // 插入平台用户 |
| | |
| | | this.finSysTenantUserService.execInsertRoleUserList(finSysTenantUsers); |
| | | } |
| | | |
| | | public static class ImportUserParamVerifyException extends RuntimeException{ |
| | | public ImportUserParamVerifyException(){super();} |
| | | public ImportUserParamVerifyException(String message){super(message);} |
| | | public static class ImportUserParamVerifyException extends RuntimeException { |
| | | |
| | | public ImportUserParamVerifyException() { |
| | | super(); |
| | | } |
| | | |
| | | public ImportUserParamVerifyException(String message) { |
| | | super(message); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 得到 当前登录用户的信息 |
| | | * 增加 父类机构的code |
| | | * 得到 当前登录用户的信息 增加 父类机构的code |
| | | * |
| | | * @param |
| | | * @return |
| | |
| | | // 2. 修改平台用户(不用修改) |
| | | return ResponseValue.success(1); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据机构id查询部门中的用户", notes = "根据机构id查询部门中的用户") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "agencyId", value = "机构id", required = true, dataType = "Long", paramType = "query") |
| | | }) |
| | | @GetMapping("/select/department") |
| | | public ResponseValue selectDepartment(Long agencyId) { |
| | | FinSysTenantVO finSysTenantVO = new FinSysTenantVO(); |
| | | |
| | | FinSysTenant finSysTenant = new FinSysTenant(); |
| | | finSysTenant.setId(agencyId); |
| | | FinSysTenant sysTenant = finSysTenantService.select(finSysTenant).get(0); |
| | | finSysTenantVO.setId(sysTenant.getId()); |
| | | finSysTenantVO.setName(sysTenant.getName()); |
| | | finSysTenantVO.setType("tenant"); |
| | | // 部门 |
| | | FinSysTenantDepartment finSysTenantDepartment = new FinSysTenantDepartment(); |
| | | finSysTenantDepartment.setTenantId(agencyId); |
| | | List<FinSysTenantDepartment> tenantDepartmentList = finSysTenantDepartmentService.select(finSysTenantDepartment); |
| | | List<DepartmentVO> departmentVOList = Lists.newArrayList(); |
| | | tenantDepartmentList.forEach(department -> { |
| | | DepartmentVO departmentVO = new DepartmentVO(); |
| | | //用户 |
| | | Long id = department.getId(); |
| | | departmentVO.setId(id); |
| | | departmentVO.setName(department.getName()); |
| | | departmentVO.setType("department"); |
| | | FinSysTenantUser finSysTenantUser = new FinSysTenantUser(); |
| | | finSysTenantUser.setSysDeptId(id); |
| | | List<FinSysTenantUser> tenantUserList = finSysTenantUserService.select(finSysTenantUser); |
| | | List<UserVO> userVOList = Lists.newArrayList(); |
| | | tenantUserList.forEach(user -> { |
| | | UserVO userVO = new UserVO(); |
| | | userVO.setId(user.getId()); |
| | | userVO.setName(user.getUserName()); |
| | | userVO.setType("user"); |
| | | userVOList.add(userVO); |
| | | }); |
| | | departmentVO.setChildren(userVOList); |
| | | departmentVOList.add(departmentVO); |
| | | }); |
| | | finSysTenantVO.setChildren(departmentVOList); |
| | | |
| | | return ResponseValue.success(finSysTenantVO); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.consum.base.service.LWhFormOutputServiceImpl; |
| | | import com.consum.base.service.LWhGoodsService; |
| | | import com.consum.base.service.LWhProcureModelService; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormOutput; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | |
| | | /*当前登录人只能看到自己机构下的列表*/ |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | String tenantId = sysInfo.getTenantId(); |
| | | if (param.getAgencyId() == null) { |
| | | param.setAgencyId(Long.valueOf(tenantId)); |
| | | } |
| | | GenericPager genericPager = lWhFormOutputService.queryFormOutputList(param); |
| | | List<LWhFormOutput> data = genericPager.getDatas(); |
| | | |
| | |
| | | return ResponseValue.success("查询成功!", lWhFormOutputExtendVO); |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据仓库id和型号id 查询库存 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/11/2 |
| | | */ |
| | | @ApiOperation(value = "根据仓库id和型号id 查询库存", notes = "根据仓库id和型号id 查询库存") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "warehouseId", value = "仓库id", required = true, dataType = "Long", paramType = "query"), |
| | | @ApiImplicitParam(name = "baseGoodsModelsId", value = "型号id", required = true, dataType = "Long", paramType = "query") |
| | | }) |
| | | @GetMapping("/select/number") |
| | | public ResponseValue selectNumber(Long warehouseId, Long baseGoodsModelsId) { |
| | | if (warehouseId == null || baseGoodsModelsId == null) { |
| | | return ResponseValue.error("参数错误"); |
| | | } |
| | | int num = this.lWhGoodsService.queryGoodsModelNum(0, warehouseId, baseGoodsModelsId, (short) 1, null); |
| | | return ResponseValue.success(num); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "查询出库单详情明细", notes = "查询出库单详情明细") |
| | | @ApiImplicitParam(name = "formOutputQry", value = "出库单详情查询条件", required = true, dataType = "LWhFormOutputQry", paramType = "query") |
| | |
| | | } |
| | | String modelName = (String) tempGoodsInfo.get("modelname"); |
| | | // 查询型号库存 |
| | | int goodsModelNum = lWhGoodsService.queryGoodsModelNum(0, warehouseId, baseGoodsModelsId, (short) 1, null); |
| | | int goodsModelNum = lWhGoodsService.queryGoodsModelNum(0, warehouseId, baseGoodsModelsId, 1, null); |
| | | LWhProcureModel model = new LWhProcureModel(); |
| | | model.setId(NumberGenerator.getLongSequenceNumber()); |
| | | model.setFromProcureGoodsId(fromProcureGoodsId); |
| | |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | |
| | | /*当前登录人只能看到自己机构下的列表*/ |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | String tenantId = sysInfo.getTenantId(); |
| | | if (param.getAgencyId() == null) { |
| | | param.setAgencyId(Long.valueOf(tenantId)); |
| | | } |
| | | GenericPager genericPager = lWhFormProcureService.queryFormProcureList(param); |
| | | List<LWhFormProcure> data = genericPager.getDatas(); |
| | | ArrayList<FormProcureVO> result = new ArrayList<>(); |
| | |
| | | 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.*; |
| | | import com.consum.base.pojo.LWhFormTransferGoodsInfoParam; |
| | | import com.consum.base.pojo.LWhFormTransferParam; |
| | | import com.consum.base.pojo.ProcureModelInfoDto; |
| | | import com.consum.base.pojo.UseRecordDto; |
| | | import com.consum.base.pojo.UseRecordSkuDto; |
| | | import com.consum.base.pojo.query.TransferQry; |
| | | 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.*; |
| | | import com.consum.model.po.*; |
| | | 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.BaseGoodsModels; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormTransfer; |
| | | import com.consum.model.po.LWhProcureModel; |
| | | import com.consum.model.po.LWhProcureModelUser; |
| | | import com.consum.model.po.LWhProcureModelUserRecord; |
| | | 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 org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | 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; |
| | | |
| | | /** |
| | | * @Description 调拨管理 |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/pc/l/wh/form/transfer") |
| | | @Api(tags = "调拨分发管理") |
| | | @Api(value = "调拨分发管理", tags = "调拨分发管理") |
| | | public class LWhFormTransferController extends BaseController { |
| | | |
| | | @Autowired |
| | |
| | | private BaseGoodsModelsServiceImpl baseGoodsModelsService; |
| | | @Autowired |
| | | private BaseWarehouseServiceImpl baseWarehouseService; |
| | | |
| | | /** |
| | | * @Description 新增 |
| | | */ |
| | |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | |
| | | /*当前登录人只能看到自己机构下的列表*/ |
| | | GenericPager genericPager = lWhFormTransferService.queryFormTransferList(param); |
| | | List<LWhFormTransfer> datas = genericPager.getDatas(); |
| | | ArrayList<FormTransferVO> result = new ArrayList<>(); |
| | |
| | | return ResponseValue.success(vo); |
| | | } |
| | | |
| | | @ApiOperation(value = "调拨明细列表", notes = "调拨明细列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "param", value = "条件", required = true, dataType = "TransferQry"), |
| | | }) |
| | | @GetMapping("/detail/list") |
| | | public ResponseValue queryFormTransferDetailList(TransferQry param) { |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | GenericPager<Map<String, Object>> mapGenericPager = lWhFormTransferService.queryFormTransferDetailList(param); |
| | | |
| | | return ResponseValue.success(mapGenericPager); |
| | | } |
| | | |
| | | /** |
| | | * 撤销 |
| | | * |
| | |
| | | FinSysTenantUser sysTenantUser = this.getSysInfo(); |
| | | String agencyId = sysTenantUser.getTenantId(); |
| | | List<BaseWarehouse> baseWarehouseList = baseWarehouseService.getByAgencyId(Long.valueOf(agencyId), (short) 1, (short) 1); |
| | | if (CollectionUtils.isEmpty(baseWarehouseList)){ |
| | | if (CollectionUtils.isEmpty(baseWarehouseList)) { |
| | | return ResponseValue.error("机构无默认仓库!"); |
| | | } |
| | | BaseWarehouse baseWarehouse = baseWarehouseList.get(0); |
| | |
| | | public ResponseValue queryDepartmentTransferOrder(Long agencyId) { |
| | | |
| | | TransferInfoVO transferInfoVO = new TransferInfoVO(); |
| | | String sql = "SELECT ft.id,\n" |
| | | + " ft.BUSINESS_FORM_CODE,\n" |
| | | + " gr.GOODS_TEMPLATE_NAME,\n" |
| | | + " gr.BASE_GOODS_TEMPLATE_ID,\n" |
| | | + " ft.CREATE_TIME\n" |
| | | + "\n" |
| | | + "FROM l_wh_form_transfer ft\n" |
| | | + " LEFT JOIN L_WAREHOUSE_FLOW wf ON ft.id = wf.BUSINESS_FORM_ID\n" |
| | | + " left join L_WH_GOODS_RECORD gr on gr.WAREHOUSE_FLOW_ID = wf.id\n" |
| | | + " LEFT JOIN L_GOODS_WH_RECORD gwr on gwr.WAREHOUSE_FLOW_ID = wf.id\n" |
| | | + " left join L_WH_GOODS g on g.id = gwr.WH_GOODS_ID\n" |
| | | + "\n" |
| | | + "\n" |
| | | + "\n" |
| | | + "\n"; |
| | | return ResponseValue.success(transferInfoVO); |
| | | } |
| | | } |
| | |
| | | package com.consum.base.pojo; |
| | | |
| | | import com.walker.web.param.ParamRequest; |
| | | import io.swagger.annotations.ApiModel; |
| | | |
| | | @ApiModel(value = "FinSysTenantDepartmentParam") |
| | | public class FinSysTenantDepartmentParam extends ParamRequest { |
| | | |
| | | /** |
| | | * id |
| | | */ |
New file |
| | |
| | | package com.consum.base.pojo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: 库管员信息 |
| | | * @date 2023/11/17 13:07 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "库管员信息") |
| | | public class WarehouseManagerInfo { |
| | | |
| | | private Long managerId; |
| | | private String managerName; |
| | | |
| | | } |
New file |
| | |
| | | package com.consum.base.pojo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import java.util.List; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: 库管员信息 |
| | | * @date 2023/11/17 13:05 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "库管员信息") |
| | | public class WarehouseManagerParam { |
| | | |
| | | private Long warehouseId; |
| | | |
| | | List<WarehouseManagerInfo> warehouseManagerInfoList; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "接收机构") |
| | | private Long inAgencyId; |
| | | /** |
| | | * 状态 0=待出库;1=待接收;2=已入库 |
| | | * 状态 0=待出库;1=待接收;2=已入库库:4=已撤销 |
| | | */ |
| | | @ApiModelProperty(value = "状态 0=待出库;1=待接收;2=已入库") |
| | | @ApiModelProperty(value = "状态 0=待出库;1=待接收;2=已入库库:4=已撤销") |
| | | private Short states; |
| | | /** |
| | | * 创建人/分发人 |
| | |
| | | * 规格型号id |
| | | */ |
| | | @ApiModelProperty(value = "规格型号id") |
| | | private Long baseGoodsTemplateId; |
| | | private Long baseGoodsModelsId; |
| | | |
| | | /** |
| | | * 页码 |
New file |
| | |
| | | package com.consum.base.pojo.query; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: 库存查询条件 |
| | | * @date 2023/11/16 10:18 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "库存查询条件") |
| | | public class WarehouseQry { |
| | | |
| | | @ApiModelProperty(value = "仓库id") |
| | | private Long warehouseId; |
| | | @ApiModelProperty(value = "商品型号id") |
| | | @NotNull(message = "商品型号id不能为空") |
| | | private Long baseGoodsModelsId; |
| | | //仓库类型 0机构1部门 |
| | | @ApiModelProperty(value = "仓库类型 0机构1部门") |
| | | private Integer warehouseType; |
| | | //(0=在途调拨;1=入库未分发;2=已下发;3=报废) |
| | | @ApiModelProperty(value = "(0=在途调拨;1=入库未分发;2=已下发;3=报废)") |
| | | private Integer states; |
| | | //采购方式(1:集采;2=自采) |
| | | @ApiModelProperty(value = "采购方式(1:集采;2=自采)") |
| | | private Integer buyType; |
| | | @ApiModelProperty(value = "机构id") |
| | | private Long agencyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.consum.base.pojo.response; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: TODO |
| | | * @date 2023/11/16 16:57 |
| | | */ |
| | | @Data |
| | | public class DepartmentVO { |
| | | |
| | | private Long id; |
| | | private String name; |
| | | private String type; |
| | | private List<UserVO> children = new ArrayList<>(); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.consum.base.pojo.response; |
| | | |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: 机构用户信息 |
| | | * @date 2023/11/16 15:46 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "FinSysTenantUserVO", description = "机构用户信息") |
| | | public class FinSysTenantUserVO extends FinSysTenantUser { |
| | | |
| | | private String sysDeptName; |
| | | } |
New file |
| | |
| | | package com.consum.base.pojo.response; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: 机构 |
| | | * @date 2023/11/16 16:56 |
| | | */ |
| | | @Data |
| | | public class FinSysTenantVO { |
| | | |
| | | private Long id; |
| | | private String name; |
| | | //tenant department user |
| | | private String type; |
| | | private List<DepartmentVO> children = new ArrayList<>(); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.consum.base.pojo.response; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: TODO |
| | | * @date 2023/11/16 16:57 |
| | | */ |
| | | @Data |
| | | public class UserVO { |
| | | |
| | | private Long id; |
| | | private String name; |
| | | private String type; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.core.CodeGeneratorService; |
| | | import com.consum.base.pojo.BaseGoodsTemplateParam; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.base.pojo.BaseGoodsTemplateParam; |
| | | import com.consum.model.po.BaseCategory; |
| | | import com.consum.model.po.BaseGoodsModels; |
| | | import com.consum.model.po.BaseGoodsTemplate; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.SDictData; |
| | | import com.consum.model.vo.BaseGoodsTemplateVo; |
| | | import com.iplatform.model.po.S_user_core; |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/24 |
| | | */ |
| | | public int add(BaseGoodsTemplateParam param, S_user_core currentUser) { |
| | | public int add(BaseGoodsTemplateParam param, FinSysTenantUser currentUser) { |
| | | //1.新增物品模板 |
| | | BaseGoodsTemplate baseGoodsTemplate = new BaseGoodsTemplate(); |
| | | BeanUtils.copyProperties(param, baseGoodsTemplate); |
| | |
| | | //当前机构的父级机构编号 |
| | | //机构层级 |
| | | //机构编号 |
| | | baseGoodsTemplate.setAgencyId(Long.valueOf(currentUser.getTenantId())); |
| | | //机构名称 |
| | | baseGoodsTemplate.setAgencyName(currentUser.getTenantName()); |
| | | //创建时间 |
| | | long createTime = DateUtils.getDateTimeNumber(System.currentTimeMillis()); |
| | | baseGoodsTemplate.setCreateDate(createTime); |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.base.pojo.WarehouseManagerInfo; |
| | | import com.consum.base.pojo.WarehouseManagerParam; |
| | | import com.consum.model.po.BaseWarehouseManager; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.iplatform.model.po.S_role; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * @Description 物品分类 |
| | |
| | | @Service |
| | | public class BaseWarehouseManagerServiceImpl extends BaseServiceImpl { |
| | | |
| | | @Autowired |
| | | private FinSysTenantUserServiceImpl finSysTenantUserService; |
| | | |
| | | /** |
| | | * @Description 新增 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | public int add(BaseWarehouseManager baseWarehouseManager) { |
| | | baseWarehouseManager.setId(IdUtil.generateId()); |
| | | return this.insert(baseWarehouseManager); |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void add(WarehouseManagerParam list) throws Exception { |
| | | |
| | | Long warehouseId = list.getWarehouseId(); |
| | | |
| | | // 角色id |
| | | Long roleId = null; |
| | | List<S_role> roleAll = finSysTenantUserService.getRoleAll(); |
| | | if (!CollectionUtils.isEmpty(roleAll)) { |
| | | S_role sRole = roleAll.stream().filter(item -> item.getRole_name().equals("仓库管理员")).findFirst().orElse(null); |
| | | if (sRole != null) { |
| | | roleId = sRole.getRole_id(); |
| | | } |
| | | } |
| | | |
| | | // 删除角色 |
| | | BaseWarehouseManager warehouseManager = new BaseWarehouseManager(); |
| | | warehouseManager.setBaseWarehouseId(warehouseId); |
| | | List<BaseWarehouseManager> baseWarehouseManagerList = this.select(warehouseManager); |
| | | String deleteRoleSql = "DELETE FROM S_ROLE_USER WHERE USER_ID =:managerId AND role_id =:roleId"; |
| | | for (BaseWarehouseManager item : baseWarehouseManagerList) { |
| | | Long managerId = item.getManagerId(); |
| | | FinSysTenantUser finSysTenantUser = finSysTenantUserService.queryOneById(String.valueOf(managerId)); |
| | | if (finSysTenantUser == null) { |
| | | throw new Exception("用户不存在"); |
| | | } |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("managerId", finSysTenantUser.getSysUserId()); |
| | | params.put("roleId", roleId); |
| | | this.execute(deleteRoleSql, params); |
| | | } |
| | | |
| | | //删除库管记录 |
| | | String sql = "delete from base_warehouse_manager where base_warehouse_id =:warehouseId"; |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("warehouseId", warehouseId); |
| | | this.execute(sql, params); |
| | | //重新保存 |
| | | List<WarehouseManagerInfo> warehouseManagerInfoList = list.getWarehouseManagerInfoList(); |
| | | if (!CollectionUtils.isEmpty(warehouseManagerInfoList)) { |
| | | for (WarehouseManagerInfo warehouseManagerInfo : warehouseManagerInfoList) { |
| | | Long managerId = warehouseManagerInfo.getManagerId(); |
| | | String managerName = warehouseManagerInfo.getManagerName(); |
| | | BaseWarehouseManager baseWarehouseManager = new BaseWarehouseManager(); |
| | | baseWarehouseManager.setId(IdUtil.generateId()); |
| | | baseWarehouseManager.setBaseWarehouseId(warehouseId); |
| | | baseWarehouseManager.setManagerId(managerId); |
| | | baseWarehouseManager.setManagerName(managerName); |
| | | this.insert(baseWarehouseManager); |
| | | |
| | | FinSysTenantUser finSysTenantUser = finSysTenantUserService.queryOneById(String.valueOf(managerId)); |
| | | if (finSysTenantUser == null) { |
| | | throw new Exception("用户不存在"); |
| | | } |
| | | Long sysUserId = finSysTenantUser.getSysUserId(); |
| | | String saveUserRole = "insert into s_role_user(user_id, role_id, org_id) values(:managerId,:roleId,0)"; |
| | | Map<String, Object> userRoleParam = new HashMap<>(); |
| | | userRoleParam.put("managerId", sysUserId); |
| | | userRoleParam.put("roleId", roleId); |
| | | this.execute(saveUserRole, userRoleParam); |
| | | // this.finSysTenantUserService.execInsertRoleUserList(roleList, sysUserId); |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | // public GenericPager<BaseWarehouse> queryList(BaseWarehouseParam param, FinSysTenantUser sysInfo) { |
| | | public GenericPager<BaseWarehouse> queryList(BaseWarehouseParam param) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM base_warehouse WHERE 1 = 1 "); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | |
| | | paramts.put("CLASSIFICATION_CODE", param.getClassificationCode()); |
| | | } |
| | | //机构id |
| | | // sql.append(" and AGENCY_ID =:AGENCY_ID "); |
| | | // if (param.getAgencyId() != null) { |
| | | // paramts.put("AGENCY_ID", param.getAgencyId()); |
| | | // } else { |
| | | // paramts.put("AGENCY_ID", Long.valueOf(sysInfo.getTenantId())); |
| | | // } |
| | | if (param.getAgencyId() != null) { |
| | | sql.append(" and AGENCY_ID =:AGENCY_ID "); |
| | | paramts.put("AGENCY_ID", param.getAgencyId()); |
| | | } |
| | | //状态 |
| | | if (param.getStates() != null) { |
| | | sql.append(" and states =:states "); |
| | |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class FinSysTenantUserServiceImpl extends BaseServiceImpl { |
| | | |
| | | private static final String SQL_GET_USER = "SELECT * FROM fin_sys_tenant_user WHERE IS_DELETE = 1 AND `STATUS` = 1 AND TENANT_ID = ?"; |
| | | private static final String SQL_QH_PAGE_USER_PREFIX = "select fstu.* from FIN_SYS_TENANT_USER fstu where fstu.IS_DELETE = 1 "; |
| | | private static final String SQL_QH_PAGE_USER_PREFIX_NEW = "select fstu.* from FIN_SYS_TENANT_USER fstu where IS_DELETE = 1 and status=1 "; |
| | | private static final String SQL_TENANT_USER = "select fstu.*, fst.TENANT_NAME, fst.LV from FIN_SYS_TENANT_USER fstu\n" + |
| | | "left join (SELECT CODE, NAME AS TENANT_NAME, LV FROM FIN_SYS_TENANT) fst ON fstu.TENANT_CODE = fst.CODE\n" + |
| | | "where fstu.SYS_USER_ID = ?"; |
| | | 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.* from FIN_SYS_TENANT_USER fstu where fstu.IS_DELETE = 0 "; |
| | | private static final String SQL_QH_PAGE_USER_PREFIX_NEW = "select fstu.* from FIN_SYS_TENANT_USER fstu where IS_DELETE = 0 and status=1 "; |
| | | private static final String SQL_TENANT_USER = "select fstu.*, fst.TENANT_NAME, fst.LV from FIN_SYS_TENANT_USER fstu\n" |
| | | + "left join (SELECT CODE, NAME AS TENANT_NAME, LV FROM FIN_SYS_TENANT) fst ON fstu.TENANT_CODE = fst.CODE\n" + "where fstu.SYS_USER_ID = ?"; |
| | | private static final String SQL_TENANT_USER_BY_USER_ID = "select * from FIN_SYS_TENANT_USER where SYS_USER_ID = ? AND STATUS = 1"; |
| | | private static final String SQL_INSERT_ROLE_USER="insert into s_role_user(user_id, role_id, org_id) values(?,?,0)"; |
| | | private static final String SQL_INSERT_ROLE_USER = "insert into s_role_user(user_id, role_id, org_id) values(?,?,0)"; |
| | | |
| | | private static final String SQL_DELETE_ROLE_USER="DELETE FROM S_ROLE_USER WHERE USER_ID =?"; |
| | | private static final String SQL_DELETE_ROLE_USER = "DELETE FROM S_ROLE_USER WHERE USER_ID =?"; |
| | | |
| | | private static final String SQL_SELECT_USER_CODE="SELECT * FROM FIN_SYS_TENANT_USER where 1 = 1 "; |
| | | /** |
| | | * 根据用户id和角色id删除角色 |
| | | */ |
| | | private static final String SQL_DELETE_ROLE_BY_USER_ID_AND_ROLE_ID = "DELETE FROM S_ROLE_USER WHERE USER_ID =? AND role_id =?"; |
| | | |
| | | private static final String SQL_SELECT_USER_ID="SELECT * FROM S_ROLE where 1=1 "; |
| | | private static final String SQL_SELECT_USER_CODE = "SELECT * FROM FIN_SYS_TENANT_USER where 1 = 1 "; |
| | | |
| | | private static final String SQL_SELECT_USER_ID = "SELECT * FROM S_ROLE where 1=1 "; |
| | | private static final String SQL_DEPT_ROLES = "select * from s_dept where status=0 and del_flag=0"; |
| | | |
| | | private static final String SQL_FIN_SYS_ORG = "SELECT * from FIN_SYS_ORG where ID=?"; |
| | | |
| | | |
| | | private static final String SQL_TENANT_KF_USER = "select fstu.*, sru.USER_ID from FIN_SYS_TENANT_USER fstu\n" + |
| | | "left join (select USER_ID FROM S_ROLE_USER WHERE ROLE_ID = '1690961420053') sru ON fstu.SYS_USER_ID = sru.USER_ID\n" + |
| | | "WHERE IS_DELETE = 1 AND STATUS = 1 AND sru.USER_ID is NOT NULL AND TENANT_CODE = ?"; |
| | | private static final String SQL_TENANT_KF_USER = "select fstu.*, sru.USER_ID from FIN_SYS_TENANT_USER fstu\n" |
| | | + "left join (select USER_ID FROM S_ROLE_USER WHERE ROLE_ID = '1690961420053') sru ON fstu.SYS_USER_ID = sru.USER_ID\n" |
| | | + "WHERE IS_DELETE = 0 AND STATUS = 1 AND sru.USER_ID is NOT NULL AND TENANT_CODE = ?"; |
| | | |
| | | private static final String SQL_TEAM_KF_USER = "select fstu.*, sru.USER_ID,FST2.CODE as PARENT_Code from FIN_SYS_TENANT_USER fstu\n" + |
| | | " left join (select USER_ID FROM S_ROLE_USER WHERE ROLE_ID = 2) sru ON fstu.SYS_USER_ID = sru.USER_ID\n" + |
| | | " LEFT JOIN FIN_SYS_TENANT FST ON FST.CODE = fstu.TENANT_CODE \n" + |
| | | " LEFT JOIN FIN_SYS_TENANT FST2 ON FST2.ID = FST.PARENT_ID \n" + |
| | | " WHERE IS_DELETE = 1 AND STATUS = 1 AND sru.USER_ID is NOT NULL AND fstu.ID != ?"; |
| | | private static final String SQL_TEAM_KF_USER = "select fstu.*, sru.USER_ID,FST2.CODE as PARENT_Code from FIN_SYS_TENANT_USER fstu\n" |
| | | + " left join (select USER_ID FROM S_ROLE_USER WHERE ROLE_ID = 2) sru ON fstu.SYS_USER_ID = sru.USER_ID\n" |
| | | + " LEFT JOIN FIN_SYS_TENANT FST ON FST.CODE = fstu.TENANT_CODE \n" + " LEFT JOIN FIN_SYS_TENANT FST2 ON FST2.ID = FST.PARENT_ID \n" |
| | | + " WHERE IS_DELETE = 0 AND STATUS = 1 AND sru.USER_ID is NOT NULL AND fstu.ID != ?"; |
| | | |
| | | /** |
| | | * @Description 分页查询系统用户 |
| | |
| | | public GenericPager<FinSysTenantUser> queryAllPageUser(FinSysTenantUserSearchParam param) { |
| | | Map<String, Object> parameter = new HashMap<>(5); |
| | | StringBuilder sql = new StringBuilder(SQL_QH_PAGE_USER_PREFIX); |
| | | if(param.getTenantCode() > 0){ |
| | | if (param.getTenantCode() > 0) { |
| | | sql.append(" and fstu.TENANT_CODE =:tenantCode"); |
| | | parameter.put("tenantCode", param.getTenantCode()); |
| | | } |
| | | if(param.getSupplierId() !=null ){ |
| | | if (param.getSupplierId() != null) { |
| | | sql.append(" and fstu.supplier_Id =:supplier_Id"); |
| | | parameter.put("supplier_Id", param.getSupplierId()); |
| | | } |
| | | if(StringUtils.isNotEmpty(param.getUserName())){ |
| | | if (StringUtils.isNotEmpty(param.getUserName())) { |
| | | sql.append(" and USER_NAME like :userName"); |
| | | parameter.put("userName", StringUtils.CHAR_PERCENT + param.getUserName() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | if(StringUtils.isNotEmpty(param.getUserCode())){ |
| | | if (StringUtils.isNotEmpty(param.getUserCode())) { |
| | | sql.append(" and USER_CODE like :USER_CODE"); |
| | | parameter.put("USER_CODE", StringUtils.CHAR_PERCENT + param.getUserCode() + StringUtils.CHAR_PERCENT); |
| | | } |
| | |
| | | // sql.append(" and user_code like :user_code"); |
| | | // parameter.put("user_code", StringUtils.CHAR_PERCENT + param.getUserCode() + StringUtils.CHAR_PERCENT); |
| | | // } |
| | | if(param.getStatus()!=null){ |
| | | if (param.getStatus() != null) { |
| | | sql.append(" and status =:status"); |
| | | parameter.put("status", param.getStatus()); |
| | | } |
| | |
| | | // parameter.put("role_id", param.getRoleId()); |
| | | // } |
| | | |
| | | |
| | | if(StringUtils.isNotEmpty(param.getUserPhone())){ |
| | | if (StringUtils.isNotEmpty(param.getUserPhone())) { |
| | | sql.append(" and USER_PHONE =:userPhone"); |
| | | try { |
| | | // 加密手机号 |
| | |
| | | } |
| | | |
| | | // 这里是选择人员加的 |
| | | if(param.getType()!=null){ |
| | | // 1 是财政用户 2 供应商 他俩的区别就是 供应商id是否为空 |
| | | if(param.getType()==1){ |
| | | sql.append(" and fstu.supplier_Id is null "); |
| | | } |
| | | if (param.getType() != null) { |
| | | // 1 是财政用户 2 供应商 他俩的区别就是 供应商id是否为空 |
| | | if (param.getType() == 1) { |
| | | sql.append(" and fstu.supplier_Id is null "); |
| | | } |
| | | |
| | | if(param.getType()==2){ |
| | | //这里是 查的供应商 供应商id 已经在上面加过了 |
| | | } |
| | | if (param.getType() == 2) { |
| | | //这里是 查的供应商 供应商id 已经在上面加过了 |
| | | } |
| | | } |
| | | // 绑定CTI客服 |
| | | if (param.getCtiStatus() != null) { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * @Description 分页查询系统用户 |
| | | * @Author wh |
| | |
| | | public GenericPager<FinSysTenantUser> queryAllPageUserNew(FinSysTenantUserSearchParam param) { |
| | | Map<String, Object> parameter = new HashMap<>(5); |
| | | StringBuilder sql = new StringBuilder(SQL_QH_PAGE_USER_PREFIX_NEW); |
| | | if(param.getTenantCode() > 0){ |
| | | if (param.getTenantCode() > 0) { |
| | | sql.append(" and fstu.TENANT_CODE =:tenantCode"); |
| | | parameter.put("tenantCode", param.getTenantCode()); |
| | | } |
| | | if(param.getSupplierId() !=null ){ |
| | | if (param.getSupplierId() != null) { |
| | | sql.append(" and fstu.supplier_Id =:supplier_Id"); |
| | | parameter.put("supplier_Id", param.getSupplierId()); |
| | | } |
| | | if(StringUtils.isNotEmpty(param.getUserName())){ |
| | | if (StringUtils.isNotEmpty(param.getUserName())) { |
| | | sql.append(" and USER_NAME like :userName"); |
| | | parameter.put("userName", StringUtils.CHAR_PERCENT + param.getUserName() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | if(StringUtils.isNotEmpty(param.getUserCode())){ |
| | | if (StringUtils.isNotEmpty(param.getUserCode())) { |
| | | sql.append(" and user_code like :user_code"); |
| | | parameter.put("user_code", StringUtils.CHAR_PERCENT + param.getUserCode() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | if(param.getStatus()!=null){ |
| | | if (param.getStatus() != null) { |
| | | sql.append(" and status like :status"); |
| | | parameter.put("status", param.getStatus()); |
| | | } |
| | | |
| | | if(param.getRoleId()!=null &&!param.getRoleId().equals("")){ |
| | | if (param.getRoleId() != null && !param.getRoleId().equals("")) { |
| | | sql.append(" and fstu.SYS_USER_ID in (select user_id from s_role_user where role_id = :role_id)"); |
| | | parameter.put("role_id", param.getRoleId()); |
| | | } |
| | | |
| | | |
| | | if(StringUtils.isNotEmpty(param.getUserPhone())){ |
| | | if (StringUtils.isNotEmpty(param.getUserPhone())) { |
| | | sql.append(" and USER_PHONE =:userPhone"); |
| | | try { |
| | | // 加密手机号 |
| | |
| | | } |
| | | |
| | | // 这里是选择人员加的 |
| | | if(param.getType()!=null){ |
| | | if (param.getType() != null) { |
| | | // 1 是财政用户 2 供应商 他俩的区别就是 供应商id是否为空 |
| | | if(param.getType()==1){ |
| | | if (param.getType() == 1) { |
| | | sql.append(" and fstu.supplier_Id is null "); |
| | | } |
| | | |
| | | if(param.getType()==2){ |
| | | if (param.getType() == 2) { |
| | | //这里是 查的供应商 供应商id 已经在上面加过了 |
| | | } |
| | | } |
| | |
| | | FinSysTenantUser finSysTenantUser = new FinSysTenantUser(); |
| | | finSysTenantUser.setId(Long.valueOf(id)); |
| | | List<FinSysTenantUser> finSysTenantUserList = this.select(finSysTenantUser); |
| | | if(!StringUtils.isEmptyList(finSysTenantUserList)){ |
| | | if (!StringUtils.isEmptyList(finSysTenantUserList)) { |
| | | return finSysTenantUserList.get(0); |
| | | } |
| | | return null; |
| | |
| | | |
| | | /** |
| | | * 批量添加角色对应的用户。 |
| | | * |
| | | * @param roleIdList |
| | | * @param userId |
| | | */ |
| | | public void execInsertRoleUserList(List<Long> roleIdList, Long userId){ |
| | | public void execInsertRoleUserList(List<Long> roleIdList, Long userId) { |
| | | List<Object[]> parameters = new ArrayList<>(); |
| | | Object[] one = null; |
| | | for(long roleId : roleIdList){ |
| | | for (long roleId : roleIdList) { |
| | | one = new Object[2]; |
| | | one[0] = userId; |
| | | one[1] = roleId; |
| | |
| | | /** |
| | | * 批量添加角色对应的用户。支持同时多个用户 |
| | | */ |
| | | public void execInsertRoleUserList(List<FinSysTenantUser> finSysTenantUsers){ |
| | | public void execInsertRoleUserList(List<FinSysTenantUser> finSysTenantUsers) { |
| | | List<Object[]> parameters = new ArrayList<>(); |
| | | for (FinSysTenantUser finSysTenantUser : finSysTenantUsers) { |
| | | Object[] one = null; |
| | | for(long roleId : finSysTenantUser.getRoleList()){ |
| | | for (long roleId : finSysTenantUser.getRoleList()) { |
| | | one = new Object[2]; |
| | | one[0] = finSysTenantUser.getSysUserId(); |
| | | one[1] = roleId; |
| | |
| | | |
| | | /** |
| | | * 批量删除用户角色 |
| | | * |
| | | * @param userId |
| | | */ |
| | | public void execDelRoleUserList(Long userId){ |
| | | public void execDelRoleUserList(Long userId) { |
| | | List<Object[]> parameters = new ArrayList<>(); |
| | | Object[] one = new Object[1]; |
| | | one[0]=userId; |
| | | one[0] = userId; |
| | | parameters.add(one); |
| | | this.execBatchUpdate(SQL_DELETE_ROLE_USER, parameters); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户id和角色id删除用户角色 |
| | | * |
| | | * @param userId |
| | | */ |
| | | public void execDeleteRoleByUserIdAndRoleId(Long userId, Long roleId) { |
| | | List<Object[]> parameters = new ArrayList<>(); |
| | | Object[] one = new Object[2]; |
| | | one[0] = userId; |
| | | one[1] = roleId; |
| | | parameters.add(one); |
| | | this.execBatchUpdate(SQL_DELETE_ROLE_BY_USER_ID_AND_ROLE_ID, parameters); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据userCode查询重复。 |
| | | * @param userCode 用户登录标识 |
| | | * |
| | | * @param userCode 用户登录标识 |
| | | * @return |
| | | */ |
| | | public Integer getByUserCode(String userCode){ |
| | | public Integer getByUserCode(String userCode) { |
| | | Map<String, Object> parameter = new HashMap<>(); |
| | | StringBuilder sql = new StringBuilder(SQL_SELECT_USER_CODE); |
| | | sql.append("and USER_CODE= :userCode"); |
| | | parameter.put("userCode", userCode); |
| | | sql.append(" limit 1"); |
| | | List<FinSysTenantUser> select = this.select(sql.toString(), parameter, new FinSysTenantUser()); |
| | | Integer flag=0; |
| | | if (select!=null && select.size() >0){ |
| | | flag=select.size(); |
| | | Integer flag = 0; |
| | | if (select != null && select.size() > 0) { |
| | | flag = select.size(); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * 根据USERID查询角色 |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | public List<S_role> getByUserId(Long userId){ |
| | | public List<S_role> getByUserId(Long userId) { |
| | | Map<String, Object> parameter = new HashMap<>(); |
| | | StringBuilder sql = new StringBuilder(SQL_SELECT_USER_ID); |
| | | sql.append("and ROLE_ID IN (SELECT DISTINCT(ROLE_ID) FROM S_ROLE_USER WHERE USER_ID= :userId )"); |
| | |
| | | return select; |
| | | } |
| | | |
| | | /** |
| | | * 查询所有角色列表 |
| | | * |
| | | * @return |
| | | */ |
| | | public List<S_role> getRoleAll() { |
| | | Map<String, Object> parameter = new HashMap<>(); |
| | | StringBuilder sql = new StringBuilder(SQL_SELECT_USER_ID); |
| | | List<S_role> select = this.select(sql.toString(), parameter, new S_role()); |
| | | return select; |
| | | } |
| | | |
| | | public List<S_dept> selectDept(String deptName) { |
| | | StringBuilder sqlStr=new StringBuilder(SQL_DEPT_ROLES); |
| | | StringBuilder sqlStr = new StringBuilder(SQL_DEPT_ROLES); |
| | | Map<String, Object> paramts = new HashMap<>(); |
| | | sqlStr.append(" and dept_name =:dept_name"); |
| | | paramts.put("dept_name",deptName); |
| | | paramts.put("dept_name", deptName); |
| | | List<S_dept> orgDeptList = this.select(sqlStr.toString(), paramts, new S_dept()); |
| | | return orgDeptList; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 根据机构id查询机构 |
| | | * |
| | | * @param orgId |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | } |
| | | |
| | | private static final String SQL_GET_ALL_USER = "select DISTINCT( fstu.sys_user_id), fstu.USER_NAME as USER_Name, fstu.id as Id from (\n" + |
| | | "SELECT DISTINCT(CREATE_BY), EVENT_MANAGE_ID FROM FIN_EVENT_MANAGE_RECORD) femr LEFT JOIN FIN_SYS_TENANT_USER fstu ON femr.CREATE_BY = fstu.ID\n" + |
| | | "LEFT JOIN FIN_EVENT_MANAGE fem ON fem.id = femr.EVENT_MANAGE_ID WHERE USER_NAME is not NULL "; |
| | | private static final String SQL_GET_ALL_USER = "select DISTINCT( fstu.sys_user_id), fstu.USER_NAME as USER_Name, fstu.id as Id from (\n" |
| | | + "SELECT DISTINCT(CREATE_BY), EVENT_MANAGE_ID FROM FIN_EVENT_MANAGE_RECORD) femr LEFT JOIN FIN_SYS_TENANT_USER fstu ON femr.CREATE_BY = fstu.ID\n" |
| | | + "LEFT JOIN FIN_EVENT_MANAGE fem ON fem.id = femr.EVENT_MANAGE_ID WHERE USER_NAME is not NULL "; |
| | | |
| | | /** |
| | | * @Description 查询数据统计的信息 |
| | | * @Author wh |
| | | * @Date 2023/9/5 11:53 |
| | | * */ |
| | | */ |
| | | public List<FinSysTenantUser> getStatics(FinSysTenantUserSearchParam finSysTenantUserSearchParam) { |
| | | Map<String, Object> parameters = new HashMap<>(10); |
| | | StringBuilder sql = new StringBuilder(SQL_GET_ALL_USER); |
| | |
| | | sql.append(" and fstu.USER_NAME like :userName"); |
| | | parameters.put("userName", StringUtils.CHAR_PERCENT + finSysTenantUserSearchParam.getUserName() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | if(finSysTenantUserSearchParam.getStartTime() != null && finSysTenantUserSearchParam.getStartTime() > 0){ |
| | | if (finSysTenantUserSearchParam.getStartTime() != null && finSysTenantUserSearchParam.getStartTime() > 0) { |
| | | sql.append(" and fem.create_time >= :startTime"); |
| | | parameters.put("startTime", finSysTenantUserSearchParam.getStartTime()); |
| | | } |
| | | if(finSysTenantUserSearchParam.getEndTime() != null && finSysTenantUserSearchParam.getEndTime() > 0){ |
| | | if (finSysTenantUserSearchParam.getEndTime() != null && finSysTenantUserSearchParam.getEndTime() > 0) { |
| | | sql.append(" and fem.create_time <= :endTime"); |
| | | parameters.put("endTime", finSysTenantUserSearchParam.getEndTime()); |
| | | } |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.consum.base.core.utils.LockManage; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.LWarehouseFlow; |
| | | import com.consum.model.po.LWhFormProcure; |
| | | import com.consum.model.po.LWhGoodsRecord; |
| | | import com.consum.model.po.LWhProcureModel; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.infrastructure.utils.NumberGenerator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | |
| | | import org.springframework.jdbc.core.simple.SimpleJdbcCall; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @ClassName LWarehouseFlowService |
| | | |
| | | * @Date 2023/10/24 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | private BaseGoodsTemplateServiceImpl baseGoodsTemplateService; |
| | | |
| | | @Autowired |
| | | public LWarehouseFlowCoreService(JdbcTemplate jdbcTemplate, LWarehouseFlowService lWarehouseFlowService, LWhGoodsService lWhGoodsService, BaseGoodsTemplateServiceImpl baseGoodsTemplateService, LWhGoodsRecordService lWhGoodsRecordService) { |
| | | public LWarehouseFlowCoreService(JdbcTemplate jdbcTemplate, LWarehouseFlowService lWarehouseFlowService, LWhGoodsService lWhGoodsService, |
| | | BaseGoodsTemplateServiceImpl baseGoodsTemplateService, LWhGoodsRecordService lWhGoodsRecordService) { |
| | | this.jdbcTemplate = jdbcTemplate; |
| | | this.lWarehouseFlowService = lWarehouseFlowService; |
| | | this.baseGoodsTemplateService = baseGoodsTemplateService; |
| | |
| | | |
| | | //统计各型号数量 |
| | | Map<Long, Integer> countsSumByBaseGoodsModelsId = goodsModelNumList.stream() |
| | | .collect(Collectors.groupingBy(LWhProcureModel::getBaseGoodsModelsId, |
| | | Collectors.summingInt(LWhProcureModel::getCounts))); |
| | | .collect(Collectors.groupingBy(LWhProcureModel::getBaseGoodsModelsId, |
| | | Collectors.summingInt(LWhProcureModel::getCounts))); |
| | | Map<Long, List<LWhProcureModel>> sameModelList = goodsModelNumList.stream() |
| | | // 按型号分 |
| | | .collect(Collectors.groupingBy(LWhProcureModel::getBaseGoodsModelsId)); |
| | | // 按型号分 |
| | | .collect(Collectors.groupingBy(LWhProcureModel::getBaseGoodsModelsId)); |
| | | countsSumByBaseGoodsModelsId.forEach((baseGoodsModelsId, modelCount) -> { |
| | | //查询型号信息 |
| | | Map<String, Object> tempGoodsInfo = baseGoodsTemplateService.queryGoodsInfoByModelId(baseGoodsModelsId); |
| | |
| | | Object warehouseModelLockObj = LockManage.acquireLock(warehouseType, warehouseId, baseGoodsModelsId); |
| | | synchronized (warehouseModelLockObj) { |
| | | // 获得锁后查询该型号的期初数量 |
| | | int goodsModelNum = lWhGoodsService.queryGoodsModelNum(warehouseType, warehouseId, baseGoodsModelsId, (short) 1, null); |
| | | int goodsModelNum = lWhGoodsService.queryGoodsModelNum(warehouseType, warehouseId, baseGoodsModelsId, 1, null); |
| | | whGoodsRecord.setInitialCount(goodsModelNum); |
| | | whGoodsRecord.setThisCount(modelCount); |
| | | whGoodsRecord.setEndCount(goodsModelNum + modelCount); |
| | |
| | | Integer counts = item.getCounts(); |
| | | totalPrice = totalPrice + counts*price; |
| | | sameGoodsInsertMore(warehouseFlowId, warehouseType, warehouseId, whGoodsRecordId, (short) 1, warehouseName, |
| | | classification, tempGoodsId, goodsName, baseGoodsModelsId, modelName, |
| | | supplier, buyType, goodsUnit, price, procureTime, 1, dealTime, counts); |
| | | classification, tempGoodsId, goodsName, baseGoodsModelsId, modelName, |
| | | supplier, buyType, goodsUnit, price, procureTime, 1, dealTime, counts); |
| | | }; |
| | | whGoodsRecord.setTotalPrice(totalPrice); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 同样规格的物品 插入多次, |
| | | * 同时将主键记录在 进出库流水明细【L_WH_GOODS_RECORD_DETAILS】, |
| | | * 更新 物品仓库保管记录【L_GOODS_WH_RECORD】 |
| | | * 同样规格的物品 插入多次, 同时将主键记录在 进出库流水明细【L_WH_GOODS_RECORD_DETAILS】, 更新 物品仓库保管记录【L_GOODS_WH_RECORD】 |
| | | * |
| | | * @param pWarehouseId 仓库id |
| | | * @param pWarehouseName 仓库名称 |
| | |
| | | * @param pStates 状态 |
| | | * @param pTimes 插入条数 |
| | | */ |
| | | public void sameGoodsInsertMore(long pWarehouseFlowId, Integer warehouseType, long pWarehouseId, long pWhGoodsRecordId, short pRecordType, String pWarehouseName, short pCostType, |
| | | long pBaseGoodsTemplateId, String pGoodsTemplateName, long pBaseGoodsModelsId, |
| | | String pBaseGoodsModelsName, String pSupplier, short pBuyType, |
| | | String pUnit, long pPrice, long pProcureDate, |
| | | int pStates, long pDealTime, int pTimes) { |
| | | public void sameGoodsInsertMore(long pWarehouseFlowId, Integer warehouseType, long pWarehouseId, long pWhGoodsRecordId, short pRecordType, |
| | | String pWarehouseName, short pCostType, |
| | | long pBaseGoodsTemplateId, String pGoodsTemplateName, long pBaseGoodsModelsId, |
| | | String pBaseGoodsModelsName, String pSupplier, short pBuyType, |
| | | String pUnit, long pPrice, long pProcureDate, |
| | | int pStates, long pDealTime, int pTimes) { |
| | | SqlParameterSource in = new MapSqlParameterSource() |
| | | .addValue("p_WAREHOUSE_FLOW_ID", pWarehouseFlowId) |
| | | .addValue("p_WAREHOUSE_TYPE", warehouseType) |
| | | .addValue("p_WAREHOUSE_ID", pWarehouseId) |
| | | .addValue("p_WH_GOODS_RECORD_ID", pWhGoodsRecordId) |
| | | .addValue("p_RECORD_TYPE", pRecordType) |
| | | .addValue("p_WAREHOUSE_NAME", pWarehouseName) |
| | | .addValue("p_COST_TYPE", pCostType) |
| | | .addValue("p_BASE_GOODS_TEMPLATE_ID", pBaseGoodsTemplateId) |
| | | .addValue("p_GOODS_TEMPLATE_NAME", pGoodsTemplateName) |
| | | .addValue("p_BASE_GOODS_MODELS_ID", pBaseGoodsModelsId) |
| | | .addValue("p_BASE_GOODS_MODELS_NAME", pBaseGoodsModelsName) |
| | | .addValue("p_SUPPLIER", pSupplier) |
| | | .addValue("p_BUY_TYPE", pBuyType) |
| | | .addValue("p_UNIT", pUnit) |
| | | .addValue("p_PRICE", pPrice) |
| | | .addValue("p_PROCURE_DATE", pProcureDate) |
| | | .addValue("p_STATES", pStates) |
| | | .addValue("p_DEAL_TIME", pDealTime) |
| | | .addValue("p_times", pTimes); |
| | | .addValue("p_WAREHOUSE_FLOW_ID", pWarehouseFlowId) |
| | | .addValue("p_WAREHOUSE_TYPE", warehouseType) |
| | | .addValue("p_WAREHOUSE_ID", pWarehouseId) |
| | | .addValue("p_WH_GOODS_RECORD_ID", pWhGoodsRecordId) |
| | | .addValue("p_RECORD_TYPE", pRecordType) |
| | | .addValue("p_WAREHOUSE_NAME", pWarehouseName) |
| | | .addValue("p_COST_TYPE", pCostType) |
| | | .addValue("p_BASE_GOODS_TEMPLATE_ID", pBaseGoodsTemplateId) |
| | | .addValue("p_GOODS_TEMPLATE_NAME", pGoodsTemplateName) |
| | | .addValue("p_BASE_GOODS_MODELS_ID", pBaseGoodsModelsId) |
| | | .addValue("p_BASE_GOODS_MODELS_NAME", pBaseGoodsModelsName) |
| | | .addValue("p_SUPPLIER", pSupplier) |
| | | .addValue("p_BUY_TYPE", pBuyType) |
| | | .addValue("p_UNIT", pUnit) |
| | | .addValue("p_PRICE", pPrice) |
| | | .addValue("p_PROCURE_DATE", pProcureDate) |
| | | .addValue("p_STATES", pStates) |
| | | .addValue("p_DEAL_TIME", pDealTime) |
| | | .addValue("p_times", pTimes); |
| | | Map<String, Object> out = simpleJdbcCall.execute(in); |
| | | System.out.println("Procedure result: " + out); |
| | | } |
| | |
| | | import com.consum.base.core.CodeGeneratorService; |
| | | import com.consum.base.core.WhBusinessEnum; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormInventory; |
| | | import com.consum.model.po.LWhFormInventoryGoods; |
| | | import com.consum.model.po.LWhFormOutput; |
| | | import com.consum.model.po.LWhFormProcure; |
| | | import com.consum.model.po.LWhFormProcureGoods; |
| | | import com.consum.model.po.LWhProcureModel; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.infrastructure.utils.NumberGenerator; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @ClassName LWhFormInventoryCoreService |
| | | |
| | | * @Date 2023/11/1 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class LWhFormInventoryCoreService { |
| | | |
| | | private LWhFormInventoryGoodsServiceImpl lWhFormInventoryGoods; |
| | | private LWhFormOutputCoreService lWhFormOutputCoreService; |
| | | private CodeGeneratorService codeGeneratorService; |
| | |
| | | |
| | | @Autowired |
| | | public LWhFormInventoryCoreService(LWhFormInventoryGoodsServiceImpl lWhFormInventoryGoods, |
| | | LWhFormOutputCoreService lWhFormOutputCoreService, |
| | | CodeGeneratorService codeGeneratorService, |
| | | LWhFormProcureService lWhFormProcureService, |
| | | BaseWarehouseServiceImpl baseWarehouseService, |
| | | LWhFormProcureGoodsService lWhFormProcureGoodsService, |
| | | LWhProcureModelService lWhProcureModelService, |
| | | BaseGoodsTemplateServiceImpl baseGoodsTemplateService, |
| | | LWhGoodsService lWhGoodsService, |
| | | LWhFormInventoryServiceImpl lWhFormInventoryService, |
| | | LWhFormProcureCoreService lWhFormProcureCoreService, |
| | | LWhFormOutputServiceImpl lWhFormOutputService |
| | | LWhFormOutputCoreService lWhFormOutputCoreService, |
| | | CodeGeneratorService codeGeneratorService, |
| | | LWhFormProcureService lWhFormProcureService, |
| | | BaseWarehouseServiceImpl baseWarehouseService, |
| | | LWhFormProcureGoodsService lWhFormProcureGoodsService, |
| | | LWhProcureModelService lWhProcureModelService, |
| | | BaseGoodsTemplateServiceImpl baseGoodsTemplateService, |
| | | LWhGoodsService lWhGoodsService, |
| | | LWhFormInventoryServiceImpl lWhFormInventoryService, |
| | | LWhFormProcureCoreService lWhFormProcureCoreService, |
| | | LWhFormOutputServiceImpl lWhFormOutputService |
| | | |
| | | ) { |
| | | this.lWhFormInventoryGoods = lWhFormInventoryGoods; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据 盘点单 生成 出库单 和 入库单 |
| | | * 盘点单中 盘盈物品生成入库单,盘亏生成出库单 |
| | | * 根据 盘点单 生成 出库单 和 入库单 盘点单中 盘盈物品生成入库单,盘亏生成出库单 |
| | | * |
| | | * @param whformInventoryId 盘点单id |
| | | * @return status true/false |
| | | * errMsg 错误消息 |
| | | * @return status true/false errMsg 错误消息 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String createInOutFormByInventoryId(Long whformInventoryId, S_user_core currentUser, FinSysTenantUser sysInfo) { |
| | |
| | | return "没有找到盘点单结果物品"; |
| | | } |
| | | Map<Integer, List<LWhFormInventoryGoods>> inventoryGoodsMap = lWhFormInventoryGoods.stream() |
| | | .filter(goods -> goods.getInventoryResult() == 2 || goods.getInventoryResult() == 3) |
| | | .collect(Collectors.groupingBy(LWhFormInventoryGoods::getInventoryResult)); |
| | | .filter(goods -> goods.getInventoryResult() == 2 || goods.getInventoryResult() == 3) |
| | | .collect(Collectors.groupingBy(LWhFormInventoryGoods::getInventoryResult)); |
| | | if (CollectionUtils.isEmpty(lWhFormInventoryGoods)) { |
| | | // rtnMap.put("status", true); |
| | | return null; |
| | |
| | | inOutMap.putAll(ckMap); |
| | | Long lWhFormOutputId = (Long) inOutMap.get("outId"); |
| | | //2.根据出库单出库 |
| | | Long lWarehouseFlowId = lWhFormOutputCoreService.outFormByTransId(lWhFormOutputId,WhBusinessEnum.CAIGOU, currentUser, stopTime); |
| | | Long lWarehouseFlowId = lWhFormOutputCoreService.outFormByTransId(lWhFormOutputId, WhBusinessEnum.CAIGOU, currentUser, stopTime); |
| | | if (lWarehouseFlowId == null) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | // throw new RuntimeException("创建出库单失败"); |
| | |
| | | * @param currentUser |
| | | */ |
| | | private Map<String, Object> createInFormByInventoryId(Long warehouseId, Long procureTime, List<LWhFormInventoryGoods> inventoryGoodsList, |
| | | S_user_core currentUser) { |
| | | S_user_core currentUser) { |
| | | if (CollectionUtils.isEmpty(inventoryGoodsList)) { |
| | | return null; |
| | | } |
| | |
| | | continue; |
| | | } |
| | | // 查询型号库存 |
| | | int goodsModelNum = lWhGoodsService.queryGoodsModelNum(0, warehouseId, baseGoodsModelsId, (short) 1, null); |
| | | int goodsModelNum = lWhGoodsService.queryGoodsModelNum(0, warehouseId, baseGoodsModelsId, 1, null); |
| | | LWhProcureModel model = new LWhProcureModel(); |
| | | model.setId(NumberGenerator.getLongSequenceNumber()); |
| | | model.setFromProcureGoodsId(fromProcureGoodsId); |
| | |
| | | * @param currentUser |
| | | */ |
| | | private Map<String, Object> createOutFormByInventoryId(Long warehouseId, Long procureTime, List<LWhFormInventoryGoods> inventoryGoodsList, |
| | | S_user_core currentUser, FinSysTenantUser sysInfo) { |
| | | S_user_core currentUser, FinSysTenantUser sysInfo) { |
| | | if (CollectionUtils.isEmpty(inventoryGoodsList)) { |
| | | return null; |
| | | } |
| | |
| | | continue; |
| | | } |
| | | //根据物品型号查询物品库存 |
| | | int goodsNum = lWhGoodsService.queryGoodsModelNum(0, warehouseId, baseGoodsModelsId, (short) 1, null); |
| | | int goodsNum = lWhGoodsService.queryGoodsModelNum(0, warehouseId, baseGoodsModelsId, 1, null); |
| | | //新增L_WH_PROCURE_MODEL记录 |
| | | LWhProcureModel lWhProcureModel = new LWhProcureModel(); |
| | | lWhProcureModel.setId(IdUtil.generateId()); |
| | |
| | | import com.consum.base.core.WhBusinessEnum; |
| | | import com.consum.base.core.param.BaseWarehouseParam1; |
| | | import com.consum.base.core.utils.LockManage; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.po.LWarehouseFlow; |
| | | import com.consum.model.po.LWhFormOutput; |
| | | import com.consum.model.po.LWhFormTransfer; |
| | | import com.consum.model.po.LWhGoodsRecord; |
| | | import com.consum.model.po.LWhProcureModel; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.infrastructure.utils.NumberGenerator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @ClassName WhFormOutputCoreService |
| | |
| | | |
| | | @Autowired |
| | | public LWhFormOutputCoreService(BaseGoodsTemplateServiceImpl baseGoodsTemplateService, |
| | | LWhGoodsService lWhGoodsService, |
| | | CodeGeneratorService codeGeneratorService, |
| | | LWhProcureModelService lWhProcureModelService, |
| | | LWhFormOutputService lWhFormOutputService, |
| | | LWarehouseFlowService lWarehouseFlowService, |
| | | LWhGoodsRecordDetailsService lWhGoodsRecordDetailsService, |
| | | LWhGoodsRecordService lWhGoodsRecordService) { |
| | | LWhGoodsService lWhGoodsService, |
| | | CodeGeneratorService codeGeneratorService, |
| | | LWhProcureModelService lWhProcureModelService, |
| | | LWhFormOutputService lWhFormOutputService, |
| | | LWarehouseFlowService lWarehouseFlowService, |
| | | LWhGoodsRecordDetailsService lWhGoodsRecordDetailsService, |
| | | LWhGoodsRecordService lWhGoodsRecordService) { |
| | | this.baseGoodsTemplateService = baseGoodsTemplateService; |
| | | this.lWhGoodsService = lWhGoodsService; |
| | | this.codeGeneratorService = codeGeneratorService; |
| | |
| | | * @return 流水记录总表ID |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Long outFormByTransId(Long outWarehouseFormId,WhBusinessEnum businessType, S_user_core currentUser, Long dealTime) { |
| | | public Long outFormByTransId(Long outWarehouseFormId, WhBusinessEnum businessType, S_user_core currentUser, Long dealTime) { |
| | | if (outWarehouseFormId == null) { |
| | | return null; |
| | | } |
| | |
| | | long lWarehouseFlowBusinessId = outWarehouseFormId; |
| | | |
| | | // 物品状态(0=在途调拨;1=入库未分发;2=已下发;3=报废) |
| | | short queryModelStatusT = 1; |
| | | Integer queryModelStatusT = 1; |
| | | //采购方式(1:集采;2=自采) |
| | | Short buyTypeT = null; |
| | | Integer buyTypeT = null; |
| | | Integer modGoodsTransferingStatusT = null; |
| | | String outputCode = lWhFormOutput.getOutputCode(); |
| | | if ((BaseWarehouseParam1.In_OutPutTypeEnum.Transfer_Output.getValue() + "").equals(outputCode)) { |
| | |
| | | buyTypeT = null; |
| | | modGoodsTransferingStatusT = 4; |
| | | } |
| | | short queryModelStatus = queryModelStatusT; |
| | | Short buyType = buyTypeT; |
| | | Integer queryModelStatus = queryModelStatusT; |
| | | Integer buyType = buyTypeT; |
| | | Integer modGoodsTransferingStatus = modGoodsTransferingStatusT; |
| | | |
| | | goodsModelNumList.forEach(itemModelInfo -> { |
| | |
| | | |
| | | //出库时候,按 先入库的先出库,同时入库的,按价格高的先出库 |
| | | outGoodsId = lWhGoodsService.queryOutGoodsId(outWarehouseType, outWarehouseId, baseGoodsModelsId, queryModelStatus, buyType, |
| | | counts); |
| | | counts); |
| | | lWhGoodsService.modGoodsTransfering(outGoodsId, inWarehouseType, inWarehouseId, inWarehouseName, modGoodsTransferingStatus); |
| | | // 批量插入 进出库流水明细[L_WH_GOODS_RECORD_DETAILS] |
| | | lWhGoodsRecordDetailsService.sameGoodsInsertMore(outGoodsId, whGoodsRecordId, (short) 0); |
| | |
| | | import com.consum.base.pojo.LWFormsOutputGoodsModelParam; |
| | | import com.consum.base.pojo.LWhFormOutputParam; |
| | | import com.consum.base.pojo.query.LWhFormOutputQry; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.po.BaseGoodsModels; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormOutput; |
| | | import com.consum.model.po.LWhProcureModel; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | /** |
| | | * @Description 出库单 |
| | |
| | | } |
| | | lWhProcureModel.setCounts(model.getCounts()); |
| | | //根据物品型号查询物品库存 |
| | | int goodsNum = this.lWhGoodsService.queryGoodsModelNum(0, warehouseId, model.getBaseGoodsModelsId(), (short) 1, null); |
| | | int goodsNum = this.lWhGoodsService.queryGoodsModelNum(0, warehouseId, model.getBaseGoodsModelsId(), 1, null); |
| | | lWhProcureModel.setWorehouseCount(goodsNum); |
| | | modelList.add(lWhProcureModel); |
| | | } |
| | |
| | | |
| | | import com.consum.base.core.CodeGeneratorEnum; |
| | | import com.consum.base.core.CodeGeneratorService; |
| | | import com.consum.base.core.utils.MapRowMapper; |
| | | import com.consum.base.pojo.*; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.model.po.*; |
| | | import com.consum.base.core.utils.MapRowMapper; |
| | | import com.consum.base.pojo.LWhFormScrappedExtend; |
| | | import com.consum.base.pojo.LWhFormScrappedGoodsParams; |
| | | import com.consum.base.pojo.LWhFormScrappedParam; |
| | | import com.consum.model.po.BaseGoodsModels; |
| | | import com.consum.model.po.BaseGoodsTemplate; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenantDepartment; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormScrapped; |
| | | import com.consum.model.po.LWhFormScrappedGoods; |
| | | import com.consum.model.po.SDictData; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | /** |
| | | * @Description 报废单 |
| | |
| | | */ |
| | | @Service |
| | | public class LWhFormScrappedServiceImpl extends BaseServiceImpl { |
| | | |
| | | @Autowired |
| | | private CodeGeneratorService codeGeneratorService; |
| | | @Autowired |
| | |
| | | private static String QUERY_LIST = "SELECT * FROM l_wh_form_scrapped WHERE 1 = 1"; |
| | | |
| | | private static final String QUERY_BF_DETAIL_LIST = "select lwfs.BUSINESS_FORM_CODE,\n" + |
| | | " lwfsg.GOODS_TEMPLATE_NAME,\n" + |
| | | " lwfsg.BASE_GOODS_MODELS_NAME,\n" + |
| | | " lwfsg.COUNTS,\n" + |
| | | " lwfs.AGENCY_NAME,\n" + |
| | | " lwfs,OPERATOR_NAME,\n" + |
| | | " lwfs,DEAL_TIME\n" + |
| | | "from l_wh_form_scrapped lwfs\n" + |
| | | " inner join l_wh_form_scrapped_goods lwfsg on lwfs.ID = lwfsg.FORM_SCRAPPED_ID "; |
| | | " lwfsg.GOODS_TEMPLATE_NAME,\n" + |
| | | " lwfsg.BASE_GOODS_MODELS_NAME,\n" + |
| | | " lwfsg.COUNTS,\n" + |
| | | " lwfs.AGENCY_NAME,\n" + |
| | | " lwfs,OPERATOR_NAME,\n" + |
| | | " lwfs,DEAL_TIME\n" + |
| | | "from l_wh_form_scrapped lwfs\n" + |
| | | " inner join l_wh_form_scrapped_goods lwfsg on lwfs.ID = lwfsg.FORM_SCRAPPED_ID "; |
| | | |
| | | /** |
| | | * 新增 |
| | | * |
| | | * @param param |
| | | * @param currentUser 当前登录用户 |
| | | * @param sysInfo 当前登录用户 |
| | | * @param currentUser 当前登录用户 |
| | | * @param sysInfo 当前登录用户 |
| | | * @return |
| | | */ |
| | | //1.新增报废单 |
| | |
| | | LWhFormScrappedGoods scrappedGoods = new LWhFormScrappedGoods(); |
| | | scrappedGoods.setId(IdUtil.generateId()); |
| | | //根据物品型号查询物品库存 |
| | | int goodsNum = this.lWhGoodsService.queryGoodsModelNum(0, warehouseId, scrappedGoods.getBaseGoodsModelsId(), (short) 1, null); |
| | | int goodsNum = this.lWhGoodsService.queryGoodsModelNum(0, warehouseId, scrappedGoods.getBaseGoodsModelsId(), 1, null); |
| | | if (params.getCounts() > goodsNum) { |
| | | log.error("报废数量大于库存数量"); |
| | | return 0; |
| | |
| | | } |
| | | |
| | | /** |
| | | * @Description 列表查询 |
| | | * @Description 列表查询 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/11/2 |
| | | */ |
| | |
| | | } |
| | | //物品名称 |
| | | if (!StringUtils.isEmpty(param.getGoodsTemplateName())) { |
| | | sql.append(" AND id IN (SELECT BUSINESS_ID FROM L_WH_PROCURE_MODEL procureModel LEFT JOIN BASE_GOODS_MODELS baseModel ON procureModel.BASE_GOODS_MODELS_ID=baseModel.ID LEFT JOIN BASE_GOODS_TEMPLATE baseTemp ON baseModel.GOODS_TEMPLATES_ID=baseTemp.id WHERE procureModel.BUSINESS_TYPE=1 AND baseTemp.GOODS_NAME LIKE :goodsTemplateName)"); |
| | | sql.append( |
| | | " AND id IN (SELECT BUSINESS_ID FROM L_WH_PROCURE_MODEL procureModel LEFT JOIN BASE_GOODS_MODELS baseModel ON procureModel.BASE_GOODS_MODELS_ID=baseModel.ID LEFT JOIN BASE_GOODS_TEMPLATE baseTemp ON baseModel.GOODS_TEMPLATES_ID=baseTemp.id WHERE procureModel.BUSINESS_TYPE=1 AND baseTemp.GOODS_NAME LIKE :goodsTemplateName)"); |
| | | paramts.put("goodsTemplateName", StringUtils.CHAR_PERCENT + param.getGoodsTemplateName() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | //机构 |
| | | sql.append(" and AGENCY_ID like :agencyId "); |
| | | if (param.getAgencyId() != null){ |
| | | paramts.put("agencyId", param.getAgencyId() + StringUtils.CHAR_PERCENT); |
| | | if (param.getAgencyId() != null) { |
| | | paramts.put("agencyId", param.getAgencyId() + StringUtils.CHAR_PERCENT); |
| | | } else { |
| | | paramts.put("agencyId", sysInfo.getTenantId() + StringUtils.CHAR_PERCENT); |
| | | paramts.put("agencyId", sysInfo.getTenantId() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | //报废时间 |
| | | if (param.getDealTimeStart() != null) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据id查询详情 |
| | | * @Description 根据id查询详情 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/11/2 |
| | | */ |
| | |
| | | //1.查询报废单 |
| | | LWhFormScrapped lWhFormScrapped = this.get(new LWhFormScrapped(id)); |
| | | if (lWhFormScrapped != null) { |
| | | BeanUtils.copyProperties(lWhFormScrapped,scrappedExtend); |
| | | BeanUtils.copyProperties(lWhFormScrapped, scrappedExtend); |
| | | } |
| | | //2.查询报废单 |
| | | List<LWhFormScrappedGoods> scrappedGoodsList = this.scrappedGoodsService.getByFormScrappedId(id); |
| | |
| | | |
| | | /** |
| | | * 报废明细 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | |
| | | |
| | | |
| | | /** |
| | | * @Description 导出报废登记单 |
| | | * @Description 导出报废登记单 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/11/2 |
| | | */ |
| | |
| | | if (lWhFormScrapped != null) { |
| | | lWhFormScrapped.setDealTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | lWhFormScrapped.setOperatorName(sysInfo.getUserName()); |
| | | BeanUtils.copyProperties(lWhFormScrapped,scrappedExtend); |
| | | BeanUtils.copyProperties(lWhFormScrapped, scrappedExtend); |
| | | } |
| | | //2.查询报废单物品 |
| | | List<LWhFormScrappedGoods> scrappedGoodsList = this.scrappedGoodsService.getByFormScrappedId(id); |
| | |
| | | |
| | | import com.consum.base.core.WhBusinessEnum; |
| | | import com.consum.base.core.utils.LockManage; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.po.LGoodsUserRecord; |
| | | import com.consum.model.po.LWarehouseFlow; |
| | | import com.consum.model.po.LWhFormTransfer; |
| | | import com.consum.model.po.LWhGoodsRecord; |
| | | import com.consum.model.po.LWhGoodsRecordDetails; |
| | | import com.consum.model.po.LWhProcureModelUser; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.NumberGenerator; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | /** |
| | | * @ClassName LWhFormTransferCoreService |
| | |
| | | lGoodsWhRecordService.insertNewRecord(outGoodsIds, inWarehouseFlowId, dealTime); |
| | | |
| | | // 获得锁后查询该型号的期初数量 |
| | | int goodsModelNum = lWhGoodsService.queryGoodsModelNum(inWarehouseType, inWarehouseId, baseGoodsModelsId, (short) 1, null); |
| | | int goodsModelNum = lWhGoodsService.queryGoodsModelNum(inWarehouseType, inWarehouseId, baseGoodsModelsId, 1, null); |
| | | whGoodsRecord.setInitialCount(goodsModelNum); |
| | | whGoodsRecord.setEndCount(goodsModelNum + whGoodsRecord.getThisCount()); |
| | | } |
| | |
| | | import com.consum.base.pojo.response.FormTransferGoodsVO; |
| | | import com.consum.base.pojo.response.GoodsModelVO; |
| | | import com.consum.base.pojo.response.LWHFromTransferExtendVO; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.po.BaseGoodsModels; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenant; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormOutput; |
| | | import com.consum.model.po.LWhFormTransfer; |
| | | import com.consum.model.po.LWhGoodsRecord; |
| | | import com.consum.model.po.LWhProcureModel; |
| | | import com.consum.model.po.LWhProcureModelUser; |
| | | import com.consum.model.vo.LWhFormOutputVo; |
| | | import com.consum.model.vo.LWhGoodsRecordVo; |
| | | import com.iplatform.model.po.S_user_core; |
| | |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description 调拨管理 |
| | |
| | | if (baseGoodsModels != null) { |
| | | lWhProcureModel.setBaseGoodsModelsName(baseGoodsModels.getModelName()); |
| | | } |
| | | // TODO 价格 |
| | | lWhProcureModel.setPrice(10L); |
| | | //根据物品型号查询物品库存 |
| | | int goodsNum = this.lWhGoodsService.queryGoodsModelNum(0, warehouseId, model.getBaseGoodsModelsId(), (short) 1, null); |
| | | int goodsNum = this.lWhGoodsService.queryGoodsModelNum(0, warehouseId, model.getBaseGoodsModelsId(), 1, null); |
| | | lWhProcureModel.setWorehouseCount(goodsNum); |
| | | |
| | | //3.当业务类型为部门分发时 添加部门分发记录和使用人 |
| | |
| | | paramts.put("goodsName", StringUtils.CHAR_PERCENT + transferQry.getGoodsTemplateName() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | // 规格型号 |
| | | if (transferQry.getBaseGoodsTemplateId() != null) { |
| | | if (transferQry.getBaseGoodsModelsId() != null) { |
| | | sql.append("AND bgm.id =:goodsModelId "); |
| | | paramts.put("goodsModelId", transferQry.getBaseGoodsTemplateId()); |
| | | paramts.put("goodsModelId", transferQry.getBaseGoodsModelsId()); |
| | | } |
| | | //调拨机构 |
| | | if (transferQry.getOutAgencyId() != null) { |
| | |
| | | } |
| | | |
| | | |
| | | public GenericPager<Map<String, Object>> queryFormTransferDetailList(TransferQry param) { |
| | | |
| | | HashMap<String, Object> params = new HashMap<>(); |
| | | StringBuilder sql = new StringBuilder("SELECT ft.id,\n" |
| | | + " ft.BUSINESS_FORM_CODE,\n" |
| | | + " bgt.GOODS_NAME,\n" |
| | | + " bgt.CLASSIFICATION,\n" |
| | | + " pm.BASE_GOODS_MODELS_NAME,\n" |
| | | + " pm.COUNTS,\n" |
| | | + " ft.IN_AGENCY_NAME,\n" |
| | | + " ft.OPERATOR_NAME,\n" |
| | | + " ft.CREATE_TIME,\n" |
| | | + " ft.IN_TIME,\n" |
| | | + " ft.OUT_AGENCY_NAME,\n" |
| | | + " ft.OUT_OPERATOR_NAME,\n" |
| | | + " ft.OUTPUT_TIME\n" |
| | | + "FROM l_wh_form_transfer ft\n" |
| | | + " LEFT JOIN l_wh_procure_model pm ON ft.ID = pm.BUSINESS_ID\n" |
| | | + " LEFT JOIN base_goods_models bgm ON bgm.id = pm.BASE_GOODS_MODELS_ID\n" |
| | | + " LEFT JOIN base_goods_template bgt ON bgt.id = bgm.GOODS_TEMPLATES_ID where 1=1 "); |
| | | if (StringUtils.isNotEmpty(param.getBusinessFormCode())) { |
| | | sql.append("AND ft.BUSINESS_FORM_CODE = :businessFormCode "); |
| | | params.put("businessFormCode", param.getBusinessFormCode()); |
| | | } |
| | | if (StringUtils.isNotEmpty(param.getGoodsTemplateName())) { |
| | | sql.append("AND bgt.GOODS_NAME like :goodsName "); |
| | | params.put("goodsName", StringUtils.CHAR_PERCENT + param.getGoodsTemplateName() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | if (param.getBaseGoodsModelsId() != null) { |
| | | sql.append("AND bgm.id = :goodsModelId "); |
| | | params.put("goodsModelId", param.getBaseGoodsModelsId()); |
| | | } |
| | | if (param.getOutAgencyId() != null) { |
| | | sql.append("AND ft.OUT_AGENCY_ID like :outAgencyId "); |
| | | params.put("outAgencyId", param.getOutAgencyId()); |
| | | } |
| | | if (param.getOutAgencyId() != null) { |
| | | sql.append("AND ft.IN_AGENCY_ID like :inAgencyId "); |
| | | params.put("inAgencyId", param.getInAgencyId()); |
| | | } |
| | | if (StringUtils.isNotEmpty(param.getOperatorName())) { |
| | | sql.append("AND ft.OPERATOR_NAME = :operatorName "); |
| | | params.put("operatorName", param.getOperatorName()); |
| | | } |
| | | //申请创建时间 |
| | | if (param.getCreateTimeStart() != null) { |
| | | sql.append("AND ft.CREATE_TIME >= :createTimeStart "); |
| | | params.put("createTimeStart", param.getCreateTimeStart() * 1000000); |
| | | } |
| | | if (param.getCreateTimeEnd() != null) { |
| | | sql.append("AND ft.CREATE_TIME < :createTimeEnd "); |
| | | params.put("createTimeEnd", param.getCreateTimeEnd() * 1000000 + 240000); |
| | | } |
| | | //接收时间 |
| | | if (param.getStartTime() != null) { |
| | | sql.append("AND ft.IN_TIME >= :createTimeStart "); |
| | | params.put("createTimeStart", param.getStartTime() * 1000000); |
| | | } |
| | | if (param.getEndTime() != null) { |
| | | sql.append("AND ft.IN_TIME < :createTimeEnd "); |
| | | params.put("createTimeEnd", param.getEndTime() * 1000000 + 240000); |
| | | } |
| | | GenericPager<Map<String, Object>> mapGenericPager = this.selectSplit(sql.toString(), params, param.getPageNum(), param.getPageSize(), new MapperUtil()); |
| | | return mapGenericPager; |
| | | |
| | | } |
| | | } |
| | |
| | | */ |
| | | private static String query_Goods_Model_Num = "SELECT COUNT(1) from L_WH_GOODS where 1=1"; |
| | | |
| | | public int queryGoodsModelNum(Integer warehouseType, Long warehouseId, Long baseGoodsModelsId, Short states, Short buyType) { |
| | | public int queryGoodsModelNum(Integer warehouseType, Long warehouseId, Long baseGoodsModelsId, Integer states, Integer buyType) { |
| | | StringBuilder sql = new StringBuilder(query_Goods_Model_Num); |
| | | Map<String, Object> paramts = new HashMap<>(); |
| | | |
| | |
| | | */ |
| | | private static String QUERY_OUT_GOODS_ID = "SELECT * FROM L_WH_GOODS WHERE 1=1"; |
| | | |
| | | public List<Map<String, Object>> queryOutGoods(Integer warehouseType, Long warehouseId, Long baseGoodsModelsId, Short states, Short buyType, |
| | | public List<Map<String, Object>> queryOutGoods(Integer warehouseType, Long warehouseId, Long baseGoodsModelsId, Integer states, Integer buyType, |
| | | Integer goodsModelNum) { |
| | | StringBuilder sql = new StringBuilder(QUERY_OUT_GOODS_ID); |
| | | Map<String, Object> paramts = new HashMap<>(); |
| | |
| | | * @param goodsModelNum 取出的数量 |
| | | * @return |
| | | */ |
| | | public List<Long> queryOutGoodsId(Integer warehouseType, Long warehouseId, Long baseGoodsModelsId, Short states, Short buyType, Integer goodsModelNum) { |
| | | public List<Long> queryOutGoodsId(Integer warehouseType, Long warehouseId, Long baseGoodsModelsId, Integer states, Integer buyType, Integer goodsModelNum) { |
| | | List<Map<String, Object>> outGoods = queryOutGoods(warehouseType, warehouseId, baseGoodsModelsId, states, buyType, goodsModelNum); |
| | | if (CollectionUtils.isEmpty(outGoods)) { |
| | | return null; |