代码提交
This commit is contained in:
parent
8d9b7ccfa3
commit
2d6f3939a9
|
|
@ -53,9 +53,8 @@ public class MachineController extends BaseController {
|
||||||
@ApiOperation(value = "查询机具设备管理列表1")
|
@ApiOperation(value = "查询机具设备管理列表1")
|
||||||
//@RequiresPermissions("ma:machine:list")
|
//@RequiresPermissions("ma:machine:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(Machine machine)
|
public TableDataInfo list(Machine machine) {
|
||||||
{
|
if (machine.getPrefix() == null) {
|
||||||
if (machine.getPrefix()==null){
|
|
||||||
startPage();
|
startPage();
|
||||||
}
|
}
|
||||||
List<MachineVo> list = machineService.selectMachineList(machine);
|
List<MachineVo> list = machineService.selectMachineList(machine);
|
||||||
|
|
@ -68,8 +67,7 @@ public class MachineController extends BaseController {
|
||||||
@ApiOperation(value = "查询在库机具编号")
|
@ApiOperation(value = "查询在库机具编号")
|
||||||
//@RequiresPermissions("ma:machine:typeList")
|
//@RequiresPermissions("ma:machine:typeList")
|
||||||
@GetMapping("/getMachineList")
|
@GetMapping("/getMachineList")
|
||||||
public AjaxResult getMachineList(Type type)
|
public AjaxResult getMachineList(Type type) {
|
||||||
{
|
|
||||||
return machineService.getMachineList(type);
|
return machineService.getMachineList(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,8 +77,7 @@ public class MachineController extends BaseController {
|
||||||
@ApiOperation(value = "查询机具设备管理列表2")
|
@ApiOperation(value = "查询机具设备管理列表2")
|
||||||
//@RequiresPermissions("ma:machine:typeList")
|
//@RequiresPermissions("ma:machine:typeList")
|
||||||
@GetMapping("/getTypeList")
|
@GetMapping("/getTypeList")
|
||||||
public AjaxResult list(Type type)
|
public AjaxResult list(Type type) {
|
||||||
{
|
|
||||||
return machineService.selectByTypeList(type);
|
return machineService.selectByTypeList(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -90,10 +87,9 @@ public class MachineController extends BaseController {
|
||||||
@ApiOperation(value = "导出机具设备管理列表")
|
@ApiOperation(value = "导出机具设备管理列表")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("ma:machine:export")
|
@RequiresPermissions("ma:machine:export")
|
||||||
@SysLog(title = "机具设备管理", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出机具设备管理")
|
@SysLog(title = "机具设备管理", businessType = OperaType.EXPORT, logType = 1, module = "仓储管理->导出机具设备管理")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, Machine machine)
|
public void export(HttpServletResponse response, Machine machine) {
|
||||||
{
|
|
||||||
List<MachineVo> list = machineService.selectMachineList(machine);
|
List<MachineVo> list = machineService.selectMachineList(machine);
|
||||||
ExcelUtil<MachineVo> util = new ExcelUtil<MachineVo>(MachineVo.class);
|
ExcelUtil<MachineVo> util = new ExcelUtil<MachineVo>(MachineVo.class);
|
||||||
util.exportExcel(response, list, "机具设备管理数据");
|
util.exportExcel(response, list, "机具设备管理数据");
|
||||||
|
|
@ -105,13 +101,13 @@ public class MachineController extends BaseController {
|
||||||
@ApiOperation(value = "获取机具设备管理详细信息")
|
@ApiOperation(value = "获取机具设备管理详细信息")
|
||||||
@RequiresPermissions("ma:machine:query")
|
@RequiresPermissions("ma:machine:query")
|
||||||
@GetMapping(value = "/{maId}")
|
@GetMapping(value = "/{maId}")
|
||||||
public AjaxResult getInfo(@PathVariable("maId") Long maId)
|
public AjaxResult getInfo(@PathVariable("maId") Long maId) {
|
||||||
{
|
|
||||||
return AjaxResult.success(machineService.selectMachineByMaId(maId));
|
return AjaxResult.success(machineService.selectMachineByMaId(maId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取机具设备管理详细信息
|
* 获取机具设备管理详细信息
|
||||||
|
*
|
||||||
* @param machine
|
* @param machine
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -132,10 +128,9 @@ public class MachineController extends BaseController {
|
||||||
@ApiOperation(value = "新增机具设备管理")
|
@ApiOperation(value = "新增机具设备管理")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("ma:machine:add")
|
@RequiresPermissions("ma:machine:add")
|
||||||
@SysLog(title = "机具设备管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增机具设备管理")
|
@SysLog(title = "机具设备管理", businessType = OperaType.INSERT, logType = 1, module = "仓储管理->新增机具设备管理")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody Machine machine)
|
public AjaxResult add(@RequestBody Machine machine) {
|
||||||
{
|
|
||||||
return toAjax(machineService.insertMachine(machine));
|
return toAjax(machineService.insertMachine(machine));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -145,29 +140,39 @@ public class MachineController extends BaseController {
|
||||||
@ApiOperation(value = "修改机具设备管理")
|
@ApiOperation(value = "修改机具设备管理")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("ma:machine:edit")
|
@RequiresPermissions("ma:machine:edit")
|
||||||
@SysLog(title = "机具设备管理", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改机具设备管理")
|
@SysLog(title = "机具设备管理", businessType = OperaType.UPDATE, logType = 1, module = "仓储管理->修改机具设备管理")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody Machine machine)
|
public AjaxResult edit(@RequestBody Machine machine) {
|
||||||
{
|
|
||||||
return machineService.updateMachine(machine);
|
return machineService.updateMachine(machine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改机具设备状态
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改机具设备状态")
|
||||||
|
@PreventRepeatSubmit
|
||||||
|
@RequiresPermissions("ma:machine:editMachineStatus")
|
||||||
|
@SysLog(title = "修改机具设备状态", businessType = OperaType.UPDATE, logType = 1, module = "仓储管理->修改机具设备状态")
|
||||||
|
@PutMapping("/editMachineStatus")
|
||||||
|
public AjaxResult editMachineStatus(@RequestBody Machine machine) {
|
||||||
|
return machineService.editMachineStatus(machine);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除机具设备管理
|
* 删除机具设备管理
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "删除机具设备管理")
|
@ApiOperation(value = "删除机具设备管理")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("ma:machine:remove")
|
@RequiresPermissions("ma:machine:remove")
|
||||||
@SysLog(title = "机具设备管理", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除机具设备管理")
|
@SysLog(title = "机具设备管理", businessType = OperaType.DELETE, logType = 1, module = "仓储管理->删除机具设备管理")
|
||||||
@DeleteMapping("/{maId}")
|
@DeleteMapping("/{maId}")
|
||||||
public AjaxResult remove(@PathVariable Long maId)
|
public AjaxResult remove(@PathVariable Long maId) {
|
||||||
{
|
|
||||||
return machineService.deleteMachineByMaId(maId);
|
return machineService.deleteMachineByMaId(maId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电子标签查询
|
* 电子标签查询
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "电子标签查询")
|
@ApiOperation(value = "电子标签查询")
|
||||||
@GetMapping("/getElectronicLabel")
|
@GetMapping("/getElectronicLabel")
|
||||||
|
|
@ -177,6 +182,7 @@ public class MachineController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电子标签编码查询
|
* 电子标签编码查询
|
||||||
|
*
|
||||||
* @param machine
|
* @param machine
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -192,6 +198,7 @@ public class MachineController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据标签信息查询出库单
|
* 根据标签信息查询出库单
|
||||||
|
*
|
||||||
* @param leaseApplyInfo
|
* @param leaseApplyInfo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -204,7 +211,7 @@ public class MachineController extends BaseController {
|
||||||
|
|
||||||
@ApiOperation(value = "获取报告")
|
@ApiOperation(value = "获取报告")
|
||||||
@PostMapping("/getReport")
|
@PostMapping("/getReport")
|
||||||
public AjaxResult getReport(@RequestBody Machine machine){
|
public AjaxResult getReport(@RequestBody Machine machine) {
|
||||||
try {
|
try {
|
||||||
// 创建RestTemplate实例
|
// 创建RestTemplate实例
|
||||||
RestTemplate restTemplate = new RestTemplate();
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
|
|
@ -263,8 +270,7 @@ public class MachineController extends BaseController {
|
||||||
@ApiOperation(value = "检验报告同步")
|
@ApiOperation(value = "检验报告同步")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@PostMapping("/synchReport")
|
@PostMapping("/synchReport")
|
||||||
public AjaxResult synchReport(@RequestBody Machine machine)
|
public AjaxResult synchReport(@RequestBody Machine machine) {
|
||||||
{
|
|
||||||
return machineService.synchReport(machine);
|
return machineService.synchReport(machine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -274,13 +280,13 @@ public class MachineController extends BaseController {
|
||||||
@ApiOperation(value = "固定资产编号录入")
|
@ApiOperation(value = "固定资产编号录入")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@PostMapping("/editAssetsCode")
|
@PostMapping("/editAssetsCode")
|
||||||
public AjaxResult editAssetsCode(@RequestBody Machine machine)
|
public AjaxResult editAssetsCode(@RequestBody Machine machine) {
|
||||||
{
|
|
||||||
return toAjax(machineService.editAssetsCode(machine));
|
return toAjax(machineService.editAssetsCode(machine));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据qrcode查询机具历史信息
|
* 根据qrcode查询机具历史信息
|
||||||
|
*
|
||||||
* @param machine
|
* @param machine
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -299,6 +305,7 @@ public class MachineController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据qrcode查询机具历史信息
|
* 根据qrcode查询机具历史信息
|
||||||
|
*
|
||||||
* @param machine
|
* @param machine
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -309,6 +316,7 @@ public class MachineController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据qrcode查询机具历史信息-New查询安全工器具和工器具
|
* 根据qrcode查询机具历史信息-New查询安全工器具和工器具
|
||||||
|
*
|
||||||
* @param machine
|
* @param machine
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -319,6 +327,7 @@ public class MachineController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据类型id获取编码
|
* 根据类型id获取编码
|
||||||
|
*
|
||||||
* @param machine
|
* @param machine
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import com.bonus.common.biz.annotation.StoreLog;
|
||||||
import com.bonus.common.biz.config.ListPagingUtil;
|
import com.bonus.common.biz.config.ListPagingUtil;
|
||||||
import com.bonus.common.core.utils.ServletUtils;
|
import com.bonus.common.core.utils.ServletUtils;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
|
|
@ -262,6 +263,14 @@ public class TypeController extends BaseController {
|
||||||
public AjaxResult add(@RequestBody Type type) {
|
public AjaxResult add(@RequestBody Type type) {
|
||||||
return toAjax(typeService.insertType(type));
|
return toAjax(typeService.insertType(type));
|
||||||
}
|
}
|
||||||
|
@ApiOperation(value = "修改物资库存")
|
||||||
|
@PreventRepeatSubmit
|
||||||
|
@RequiresPermissions("ma:type:updateNum")
|
||||||
|
@SysLog(title = "物资类型管理", businessType = OperaType.INSERT, module = "仓储管理->修改物资库存")
|
||||||
|
@PostMapping("/updateStorageNum")
|
||||||
|
public AjaxResult updateStorageNum(@RequestBody Type type) {
|
||||||
|
return toAjax(typeService.updateStorageNum(type));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改物资类型管理
|
* 修改物资类型管理
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,9 @@ public class Type extends BaseEntity {
|
||||||
@Excel(name = "实时库存",sort = 11)
|
@Excel(name = "实时库存",sort = 11)
|
||||||
@ApiModelProperty(value = "实时库存")
|
@ApiModelProperty(value = "实时库存")
|
||||||
private BigDecimal storageNum;
|
private BigDecimal storageNum;
|
||||||
|
/** 实时库存 */
|
||||||
|
@ApiModelProperty(value = "修改前库存")
|
||||||
|
private BigDecimal preStoreNum;
|
||||||
|
|
||||||
/** 是否扣费 */
|
/** 是否扣费 */
|
||||||
@ApiModelProperty(value = "是否扣费,0:扣费, 1:不扣费")
|
@ApiModelProperty(value = "是否扣费,0:扣费, 1:不扣费")
|
||||||
|
|
|
||||||
|
|
@ -220,4 +220,6 @@ public interface MachineMapper
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int batchUpdateSynchReport(@Param("list") List<SampleSync> samples);
|
int batchUpdateSynchReport(@Param("list") List<SampleSync> samples);
|
||||||
|
|
||||||
|
int editMachineStatus(Machine machine);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -217,4 +217,10 @@ public interface TypeMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<MaTypeVo> getUserList(MaTypeVo type);
|
List<MaTypeVo> getUserList(MaTypeVo type);
|
||||||
|
|
||||||
|
int updateStorageNum(Type type);
|
||||||
|
|
||||||
|
BigDecimal getStorageNumByTypeId(Type type);
|
||||||
|
|
||||||
|
void insertStorageNumLog(Type type);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -140,4 +140,6 @@ public interface IMachineService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult getHisByCodeNew(Machine machine);
|
AjaxResult getHisByCodeNew(Machine machine);
|
||||||
|
|
||||||
|
AjaxResult editMachineStatus(Machine machine);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -144,4 +144,6 @@ public interface ITypeService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<MaTypeVo> getUserList(MaTypeVo type);
|
List<MaTypeVo> getUserList(MaTypeVo type);
|
||||||
|
|
||||||
|
int updateStorageNum(Type type);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -572,6 +572,16 @@ public class MachineServiceImpl implements IMachineService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult editMachineStatus(Machine machine) {
|
||||||
|
machine.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
int result = machineMapper.editMachineStatus(machine);
|
||||||
|
if (result > 0) {
|
||||||
|
return success(HttpCodeEnum.SUCCESS.getMsg(), result);
|
||||||
|
}
|
||||||
|
return error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编码铭牌信息
|
* 编码铭牌信息
|
||||||
* @param machine
|
* @param machine
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ import javax.annotation.Resource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物资类型管理Service业务层实现
|
* 物资类型管理Service业务层实现
|
||||||
|
*
|
||||||
* @author syruan
|
* @author syruan
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
|
@ -78,7 +79,8 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询物资类型四级树--前端联动式下拉框
|
* 查询物资类型四级树--前端联动式下拉框
|
||||||
* @param typeId 类型id
|
*
|
||||||
|
* @param typeId 类型id
|
||||||
* @param typeName 类型名称
|
* @param typeName 类型名称
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -131,7 +133,8 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 递归调用获取子级
|
* 递归调用获取子级
|
||||||
* @param list 集合
|
*
|
||||||
|
* @param list 集合
|
||||||
* @param parentId 父级id
|
* @param parentId 父级id
|
||||||
*/
|
*/
|
||||||
public List<Type> getChild(List<Type> list, Long parentId) {
|
public List<Type> getChild(List<Type> list, Long parentId) {
|
||||||
|
|
@ -184,6 +187,7 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询一级列表
|
* 查询一级列表
|
||||||
|
*
|
||||||
* @param maTypeVo
|
* @param maTypeVo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -195,6 +199,7 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询物资类型管理绑定的库管班长用户列表
|
* 查询物资类型管理绑定的库管班长用户列表
|
||||||
|
*
|
||||||
* @param type
|
* @param type
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -203,6 +208,17 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
return typeMapper.getUserList(type);
|
return typeMapper.getUserList(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateStorageNum(Type type) {
|
||||||
|
// 查询库存
|
||||||
|
// BigDecimal storageNum = typeMapper.getStorageNumByTypeId(type);
|
||||||
|
type.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||||
|
// type.setPreStoreNum(storageNum);
|
||||||
|
// 插入修改记录
|
||||||
|
typeMapper.insertStorageNumLog(type);
|
||||||
|
return typeMapper.updateStorageNum(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MaTypeSelectVo> selectMaTypeListByHouseId(Long houseId) {
|
public List<MaTypeSelectVo> selectMaTypeListByHouseId(Long houseId) {
|
||||||
|
|
@ -212,8 +228,8 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
/**
|
/**
|
||||||
* 根据组织树parent_id查询结果
|
* 根据组织树parent_id查询结果
|
||||||
*
|
*
|
||||||
* @param typeId 父级id
|
* @param typeId 父级id
|
||||||
* @param type 名称筛选
|
* @param type 名称筛选
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<MaTypeVo> getListByParentId(Long typeId, MaTypeVo type) {
|
public List<MaTypeVo> getListByParentId(Long typeId, MaTypeVo type) {
|
||||||
|
|
@ -233,7 +249,7 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Type> selectTypeList(Type type) {
|
public List<Type> selectTypeList(Type type) {
|
||||||
if (type != null ) {
|
if (type != null) {
|
||||||
if (StringUtils.isEmpty(type.getDelFlag())) {
|
if (StringUtils.isEmpty(type.getDelFlag())) {
|
||||||
// 如果没赋值,则默认查询正常数据状态
|
// 如果没赋值,则默认查询正常数据状态
|
||||||
type.setDelFlag(String.valueOf(DataCodeEnum.NORMAL.getCode()));
|
type.setDelFlag(String.valueOf(DataCodeEnum.NORMAL.getCode()));
|
||||||
|
|
@ -255,7 +271,7 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
@Override
|
@Override
|
||||||
public List<Type> selectTypeList4Keeper(Type type) {
|
public List<Type> selectTypeList4Keeper(Type type) {
|
||||||
List<Type> typeList = Collections.emptyList();
|
List<Type> typeList = Collections.emptyList();
|
||||||
if (type != null ) {
|
if (type != null) {
|
||||||
if (StringUtils.isEmpty(type.getDelFlag())) {
|
if (StringUtils.isEmpty(type.getDelFlag())) {
|
||||||
// 如果没赋值,则默认查询正常数据状态
|
// 如果没赋值,则默认查询正常数据状态
|
||||||
type.setDelFlag(String.valueOf(DataCodeEnum.NORMAL.getCode()));
|
type.setDelFlag(String.valueOf(DataCodeEnum.NORMAL.getCode()));
|
||||||
|
|
@ -266,7 +282,7 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
typeList = typeMapper.selectTypeList4Keeper(type);
|
typeList = typeMapper.selectTypeList4Keeper(type);
|
||||||
typeList.removeIf(item -> item.getLevel() == null || !Objects.equals(item.getLevel(),"4"));
|
typeList.removeIf(item -> item.getLevel() == null || !Objects.equals(item.getLevel(), "4"));
|
||||||
return typeList;
|
return typeList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -279,7 +295,7 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
@Override
|
@Override
|
||||||
public List<Type> selectTypeList4Repair(Type type) {
|
public List<Type> selectTypeList4Repair(Type type) {
|
||||||
List<Type> typeList;
|
List<Type> typeList;
|
||||||
if (type != null ) {
|
if (type != null) {
|
||||||
if (StringUtils.isEmpty(type.getDelFlag())) {
|
if (StringUtils.isEmpty(type.getDelFlag())) {
|
||||||
// 如果没赋值,则默认查询正常数据状态
|
// 如果没赋值,则默认查询正常数据状态
|
||||||
type.setDelFlag(String.valueOf(DataCodeEnum.NORMAL.getCode()));
|
type.setDelFlag(String.valueOf(DataCodeEnum.NORMAL.getCode()));
|
||||||
|
|
@ -293,7 +309,7 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
}
|
}
|
||||||
// 执行SQL
|
// 执行SQL
|
||||||
typeList = typeMapper.selectTypeList4Repair(type);
|
typeList = typeMapper.selectTypeList4Repair(type);
|
||||||
typeList.removeIf(item -> item.getLevel() == null || !Objects.equals(item.getLevel(),"4"));
|
typeList.removeIf(item -> item.getLevel() == null || !Objects.equals(item.getLevel(), "4"));
|
||||||
return typeList;
|
return typeList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -433,8 +449,8 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
//维护库管信息
|
//维护库管信息
|
||||||
List<String> keeperArr = type.getKeeperArr();
|
List<String> keeperArr = type.getKeeperArr();
|
||||||
|
|
||||||
if (keeperArr != null && keeperArr.size()>0){
|
if (keeperArr != null && keeperArr.size() > 0) {
|
||||||
for(int i=0 ; i<keeperArr.size();i++){
|
for (int i = 0; i < keeperArr.size(); i++) {
|
||||||
Type keeper = new Type();
|
Type keeper = new Type();
|
||||||
keeper.setKeeperId(keeperArr.get(i));
|
keeper.setKeeperId(keeperArr.get(i));
|
||||||
keeper.setTypeId(type.getTypeId());
|
keeper.setTypeId(type.getTypeId());
|
||||||
|
|
@ -444,8 +460,8 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
}
|
}
|
||||||
//维护维修员信息
|
//维护维修员信息
|
||||||
List<String> repairerArr = type.getRepairerArr();
|
List<String> repairerArr = type.getRepairerArr();
|
||||||
if (repairerArr != null && repairerArr.size()>0){
|
if (repairerArr != null && repairerArr.size() > 0) {
|
||||||
for(int i=0 ; i<repairerArr.size();i++){
|
for (int i = 0; i < repairerArr.size(); i++) {
|
||||||
Type repairer = new Type();
|
Type repairer = new Type();
|
||||||
repairer.setRepairerId(repairerArr.get(i));
|
repairer.setRepairerId(repairerArr.get(i));
|
||||||
repairer.setTypeId(type.getTypeId());
|
repairer.setTypeId(type.getTypeId());
|
||||||
|
|
@ -477,7 +493,7 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
|
|
||||||
if (keeperArr != null && !keeperArr.isEmpty()) {
|
if (keeperArr != null && !keeperArr.isEmpty()) {
|
||||||
typeMapper.deleteTypeKeeperByTypeId(type);
|
typeMapper.deleteTypeKeeperByTypeId(type);
|
||||||
for(int i=0 ; i<keeperArr.size();i++){
|
for (int i = 0; i < keeperArr.size(); i++) {
|
||||||
Type keeper = new Type();
|
Type keeper = new Type();
|
||||||
keeper.setKeeperId(keeperArr.get(i));
|
keeper.setKeeperId(keeperArr.get(i));
|
||||||
keeper.setTypeId(type.getTypeId());
|
keeper.setTypeId(type.getTypeId());
|
||||||
|
|
@ -486,9 +502,9 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
}
|
}
|
||||||
//维护维修员信息
|
//维护维修员信息
|
||||||
List<String> repairerArr = type.getRepairerArr();
|
List<String> repairerArr = type.getRepairerArr();
|
||||||
if (repairerArr != null && !repairerArr.isEmpty()){
|
if (repairerArr != null && !repairerArr.isEmpty()) {
|
||||||
typeMapper.deleteTypeRepairerByTypeId(type);
|
typeMapper.deleteTypeRepairerByTypeId(type);
|
||||||
for(int i=0 ; i<repairerArr.size();i++){
|
for (int i = 0; i < repairerArr.size(); i++) {
|
||||||
Type repairer = new Type();
|
Type repairer = new Type();
|
||||||
repairer.setRepairerId(repairerArr.get(i));
|
repairer.setRepairerId(repairerArr.get(i));
|
||||||
repairer.setTypeId(type.getTypeId());
|
repairer.setTypeId(type.getTypeId());
|
||||||
|
|
@ -631,10 +647,12 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
// 3.遍历所有配置关联
|
// 3.遍历所有配置关联
|
||||||
Map<Long, List<WhHouseSet>> groupedById = whHouseSets.stream().collect(Collectors.groupingBy(WhHouseSet::getHouseId));
|
Map<Long, List<WhHouseSet>> groupedById = whHouseSets.stream().collect(Collectors.groupingBy(WhHouseSet::getHouseId));
|
||||||
groupedById.forEach((id, itemList) -> {
|
groupedById.forEach((id, itemList) -> {
|
||||||
TreeSelect thisTree = new TreeSelect(itemList.get(0).getHouseId(),itemList.get(0).getHouseName(),0,null);
|
TreeSelect thisTree = new TreeSelect(itemList.get(0).getHouseId(), itemList.get(0).getHouseName(), 0, null);
|
||||||
List<TreeSelect> children = new ArrayList<>();
|
List<TreeSelect> children = new ArrayList<>();
|
||||||
for (WhHouseSet whHouseSet : itemList) {
|
for (WhHouseSet whHouseSet : itemList) {
|
||||||
if (whHouseSet == null || whHouseSet.getTypeId() == null) { continue; }
|
if (whHouseSet == null || whHouseSet.getTypeId() == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
TreeSelect oneLevelTree = maTypeMap.get(whHouseSet.getTypeId());
|
TreeSelect oneLevelTree = maTypeMap.get(whHouseSet.getTypeId());
|
||||||
if (oneLevelTree != null) {
|
if (oneLevelTree != null) {
|
||||||
children.add(oneLevelTree);
|
children.add(oneLevelTree);
|
||||||
|
|
@ -649,6 +667,7 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过构造函数将 Type对象 转换为 TreeSelect -- 并递归处理子节点
|
* 通过构造函数将 Type对象 转换为 TreeSelect -- 并递归处理子节点
|
||||||
|
*
|
||||||
* @param type 要进行转换的object对象
|
* @param type 要进行转换的object对象
|
||||||
*/
|
*/
|
||||||
private TreeSelect convertToTreeSelect(Type type) {
|
private TreeSelect convertToTreeSelect(Type type) {
|
||||||
|
|
@ -656,11 +675,10 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.map(this::convertToTreeSelect)
|
.map(this::convertToTreeSelect)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
return new TreeSelect(type.getTypeId(), type.getTypeName(), type.getHouseId(), Integer.valueOf(type.getLevel()),type.getParentId(), children, type.getNumber(), type.getIsEnter(), type.getKeeperUserId());
|
return new TreeSelect(type.getTypeId(), type.getTypeName(), type.getHouseId(), Integer.valueOf(type.getLevel()), type.getParentId(), children, type.getNumber(), type.getIsEnter(), type.getKeeperUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建前端所需要树结构
|
* 构建前端所需要树结构
|
||||||
*
|
*
|
||||||
|
|
@ -812,7 +830,7 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MaTypeVo> getMyTypeAndBindUsers(List<MaTypeVo> list,Long userId) {
|
public List<MaTypeVo> getMyTypeAndBindUsers(List<MaTypeVo> list, Long userId) {
|
||||||
|
|
||||||
List<TypeRepair> typeRepairList = typeRepairService.selectTypeRepairListAndUserName(new TypeRepair());
|
List<TypeRepair> typeRepairList = typeRepairService.selectTypeRepairListAndUserName(new TypeRepair());
|
||||||
List<TypeKeeper> typeKeeperList = typeKeeperService.selectTypeKeeperListAndUserName(new TypeKeeper());
|
List<TypeKeeper> typeKeeperList = typeKeeperService.selectTypeKeeperListAndUserName(new TypeKeeper());
|
||||||
|
|
@ -820,34 +838,33 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
if (CollectionUtils.isNotEmpty(typeRepairList)) {
|
if (CollectionUtils.isNotEmpty(typeRepairList)) {
|
||||||
for (TypeRepair typeRepair : typeRepairList) {
|
for (TypeRepair typeRepair : typeRepairList) {
|
||||||
if (Objects.nonNull(typeRepair.getTypeId()) && typeRepair.getTypeId().equals(maTypeVo.getTypeId())) {
|
if (Objects.nonNull(typeRepair.getTypeId()) && typeRepair.getTypeId().equals(maTypeVo.getTypeId())) {
|
||||||
if(userId !=null){
|
if (userId != null) {
|
||||||
Long repairerId = typeRepair.getUserId();
|
Long repairerId = typeRepair.getUserId();
|
||||||
if (repairerId.equals(userId)){
|
if (repairerId.equals(userId)) {
|
||||||
maTypeVo.setRepairUserId(typeRepair.getUserId());
|
maTypeVo.setRepairUserId(typeRepair.getUserId());
|
||||||
maTypeVo.setRepairUserName(typeRepair.getUserName());
|
maTypeVo.setRepairUserName(typeRepair.getUserName());
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
maTypeVo.setRepairUserId(typeRepair.getUserId());
|
maTypeVo.setRepairUserId(typeRepair.getUserId());
|
||||||
maTypeVo.setRepairUserName(typeRepair.getUserName());
|
maTypeVo.setRepairUserName(typeRepair.getUserName());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(typeKeeperList)) {
|
if (CollectionUtils.isNotEmpty(typeKeeperList)) {
|
||||||
for (TypeKeeper typeKeeper : typeKeeperList) {
|
for (TypeKeeper typeKeeper : typeKeeperList) {
|
||||||
if (Objects.nonNull(typeKeeper.getTypeId()) && typeKeeper.getTypeId().equals(maTypeVo.getTypeId())) {
|
if (Objects.nonNull(typeKeeper.getTypeId()) && typeKeeper.getTypeId().equals(maTypeVo.getTypeId())) {
|
||||||
if(userId !=null){
|
if (userId != null) {
|
||||||
Long keeperId = typeKeeper.getUserId();
|
Long keeperId = typeKeeper.getUserId();
|
||||||
if (keeperId.equals(userId)){
|
if (keeperId.equals(userId)) {
|
||||||
maTypeVo.setKeeperUserId(typeKeeper.getUserId());
|
maTypeVo.setKeeperUserId(typeKeeper.getUserId());
|
||||||
maTypeVo.setKeeperUserName(typeKeeper.getUserName());
|
maTypeVo.setKeeperUserName(typeKeeper.getUserName());
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
maTypeVo.setKeeperUserId(typeKeeper.getUserId());
|
maTypeVo.setKeeperUserId(typeKeeper.getUserId());
|
||||||
maTypeVo.setKeeperUserName(typeKeeper.getUserName());
|
maTypeVo.setKeeperUserName(typeKeeper.getUserName());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -598,6 +598,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
)
|
)
|
||||||
</update>
|
</update>
|
||||||
|
<update id="editMachineStatus">
|
||||||
|
update ma_machine
|
||||||
|
set ma_status = #{maStatus}
|
||||||
|
where ma_id = #{maId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectMachineByQrCode" resultType="com.bonus.material.ma.domain.Machine">
|
<select id="selectMachineByQrCode" resultType="com.bonus.material.ma.domain.Machine">
|
||||||
|
|
|
||||||
|
|
@ -807,6 +807,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
WHERE
|
WHERE
|
||||||
type_id = #{record.typeId}
|
type_id = #{record.typeId}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateStorageNum">
|
||||||
|
UPDATE
|
||||||
|
ma_type
|
||||||
|
SET
|
||||||
|
storage_num = #{storageNum}
|
||||||
|
WHERE
|
||||||
|
type_id = #{typeId}
|
||||||
|
</update>
|
||||||
|
|
||||||
<select id="selectByTypeId" resultType="com.bonus.material.ma.domain.Type">
|
<select id="selectByTypeId" resultType="com.bonus.material.ma.domain.Type">
|
||||||
select * from ma_type WHERE
|
select * from ma_type WHERE
|
||||||
|
|
@ -885,6 +893,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
INSERT INTO ma_type_history(type_id, before_price, after_price, create_time, create_by)
|
INSERT INTO ma_type_history(type_id, before_price, after_price, create_time, create_by)
|
||||||
VALUES (#{typeId}, #{beforePrice} ,#{afterPrice}, #{createTime}, #{createBy})
|
VALUES (#{typeId}, #{beforePrice} ,#{afterPrice}, #{createTime}, #{createBy})
|
||||||
</insert>
|
</insert>
|
||||||
|
<insert id="insertStorageNumLog">
|
||||||
|
INSERT INTO update_storage_num_log(type_id, pre_store_num, after_store_num, create_time, creater)
|
||||||
|
VALUES (#{typeId}, #{preStoreNum}, #{storageNum}, now(), #{createBy})
|
||||||
|
</insert>
|
||||||
|
|
||||||
<select id="getMaTypeHistoryListBy" resultType="com.bonus.material.ma.domain.MaTypeHistory">
|
<select id="getMaTypeHistoryListBy" resultType="com.bonus.material.ma.domain.MaTypeHistory">
|
||||||
select
|
select
|
||||||
|
|
@ -995,4 +1007,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
WHERE
|
WHERE
|
||||||
sur.role_id = 73 OR sur.role_id = 70
|
sur.role_id = 73 OR sur.role_id = 70
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getStorageNumByTypeId" resultType="java.math.BigDecimal">
|
||||||
|
SELECT
|
||||||
|
storage_num
|
||||||
|
FROM
|
||||||
|
ma_type
|
||||||
|
WHERE
|
||||||
|
type_id = #{typeId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue