完成后台资产相关管理
This commit is contained in:
parent
5c31bba531
commit
0033e7a266
@ -105,7 +105,7 @@ public class EquipmentInfoController {
|
||||
public R equipmentInfoEdit(@RequestBody EquipmentInfoReq req) throws Exception {
|
||||
EquipmentInfo equipmentInfo = equipmentInfoService.selectEquipmentInfoById(req.getId());
|
||||
BeanUtils.copyProperty(equipmentInfo, req, true);
|
||||
/*Long typeId = NumberUtil.objToLongDefault(equipmentInfo.getType(), 0);
|
||||
/*Long typeId = NumberUtil.objToLongDefault(equipmentInfo.getType(), 0);//20200921注释掉,后台不支持修改类型,品牌等,只能修改备注,时间,金额
|
||||
EquipmentType type = equipmentTypeService.selectEquipmentTypeById(typeId);
|
||||
equipmentInfo.setType(type.getType());
|
||||
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
package com.lz.modules.equipment.controller;
|
||||
|
||||
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.common.utils.R;
|
||||
import com.lz.common.utils.StringUtil;
|
||||
import com.lz.modules.equipment.entity.OneCode;
|
||||
import com.lz.modules.equipment.entity.OneCodeReq;
|
||||
import com.lz.modules.equipment.service.OneCodeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@ -24,6 +26,17 @@ public class OneCodeController {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取code编码,
|
||||
* */
|
||||
@RequestMapping("/get/getPrints")
|
||||
public R getPrints(@RequestBody OneCodeReq req) {
|
||||
|
||||
PageUtils pageUtils = oneCodeService.selectByReq(req);
|
||||
|
||||
return R.ok().put("codes", pageUtils);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量生成指定数量编码,
|
||||
* */
|
||||
|
||||
@ -8,7 +8,9 @@ package com.lz.modules.equipment.dao;
|
||||
* @since 2020-07-29
|
||||
*/
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.lz.modules.equipment.entity.OneCode;
|
||||
import com.lz.modules.equipment.entity.OneCodeReq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -40,4 +42,6 @@ public interface OneCodeMapper extends BaseMapper<OneCode> {
|
||||
OneCode selectByCode(@Param("code") String code);
|
||||
|
||||
Long updatePrintOneCodes(List<String> codes);
|
||||
|
||||
List selectByCondition(@Param("page") IPage page, @Param("req") OneCodeReq req);
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.lz.modules.equipment.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 菜单权限表
|
||||
* </p>*员工表
|
||||
* @author quyixiao
|
||||
* @since 2020-07-30
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
public class OneCodeReq implements java.io.Serializable {
|
||||
|
||||
private int page = 1;
|
||||
private int rows = 10;
|
||||
private Long id;
|
||||
//是否删除0未删除,1删除
|
||||
private Integer isDelete;
|
||||
//创建时间
|
||||
private Date gmtCreate;
|
||||
//修改时间
|
||||
private Date gmtModified;
|
||||
//编码
|
||||
private String code;
|
||||
//是否打印 0未打印 1打印
|
||||
private Integer isPrint;
|
||||
}
|
||||
@ -2,7 +2,9 @@ package com.lz.modules.equipment.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.modules.equipment.entity.OneCode;
|
||||
import com.lz.modules.equipment.entity.OneCodeReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -40,4 +42,6 @@ public interface OneCodeService extends IService<OneCode> {
|
||||
OneCode selectByCode(String code);
|
||||
|
||||
Long updatePrintOneCodes(List<String> codes);
|
||||
|
||||
PageUtils selectByReq(OneCodeReq req);
|
||||
}
|
||||
@ -1,8 +1,10 @@
|
||||
package com.lz.modules.equipment.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.modules.equipment.dao.OneCodeMapper;
|
||||
import com.lz.modules.equipment.entity.OneCode;
|
||||
import com.lz.modules.equipment.entity.OneCodeReq;
|
||||
import com.lz.modules.equipment.service.OneCodeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -80,4 +82,12 @@ public class OneCodeServiceImpl extends ServiceImpl<OneCodeMapper, OneCode> impl
|
||||
return oneCodeMapper.updatePrintOneCodes(codes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils selectByReq(OneCodeReq req){
|
||||
PageUtils pageUtils = PageUtils.startPage(req.getPage(), req.getRows()).doSelect(
|
||||
page -> oneCodeMapper.selectByCondition(page, req)
|
||||
);
|
||||
return pageUtils;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -114,5 +114,12 @@
|
||||
</foreach>)
|
||||
</insert>
|
||||
|
||||
<select id="selectByCondition" resultType="OneCode" >
|
||||
select * from one_code where is_delete = 0
|
||||
<if test="req.isPrint != null">and isPrint = #{req.isPrint}</if>
|
||||
<if test="req.code != null and req.code != ''">and code like CONCAT('%', #{req.code}, '%') </if>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user