qushaowei
2023-10-18 4b4d94f411eee4d459a6556e100710278c56a830
三保验收单
已添加6个文件
已修改2个文件
365 ■■■■■ 文件已修改
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/MaintenanceThreeAcceptanceController.java 204 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/DailyMaintenanceOrder.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/MaintenanceThreeAcceptance.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/MaintenanceThreeAcceptanceMapper.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/DailyMaintenanceOrderMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/MaintenanceThreeAcceptanceMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IMaintenanceThreeAcceptanceService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/MaintenanceThreeAcceptanceServiceImpl.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/MaintenanceThreeAcceptanceController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,204 @@
package org.jeecg.modules.eam.controller;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.eam.entity.DailyMaintenanceOrder;
import org.jeecg.modules.eam.entity.MaintenanceThreeAcceptance;
import org.jeecg.modules.eam.service.IDailyMaintenanceOrderService;
import org.jeecg.modules.eam.service.IMaintenanceThreeAcceptanceService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
 /**
 * @Description: mom_eam_maintenance_three_acceptance
 * @Author: jeecg-boot
 * @Date:   2023-10-18
 * @Version: V1.0
 */
@Api(tags="mom_eam_maintenance_three_acceptance")
@RestController
@RequestMapping("/eam/maintenanceThreeAcceptance")
@Slf4j
public class MaintenanceThreeAcceptanceController extends JeecgController<MaintenanceThreeAcceptance, IMaintenanceThreeAcceptanceService> {
    @Autowired
    private IMaintenanceThreeAcceptanceService maintenanceThreeAcceptanceService;
     @Autowired
    private IDailyMaintenanceOrderService dailyMaintenanceOrderService;
    /**
     * åˆ†é¡µåˆ—表查询
     *
     * @param maintenanceThreeAcceptance
     * @param pageNo
     * @param pageSize
     * @param req
     * @return
     */
    //@AutoLog(value = "mom_eam_maintenance_three_acceptance-分页列表查询")
    @ApiOperation(value="mom_eam_maintenance_three_acceptance-分页列表查询", notes="mom_eam_maintenance_three_acceptance-分页列表查询")
    @GetMapping(value = "/list")
    public Result<IPage<MaintenanceThreeAcceptance>> queryPageList(MaintenanceThreeAcceptance maintenanceThreeAcceptance,
                                   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
                                   HttpServletRequest req) {
        QueryWrapper<MaintenanceThreeAcceptance> queryWrapper = QueryGenerator.initQueryWrapper(maintenanceThreeAcceptance, req.getParameterMap());
        Page<MaintenanceThreeAcceptance> page = new Page<MaintenanceThreeAcceptance>(pageNo, pageSize);
        IPage<MaintenanceThreeAcceptance> pageList = maintenanceThreeAcceptanceService.page(page, queryWrapper);
        return Result.OK(pageList);
    }
    /**
     *   æ·»åŠ 
     *
     * @param maintenanceThreeAcceptance
     * @return
     */
    @AutoLog(value = "mom_eam_maintenance_three_acceptance-添加")
    @ApiOperation(value="mom_eam_maintenance_three_acceptance-添加", notes="mom_eam_maintenance_three_acceptance-添加")
    //@RequiresPermissions("org.jeecg.modules.mdc:mom_eam_maintenance_three_acceptance:add")
    @PostMapping(value = "/add")
    public Result<String> add(@RequestBody MaintenanceThreeAcceptance maintenanceThreeAcceptance) {
        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        String userId = sysUser.getId();
        String maintenanceOrderId = maintenanceThreeAcceptance.getMaintenanceOrderId();
        List<MaintenanceThreeAcceptance> maintenanceThreeAcceptances = maintenanceThreeAcceptance.getMaintenanceThreeAcceptances();
        for (MaintenanceThreeAcceptance threeAcceptance : maintenanceThreeAcceptances) {
            threeAcceptance.setMaintenanceOrderId(maintenanceOrderId);
            maintenanceThreeAcceptanceService.saveOrUpdate(threeAcceptance);
        }
        DailyMaintenanceOrder maintenanceOrder = dailyMaintenanceOrderService.getById(maintenanceOrderId);
        maintenanceOrder.setInspectUser(sysUser.getRealname());
        maintenanceOrder.setInspectDate(new Date());
//        maintenanceOrder.setStatus("8");
        dailyMaintenanceOrderService.updateById(maintenanceOrder);
        return Result.OK("添加成功!");
    }
    /**
     *  ç¼–辑
     *
     * @param maintenanceThreeAcceptance
     * @return
     */
    @AutoLog(value = "mom_eam_maintenance_three_acceptance-编辑")
    @ApiOperation(value="mom_eam_maintenance_three_acceptance-编辑", notes="mom_eam_maintenance_three_acceptance-编辑")
    //@RequiresPermissions("org.jeecg.modules.mdc:mom_eam_maintenance_three_acceptance:edit")
    @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
    public Result<String> edit(@RequestBody MaintenanceThreeAcceptance maintenanceThreeAcceptance) {
        maintenanceThreeAcceptanceService.updateById(maintenanceThreeAcceptance);
        return Result.OK("编辑成功!");
    }
    /**
     *   é€šè¿‡id删除
     *
     * @param id
     * @return
     */
    @AutoLog(value = "mom_eam_maintenance_three_acceptance-通过id删除")
    @ApiOperation(value="mom_eam_maintenance_three_acceptance-通过id删除", notes="mom_eam_maintenance_three_acceptance-通过id删除")
    //@RequiresPermissions("org.jeecg.modules.mdc:mom_eam_maintenance_three_acceptance:delete")
    @DeleteMapping(value = "/delete")
    public Result<String> delete(@RequestParam(name="id",required=true) String id) {
        maintenanceThreeAcceptanceService.removeById(id);
        return Result.OK("删除成功!");
    }
    /**
     *  æ‰¹é‡åˆ é™¤
     *
     * @param ids
     * @return
     */
    @AutoLog(value = "mom_eam_maintenance_three_acceptance-批量删除")
    @ApiOperation(value="mom_eam_maintenance_three_acceptance-批量删除", notes="mom_eam_maintenance_three_acceptance-批量删除")
    //@RequiresPermissions("org.jeecg.modules.mdc:mom_eam_maintenance_three_acceptance:deleteBatch")
    @DeleteMapping(value = "/deleteBatch")
    public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
        this.maintenanceThreeAcceptanceService.removeByIds(Arrays.asList(ids.split(",")));
        return Result.OK("批量删除成功!");
    }
    /**
     * é€šè¿‡id查询
     *
     * @param id
     * @return
     */
    //@AutoLog(value = "mom_eam_maintenance_three_acceptance-通过id查询")
    @ApiOperation(value="mom_eam_maintenance_three_acceptance-通过id查询", notes="mom_eam_maintenance_three_acceptance-通过id查询")
    @GetMapping(value = "/queryById")
    public Result<MaintenanceThreeAcceptance> queryById(@RequestParam(name="id",required=true) String id) {
        MaintenanceThreeAcceptance maintenanceThreeAcceptance = maintenanceThreeAcceptanceService.getById(id);
        if(maintenanceThreeAcceptance==null) {
            return Result.error("未找到对应数据");
        }
        return Result.OK(maintenanceThreeAcceptance);
    }
    /**
    * å¯¼å‡ºexcel
    *
    * @param request
    * @param maintenanceThreeAcceptance
    */
    //@RequiresPermissions("org.jeecg.modules.mdc:mom_eam_maintenance_three_acceptance:exportXls")
    @RequestMapping(value = "/exportXls")
    public ModelAndView exportXls(HttpServletRequest request, MaintenanceThreeAcceptance maintenanceThreeAcceptance) {
        return super.exportXls(request, maintenanceThreeAcceptance, MaintenanceThreeAcceptance.class, "mom_eam_maintenance_three_acceptance");
    }
    /**
      * é€šè¿‡excel导入数据
    *
    * @param request
    * @param response
    * @return
    */
    //@RequiresPermissions("mom_eam_maintenance_three_acceptance:importExcel")
    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
        return super.importExcel(request, response, MaintenanceThreeAcceptance.class);
    }
     @GetMapping("getMaintenanceThreeAcceptanceList")
     public Result<?> getMaintenanceThreeAcceptanceList(@RequestParam(name = "maintenanceOrderId", required = true) String maintenanceOrderId) {
         List<Map<String, Object>> maintenanceThreeAcceptanceList = maintenanceThreeAcceptanceService.getMaintenanceThreeAcceptanceList(maintenanceOrderId);
         return Result.ok(maintenanceThreeAcceptanceList);
     }
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/DailyMaintenanceOrder.java
@@ -126,8 +126,17 @@
    @ApiModelProperty(value = "问题及相应处理措施描述")
    private String description;
    @ApiModelProperty(value = "炉类设备豁免20项状态(0未确认,1维修室主任,2保养人员,3仪表工)")
    private String stoveExemptStatus;
    @ApiModelProperty(value = "3保验收单检查人员")
    private String inspectUser;
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "3保验收单检查时间")
    private Date inspectDate;
    @TableField(exist = false)
    private List<DailyMaintenanceOrderDetail> dailyMaintenanceOrderDetails;
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/MaintenanceThreeAcceptance.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,68 @@
package org.jeecg.modules.eam.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import java.util.List;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.base.entity.JeecgEntity;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
 * @Description: mom_eam_maintenance_three_acceptance
 * @Author: jeecg-boot
 * @Date:   2023-10-18
 * @Version: V1.0
 */
