This commit is contained in:
zhouxian 2023-12-18 17:44:10 +08:00
commit d93d3855b6
49 changed files with 1776 additions and 102 deletions

View File

@ -47,6 +47,11 @@ public class MaMachine extends BaseEntity {
*/
@ApiModelProperty(value = "机具状态(数据字典)")
private String maStatus;
/**
* 机具状态数据字典
*/
@ApiModelProperty(value = "机具状态(数据字典)名称")
private String maStatusName;
/**
* 二维码
*/
@ -354,4 +359,12 @@ public class MaMachine extends BaseEntity {
public void setSpecificationType(String specificationType) {
this.specificationType = specificationType;
}
public String getMaStatusName() {
return maStatusName;
}
public void setMaStatusName(String maStatusName) {
this.maStatusName = maStatusName;
}
}

View File

@ -0,0 +1,42 @@
package com.bonus.sgzb.app.controller;
import com.bonus.sgzb.app.domain.CriticalData;
import com.bonus.sgzb.app.domain.ToDoList;
import com.bonus.sgzb.app.service.AppService;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author c liu
* @date 2023/12/11
*/
@RestController
@RequestMapping("/app")
public class AppController {
@Autowired
private AppService service;
@ApiOperation(value = "查询关键数据")
@Log(title = "关键数据", businessType = BusinessType.QUERY)
@GetMapping("/getCriticalData")
public AjaxResult getCriticalData()
{
CriticalData data = service.getCriticalData();
return AjaxResult.success("操作成功",data);
}
@ApiOperation(value = "查询待办事项")
@Log(title = "待办事项", businessType = BusinessType.QUERY)
@GetMapping("/getToDoList")
public AjaxResult getToDoList()
{
ToDoList data = service.getToDoList();
return AjaxResult.success("操作成功",data);
}
}

View File

@ -10,12 +10,15 @@ import com.bonus.sgzb.app.service.TmTaskService;
import com.bonus.sgzb.base.api.domain.LeaseApplyDetails;
import com.bonus.sgzb.base.api.domain.LeaseApplyInfo;
import com.bonus.sgzb.base.api.domain.TmTask;
import com.bonus.sgzb.base.domain.WarehouseKeeper;
import com.bonus.sgzb.common.core.utils.DateUtils;
import com.bonus.sgzb.common.core.utils.StringUtils;
import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -272,4 +275,13 @@ public class BackApplyController extends BaseController {
}
}
@ApiOperation("退料审核列表-审核")
@Log(title = "退料审核列表-审核", businessType = BusinessType.UPDATE)
@PostMapping("/audit")
public AjaxResult audit(String id)
{
return toAjax(backApplyService.audit(id));
}
}

View File

@ -0,0 +1,31 @@
package com.bonus.sgzb.app.controller;
import com.bonus.sgzb.app.domain.SysNotice;
import com.bonus.sgzb.app.service.SysNoticeService;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author c liu
* @date 2023/12/11
*/
@RestController
@RequestMapping("/sysNotice")
public class SysNoticeController {
@Autowired
private SysNoticeService service;
@ApiOperation(value = "查询通知公告列表")
@GetMapping("/getList")
public AjaxResult getList()
{
List<SysNotice> list = service.getList();
return AjaxResult.success("操作成功",list);
}
}

View File

@ -0,0 +1,34 @@
package com.bonus.sgzb.app.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author c liu
* @date 2023/12/11
*/
@Data
@ApiModel(value="关键数据")
public class CriticalData {
/**
* 当日领料
*/
@ApiModelProperty(value = "当日领料")
private int dayLeaseNum;
/**
* 当日退料
*/
@ApiModelProperty(value = "当日退料")
private int dayBackNum;
/**
* 当日入库
*/
@ApiModelProperty(value = "当日入库")
private int dayInputNum;
/**
* 当日出库
*/
@ApiModelProperty(value = "当日出库")
private int dayOutNum;
}

View File

@ -0,0 +1,65 @@
package com.bonus.sgzb.app.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author c liu
* @date 2023/12/11
*/
@Data
@ApiModel(value="通知公告")
public class SysNotice {
/**
* 公告ID
*/
@ApiModelProperty(value = "公告ID")
private Long noticeId;
/**
* 公告标题
*/
@ApiModelProperty(value = "公告标题")
private String noticeTitle;
/**
* 公告类型1通知 2公告
*/
@ApiModelProperty(value = "公告类型1通知 2公告")
private String noticeType;
/**
* 公告内容
*/
@ApiModelProperty(value = "公告内容")
private byte[] noticeContent;
private String noticeContentStr;
/**
* 公告状态0正常 1关闭
*/
@ApiModelProperty(value = "公告状态0正常 1关闭")
private String status;
/**
* 创建者
*/
@ApiModelProperty(value = "创建者")
private String createBy;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private String createTime;
/**
* 更新者
*/
@ApiModelProperty(value = "更新者")
private String updateBy;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
private String updateTime;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remark;
}

View File

@ -0,0 +1,34 @@
package com.bonus.sgzb.app.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author c liu
* @date 2023/12/11
*/
@Data
@ApiModel(value="代办事项")
public class ToDoList {
/**
* 领料待审批
*/
@ApiModelProperty(value = "领料待审批")
private int leaseNum;
/**
* 退料待审批
*/
@ApiModelProperty(value = "退料待审批")
private int backNum;
/**
* 报废待审核
*/
@ApiModelProperty(value = "报废待审核")
private int scrapNum;
/**
* 试验检验待审核
*/
@ApiModelProperty(value = "试验检验待审核")
private int trialNum;
}

View File

@ -0,0 +1,28 @@
package com.bonus.sgzb.app.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author c liu
* @date 2023/12/11
*/
@Mapper
public interface AppMapper {
int getDayLeaseNum(@Param("startTime") String startTime, @Param("endTime")String endTime);
int getDayBackNum(@Param("startTime") String startTime, @Param("endTime")String endTime);
int getDayInputNum(@Param("startTime") String startTime, @Param("endTime")String endTime);
int getDayOutNum(@Param("startTime") String startTime, @Param("endTime")String endTime);
int getLeaseNum();
int getBackNum();
int getScrapNum();
int getTrialNum();
}

View File

@ -40,4 +40,6 @@ public interface BackApplyMapper {
List<BackApplyInfo> examineList(BackApplyInfo record);
List<BackApplyInfo> examineView(BackApplyInfo record);
int audit(String id);
}

View File

@ -0,0 +1,15 @@
package com.bonus.sgzb.app.mapper;
import com.bonus.sgzb.app.domain.SysNotice;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author c liu
* @date 2023/12/11
*/
@Mapper
public interface SysNoticeMapper {
List<SysNotice> getList();
}

View File

@ -0,0 +1,15 @@
package com.bonus.sgzb.app.service;
import com.bonus.sgzb.app.domain.CriticalData;
import com.bonus.sgzb.app.domain.ToDoList;
/**
* @author c liu
* @date 2023/12/11
*/
public interface AppService {
CriticalData getCriticalData();
ToDoList getToDoList();
}

View File

@ -43,4 +43,6 @@ public interface BackApplyService {
List<BackApplyInfo> examineList(BackApplyInfo record);
List<BackApplyInfo> examineView(BackApplyInfo record);
int audit(String id);
}

View File

@ -0,0 +1,13 @@
package com.bonus.sgzb.app.service;
import com.bonus.sgzb.app.domain.SysNotice;
import java.util.List;
/**
* @author c liu
* @date 2023/12/11
*/
public interface SysNoticeService {
List<SysNotice> getList();
}

View File

