立体仓标准箱
This commit is contained in:
parent
349f2493cf
commit
73c64cf1ab
|
|
@ -1,5 +1,7 @@
|
|||
package com.bonus.material.basic.controller;
|
||||
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
|
|
@ -7,6 +9,7 @@ import com.bonus.common.log.annotation.SysLog;
|
|||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.material.basic.domain.BmQrBoxInfo;
|
||||
import com.bonus.material.basic.domain.dto.BoxBindWarehouseDto;
|
||||
import com.bonus.material.basic.domain.vo.BmQrBoxInfoExport;
|
||||
import com.bonus.material.basic.service.BmQrBoxService;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.material.ma.domain.Machine;
|
||||
|
|
@ -63,6 +66,19 @@ public class BmQrBoxController extends BaseController {
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询立体仓二维码标准箱绑定详情列表
|
||||
* @param bmQrBoxInfo
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询立体仓二维码标准箱绑定详情列表")
|
||||
@GetMapping("/getNumList")
|
||||
public TableDataInfo getNumList(BmQrBoxInfo bmQrBoxInfo) {
|
||||
startPage();
|
||||
List<BmQrBoxInfo> list = qrBoxService.getNumList(bmQrBoxInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* APP -- 查询二维码标准箱绑定列表 -- 不分页
|
||||
* @param
|
||||
|
|
@ -327,4 +343,36 @@ public class BmQrBoxController extends BaseController {
|
|||
public AjaxResult getBoxBindWsList(BmQrBoxInfo bean) {
|
||||
return AjaxResult.success(getDataTable(qrBoxService.getBoxBindWsList(bean)));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "数量设备扫码绑定机具")
|
||||
@PostMapping("/app_bind_num")
|
||||
public AjaxResult addQrcodeNumBoxBind(@RequestBody @NotNull(message = "参数不能为空") BmQrBoxInfo bmQrBoxInfo) {
|
||||
return qrBoxService.addQrcodeNumBoxBind(bmQrBoxInfo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "APP -- 查询数量标准箱绑定列表")
|
||||
@GetMapping("/app_box_num_list")
|
||||
public AjaxResult getBoxBindNumList(BmQrBoxInfo bean) {
|
||||
return AjaxResult.success(getDataTable(qrBoxService.getBoxBindNumList(bean)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出立体库标准箱绑定详情
|
||||
* @param response
|
||||
* @param bean
|
||||
*/
|
||||
@ApiOperation(value = "导出立体库标准箱绑定详情")
|
||||
@PostMapping("/exportDetails")
|
||||
public void exportDetails(HttpServletResponse response, BmQrBoxInfo bean) {
|
||||
String fileName = "立体库标准箱绑定详情";
|
||||
List<BmQrBoxInfoExport> list = qrBoxService.exportDetails(bean);
|
||||
// 根据list集合数,去填充序号
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
list.get(i).setSeq(i + 1);
|
||||
}
|
||||
ExcelUtil<BmQrBoxInfoExport> util = new ExcelUtil<>(BmQrBoxInfoExport.class);
|
||||
// 获取当前年月日时分秒导出时间,用括号拼接在后面
|
||||
String title = "立体库标准箱绑定详情" + "(" + "导出时间:" + DateUtils.getTime() + ")";
|
||||
util.exportExcel(response, list, fileName, title);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,4 +109,21 @@ public class BmQrBoxInfo extends BaseEntity
|
|||
@ApiModelProperty("机具类型(1机具,2安全工器具)")
|
||||
private int jiJuType;
|
||||
|
||||
@ApiModelProperty(value = "类型id")
|
||||
private Long typeId;
|
||||
|
||||
@ApiModelProperty(value = "设备类型")
|
||||
private String maName;
|
||||
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String maModel;
|
||||
|
||||
@ApiModelProperty(value = "本次检验日期")
|
||||
private String thisCheckTime;
|
||||
|
||||
@ApiModelProperty(value = "下次检验日期")
|
||||
private String nextCheckTime;
|
||||
|
||||
private String modelId;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,106 @@
|
|||
package com.bonus.material.basic.domain.vo;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 二维码管理对象 bm_qrcode_info
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-09-26
|
||||
*/
|
||||
@Data
|
||||
public class BmQrBoxInfoExport {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "序号")
|
||||
@Excel(name = "序号", cellType = Excel.ColumnType.NUMERIC, width = 5,sort = 0)
|
||||
private Integer seq;
|
||||
|
||||
@ApiModelProperty(value = "绑定明细id")
|
||||
private Long id;
|
||||
|
||||
/** 标准箱ID */
|
||||
@ApiModelProperty(value = "标准箱ID")
|
||||
private Long boxId;
|
||||
|
||||
@ApiModelProperty(value = "二维码标准箱名称")
|
||||
@Excel(name = "标准箱名称", width = 40)
|
||||
private String boxName;
|
||||
|
||||
/** 二维码标准箱编码 */
|
||||
@ApiModelProperty(value = "二维码标准箱编码")
|
||||
@Excel(name = "标准箱编码")
|
||||
private String boxCode;
|
||||
|
||||
/** 二维码类型 */
|
||||
@ApiModelProperty(value = "二维码类型")
|
||||
private String boxType;
|
||||
|
||||
/** 数据所属组织 */
|
||||
@ApiModelProperty(value = "标准箱绑定机具数量")
|
||||
private Integer devNum;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyWord;
|
||||
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
@Excel(name = "物资类型")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "规格类型")
|
||||
@Excel(name = "规格类型")
|
||||
private String typeModelName;
|
||||
|
||||
@ApiModelProperty(value = "二维码编码")
|
||||
private String qrCode;
|
||||
|
||||
@ApiModelProperty(value = "机具ID")
|
||||
private Long maId;
|
||||
|
||||
@ApiModelProperty(value = "机具编号")
|
||||
@Excel(name = "设备编码")
|
||||
private String maCode;
|
||||
|
||||
@ApiModelProperty(value = "状态集合")
|
||||
private List<String> statusList;
|
||||
|
||||
@ApiModelProperty(value = "标准箱信息")
|
||||
private String msg;
|
||||
|
||||
@ApiModelProperty(value = "任务ID")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty("机具类型(1机具,2安全工器具)")
|
||||
private int jiJuType;
|
||||
|
||||
@ApiModelProperty(value = "类型id")
|
||||
private Long typeId;
|
||||
|
||||
@ApiModelProperty(value = "本次检验日期")
|
||||
@Excel(name = "设备本次检验日期")
|
||||
private String thisCheckTime;
|
||||
|
||||
@ApiModelProperty(value = "下次检验日期")
|
||||
@Excel(name = "设备下次检验日期")
|
||||
private String nextCheckTime;
|
||||
|
||||
@ApiModelProperty(value = "录入人")
|
||||
@Excel(name = "录入人")
|
||||
private String createBy;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "绑定时间")
|
||||
@Excel(name = "绑定时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.basic.mapper;
|
|||
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
||||
import com.bonus.material.basic.domain.BmQrBoxInfo;
|
||||
import com.bonus.material.basic.domain.dto.BoxBindWarehouseDto;
|
||||
import com.bonus.material.basic.domain.vo.BmQrBoxInfoExport;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -186,4 +187,47 @@ public interface BmQrBoxMapper {
|
|||
List<BmQrBoxInfo> selectByBoxId(Long boxId);
|
||||
|
||||
void updateStatusByBoxId(Long boxId);
|
||||
|
||||
/**
|
||||
* 根据标准箱code以及名称查询是否已经存在
|
||||
* @param bmQrBoxInfo
|
||||
* @return
|
||||
*/
|
||||
int findByCodeAndName(BmQrBoxInfo bmQrBoxInfo);
|
||||
|
||||
/**
|
||||
* 根据物资编码查询
|
||||
* @param maCode
|
||||
* @param typeId
|
||||
* @return
|
||||
*/
|
||||
int getMaCode(@Param("maCode") String maCode,@Param("typeId") String typeId);
|
||||
|
||||
/**
|
||||
* 查询数量标准箱绑定列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<BmQrBoxInfo> getBoxBindNumList(BmQrBoxInfo bean);
|
||||
|
||||
/**
|
||||
* 查询立体仓二维码标准箱绑定详情列表
|
||||
* @param bmQrBoxInfo
|
||||
* @return
|
||||
*/
|
||||
List<BmQrBoxInfo> getNumList(BmQrBoxInfo bmQrBoxInfo);
|
||||
|
||||
/**
|
||||
* 根据标准箱code判断该标准箱编码是否存在
|
||||
* @param bmQrBoxInfo
|
||||
* @return
|
||||
*/
|
||||
int findByCode(BmQrBoxInfo bmQrBoxInfo);
|
||||
|
||||
/**
|
||||
* 导出立体库标准箱绑定详情
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<BmQrBoxInfoExport> exportDetails(BmQrBoxInfo bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.basic.service;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.basic.domain.BmQrBoxInfo;
|
||||
import com.bonus.material.basic.domain.dto.BoxBindWarehouseDto;
|
||||
import com.bonus.material.basic.domain.vo.BmQrBoxInfoExport;
|
||||
import com.bonus.material.ma.domain.Machine;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
|
@ -148,4 +149,32 @@ public interface BmQrBoxService {
|
|||
* @return
|
||||
*/
|
||||
List<BmQrBoxInfo> getBoxBindWsList(BmQrBoxInfo bean);
|
||||
|
||||
/**
|
||||
* 数量设备扫码绑定机具
|
||||
* @param bmQrBoxInfo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult addQrcodeNumBoxBind(BmQrBoxInfo bmQrBoxInfo);
|
||||
|
||||
/**
|
||||
* 查询数量标准箱绑定列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<BmQrBoxInfo> getBoxBindNumList(BmQrBoxInfo bean);
|
||||
|
||||
/**
|
||||
* 查询立体仓二维码标准箱绑定详情列表
|
||||
* @param bmQrBoxInfo
|
||||
* @return
|
||||
*/
|
||||
List<BmQrBoxInfo> getNumList(BmQrBoxInfo bmQrBoxInfo);
|
||||
|
||||
/**
|
||||
* 导出立体库标准箱绑定详情
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<BmQrBoxInfoExport> exportDetails(BmQrBoxInfo bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,16 +14,18 @@ import com.bonus.common.core.web.domain.AjaxResult;
|
|||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.basic.domain.BmQrBoxInfo;
|
||||
import com.bonus.material.basic.domain.dto.BoxBindWarehouseDto;
|
||||
import com.bonus.material.basic.domain.vo.BmQrBoxInfoExport;
|
||||
import com.bonus.material.basic.domain.vo.BoxInfoBindVo;
|
||||
import com.bonus.material.basic.mapper.BmQrBoxMapper;
|
||||
import com.bonus.material.basic.service.BmQrBoxService;
|
||||
import com.bonus.material.codeCollection.domain.WsMaInfo;
|
||||
import com.bonus.material.codeCollection.mapper.WsMaInfoMapper;
|
||||
import com.bonus.material.ma.domain.Machine;
|
||||
import com.bonus.material.ma.domain.Type;
|
||||
import com.bonus.material.ma.domain.vo.MachineVo;
|
||||
import com.bonus.material.ma.mapper.MachineMapper;
|
||||
import com.bonus.material.ma.service.ITypeService;
|
||||
import com.bonus.material.purchase.config.RemoteConfig;
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||
import com.bonus.material.purchase.domain.vo.PurchaseVo;
|
||||
import com.bonus.material.purchase.mapper.PurchaseBindMapper;
|
||||
import com.bonus.material.purchase.mapper.PurchaseStorageMapper;
|
||||
|
|
@ -75,6 +77,9 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
|
|||
@Resource
|
||||
private ITypeService typeService;
|
||||
|
||||
@Resource
|
||||
private WsMaInfoMapper mapper;
|
||||
|
||||
/**
|
||||
* 查询二维码标准箱管理列表
|
||||
*/
|
||||
|
|
@ -443,6 +448,16 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
|
|||
*/
|
||||
@Override
|
||||
public AjaxResult updateBmQrcodeInfoByCode(BmQrBoxInfo bmQrBoxInfo) {
|
||||
// 根据标准箱code判断该标准箱编码是否存在
|
||||
int res = bmQrBoxMapper.findByCode(bmQrBoxInfo);
|
||||
if (res == 0) {
|
||||
return AjaxResult.error("该标准箱编号不存在,请检查后重新提交");
|
||||
}
|
||||
// 根据标准箱code以及名称查询是否已经存在
|
||||
int count = bmQrBoxMapper.findByCodeAndName(bmQrBoxInfo);
|
||||
if (count > 0) {
|
||||
return AjaxResult.error("该标准箱已创建,请勿重复创建");
|
||||
}
|
||||
bmQrBoxInfo.setUpdateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
bmQrBoxInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
bmQrBoxInfo.setStatus(QrBoxStatusEnum.QR_BOX_STATUS_WAIT_BIND.getStatus().toString());
|
||||
|
|
@ -806,6 +821,110 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
|
|||
return bmQrBoxMapper.getBoxBindWsList(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数量设备扫码绑定机具
|
||||
* @param machine
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult addQrcodeNumBoxBind(BmQrBoxInfo machine) {
|
||||
if (null == machine.getBoxId()) {return AjaxResult.error("标准箱ID为空,请完善后重试!");}
|
||||
if (null == machine.getMaCode()) {return AjaxResult.error("编码为空,请完善后重试!");}
|
||||
|
||||
try {
|
||||
// 先查询数据是否存在
|
||||
BmQrBoxInfo bmQrBoxInfo = new BmQrBoxInfo();
|
||||
bmQrBoxInfo.setMaCode(machine.getMaCode());
|
||||
bmQrBoxInfo.setBoxId(machine.getBoxId());
|
||||
bmQrBoxInfo.setCreateTime(DateUtils.getNowDate());
|
||||
// 此类型编码未在其他标准箱入过库,才可以绑定
|
||||
if (0 < bmQrBoxMapper.getMaCode(machine.getMaCode(), machine.getModelId())) {
|
||||
return AjaxResult.error("该设备已绑定,无法再次绑定!");
|
||||
}
|
||||
// 一个标准型只有1种类型
|
||||
final List<Long> boxMaTypeList = bmQrBoxMapper.getBoxWsTypeList(machine.getBoxId());
|
||||
if (!boxMaTypeList.isEmpty()) {
|
||||
if (1 < boxMaTypeList.size()) {
|
||||
return AjaxResult.error("该标准箱已绑定多种物资,无法进行操作,请联系运维人员处理!");
|
||||
}
|
||||
if (!Objects.equals(boxMaTypeList.get(0).toString(), machine.getModelId())) {
|
||||
return AjaxResult.error("该标准箱已绑定其他类型物资,无法绑定此类型!");
|
||||
}
|
||||
}
|
||||
WsMaInfo info = new WsMaInfo();
|
||||
info.setMaName(machine.getMaName());
|
||||
info.setMaModel(machine.getMaModel());
|
||||
info.setMaCode(machine.getMaCode());
|
||||
info.setModelId(machine.getModelId());
|
||||
//查询是否存在
|
||||
WsMaInfo maInfo = mapper.getListByInfo(info);
|
||||
if (maInfo != null) {
|
||||
bmQrBoxInfo.setMaId(Long.valueOf(maInfo.getId()));
|
||||
// 存在更新本次检验日期及下次检验日期
|
||||
int result = mapper.updateWsMaInfoData(info);
|
||||
if (result == 0) {
|
||||
throw new RuntimeException("更新检验日期失败");
|
||||
}
|
||||
} else {
|
||||
// 不存在添加
|
||||
// 先去表中查询最近一次录入人
|
||||
WsMaInfo wsMaInfo = mapper.selectLastOptUser(info);
|
||||
info.setOptUser(wsMaInfo != null ? wsMaInfo.getOptUser() : "");
|
||||
int result = mapper.insert(info);
|
||||
if (result == 0) {
|
||||
throw new RuntimeException("新增编码失败");
|
||||
}
|
||||
bmQrBoxInfo.setMaId(Long.valueOf(info.getId()));
|
||||
bmQrBoxInfo.setCreateBy(wsMaInfo != null ? wsMaInfo.getOptUser() : "");
|
||||
}
|
||||
if (0 < bmQrBoxMapper.addQrcodeBoxBind(bmQrBoxInfo)) {
|
||||
// 修改标准箱状态为已录入
|
||||
bmQrBoxInfo.setStatus(QrBoxStatusEnum.QR_BOX_STATUS_COMPLETE.getStatus().toString());
|
||||
int result = bmQrBoxMapper.updateBmQrcodeStatus(bmQrBoxInfo);
|
||||
if (result == 0) {
|
||||
throw new RuntimeException("更新标准箱状态失败");
|
||||
}
|
||||
return AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg());
|
||||
} else {
|
||||
throw new RuntimeException("绑定失败");
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
System.err.println("绑定失败,SQL执行异常:" + e.getMessage());
|
||||
return AjaxResult.error("绑定失败,SQL执行异常:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询数量标准箱绑定列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BmQrBoxInfo> getBoxBindNumList(BmQrBoxInfo bean) {
|
||||
return bmQrBoxMapper.getBoxBindNumList(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询立体仓二维码标准箱绑定详情列表
|
||||
* @param bmQrBoxInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BmQrBoxInfo> getNumList(BmQrBoxInfo bmQrBoxInfo) {
|
||||
return bmQrBoxMapper.getNumList(bmQrBoxInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出立体库标准箱绑定详情
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BmQrBoxInfoExport> exportDetails(BmQrBoxInfo bean) {
|
||||
return bmQrBoxMapper.exportDetails(bean);
|
||||
}
|
||||
|
||||
private int updateBoxStatus(BoxBindWarehouseDto boxMa) {
|
||||
int result = 0;
|
||||
result = bmQrBoxMapper.updateBoxStatus(boxMa);
|
||||
|
|
|
|||
|
|
@ -172,4 +172,17 @@ public class WsMaInfoController extends BaseController {
|
|||
{
|
||||
return service.importTbData(file);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取数量设备机具类型")
|
||||
@SysLog(title = "获取数量设备机具类型", businessType = OperaType.DELETE, logType = 1, module = "获取数量设备机具类型")
|
||||
@PostMapping("/getAcMaTypeData")
|
||||
public AjaxResult getAcMaTypeData() {
|
||||
return service.getAcMaTypeData();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询小工具编码信息")
|
||||
@PostMapping("/getWsMaInfoData")
|
||||
public AjaxResult getWsMaInfoData(@RequestBody WsMaInfo info) {
|
||||
return service.getWsMaInfoData(info);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,4 +157,32 @@ public interface WsMaInfoMapper {
|
|||
@Param("parentName") String parentName,
|
||||
@Param("childLevel") String childLevel,
|
||||
@Param("childName") String childName);
|
||||
|
||||
/**
|
||||
* 获取数量设备机具类型下拉选
|
||||
* @return
|
||||
*/
|
||||
@MapKey("id")
|
||||
List<Map<String, Objects>> getAcMaTypeData();
|
||||
|
||||
/**
|
||||
* 更新数量设备机具信息
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
int updateWsMaInfoData(WsMaInfo info);
|
||||
|
||||
/**
|
||||
* 获取最后操作人
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
WsMaInfo selectLastOptUser(WsMaInfo info);
|
||||
|
||||
/**
|
||||
* 根据条件查询机具信息
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
WsMaInfo getListByInfo(WsMaInfo info);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,4 +132,17 @@ public interface WsMaInfoService {
|
|||
* @return
|
||||
*/
|
||||
AjaxResult importTbData(MultipartFile file);
|
||||
|
||||
/**
|
||||
* 获取数量设备机具类型
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getAcMaTypeData();
|
||||
|
||||
/**
|
||||
* 查询小工具编码信息
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getWsMaInfoData(WsMaInfo info);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -408,6 +408,41 @@ public class WsMaInfoServiceImpl implements WsMaInfoService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数量设备机具类型
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getAcMaTypeData() {
|
||||
try {
|
||||
List<Map<String, Objects>> maTypeData = mapper.getAcMaTypeData();
|
||||
return ObjectUtils.isNotEmpty(maTypeData) ? AjaxResult.success(maTypeData) : AjaxResult.success();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return AjaxResult.error("");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询小工具编码信息
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getWsMaInfoData(WsMaInfo info) {
|
||||
try {
|
||||
//查询是否存在
|
||||
int count = mapper.selectCountByCode(info);
|
||||
if (count > 0) {
|
||||
return AjaxResult.success(true);
|
||||
}
|
||||
return AjaxResult.success(false);
|
||||
} catch (Exception e) {
|
||||
log.error("添加小工具编码信息列表:", e.getMessage());
|
||||
return AjaxResult.error("添加小工具编码信息列表失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证表头格式
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -36,12 +36,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
bqb.transfer_user as transferUser,
|
||||
bqb.input_user as inputUser,
|
||||
mm.type_id as maTypeId,
|
||||
COUNT(qbb.box_id) as devNum
|
||||
COUNT(qbb.box_id) as devNum,
|
||||
mt1.type_name as typeName,
|
||||
mt.type_name as typeModelName,
|
||||
bqb.type_id as typeId,
|
||||
bqb.this_check_time as thisCheckTime,
|
||||
bqb.next_check_time as nextCheckTime
|
||||
from bm_qrcode_box bqb
|
||||
left join bm_qrcode_box_bind qbb on bqb.box_id = qbb.box_id
|
||||
left join ma_machine mm on qbb.ma_id = mm.ma_id
|
||||
left join ma_type mt on bqb.type_id = mt.type_id
|
||||
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||
<where>
|
||||
1=1
|
||||
bqb.box_type = #{boxType}
|
||||
<if test="boxId != null">and bqb.box_id = #{boxId}</if>
|
||||
<if test="boxName != null and boxName != ''">and bqb.box_name like concat('%',#{boxName},'%')</if>
|
||||
<if test="boxCode != null and boxCode != ''">and bqb.box_code like concat('%',#{boxCode},'%')</if>
|
||||
|
|
@ -135,6 +142,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="status != null">box_status = #{status},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="typeId != null">type_id = #{typeId},</if>
|
||||
<if test="thisCheckTime != null and thisCheckTime != ''">this_check_time = #{thisCheckTime},</if>
|
||||
<if test="nextCheckTime != null and nextCheckTime != ''">next_check_time = #{nextCheckTime},</if>
|
||||
</trim>
|
||||
where box_code = #{boxCode}
|
||||
</update>
|
||||
|
|
@ -158,12 +168,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="boxId != null">box_id,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="maCode != null and maCode != ''">ma_code,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="maId != null">#{maId},</if>
|
||||
<if test="boxId != null">#{boxId},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="maCode != null and maCode != ''">#{maCode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
@ -449,6 +461,123 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
qb.box_id = #{boxId}
|
||||
</select>
|
||||
|
||||
<select id="findByCodeAndName" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
count(*)
|
||||
FROM
|
||||
bm_qrcode_box
|
||||
WHERE
|
||||
box_code = #{boxCode}
|
||||
AND box_name is not null
|
||||
</select>
|
||||
|
||||
<select id="getMaCode" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from bm_qrcode_box_bind bqbb
|
||||
left join bm_qrcode_box bqb on bqbb.box_id = bqb.box_id
|
||||
where bqbb.ma_code = #{maCode}
|
||||
and bqb.type_id = #{typeId}
|
||||
</select>
|
||||
|
||||
<select id="getBoxBindNumList" resultType="com.bonus.material.basic.domain.BmQrBoxInfo">
|
||||
SELECT
|
||||
id as id, box_id as boxId, create_by as createBy, create_time as createTime,
|
||||
ma_code as maCode
|
||||
FROM
|
||||
bm_qrcode_box_bind
|
||||
<where>
|
||||
box_id = #{boxId}
|
||||
<if test="keyWord != null and keyWord !=''">
|
||||
and ma_code LIKE concat('%',#{keyWord},'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getNumList" resultType="com.bonus.material.basic.domain.BmQrBoxInfo">
|
||||
SELECT
|
||||
qb.id as id,qb.box_id as boxId,qb.create_by as createBy,
|
||||
mt1.type_name as typeName,
|
||||
mt.type_name as typeModelName,
|
||||
qb.ma_code as maCode,mt.type_id as maTypeId
|
||||
FROM
|
||||
bm_qrcode_box_bind qb
|
||||
LEFT JOIN bm_qrcode_box bqb ON qb.box_id = bqb.box_id
|
||||
LEFT JOIN ma_type mt ON bqb.type_id = mt.type_id AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id AND mt1.del_flag = '0'
|
||||
<where>
|
||||
<if test="boxId != null">and qb.box_id = #{boxId}</if>
|
||||
<if test="boxCode != null and boxCode != ''">and bqb.box_code = #{boxCode}</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
mt1.type_name like concat('%',#{keyWord},'%')
|
||||
OR mt.type_name like concat('%',#{keyWord},'%')
|
||||
OR qb.ma_code like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
qb.create_time
|
||||
DESC
|
||||
</select>
|
||||
|
||||
<select id="findByCode" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
count(*)
|
||||
FROM
|
||||
bm_qrcode_box
|
||||
WHERE
|
||||
box_code = #{boxCode}
|
||||
</select>
|
||||
|
||||
<select id="exportDetails" resultType="com.bonus.material.basic.domain.vo.BmQrBoxInfoExport">
|
||||
SELECT
|
||||
bqbb.box_id as boxId,
|
||||
bqb.box_name as boxName,
|
||||
bqb.box_code as boxCode,
|
||||
mt1.type_name as typeName,
|
||||
mt.type_name as typeModelName,
|
||||
bqbb.ma_code as maCode,
|
||||
bqbb.create_by as createBy,
|
||||
bqbb.create_time as createTime,
|
||||
wmi.this_check_time as thisCheckTime,
|
||||
wmi.next_check_time as nextCheckTime
|
||||
FROM
|
||||
bm_qrcode_box_bind bqbb
|
||||
LEFT JOIN bm_qrcode_box bqb ON bqbb.box_id = bqb.box_id
|
||||
LEFT JOIN ma_type mt ON bqb.type_id = mt.type_id
|
||||
AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
AND mt1.del_flag = '0'
|
||||
LEFT JOIN ws_ma_info wmi ON bqbb.ma_id = wmi.id
|
||||
<where>
|
||||
bqb.box_type = #{boxType}
|
||||
<if test="boxId != null">and bqb.box_id = #{boxId}</if>
|
||||
<if test="boxName != null and boxName != ''">and bqb.box_name like concat('%',#{boxName},'%')</if>
|
||||
<if test="boxCode != null and boxCode != ''">and bqb.box_code like concat('%',#{boxCode},'%')</if>
|
||||
<if test="boxType != null">and bqb.box_type = #{boxType}</if>
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
<![CDATA[ AND DATE_FORMAT( bqb.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
bqb.box_name like concat('%',#{keyWord},'%')
|
||||
OR bqb.box_code like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="statusList != null and statusList != ''">
|
||||
AND bqb.box_status in
|
||||
<foreach item="key" collection="statusList" open="(" separator="," close=")">
|
||||
#{key}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
bqbb.id
|
||||
ORDER BY
|
||||
bqbb.create_time
|
||||
DESC
|
||||
</select>
|
||||
|
||||
<update id="updateTaskStatus">
|
||||
UPDATE tm_task SET task_status = 22 WHERE task_id = #{taskId}
|
||||
</update>
|
||||
|
|
|
|||
|
|
@ -222,6 +222,36 @@
|
|||
AND mt4.type_name = #{childName}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="getAcMaTypeData" resultType="java.util.Map">
|
||||
SELECT type_id AS id,
|
||||
type_name AS `name`
|
||||
FROM ma_type
|
||||
WHERE `level` = '3'
|
||||
AND del_flag = '0'
|
||||
and manage_type = '1'
|
||||
</select>
|
||||
<select id="selectLastOptUser" resultType="com.bonus.material.codeCollection.domain.WsMaInfo">
|
||||
SELECT opt_user as optUser
|
||||
FROM ws_ma_info
|
||||
WHERE
|
||||
ma_name = #{maName}
|
||||
and ma_model = #{maModel}
|
||||
ORDER BY opt_time DESC
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="getListByInfo" resultType="com.bonus.material.codeCollection.domain.WsMaInfo">
|
||||
SELECT
|
||||
id as id,
|
||||
ma_name AS maName
|
||||
FROM ws_ma_info
|
||||
WHERE ma_code = #{maCode}
|
||||
and ma_name = #{maName}
|
||||
and ma_model = #{maModel}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.bonus.material.codeCollection.domain.WsMaInfo" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
INSERT INTO ws_ma_info (ma_name, ma_model, ma_code, supplier, this_check_time, next_check_time,
|
||||
|
|
@ -290,6 +320,14 @@
|
|||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateWsMaInfoData">
|
||||
UPDATE ws_ma_info
|
||||
SET this_check_time = CURDATE(),
|
||||
next_check_time = DATE_SUB(DATE_ADD(CURDATE(), INTERVAL 1 YEAR), INTERVAL 1 DAY),
|
||||
opt_time = NOW()
|
||||
WHERE ma_code = #{maCode};
|
||||
</update>
|
||||
|
||||
<delete id="deleteById" parameterType="int">
|
||||
DELETE
|
||||
FROM ws_ma_info
|
||||
|
|
|
|||
Loading…
Reference in New Issue