@Data
@TableName("mom_eam_maintenance_three_acceptance")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="mom_eam_maintenance_three_acceptance对象", description="mom_eam_maintenance_three_acceptance")
public class MaintenanceThreeAcceptance extends JeecgEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    /**3保工单id*/
    @Excel(name = "3保工单id", width = 15)
    @ApiModelProperty(value = "3保工单id")
    private java.lang.String maintenanceOrderId;
    /**保养部位*/
    @Excel(name = "保养部位", width = 15)
    @ApiModelProperty(value = "保养部位")
    private java.lang.String position;
    /**保养内容*/
    @Excel(name = "保养内容", width = 15)
    @ApiModelProperty(value = "保养内容")
    private java.lang.String content;
    /**保养标准*/
    @Excel(name = "保养标准", width = 15)
    @ApiModelProperty(value = "保养标准")
    private java.lang.String standard;
    /**第一次检*/
    @Excel(name = "第一次检", width = 15)
    @ApiModelProperty(value = "第一次检")
    private java.lang.String firstInspect;
    /**第二次检*/
    @Excel(name = "第二次检", width = 15)
    @ApiModelProperty(value = "第二次检")
    private java.lang.String secondInspect;
    /**delFlag*/
    @Excel(name = "delFlag", width = 15)
    @ApiModelProperty(value = "delFlag")
    @TableLogic
    private java.lang.Integer delFlag = CommonConstant.DEL_FLAG_0;
    @TableField(exist = false)
    private List<MaintenanceThreeAcceptance> maintenanceThreeAcceptances;
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/MaintenanceThreeAcceptanceMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
package org.jeecg.modules.eam.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.eam.entity.MaintenanceThreeAcceptance;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
 * @Description: mom_eam_maintenance_three_acceptance
 * @Author: jeecg-boot
 * @Date:   2023-10-18
 * @Version: V1.0
 */