@ -0,0 +1,52 @@
package com.bonus.sgzb.app.service.impl;
import com.bonus.sgzb.app.domain.CriticalData;
import com.bonus.sgzb.app.domain.ToDoList;
import com.bonus.sgzb.app.mapper.AppMapper;
import com.bonus.sgzb.app.service.AppService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
/**
* @author c liu
* @date 2023/12/11
*/
@Service("AppService")
public class AppServiceImpl implements AppService {
@Autowired
private AppMapper mapper;
@Override
public CriticalData getCriticalData() {
CriticalData data = new CriticalData();
LocalDate current_date = LocalDate.now();
String startTime = current_date + " 00:00:00";
String endTime = current_date + " 23:59:59";
int dayLeaseNum = mapper.getDayLeaseNum(startTime,endTime);
int dayBackNum = mapper.getDayBackNum(startTime,endTime);
int dayInputNum = mapper.getDayInputNum(startTime,endTime);
int dayOutNum = mapper.getDayOutNum(startTime,endTime);
data.setDayLeaseNum(dayLeaseNum);
data.setDayBackNum(dayBackNum);
data.setDayInputNum(dayInputNum);
data.setDayOutNum(dayOutNum);
return data;
}
@Override
public ToDoList getToDoList() {
ToDoList data = new ToDoList();
int leaseNum = mapper.getLeaseNum();
int backNum = mapper.getBackNum();
int scrapNum = mapper.getScrapNum();
int trialNum = mapper.getTrialNum();
data.setLeaseNum(leaseNum);
data.setBackNum(backNum);
data.setScrapNum(scrapNum);
data.setTrialNum(trialNum);
return data;
}
}

View File

@ -81,4 +81,9 @@ public class BackApplyServiceImpl implements BackApplyService {
return backApplyMapper.examineView(record);
}
@Override
public int audit(String id) {
return backApplyMapper.audit(id);
}
}

View File

@ -0,0 +1,30 @@
package com.bonus.sgzb.app.service.impl;
import com.bonus.sgzb.app.domain.SysNotice;
import com.bonus.sgzb.app.mapper.SysNoticeMapper;
import com.bonus.sgzb.app.service.SysNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Base64;
import java.util.List;
/**
* @author c liu
* @date 2023/12/11
*/
@Service("SysNoticeService")
public class SysNoticeServiceImpl implements SysNoticeService {
@Autowired
private SysNoticeMapper mapper;
@Override
public List<SysNotice> getList() {
List<SysNotice> list = mapper.getList();
for (SysNotice bean : list){
String noticeContent = Base64.getEncoder().encodeToString(bean.getNoticeContent());
bean.setNoticeContentStr(noticeContent);
}
return list;
}
}

View File

@ -47,6 +47,18 @@ public class BmProjectInfoController extends BaseController{
}
/**
* 获取工程项目下拉选
*/
@ApiOperation(value = "获取工程项目下拉选")
@GetMapping("/getProjectSelect")
public AjaxResult getProjectSelect(BmProjectInfo bmProjectInfo)
{
List<BmProjectInfo> list = bmProjectInfoService.getProjectInfoAll(bmProjectInfo);
return AjaxResult.success(list);
}
/**
* 根据条件进行查询
*/

View File

@ -47,6 +47,18 @@ public class BmUnitInfoController extends BaseController{
}
/**
* 获取往来单位下拉选
*/
@ApiOperation(value = "获取往来单位下拉选")
@GetMapping("/getUnitInfoSelect")
public AjaxResult getUnitInfoSelect(BmUnitInfo bmUnitInfo)
{
List<BmUnitInfo> list = bmUnitInfoService.getUnitInfoAll(bmUnitInfo);
return AjaxResult.success(list);
}
/**
* 根据条件进行查询往来单位
*/

View File

