From 4b4d94f411eee4d459a6556e100710278c56a830 Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期三, 18 十月 2023 14:22:07 +0800 Subject: [PATCH] 三保验收单 --- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IMaintenanceThreeAcceptanceService.java | 18 ++ lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/MaintenanceThreeAcceptanceMapper.xml | 17 ++ lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/DailyMaintenanceOrderMapper.xml | 4 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/MaintenanceThreeAcceptanceController.java | 204 +++++++++++++++++++++++++++++ lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/MaintenanceThreeAcceptance.java | 68 +++++++++ lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/DailyMaintenanceOrder.java | 9 + lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/MaintenanceThreeAcceptanceMapper.java | 19 ++ lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/MaintenanceThreeAcceptanceServiceImpl.java | 26 +++ 8 files changed, 364 insertions(+), 1 deletions(-) diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/MaintenanceThreeAcceptanceController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/MaintenanceThreeAcceptanceController.java new file mode 100644 index 0000000..4486bae --- /dev/null +++ b/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); + } + +} diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/DailyMaintenanceOrder.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/DailyMaintenanceOrder.java index 9b360d6..2672f9b 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/DailyMaintenanceOrder.java +++ b/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; } diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/MaintenanceThreeAcceptance.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/MaintenanceThreeAcceptance.java new file mode 100644 index 0000000..7a85557 --- /dev/null +++ b/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淇濆伐鍗昳d*/ + @Excel(name = "3淇濆伐鍗昳d", width = 15) + @ApiModelProperty(value = "3淇濆伐鍗昳d") + 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; +} diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/MaintenanceThreeAcceptanceMapper.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/MaintenanceThreeAcceptanceMapper.java new file mode 100644 index 0000000..bd253a9 --- /dev/null +++ b/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); +} diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/DailyMaintenanceOrderMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/DailyMaintenanceOrderMapper.xml index fbbbff6..fc79d81 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/DailyMaintenanceOrderMapper.xml +++ b/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 diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/MaintenanceThreeAcceptanceMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/MaintenanceThreeAcceptanceMapper.xml new file mode 100644 index 0000000..bfa4030 --- /dev/null +++ b/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> \ No newline at end of file diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IMaintenanceThreeAcceptanceService.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IMaintenanceThreeAcceptanceService.java new file mode 100644 index 0000000..e7efe01 --- /dev/null +++ b/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); +} diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/MaintenanceThreeAcceptanceServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/MaintenanceThreeAcceptanceServiceImpl.java new file mode 100644 index 0000000..058ff0a --- /dev/null +++ b/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); + } +} -- Gitblit v1.9.3