public interface MaintenanceThreeAcceptanceMapper extends BaseMapper<MaintenanceThreeAcceptance> {
    List<Map<String, Object>> getMaintenanceThreeAcceptanceList(@Param("maintenanceOrderId")String maintenanceOrderId);
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/DailyMaintenanceOrderMapper.xml
@@ -79,7 +79,9 @@
            t1.remark,
            t1.description,
            t1.precision_inspection_status as precisionInspectionStatus,
            t1.stove_exempt_status as stoveExemptStatus
            t1.stove_exempt_status as stoveExemptStatus,
            t1.inspect_user as inspectUser,
            t1.inspect_date as inspectDate
        FROM
            mom_eam_daily_maintenance_order t1
        LEFT JOIN mom_eam_maintenance_standard t2 ON t1.maintenance_standard_id = t2.id
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/MaintenanceThreeAcceptanceMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
<?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="org.jeecg.modules.eam.mapper.MaintenanceThreeAcceptanceMapper">
    <select id="getMaintenanceThreeAcceptanceList"  parameterType="Map" resultType="Map">
        SELECT
            t1.id AS id,
            t1.position,
            t1.content,
            t1.standard,
            t1.first_inspect as firstInspect,
            t1.second_inspect as secondInspect
        FROM
            mom_eam_maintenance_three_acceptance t1
        WHERE t1.del_flag = '0' AND t1.maintenance_order_id = #{maintenanceOrderId}
    </select>
</mapper>
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IMaintenanceThreeAcceptanceService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
package org.jeecg.modules.eam.service;
import org.jeecg.modules.eam.entity.MaintenanceThreeAcceptance;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map;
/**
 * @Description: mom_eam_maintenance_three_acceptance
 * @Author: jeecg-boot
 * @Date:   2023-10-18
 * @Version: V1.0
 */
public interface IMaintenanceThreeAcceptanceService extends IService<MaintenanceThreeAcceptance> {
    List<Map<String, Object>> getMaintenanceThreeAcceptanceList(String maintenanceOrderId);
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/MaintenanceThreeAcceptanceServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,26 @@
package org.jeecg.modules.eam.service.impl;
import org.jeecg.modules.eam.entity.MaintenanceThreeAcceptance;
import org.jeecg.modules.eam.mapper.MaintenanceThreeAcceptanceMapper;
import org.jeecg.modules.eam.service.IMaintenanceThreeAcceptanceService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import java.util.Map;
/**
 * @Description: mom_eam_maintenance_three_acceptance
 * @Author: jeecg-boot
 * @Date:   2023-10-18
 * @Version: V1.0
 */
@Service
public class MaintenanceThreeAcceptanceServiceImpl extends ServiceImpl<MaintenanceThreeAcceptanceMapper, MaintenanceThreeAcceptance> implements IMaintenanceThreeAcceptanceService {
    @Override
    public List<Map<String, Object>> getMaintenanceThreeAcceptanceList(String maintenanceOrderId) {
        return this.baseMapper.getMaintenanceThreeAcceptanceList(maintenanceOrderId);
    }
}