@ -23,7 +23,7 @@ import java.util.List;
* @since 2023-11-27 16:44:02
*/
@RestController
@RequestMapping("/maPartType")
@RequestMapping("maPartType")
public class MaPartTypeController extends BaseController {
/**
* 服务对象
@ -39,7 +39,6 @@ public class MaPartTypeController extends BaseController {
@GetMapping("/list")
public AjaxResult list(MaPartType maPartType)
{
startPage();
List<MaPartType> list = maPartTypeService.selectMaPartList(maPartType);
return AjaxResult.success(list);
}

View File

@ -51,6 +51,17 @@ public class MaSupplierInfoController extends BaseController
return getDataTable(list);
}
/**
* 查询供应商管理下拉选
*/
@ApiOperation(value = "查询供应商管理下拉选")
@GetMapping("/getSupplierSelect")
public AjaxResult getSupplierSelect(MaSupplierInfo maSupplierInfo)
{
List<MaSupplierInfo> list = maSupplierInfoService.selectMaSupplierInfoList(maSupplierInfo);
return AjaxResult.success(list);
}
/**
* 导出供应商管理列表
*/

View File

@ -46,6 +46,17 @@ public class MaTypeController extends BaseController {
return AjaxResult.success(maTypeList);
}
/**
* 工机具类型下拉树
* @return 结果
*/
@ApiOperation(value = "工机具类型下拉树")
@GetMapping("/getMaTypeSelect")
public AjaxResult getMaTypeSelect(@RequestParam(required = false, defaultValue = "", value = "typeName") String typeName, @RequestParam(required = false, defaultValue = "", value = "parentId") String parentId){
List<TreeSelect> maTypeList = iTypeService.getMaTypeSelect(typeName, parentId);
return AjaxResult.success(maTypeList);
}
@ApiOperation(value = "获取机具设备的具体规格")
@GetMapping(value = "/selectMaTypeTreeByLevel")
public AjaxResult selectMaTypeTreeByLevel(@RequestParam(value = "typeId") String typeId) {
@ -53,6 +64,20 @@ public class MaTypeController extends BaseController {
return AjaxResult.success(maTypeList);
}
/**
* 根据左列表类型id查询右表格
* @param typeId
* @return
*/
@ApiOperation(value = "工器具类型")
@GetMapping("/equipmentType")
public AjaxResult equipmentType(@RequestParam(required = false) Long typeId,
@RequestParam(required = false) String typeName){
List<MaType> listByMaType = iTypeService.getEquipmentType(typeId,typeName);
return success(listByMaType);
}
/**
* 获取规格层级为3的设备列表
* @return 结果
@ -150,6 +175,19 @@ public class MaTypeController extends BaseController {
*/
@ApiOperation(value = "根据左列表类型id查询右表格")
@GetMapping("/getListByMaType")
public AjaxResult getListByMaType(@RequestParam(required = false) Long typeId,
@RequestParam(required = false) String typeName){
List<MaType> listByMaType = iTypeService.getListByParentId(typeId,typeName);
return success(listByMaType);
}
/* *//**
* 根据左列表类型id查询右表格
* @param typeId
* @return
*//*
@ApiOperation(value = "根据左列表类型id查询右表格")
@GetMapping("/getListByMaType")
public TableDataInfo getListByMaType(@RequestParam(required = false) Long typeId,
@RequestParam(required = false) String typeName,
@RequestParam(required = false) Integer pageSize,
@ -161,12 +199,12 @@ public class MaTypeController extends BaseController {
TableDataInfo rspData = new TableDataInfo();
rspData.setTotal(listByMaType.size());
rspData.setCode(HttpStatus.SUCCESS);
listByMaType = listByMaType.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
// listByMaType = listByMaType.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
rspData.setRows(listByMaType);
rspData.setMsg("查询成功");
return rspData;
}
}*/
/**
* 获取机具类型管理ma_type详细信息
@ -206,8 +244,7 @@ public class MaTypeController extends BaseController {
@ApiOperation(value = "删除机具类型管理ma_type")
@Log(title = "机具类型管理ma_type", businessType = BusinessType.DELETE)
@DeleteMapping("/{typeId}")
public AjaxResult remove(@PathVariable Long typeId)
{
public AjaxResult remove(@PathVariable Long typeId) throws Exception {
return toAjax(iTypeService.deleteMaTypeByTypeId(typeId));
}

View File

@ -0,0 +1,129 @@
package com.bonus.sgzb.base.controller;
import cn.hutool.http.server.HttpServerRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.bonus.sgzb.base.domain.*;
import com.bonus.sgzb.base.domain.vo.TreeSelect;
import com.bonus.sgzb.base.domain.vo.dictVo;
import com.bonus.sgzb.base.service.RepairService;
import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import com.bonus.sgzb.common.security.annotation.RequiresPermissions;
import com.bonus.sgzb.system.api.domain.SysUser;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author c liu
* @date 2023/12/11
*/
@RestController
@RequestMapping("/repair")
public class RepairController extends BaseController {
@Autowired
private RepairService service;
/**
* 获取维修任务列表
*/
@ApiOperation(value = "获取维修任务列表")
@Log(title = "维修任务列表", businessType = BusinessType.QUERY)
@GetMapping("/getRepairTaskList")
public TableDataInfo getRepairTaskList(RepairTask bean)
{
startPage();
List<RepairTask> list = service.getRepairTaskList(bean);
return getDataTable(list);
}
/**
* 获取维修任务机具列表
*/
@ApiOperation(value = "获取维修任务机具列表")
@Log(title = "维修任务机具列表", businessType = BusinessType.QUERY)
@GetMapping("/getRepairMaTypeList")
public TableDataInfo getRepairMaTypeList(RepairTaskDetails bean)
{
startPage();
List<RepairTaskDetails> list = service.getRepairMaTypeList(bean);
return getDataTable(list);
}
/**
* 新增维修记录
*/
@ApiOperation(value = "新增维修记录")
@Log(title = "新增维修记录", businessType = BusinessType.INSERT)
@PostMapping("/submitRepairApply")
public AjaxResult submitRepairApply(@RequestBody RepairApplyRecord bean) {
String partStrList = bean.getPartStrList();
List<RepairPartDetails> repairPartDetails = JSONObject.parseArray(partStrList, RepairPartDetails.class);
bean.setPartList(repairPartDetails);
AjaxResult ajaxResult = service.submitRepairApply(bean);
return ajaxResult;
}
/**
* 快捷维修记录
*/
@ApiOperation(value = "快捷维修记录")
@Log(title = "快捷维修记录", businessType = BusinessType.INSERT)
@PostMapping("/fastRepairApply")
public AjaxResult fastRepairApply(@RequestBody List<RepairTaskDetails> list) {
AjaxResult ajaxResult = service.fastRepairApply(list);
return ajaxResult;
}
/**
* 完成维修
*/
@ApiOperation(value = "完成维修")
@Log(title = "完成维修", businessType = BusinessType.INSERT)
@PostMapping("/completeRepair")
public AjaxResult completeRepair(@RequestBody ArrayList<Long> ids) {
return toAjax(service.completeRepair(ids));
}
/**
* 提交审核
*/
@ApiOperation(value = "提交审核")
@Log(title = "提交审核", businessType = BusinessType.INSERT)
@PostMapping("/endRepairTask")
public AjaxResult endRepairTask(@RequestBody ArrayList<RepairTask> taskList) {
return service.endRepairTask(taskList);
}
/**
* 获取用户下拉选
*/
@GetMapping("/getUserSelect")
public AjaxResult getUserSelect()
{
List<SysUser> list = service.selectUserList();
return AjaxResult.success(list);
}
/**
* 字典下拉选
*/
@GetMapping("/getDicSelect")
public AjaxResult getDicSelect(@RequestParam String value)
{
List<dictVo> list = service.getDicSelect(value);
return AjaxResult.success(list);
}
}

View File

@ -0,0 +1,128 @@
package com.bonus.sgzb.base.domain;
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author c liu
* @date 2023/12/11
*/
@Data
@ApiModel(value="维修任务详细")
public class RepairApplyRecord implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
/**
* 任务ID
*/
@ApiModelProperty(value = "任务ID")
private String taskId;
/**
* 机具ID
*/
@ApiModelProperty(value = "机具ID")
private String maId;
/**
* 规格ID
*/
@ApiModelProperty(value = "规格ID")
private String typeId;
/**
* 维修数量
*/
@ApiModelProperty(value = "维修数量")
private int repairNum;
/**
* 报废数量
*/
@ApiModelProperty(value = "报废数量")
private int scrapNum;
/**
* 维修方式1内部2返厂3报废
*/
@ApiModelProperty(value = "维修方式1内部2返厂3报废")
private String repairType;
/**
* 创建者
*/
@ApiModelProperty(value = "创建者")
private Long createBy;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private String createTime;
/**
* 更新者
*/
@ApiModelProperty(value = "更新者")
private String updateBy;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
private String updateTime;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remark;//
/**
* 报废原因
*/
@ApiModelProperty(value = "报废原因")
private String scrapReason;//
/**
* 报废类型0自然报废1任务报废
*/
@ApiModelProperty(value = "报废类型0自然报废1任务报废")
private String scrapType;
/**
* 返厂id
*/
@ApiModelProperty(value = "返厂id")
private String supplierId;
/**
* 配件数量
*/
@ApiModelProperty(value = "配件数量")
private int partNum;
/**
* 配件单价
*/
@ApiModelProperty(value = "配件单价")
private String partPrice;
/**
* 维修内容
*/
@ApiModelProperty(value = "维修内容")
private String repairContent;
/**
* 类型0不收费1收费
*/
@ApiModelProperty(value = "类型0不收费1收费")
private String partType;
/**
* 配件名称
*/
@ApiModelProperty(value = "配件名称")
private String partName;
/**
* 维修人
*/
@ApiModelProperty(value = "维修人")
private Long repairer;
private List<RepairPartDetails> partList;
private String partStrList;
private Long companyId;
/**
* 损坏照片id
*/
@ApiModelProperty(value = "损坏照片id")
private String fileIds;
}

View File

@ -0,0 +1,98 @@
package com.bonus.sgzb.base.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author c liu
* @date 2023/12/11
*/
@Data
@ApiModel(value="维修配件")
public class RepairPartDetails {
/**
* 任务ID
*/
@ApiModelProperty(value = "任务ID")
private String taskId;
/**
* 机具ID
*/
@ApiModelProperty(value = "机具ID")
private String maId;
/**
* 规格ID
*/
@ApiModelProperty(value = "规格ID")
private String typeId;
/**
* 配件ID
*/
@ApiModelProperty(value = "配件ID")
private Long partId;
/**
* 配件名称
*/
@ApiModelProperty(value = "配件名称")
private String partName;
/**
* 返厂id
*/
@ApiModelProperty(value = "返厂id")
private String supplierId;
/**
* 配件数量
*/
@ApiModelProperty(value = "配件数量")
private int partNum;
/**
* 配件费用
*/
@ApiModelProperty(value = "配件费用")
private String partCost;
/**
* 配件单价
*/
@ApiModelProperty(value = "配件单价")
private String partPrice;
/**
* 类型0不收费1收费
*/
@ApiModelProperty(value = "类型0不收费1收费")
private String partType;
/**
* 创建者
*/
@ApiModelProperty(value = "创建者")
private Long createBy;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private String createTime;
/**
* 更新者
*/
@ApiModelProperty(value = "更新者")
private String updateBy;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
private String updateTime;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remark;//
/**
* 维修内容
*/
@ApiModelProperty(value = "维修内容")
private String repairContent;
private Long companyId;
private Long repairer;
@ApiModelProperty(value = "维修数量")
private int repairNum;
}

View File

@ -0,0 +1,70 @@
package com.bonus.sgzb.base.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author c liu
* @date 2023/12/11
*/
@Data
@ApiModel(value="维修任务")
public class RepairTask {
/**
* 任务id
*/
@ApiModelProperty(value = "任务id")
private String taskId;
/**
* 维修单号
*/
@ApiModelProperty(value = "维修单号")
private String repairCode;
/**
* 退料单位名称
*/
@ApiModelProperty(value = "退料单位名称")
private String backUnit;
/**
* 退料工程名称
*/
@ApiModelProperty(value = "退料工程名称")
private String backPro;
/**
* 维修机具类型
*/
@ApiModelProperty(value = "维修机具类型")
private String type;
/**
* 任务创建人
*/
@ApiModelProperty(value = "任务创建人")
private Long createBy;
/**
* 任务创建人
*/
@ApiModelProperty(value = "任务创建人")
private String createUser;
/**
* 任务创建时间
*/
@ApiModelProperty(value = "任务创建时间")
private String createTime;
/**
* 退料单号
*/
@ApiModelProperty(value = "退料单号")
private String backCode;
/**
* 维修状态
*/
@ApiModelProperty(value = "维修状态")
private String repairStatus;
private String keyword;//关键字
private String startTime;//开始时间
private String endTime;//结束时间
private String companyId;//
private Long agreementId;//
}

View File

@ -0,0 +1,83 @@
package com.bonus.sgzb.base.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author c liu
* @date 2023/12/11
*/
@Data
@ApiModel(value="维修任务明细")
public class RepairTaskDetails {
/**
* id
*/
@ApiModelProperty(value = "id")
private Long id;
/**
* 任务ID
*/
@ApiModelProperty(value = "任务ID")
private String taskId;
/**
* 机具ID
*/
@ApiModelProperty(value = "机具ID")
private String maId;
/**
* 类型名称
*/
@ApiModelProperty(value = "类型名称")
private String typeName;
/**
* 规格型号
*/
@ApiModelProperty(value = "规格型号")
private String type;
/**
* 编码
*/
@ApiModelProperty(value = "编码")
private String code;
/**
* 维修总量
*/
@ApiModelProperty(value = "维修总量")
private int repairNum;
/**
* 维修合格数量
*/
@ApiModelProperty(value = "维修合格数量")
private int repairedNum;
/**
* 维修报废数量
*/
@ApiModelProperty(value = "维修报废数量")
private int scrapNum;
/**
* 待修状态
*/
@ApiModelProperty(value = "待修状态")
private String status;
/**
* 更新者
*/
@ApiModelProperty(value = "更新者")
private String updateBy;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
private String updateTime;
/**
* 维修人
*/
@ApiModelProperty(value = "维修人")
private String repairer;
private String keyword;//关键字
private String typeId;//规格ID
private Long companyId;//规格ID
}

View File

@ -0,0 +1,17 @@
package com.bonus.sgzb.base.domain.vo;
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
import lombok.Data;
import java.io.Serializable;
/**
* @author c liu
* @date 2023/12/17
*/
@Data
public class dictVo extends BaseEntity {
private static final long serialVersionUID = 1L;
private Long id;
private String name;
}

View File

@ -74,4 +74,5 @@ public interface MaTypeMapper {
List<MaType> selectMaTypeListByLevelNotFour(String parentId);
List<MaType> getMaTypeSelect(String parentId);
}

View File

@ -0,0 +1,55 @@
package com.bonus.sgzb.base.mapper;
import com.bonus.sgzb.base.domain.RepairApplyRecord;
import com.bonus.sgzb.base.domain.RepairPartDetails;
import com.bonus.sgzb.base.domain.RepairTask;
import com.bonus.sgzb.base.domain.RepairTaskDetails;
import com.bonus.sgzb.base.domain.vo.dictVo;
import com.bonus.sgzb.system.api.domain.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.ArrayList;
import java.util.List;
/**
* @author c liu
* @date 2023/12/11
*/
@Mapper
public interface RepairMapper {
List<RepairTask> getRepairTaskList(RepairTask bean);
List<RepairTaskDetails> getRepairMaTypeList(RepairTaskDetails bean);
int addRecord(RepairApplyRecord bean);
RepairTaskDetails getById(Long id);
int updateRepairedNum(@Param("id") Long id, @Param("repairNum")int repairNum,@Param("repairer") Long repairer,@Param("userId") Long userId);
int updateScrapNum(@Param("id")Long id, @Param("scrapNum")int scrapNum,@Param("userId")Long userId);
int addPart(RepairPartDetails partDetails);
int completeRepair(@Param("ids") ArrayList<Long> ids, @Param("userId")Long userId);
List<SysUser> selectUserList();
int updateTaskStatus(@Param("taskList")List<RepairTask> taskList,@Param("userId") Long userid);
int addTask(RepairTask task);
Long getAgreementId(RepairTask task);
int createAgreementTask(RepairTask task);
int updateRepairedNumTwo(@Param("id")Long id, @Param("repairNum")int repairNum, @Param("userId")Long userid);
int getUnFinish(RepairTask task);
List<dictVo> getDicSelect(String value);
}

View File

@ -11,6 +11,7 @@ import java.util.List;
public interface ITypeService {
List<TreeSelect> getMaTypeList(String typeName, String parentId);
List<TreeSelect> getMaTypeSelect(String typeName, String parentId);
List<MaType> getListByMaType(Long typeId,String typeName);
@ -45,7 +46,7 @@ public interface ITypeService {
* @param typeId 机具类型管理ma_type主键
* @return 结果
*/
public int deleteMaTypeByTypeId(Long typeId);
public int deleteMaTypeByTypeId(Long typeId) throws Exception;
/**
* 构建前端所需要树结构
@ -67,4 +68,6 @@ public interface ITypeService {
List<MaType> getListByParentId(Long typeId, String typeName);
List<MaType> getEquipmentType(Long typeId, String typeName);
}

View File

@ -0,0 +1,38 @@
package com.bonus.sgzb.base.service;
import com.bonus.sgzb.base.domain.RepairApplyRecord;
import com.bonus.sgzb.base.domain.RepairTask;
import com.bonus.sgzb.base.domain.RepairTaskDetails;
import com.bonus.sgzb.base.domain.vo.TreeSelect;
import com.bonus.sgzb.base.domain.vo.dictVo;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.system.api.domain.SysUser;
import java.util.ArrayList;
import java.util.List;
/**
* @author c liu
* @date 2023/12/11
*/
public interface RepairService {
List<RepairTask> getRepairTaskList(RepairTask bean);
List<RepairTaskDetails> getRepairMaTypeList(RepairTaskDetails bean);
AjaxResult submitRepairApply(RepairApplyRecord bean);
AjaxResult fastRepairApply(List<RepairTaskDetails> list);
int completeRepair(ArrayList<Long> ids);
List<SysUser> selectUserList();
AjaxResult endRepairTask(List<RepairTask> taskList);
List<dictVo> getDicSelect(String value);
}

View File

@ -22,12 +22,7 @@ public class MaMachineServiceImpl implements MaMachineService {
@Override
public List<MaMachine> getMaMachine(MaMachine maMachine) {
List<MaMachine> maMachineList = maMachineMapper.getMaMachine(maMachine);
for (MaMachine machine : maMachineList) {
// 添加查询物品种类,设备类型,规格型号
getType(machine);
}
return maMachineList;
return maMachineMapper.getMaMachine(maMachine);
}
/**

View File

@ -48,23 +48,31 @@ public class MaTypeServiceImpl implements ITypeService {
@Override
@Transactional
public int insertMaType(MaType maType) {
Long parentId = maType.getParentId();
MaType maType1 = maTypeMapper.selectMaTypeByTypeId(parentId);
String level = maType1.getLevel();
maType.setLevel(String.valueOf(Integer.parseInt(level) + 1));
maType.setCreateTime(DateUtils.getNowDate());
int i = maTypeMapper.insertType(maType);
Long typeId = maType.getTypeId();
// 图片路径保存
MaTypeFile typeFile = new MaTypeFile();
typeFile.setTypeId(typeId);
typeFile.setFileName(maType.getPhotoName());
typeFile.setFileUrl(maType.getPhotoUrl());
typeFile.setFileType("");
typeFileMapper.insertMaTypeFile(typeFile);
if (StringUtils.isNotEmpty(maType.getPhotoName()) && StringUtils.isNotEmpty(maType.getPhotoUrl())) {
MaTypeFile typeFile = new MaTypeFile();
typeFile.setTypeId(typeId);
typeFile.setFileName(maType.getPhotoName());
typeFile.setFileUrl(maType.getPhotoUrl());
typeFile.setFileType("");
typeFileMapper.insertMaTypeFile(typeFile);
}
// 文档路径保存
MaTypeFile typeFile1 = new MaTypeFile();
typeFile1.setTypeId(typeId);
typeFile1.setFileName(maType.getDocumentName());
typeFile1.setFileUrl(maType.getDocumentUrl());
typeFile1.setFileType("");
typeFileMapper.insertMaTypeFile(typeFile1);
if (StringUtils.isNotEmpty(maType.getDocumentName()) && StringUtils.isNotEmpty(maType.getDocumentUrl())) {
MaTypeFile typeFile1 = new MaTypeFile();
typeFile1.setTypeId(typeId);
typeFile1.setFileName(maType.getDocumentName());
typeFile1.setFileUrl(maType.getDocumentUrl());
typeFile1.setFileType("");
typeFileMapper.insertMaTypeFile(typeFile1);
}
// 库管员配置
MaTypeKeeper typeKeeper = new MaTypeKeeper();
typeKeeper.setUserId(maType.getKeeperUserId());
@ -145,7 +153,11 @@ public class MaTypeServiceImpl implements ITypeService {
* @return 结果
*/
@Override
public int deleteMaTypeByTypeId(Long typeId) {
public int deleteMaTypeByTypeId(Long typeId) throws Exception {
List<MaType> listByParentId = maTypeMapper.getListByParentId(typeId, "");
if (listByParentId.size() > 0) {
throw new Exception("子级类型不为空!!!");
}
return maTypeMapper.deleteTypeById(typeId);
}
@ -157,6 +169,16 @@ public class MaTypeServiceImpl implements ITypeService {
return treeSelectList;
}
@Override
public List<TreeSelect> getMaTypeSelect(String typeName, String parentId) {
List<MaType> maTypes = maTypeMapper.getMaTypeSelect(parentId);
List<TreeSelect> treeSelectList = buildDeptTreeSelect(maTypes);
//如果没有查询到那么返回空
return treeSelectList;
}
/**
* 根据左列表类型id查询右表格
*

View File

@ -0,0 +1,189 @@
package com.bonus.sgzb.base.service.impl;
import cn.hutool.http.server.HttpServerRequest;
import com.bonus.sgzb.base.domain.RepairApplyRecord;
import com.bonus.sgzb.base.domain.RepairPartDetails;
import com.bonus.sgzb.base.domain.RepairTask;
import com.bonus.sgzb.base.domain.RepairTaskDetails;
import com.bonus.sgzb.base.domain.vo.TreeSelect;
import com.bonus.sgzb.base.domain.vo.dictVo;
import com.bonus.sgzb.base.mapper.RepairMapper;
import com.bonus.sgzb.base.service.RepairService;
import com.bonus.sgzb.common.core.constant.TokenConstants;
import com.bonus.sgzb.common.core.utils.SpringUtils;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.security.service.TokenService;
import com.bonus.sgzb.common.security.utils.SecurityUtils;
import com.bonus.sgzb.system.api.domain.SysUser;
import com.bonus.sgzb.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author c liu
* @date 2023/12/11
*/
@Service("RepairService")
public class RepairServiceImpl implements RepairService {
@Autowired
private RepairMapper mapper;
@Resource
private TokenService TokenService;
@Override
public List<RepairTask> getRepairTaskList(RepairTask bean) {
List<RepairTask> repairTaskList = mapper.getRepairTaskList(bean);
return repairTaskList;
}
@Override
public List<RepairTaskDetails> getRepairMaTypeList(RepairTaskDetails bean) {
List<RepairTaskDetails> repairMaTypeList = mapper.getRepairMaTypeList(bean);
return repairMaTypeList;
}
@Override
@Transactional
public AjaxResult submitRepairApply( RepairApplyRecord bean) {
RepairTaskDetails details = mapper.getById(bean.getId());
LoginUser loginUser = SecurityUtils.getLoginUser();
bean.setCreateBy(loginUser.getUserid());
List<RepairPartDetails> partList = bean.getPartList();
if (partList != null && partList.size()>0){
bean.setRepairNum(partList.get(0).getRepairNum());
bean.setRepairer(partList.get(0).getRepairer());
}
switch (bean.getRepairType()) {
case "1":{
int repairNum = details.getRepairedNum() + bean.getRepairNum();
int num = repairNum + details.getScrapNum();
if (num > details.getRepairNum()) {
return AjaxResult.error("维修数量大于维修总量");
}
mapper.updateRepairedNum(bean.getId(), repairNum,bean.getRepairer(),loginUser.getUserid());
break;
}
case "2": {
int repairNum = details.getRepairedNum() + bean.getRepairNum();
int num = repairNum + details.getScrapNum();
if (num > details.getRepairNum()) {
return AjaxResult.error("维修数量大于维修总量");
}
mapper.updateRepairedNumTwo(bean.getId(), repairNum,loginUser.getUserid());
break;
}
case "3": {
int scrapNum = details.getScrapNum() + bean.getScrapNum();
int num = scrapNum + details.getRepairedNum();
if (num > details.getRepairNum()) {
return AjaxResult.error("维修数量大于维修总量");
//添加维修记录
}
mapper.updateScrapNum(bean.getId(), scrapNum,loginUser.getUserid());
break;
}
}
if (partList != null && partList.size()>0){
for (RepairPartDetails partDetails : partList){
if (partDetails.getPartId() == null && bean.getRepairType().equals("1")){
return AjaxResult.error("请选择配件");
}
if (bean.getRepairType().equals("1")){
partDetails.setTaskId(bean.getTaskId());
partDetails.setMaId(bean.getMaId());
partDetails.setTypeId(bean.getTypeId());
partDetails.setCreateBy(loginUser.getUserid());
partDetails.setCompanyId(bean.getCompanyId());
mapper.addPart(partDetails);
}
}
if (bean.getRepairType().equals("2")){
bean.setPartName(partList.get(0).getPartName());
bean.setPartType(partList.get(0).getPartType());
bean.setRepairContent(partList.get(0).getRepairContent());
bean.setSupplierId(partList.get(0).getSupplierId());
bean.setPartPrice(partList.get(0).getPartPrice());
bean.setPartNum(partList.get(0).getPartNum());
}
}
mapper.addRecord(bean);
return AjaxResult.success();
}
@Override
@Transactional
public AjaxResult fastRepairApply(List<RepairTaskDetails> list) {
LoginUser loginUser = SecurityUtils.getLoginUser();
for (RepairTaskDetails bean : list){
int repairedNum = bean.getRepairNum() - bean.getRepairedNum() - bean.getScrapNum();
if (repairedNum <= 0){
return AjaxResult.error("选中的数据中包含待维修数量为0的机具请重新选择");
}
}
for (RepairTaskDetails bean : list){
int repairedNum = bean.getRepairNum() - bean.getRepairedNum() - bean.getScrapNum();
RepairApplyRecord partDetails = new RepairApplyRecord();
partDetails.setTaskId(bean.getTaskId());
partDetails.setMaId(bean.getMaId());
partDetails.setTypeId(bean.getTypeId());
partDetails.setRepairNum(repairedNum);
partDetails.setRepairType("1");
partDetails.setCreateBy(loginUser.getUserid());
partDetails.setCompanyId(bean.getCompanyId());
mapper.addRecord(partDetails);
int i = repairedNum + bean.getRepairedNum();
mapper.updateRepairedNumTwo(bean.getId(),i,loginUser.getUserid());
}
return AjaxResult.success();
}
@Override
@Transactional
public AjaxResult endRepairTask(List<RepairTask> taskList) {
LoginUser loginUser = SecurityUtils.getLoginUser();
for (RepairTask task : taskList){
int i = mapper.getUnFinish(task);
if (i > 0){
return AjaxResult.error("选中的数据中包含维修未完成的,请完成维修再进行审核");
}
}
int i = mapper.updateTaskStatus(taskList,loginUser.getUserid());
for (RepairTask task : taskList){
task.setCreateBy(loginUser.getUserid());
Long agreementId = mapper.getAgreementId(task);
mapper.addTask(task);
task.setAgreementId(agreementId);
mapper.createAgreementTask(task);
}
return AjaxResult.success();
}
@Override
public List<dictVo> getDicSelect(String value) {
return mapper.getDicSelect(value);
}
@Override
public int completeRepair(ArrayList<Long> ids) {
LoginUser loginUser = SecurityUtils.getLoginUser();
return mapper.completeRepair(ids,loginUser.getUserid());
}
@Override
public List<SysUser> selectUserList() {
return mapper.selectUserList();
}
}

View File

@ -76,7 +76,6 @@ public class CommonUtil {
valueList.add(0);
return valueList;
}
;
BigDecimal numberValue = new BigDecimal(new Double(0).toString());
BigDecimal countValue = new BigDecimal(new Double(0).toString());
for (int i = 0; i < list.size(); i++) {

View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.bonus.sgzb.app.mapper.AppMapper">
<select id="getDayLeaseNum" resultType="java.lang.Integer">
select COALESCE(SUM(pre_num), 0)
from lease_apply_details
WHERE create_time &gt;= #{startTime} AND create_time &lt;= #{endTime};
</select>
<select id="getDayBackNum" resultType="java.lang.Integer">
select COALESCE(sum(pre_num), 0)
from back_apply_details
WHERE create_time &gt;= #{startTime} AND create_time &lt;= #{endTime};
</select>
<select id="getDayInputNum" resultType="java.lang.Integer">
select COALESCE(sum(input_num), 0)
from input_apply_details
WHERE create_time &gt;= #{startTime} AND create_time &lt;= #{endTime};
</select>
<select id="getDayOutNum" resultType="java.lang.Integer">
select COALESCE(sum(out_num), 0)
from lease_out_details
WHERE create_time &gt;= #{startTime} AND create_time &lt;= #{endTime};
</select>
<select id="getLeaseNum" resultType="java.lang.Integer">
select count(1)
from lease_apply_details
where status = '0'
</select>
<select id="getBackNum" resultType="java.lang.Integer">
select count(1)
from back_apply_details
where status = '0'
</select>
<select id="getScrapNum" resultType="java.lang.Integer">
select count(1)
from scrap_apply_details
where status = '0'
</select>
<select id="getTrialNum" resultType="java.lang.Integer">
select count(1)
from scrap_apply_details
where status = '0'
</select>
</mapper>

View File

@ -268,7 +268,10 @@
NOW()
)
</insert>
<delete id="del">
<update id="audit">
UPDATE tm_task SET task_status = 38 WHERE task_id = #{id}
</update>
<delete id="del">
DELETE FROM back_apply_info WHERE id = #{id}
</delete>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.bonus.sgzb.app.mapper.SysNoticeMapper">
<select id="getList" resultType="com.bonus.sgzb.app.domain.SysNotice">
select notice_id as noticeId,
notice_title as noticeTitle,
notice_type as noticeType,
notice_content as noticeContent,
status as status,
create_by as createBy,
create_time as createTime,
update_by as updateBy,
update_time as updateTime,
remark as remark
from sys_notice
</select>
</mapper>

View File

@ -37,11 +37,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getMaMachine" parameterType="com.bonus.sgzb.base.api.domain.MaMachine" resultMap="MaMachineResult">
select ma_id, type_id, ma_code, pre_code, ma_status, qr_code, buy_price, ma_vender, out_fac_time, out_fac_code,
assets_code, check_man, this_check_time, next_check_time, gps_code, rfid_code, erp_code, transfer_code,
in_out_num, buy_task, own_house ,company_id
from ma_machine
select m.ma_id, m.type_id, m.ma_code, m.pre_code, m.ma_status, dic.name maStatusName, m.qr_code, m.buy_price, m.ma_vender, m.out_fac_time, m.out_fac_code,
m.assets_code, m.check_man, m.this_check_time, m.next_check_time, m.gps_code, m.rfid_code, m.erp_code, m.transfer_code,
m.in_out_num, m.buy_task, m.own_house ,m.company_id ,mt.type_name specificationType,mt1.type_name deviceType, mt2.type_name itemType
from ma_machine m
left join (select id,p_id,name from sys_dic where p_id in (select id from sys_dic where value = 'ma_status')) dic on m.ma_status = dic.id
left join ma_type mt on m.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
left join ma_type mt2 on mt1.parent_id = mt2.type_id
<where>
<if test="maId != null and maId != ''">
AND ma_id = #{maId}
@ -49,70 +52,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeId != null and typeId != ''">
AND type_id = #{typeId}
</if>
<if test="maCode != null and maCode != ''">
AND ma_code = #{maCode}
</if>
<if test="preCode != null and preCode != ''">
AND pre_code = #{preCode}
</if>
<if test="maStatus != null and maStatus != ''">
and ma_status = #{maStatus}
</if>
<if test="qrCode != null and qrCode != ''">
and qr_code = #{qrCode}
</if>
<if test="buyPrice != null and buyPrice != ''">
and buy_price = #{buyPrice}
</if>
<if test="maVender != null and maVender != ''">
and ma_vender = #{maVender}
</if>
<if test="outFacTime != null and outFacTime != ''">
and out_fac_time = #{outFacTime}
</if>
<if test="outFacCode != null and outFacCode != ''">
and out_fac_code = #{outFacCode}
</if>
<if test="assetsCode != null and assetsCode != ''">
and assets_code = #{assetsCode}
</if>
<if test="checkMan != null and checkMan != ''">
and update_time = #{updateTime}
</if>
<if test="remark != null and remark != ''">
and check_man = #{remark}
</if>
<if test="thisCheckTime != null and thisCheckTime != ''">
and this_check_time = #{thisCheckTime}
</if>
<if test="nextCheckTime != null and nextCheckTime != ''">
and next_check_time = #{nextCheckTime}
</if>
<if test="gpsCode != null and gpsCode != ''">
and gps_code = #{gpsCode}
</if>
<if test="rfidCode != null and rfidCode != ''">
and rfid_code = #{rfidCode}
</if>
<if test="erpCode != null and erpCode != ''">
and erp_code = #{erpCode}
</if>
<if test="transferCode != null and transferCode != ''">
and transfer_code = #{transferCode}
</if>
<if test="inOutNum != null and inOutNum != ''">
and in_out_num = #{inOutNum}
</if>
<if test="buyTask != null and buyTask != ''">
and buy_task = #{buyTask}
</if>
<if test="ownHouse != null and ownHouse != ''">
and own_house = #{ownHouse}
</if>
<if test="companyId != null and companyId != ''">
and company_id = #{companyId}
</if>
</where>
</select>
@ -276,7 +215,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="selectMaMachineByMaId" parameterType="Long" resultMap="MaMachineResult">
<include refid="selectMaMachine"/>
select m.ma_id, m.type_id, m.ma_code, m.pre_code, m.ma_status, m.qr_code, m.buy_price, m.ma_vender, m.out_fac_time, m.out_fac_code,
m.assets_code, m.check_man, m.this_check_time, m.next_check_time, m.gps_code, m.rfid_code, m.erp_code, m.transfer_code,
m.in_out_num, m.buy_task, m.own_house ,m.company_id ,mt.type_name specificationType,mt1.type_name deviceType, mt2.type_name itemType
from ma_machine m
left join ma_type mt on m.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
left join ma_type mt2 on mt1.parent_id = mt2.type_id
where ma_id = #{maId}
</select>
</mapper>

View File

@ -289,8 +289,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
m.holding_time, m.warn_num, m.del_flag, m.create_by, m.create_time,
m.remark, m.company_id
from ma_type m
where level != 4 and m.status = '0' and del_flag = '0'
</select>
<select id="getMaTypeSelect" resultType="com.bonus.sgzb.base.api.domain.MaType">
select m.type_id, m.type_name, m.parent_id, m.status, m.num, m.unit_id, m.manage_type,
m.lease_price, m.rent_price, m.buy_price, m.pay_price, m.level, m.rated_load, m.test_load,
m.holding_time, m.warn_num, m.del_flag, m.create_by, m.create_time,
m.remark, m.company_id
from ma_type m
<where>
level != 4 and m.status = '0'
m.status = '0'
</where>
</select>
@ -308,7 +316,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join (select * from ma_type_file where file_type = '2') mtf2 on m.type_id = mtf2.type_id
left join ma_type_keeper mtk on mtf.type_id = mtk.type_id
left join sys_user su on mtk.user_id = su.user_id
where m.parent_id = #{typeId} and m.status = '0'
where m.parent_id = #{typeId} and m.status = '0' and m.del_flag = '0'
<if test="typeName != null and typeName !=''">
AND type_name like concat('%',#{typeName},'%')
</if>
@ -338,4 +346,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
</where>
</select>
</mapper>

View File

@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectMaSupplierInfoList" parameterType="com.bonus.sgzb.base.domain.MaSupplierInfo" resultMap="MaSupplierInfoResult">
<include refid="selectMaSupplierInfoVo"/>
<where>
<if test="supplier != null and supplier != ''"> and supplier = #{supplier}</if>
<if test="supplier != null and supplier != ''"> and supplier like concat('%',#{supplier},'%') </if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="legalPerson != null and legalPerson != ''"> and legal_person = #{legalPerson}</if>
<if test="primaryContact != null and primaryContact != ''"> and primary_contact = #{primaryContact}</if>

View File

@ -0,0 +1,176 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.bonus.sgzb.base.mapper.RepairMapper">
<insert id="addRecord">
insert into repair_apply_record (task_id,ma_id,type_id,repair_num,scrap_num,repair_type,create_by,create_time,repair_content,company_id,scrap_reason,scrap_type,supplier_id,part_num,part_price,part_type,part_name,repairer,file_ids)
values (#{taskId},#{maId},#{typeId},#{repairNum},#{scrapNum},#{repairType},#{createBy},now(),#{repairContent},#{companyId},#{scrapReason},#{scrapType},#{supplierId},#{partNum},#{partPrice},#{partType},#{partName},#{repairer},#{fileIds});
</insert>
<insert id="addPart">
insert into repair_part_details (task_id,ma_id,type_id,part_id,part_num,part_cost,part_type,create_by,create_time,company_id,repair_content)
values (#{taskId},#{maId},#{typeId},#{partId},#{partNum},#{partCost},#{partType},#{createBy},now(),#{companyId},#{repairContent});
</insert>
<insert id="addTask" useGeneratedKeys="true" keyProperty="taskId">
insert into tm_task (task_status,task_type,code,create_by,create_time,company_id)
values (46,45,#{repairCode},#{createBy},now(),#{companyId});
</insert>
<insert id="createAgreementTask">
insert into tm_task_agreement (task_id,agreement_id,create_by,create_time,company_id)
values (#{taskId},#{agreementId},#{createBy},now(),#{companyId});
</insert>
<update id="updateRepairedNum">
update repair_apply_details
set repaired_num = #{repairNum},
repairer = #{repairer},
update_by = #{userId},
update_time = now()
where id = #{id}
</update>
<update id="updateScrapNum">
update repair_apply_details
set scrap_num = #{scrapNum},
update_by = #{userId},
update_time = now()
where id = #{id}
</update>
<update id="completeRepair">
update repair_apply_details
set status = '1',
update_by = #{userId},
update_time = now()
where id in
<foreach item="id" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<update id="updateTaskStatus">
update tm_task
set task_status = '44',
update_by = #{userId},
update_time = now()
where task_id in
<foreach item="task" collection="taskList" open="(" separator="," close=")">
#{task.taskId}
</foreach>
</update>
<update id="updateRepairedNumTwo">
update repair_apply_details
set repaired_num = #{repairNum},
update_by = #{userId},
update_time = now()
where id = #{id}
</update>
<select id="getRepairTaskList" resultType="com.bonus.sgzb.base.domain.RepairTask">
SELECT
rd.task_id,
tt.CODE AS repairCode,
bui.unit_name AS backUnit,
bpi.pro_name AS backPro,
su.user_name AS createUser,
tt.create_time AS createTime,
bai.CODE AS backCode,
sd.name AS repairStatus,
tt.company_id AS companyId,
GROUP_CONCAT(DISTINCT mt2.type_name) as type
FROM
repair_apply_details rd
LEFT JOIN ma_type mt on rd.type_id = mt.type_id
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
LEFT JOIN tm_task tt on rd.task_id = tt.task_id
LEFT JOIN back_apply_info bai ON rd.back_id = bai.id
LEFT JOIN tm_task_agreement tta ON bai.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai2 ON tta.agreement_id = bai2.agreement_id
LEFT JOIN bm_unit_info bui ON bai2.unit_id = bui.unit_id
LEFT JOIN bm_project_info bpi ON bai2.project_id = bpi.pro_id
left join sys_user su on rd.create_by = su.user_id
left join sys_dic sd on sd.id = tt.task_status
where 1=1
<if test="keyword != null and keyword != ''">
AND (locate(#{keyword}, su.user_name) > 0
or locate(#{keyword}, tt.CODE) > 0)
</if>
<if test="backUnit != null and backUnit != ''">
AND bui.unit_id = #{backUnit}
</if>
<if test="backPro != null and backPro != ''">
AND bpi.pro_id = #{backPro}
</if>
<if test="type != null and type != ''">
AND mt2.type_id = #{type}
</if>
<if test="backCode != null and backCode != ''">
AND locate(#{backCode}, bai.CODE) > 0
</if>
<if test="repairStatus != null and repairStatus != ''">
AND tt.task_status = #{repairStatus}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND ts.create_time between #{startTime} and #{endTime}
</if>
GROUP BY rd.task_id,bui.unit_name,bpi.pro_name,bai.code,su.user_name
</select>
<select id="getRepairMaTypeList" resultType="com.bonus.sgzb.base.domain.RepairTaskDetails">
select rad.id as id,
rad.task_id as taskId,
rad.ma_id as maId,
mt2.type_name as typeName,
mt.type_name as type,
mm.ma_code as code,
rad.repair_num as repairNum,
rad.repaired_num as repairedNum,
rad.scrap_num as scrapNum,
rad.status as status,
su.user_name as repairer,
rad.update_time as updateTime,
rad.type_id as typeId
from repair_apply_details rad
left join ma_type mt on rad.type_id = mt.type_id
left join ma_machine mm on mm.ma_id = rad.ma_id
left join sys_user su on rad.repairer = su.user_id
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
where rad.task_id = #{taskId}
<if test="keyword != null and keyword != ''">
AND (locate(#{keyword}, mm.ma_code) > 0
or locate(#{keyword}, su.user_name) > 0)
</if>
<if test="type != null and type != ''">
AND mt.type_id = #{type}
</if>
<if test="typeName != null and typeName != ''">
AND mt2.type_id = #{typeName}
</if>
</select>
<select id="getById" resultType="com.bonus.sgzb.base.domain.RepairTaskDetails">
select rad.id as id,
rad.repair_num as repairNum,
rad.repaired_num as repairedNum,
rad.scrap_num as scrapNum
from repair_apply_details rad
where rad.id = #{id}
</select>
<select id="selectUserList" resultType="com.bonus.sgzb.system.api.domain.SysUser">
select user_id as userId,
nick_name as nickName
from sys_user
</select>
<select id="getAgreementId" resultType="java.lang.Long">
select agreement_id
from tm_task_agreement
where task_id = #{taskId}
</select>
<select id="getUnFinish" resultType="java.lang.Integer">
select count(*)
from repair_apply_details
where task_id = #{taskId} and status = '0'
</select>
<select id="getDicSelect" resultType="com.bonus.sgzb.base.domain.vo.dictVo">
select s2.id,
s2.name
from sys_dic s1
left join sys_dic s2 on s2.p_id = s1.id
where s1.value = #{value} and s2.status = 0
</select>
</mapper>

View File

@ -0,0 +1,37 @@
package com.bonus.sgzb.material.controller;
import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
import com.bonus.sgzb.material.domain.ReturnOfMaterialsInfo;
import com.bonus.sgzb.material.service.ReturnOfMaterialsInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bonus.sgzb.material.domain.AgreementInfo;
import java.util.List;
/**
* @author lsun
*/
@Api(tags = " 退料入库")
@RestController
@RequestMapping("/returnOfMaterialsInfo")
public class ReturnOfMaterialsInfoController extends BaseController {
@Autowired
private ReturnOfMaterialsInfoService returnOfMaterialsInfoService;
/**
* 获取协议管理列表
*/
@ApiOperation(value = "获取协议管理列表")
@GetMapping("/getReturnOfMaterialsInfoAll")
public TableDataInfo getReturnOfMaterialsInfoAll(ReturnOfMaterialsInfo bean)
{
startPage();
List<ReturnOfMaterialsInfo> list = returnOfMaterialsInfoService.getReturnOfMaterialsInfoAll(bean);
return getDataTable(list);
}
}

View File

@ -0,0 +1,64 @@
package com.bonus.sgzb.material.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author lsun
* 退料入库
*/
@Data
public class ReturnOfMaterialsInfo {
@ApiModelProperty(value = "id")
private Long id;
/** 退料单号 */
@ApiModelProperty(value = "退料单号")
private String code;
/** 退料单位 */
@ApiModelProperty(value = "退料单位")
private String unitName;
/** 退料工程 */
@ApiModelProperty(value = "退料工程")
private String lotName;
@ApiModelProperty(value = "机具id")
private Long kindId;
@ApiModelProperty(value = "机具名称")
private String kindName;
@ApiModelProperty(value = "类型id")
private Long typeId;
@ApiModelProperty(value = "类型ids")
private String typeIds;
@ApiModelProperty(value = "类型名称")
private String typeName;
@ApiModelProperty(value = "规格型号id")
private Long modelId;
@ApiModelProperty(value = "规格型号")
private String modelName;
@ApiModelProperty(value = "入库数量")
private String inputNum;
@ApiModelProperty(value = "编号")
private String maCode;
@ApiModelProperty(value = "退料时间")
private String returnTime;
@ApiModelProperty(value = "提交入库时间")
private String submitStorageTime;
@ApiModelProperty(value = "提交入库人员")
private String submitToStoragePersonnel;
@ApiModelProperty(value = "备注")
private String remark;
}

View File

@ -0,0 +1,17 @@
package com.bonus.sgzb.material.mapper;
import com.bonus.sgzb.material.domain.ReturnOfMaterialsInfo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author lsun
*/
@Mapper
public interface ReturnOfMaterialsInfoMapper {
List<ReturnOfMaterialsInfo> getReturnOfMaterialsInfoAll(ReturnOfMaterialsInfo bean);
}

View File

@ -0,0 +1,14 @@
package com.bonus.sgzb.material.service;
import com.bonus.sgzb.material.domain.ReturnOfMaterialsInfo;
import java.util.List;
/**
* @author lsun
*/
public interface ReturnOfMaterialsInfoService {
List<ReturnOfMaterialsInfo> getReturnOfMaterialsInfoAll(ReturnOfMaterialsInfo bean);
}

View File

@ -15,7 +15,6 @@ import com.bonus.sgzb.material.service.IPurchaseCheckInfoService;
import com.bonus.sgzb.common.core.utils.DateUtils;
import com.bonus.sgzb.material.vo.NoticeInfoVO;
import com.bonus.sgzb.system.api.RemoteUserService;
import javafx.concurrent.Task;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

View File

@ -0,0 +1,24 @@
package com.bonus.sgzb.material.service.impl;
import com.bonus.sgzb.material.domain.ReturnOfMaterialsInfo;
import com.bonus.sgzb.material.mapper.ReturnOfMaterialsInfoMapper;
import com.bonus.sgzb.material.service.ReturnOfMaterialsInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author lsun
*/
@Service
public class ReturnOfMaterialsInfoServiceImpl implements ReturnOfMaterialsInfoService {
@Autowired
private ReturnOfMaterialsInfoMapper returnOfMaterialsInfoMapper;
@Override
public List<ReturnOfMaterialsInfo> getReturnOfMaterialsInfoAll(ReturnOfMaterialsInfo bean) {
return returnOfMaterialsInfoMapper.getReturnOfMaterialsInfoAll(bean);
}
}

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.sgzb.material.mapper.ReturnOfMaterialsInfoMapper">
<select id="getReturnOfMaterialsInfoAll" resultType="com.bonus.sgzb.material.domain.ReturnOfMaterialsInfo">
SELECT
tt.`code` ,bui.unit_name as unitName ,bpl.lot_name as lotName,
mt3.type_name as typeName,mt2.type_name as kindName,mt.type_name as modelName,
iad.input_num as inputNum,mm.ma_code as maCode,
tt.create_time as returnTime,
iad.create_time as submitStorageTime,
iad.create_by as submitToStoragePersonnel,iad.remark as remark
FROM input_apply_details iad
LEFT JOIN tm_task tt ON iad.task_id = tt.task_id
LEFT JOIN tm_task_agreement tta on tta.task_id = tt.task_id
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bai.project_id
LEFT JOIN bm_unit_info bui on bui.unit_id = bai.unit_id
LEFT JOIN ma_type mt on mt.type_id = iad.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id AND mt2.`level` = '3'
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id AND mt3.`level` = '2'
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id AND mt4.`level` = '1'
LEFT JOIN ma_machine mm ON mm.ma_id = iad.ma_id
WHERE tt.task_status = '38' and mt.`level` = '4' and input_type ='2'
</select>
</mapper>