代码提交
This commit is contained in:
parent
8d9b7ccfa3
commit
2d6f3939a9
|
|
@ -53,8 +53,7 @@ public class MachineController extends BaseController {
|
|||
@ApiOperation(value = "查询机具设备管理列表1")
|
||||
//@RequiresPermissions("ma:machine:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Machine machine)
|
||||
{
|
||||
public TableDataInfo list(Machine machine) {
|
||||
if (machine.getPrefix() == null) {
|
||||
startPage();
|
||||
}
|
||||
|
|
@ -68,8 +67,7 @@ public class MachineController extends BaseController {
|
|||
@ApiOperation(value = "查询在库机具编号")
|
||||
//@RequiresPermissions("ma:machine:typeList")
|
||||
@GetMapping("/getMachineList")
|
||||
public AjaxResult getMachineList(Type type)
|
||||
{
|
||||
public AjaxResult getMachineList(Type type) {
|
||||
return machineService.getMachineList(type);
|
||||
}
|
||||
|
||||
|
|
@ -79,8 +77,7 @@ public class MachineController extends BaseController {
|
|||
@ApiOperation(value = "查询机具设备管理列表2")
|
||||
//@RequiresPermissions("ma:machine:typeList")
|
||||
@GetMapping("/getTypeList")
|
||||
public AjaxResult list(Type type)
|
||||
{
|
||||
public AjaxResult list(Type type) {
|
||||
return machineService.selectByTypeList(type);
|
||||
}
|
||||
|
||||
|
|
@ -92,8 +89,7 @@ public class MachineController extends BaseController {
|
|||
@RequiresPermissions("ma:machine:export")
|
||||
@SysLog(title = "机具设备管理", businessType = OperaType.EXPORT, logType = 1, module = "仓储管理->导出机具设备管理")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Machine machine)
|
||||
{
|
||||
public void export(HttpServletResponse response, Machine machine) {
|
||||
List<MachineVo> list = machineService.selectMachineList(machine);
|
||||
ExcelUtil<MachineVo> util = new ExcelUtil<MachineVo>(MachineVo.class);
|
||||
util.exportExcel(response, list, "机具设备管理数据");
|
||||
|
|
@ -105,13 +101,13 @@ public class MachineController extends BaseController {
|
|||
@ApiOperation(value = "获取机具设备管理详细信息")
|
||||
@RequiresPermissions("ma:machine:query")
|
||||
@GetMapping(value = "/{maId}")
|
||||
public AjaxResult getInfo(@PathVariable("maId") Long maId)
|
||||
{
|
||||
public AjaxResult getInfo(@PathVariable("maId") Long maId) {
|
||||
return AjaxResult.success(machineService.selectMachineByMaId(maId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取机具设备管理详细信息
|
||||
*
|
||||
* @param machine
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -134,8 +130,7 @@ public class MachineController extends BaseController {
|
|||
@RequiresPermissions("ma:machine:add")
|
||||
@SysLog(title = "机具设备管理", businessType = OperaType.INSERT, logType = 1, module = "仓储管理->新增机具设备管理")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Machine machine)
|
||||
{
|
||||
public AjaxResult add(@RequestBody Machine machine) {
|
||||
return toAjax(machineService.insertMachine(machine));
|
||||
}
|
||||
|
||||
|
|
@ -147,11 +142,22 @@ public class MachineController extends BaseController {
|
|||
@RequiresPermissions("ma:machine:edit")
|
||||
@SysLog(title = "机具设备管理", businessType = OperaType.UPDATE, logType = 1, module = "仓储管理->修改机具设备管理")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Machine machine)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody Machine 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除机具设备管理
|
||||
*/
|
||||
|
|
@ -160,8 +166,7 @@ public class MachineController extends BaseController {
|
|||
@RequiresPermissions("ma:machine:remove")
|
||||
@SysLog(title = "机具设备管理", businessType = OperaType.DELETE, logType = 1, module = "仓储管理->删除机具设备管理")
|
||||
@DeleteMapping("/{maId}")
|
||||
public AjaxResult remove(@PathVariable Long maId)
|
||||
{
|
||||
public AjaxResult remove(@PathVariable Long maId) {
|
||||
return machineService.deleteMachineByMaId(maId);
|
||||
}
|
||||
|
||||
|
|
@ -177,6 +182,7 @@ public class MachineController extends BaseController {
|
|||
|
||||
/**
|
||||
* 电子标签编码查询
|
||||
*
|
||||
* @param machine
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -192,6 +198,7 @@ public class MachineController extends BaseController {
|
|||
|
||||
/**
|
||||
* 根据标签信息查询出库单
|
||||
*
|
||||
* @param leaseApplyInfo
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -263,8 +270,7 @@ public class MachineController extends BaseController {
|
|||
@ApiOperation(value = "检验报告同步")
|
||||
@PreventRepeatSubmit
|
||||
@PostMapping("/synchReport")
|
||||
public AjaxResult synchReport(@RequestBody Machine machine)
|
||||
{
|
||||
public AjaxResult synchReport(@RequestBody Machine machine) {
|
||||
return machineService.synchReport(machine);
|
||||
}
|
||||
|
||||
|
|
@ -274,13 +280,13 @@ public class MachineController extends BaseController {
|
|||
@ApiOperation(value = "固定资产编号录入")
|
||||
@PreventRepeatSubmit
|
||||
@PostMapping("/editAssetsCode")
|
||||
public AjaxResult editAssetsCode(@RequestBody Machine machine)
|
||||
{
|
||||
public AjaxResult editAssetsCode(@RequestBody Machine machine) {
|
||||
return toAjax(machineService.editAssetsCode(machine));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据qrcode查询机具历史信息
|
||||
*
|
||||
* @param machine
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -299,6 +305,7 @@ public class MachineController extends BaseController {
|
|||
|
||||
/**
|
||||
* 根据qrcode查询机具历史信息
|
||||
*
|
||||
* @param machine
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -309,6 +316,7 @@ public class MachineController extends BaseController {
|
|||
|
||||
/**
|
||||
* 根据qrcode查询机具历史信息-New查询安全工器具和工器具
|
||||
*
|
||||
* @param machine
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -319,6 +327,7 @@ public class MachineController extends BaseController {
|
|||
|
||||
/**
|
||||
* 根据类型id获取编码
|
||||
*
|
||||
* @param machine
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.bonus.common.biz.annotation.StoreLog;
|
||||
import com.bonus.common.biz.config.ListPagingUtil;
|
||||
import com.bonus.common.core.utils.ServletUtils;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
|
|
@ -262,6 +263,14 @@ public class TypeController extends BaseController {
|
|||
public AjaxResult add(@RequestBody Type 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)
|
||||
@ApiModelProperty(value = "实时库存")
|
||||
private BigDecimal storageNum;
|
||||
/** 实时库存 */
|
||||
@ApiModelProperty(value = "修改前库存")
|
||||
private BigDecimal preStoreNum;
|
||||
|
||||
/** 是否扣费 */
|
||||
@ApiModelProperty(value = "是否扣费,0:扣费, 1:不扣费")
|
||||
|
|
|
|||
|
|
@ -220,4 +220,6 @@ public interface MachineMapper
|
|||
* @return
|
||||
*/
|
||||
int batchUpdateSynchReport(@Param("list") List<SampleSync> samples);
|
||||
|
||||
int editMachineStatus(Machine machine);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -217,4 +217,10 @@ public interface TypeMapper {
|
|||
* @return
|
||||
*/
|
||||
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
|
||||
*/
|
||||
AjaxResult getHisByCodeNew(Machine machine);
|
||||
|
||||
AjaxResult editMachineStatus(Machine machine);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,4 +144,6 @@ public interface ITypeService {
|
|||
* @return
|
||||
*/
|
||||
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
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import javax.annotation.Resource;
|
|||
|
||||
/**
|
||||
* 物资类型管理Service业务层实现
|
||||
*
|
||||
* @author syruan
|
||||
*/
|
||||
@Service
|
||||
|
|
@ -78,6 +79,7 @@ public class TypeServiceImpl implements ITypeService {
|
|||
|
||||
/**
|
||||
* 查询物资类型四级树--前端联动式下拉框
|
||||
*
|
||||
* @param typeId 类型id
|
||||
* @param typeName 类型名称
|
||||
*/
|
||||
|
|
@ -131,6 +133,7 @@ public class TypeServiceImpl implements ITypeService {
|
|||
|
||||
/**
|
||||
* 递归调用获取子级
|
||||
*
|
||||
* @param list 集合
|
||||
* @param parentId 父级id
|
||||
*/
|
||||
|
|
@ -184,6 +187,7 @@ public class TypeServiceImpl implements ITypeService {
|
|||
|
||||
/**
|
||||
* 查询一级列表
|
||||
*
|
||||
* @param maTypeVo
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -195,6 +199,7 @@ public class TypeServiceImpl implements ITypeService {
|
|||
|
||||
/**
|
||||
* 查询物资类型管理绑定的库管班长用户列表
|
||||
*
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -203,6 +208,17 @@ public class TypeServiceImpl implements ITypeService {
|
|||
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
|
||||
public List<MaTypeSelectVo> selectMaTypeListByHouseId(Long houseId) {
|
||||
|
|
@ -634,7 +650,9 @@ public class TypeServiceImpl implements ITypeService {
|
|||
TreeSelect thisTree = new TreeSelect(itemList.get(0).getHouseId(), itemList.get(0).getHouseName(), 0, null);
|
||||
List<TreeSelect> children = new ArrayList<>();
|
||||
for (WhHouseSet whHouseSet : itemList) {
|
||||
if (whHouseSet == null || whHouseSet.getTypeId() == null) { continue; }
|
||||
if (whHouseSet == null || whHouseSet.getTypeId() == null) {
|
||||
continue;
|
||||
}
|
||||
TreeSelect oneLevelTree = maTypeMap.get(whHouseSet.getTypeId());
|
||||
if (oneLevelTree != null) {
|
||||
children.add(oneLevelTree);
|
||||
|
|
@ -649,6 +667,7 @@ public class TypeServiceImpl implements ITypeService {
|
|||
|
||||
/**
|
||||
* 通过构造函数将 Type对象 转换为 TreeSelect -- 并递归处理子节点
|
||||
*
|
||||
* @param type 要进行转换的object对象
|
||||
*/
|
||||
private TreeSelect convertToTreeSelect(Type type) {
|
||||
|
|
@ -660,7 +679,6 @@ public class TypeServiceImpl implements ITypeService {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 构建前端所需要树结构
|
||||
*
|
||||
|
|
@ -834,7 +852,6 @@ public class TypeServiceImpl implements ITypeService {
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -598,6 +598,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
)
|
||||
</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">
|
||||
|
|
|
|||
|
|
@ -807,6 +807,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE
|
||||
type_id = #{record.typeId}
|
||||
</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 * 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)
|
||||
VALUES (#{typeId}, #{beforePrice} ,#{afterPrice}, #{createTime}, #{createBy})
|
||||
</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
|
||||
|
|
@ -995,4 +1007,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE
|
||||
sur.role_id = 73 OR sur.role_id = 70
|
||||
</select>
|
||||
<select id="getStorageNumByTypeId" resultType="java.math.BigDecimal">
|
||||
SELECT
|
||||
storage_num
|
||||
FROM
|
||||
ma_type
|
||||
WHERE
|
||||
type_id = #{typeId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue