liuwj пре 2 година
родитељ
комит
164fd2e65f

+ 163 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmGongDan/vo/ItdmGongdanDetailListVO.java

@@ -0,0 +1,163 @@
+package org.jeecg.modules.itdmGongDan.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecg.common.aspect.annotation.Dict;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+
+@Data
+//@TableName("itdm_gongdan_detail")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="itdm_gongdan_detail对象拓展", description="工单detail拓展")
+public class ItdmGongdanDetailListVO implements Serializable {
+
+    /**主键*/
+    @TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private java.lang.String id;
+    /**工单id*/
+    @Excel(name = "工单id", width = 15)
+    @ApiModelProperty(value = "工单id")
+    private java.lang.String woId;
+    /**实绩设备id*/
+    @Excel(name = "实绩设备id", width = 15)
+    @ApiModelProperty(value = "实绩设备id")
+    @Dict(dictTable = "itdm_device", dicText = "device_name", dicCode = "id")
+    private java.lang.String shijiShebeiId;
+    /**实绩试验类型*/
+    @Excel(name = "实绩试验类型", width = 15, dicCode = "shiyan_type")
+    @Dict(dicCode = "shiiyan_type")
+    @ApiModelProperty(value = "实绩试验类型")
+    private java.lang.String shijiShiiyanType;
+    /**任务日期*/
+    @Excel(name = "任务日期", width = 15, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "任务日期")
+    private java.util.Date workDate;
+    /**试验开始时间*/
+    @Excel(name = "试验开始时间", width = 15)
+    @ApiModelProperty(value = "试验开始时间")
+    private java.lang.String startTime;
+    /**试验结束时间*/
+    @Excel(name = "试验结束时间", width = 15)
+    @ApiModelProperty(value = "试验结束时间")
+    private java.lang.String endTime;
+    /**实绩任务日期*/
+    @Excel(name = "实绩任务日期", width = 15, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "实绩任务日期")
+    private java.util.Date shijiWorkDate;
+    /**实绩试验开始时间*/
+    @Excel(name = "实绩试验开始时间", width = 15)
+    @ApiModelProperty(value = "实绩试验开始时间")
+    private java.lang.String shijiStartTime;
+    /**实绩试验结束时间*/
+    @Excel(name = "实绩试验结束时间", width = 15)
+    @ApiModelProperty(value = "实绩试验结束时间")
+    private java.lang.String shijiEndTime;
+//    /**备注*/
+//    @Excel(name = "备注", width = 15)
+//    @ApiModelProperty(value = "备注")
+//    private java.lang.String remark;
+//    /**创建人*/
+//    @ApiModelProperty(value = "创建人")
+//    private java.lang.String createBy;
+//    /**创建日期*/
+//    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+//    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+//    @ApiModelProperty(value = "创建日期")
+//    private java.util.Date createTime;
+//    /**更新人*/
+//    @ApiModelProperty(value = "更新人")
+//    private java.lang.String updateBy;
+//    /**更新日期*/
+//    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+//    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+//    @ApiModelProperty(value = "更新日期")
+//    private java.util.Date updateTime;
+//    /**所属部门*/
+//    @ApiModelProperty(value = "所属部门")
+//    private java.lang.String sysOrgCode;/**传感器*/
+//    @Excel(name = "传感器id", width = 20)
+    @ApiModelProperty(value = "传感器id")
+    @Dict(dictTable = "itdm_chuanganqi", dicText = "xuliehao", dicCode = "id")
+    private java.lang.String chuanganqi;
+
+    //来自于工单master(itdm_gongdan_master),通过工单ID(woId)查询
+    /**试验计划id*/
+    @Excel(name = "试验计划id", width = 15)
+    @ApiModelProperty(value = "试验计划id")
+    @Dict(dictTable = "itdm_test_plan", dicText = "report_no", dicCode = "id")
+    private java.lang.String jihuaShiyanId;
+    /**检测项目id*/
+    @Excel(name = "检测项目id", width = 15)
+    @ApiModelProperty(value = "检测项目id")
+    @Dict(dictTable = "itdm_weituo_yangpin_extend", dicText = "test_items", dicCode = "id")
+    private java.lang.String testItemsId;
+    /**委托样品id*/
+    @Excel(name = "委托样品id", width = 15)
+    @ApiModelProperty(value = "委托样品id")
+    @Dict(dictTable = "itdm_weituo_yangpin", dicText = "sample_name", dicCode = "id")
+    private java.lang.String weituoYangpinId;
+    /**设备id*/
+    @Excel(name = "设备id", width = 15)
+    @ApiModelProperty(value = "设备id")
+    @Dict(dictTable = "itdm_device", dicText = "device_name", dicCode = "id")
+    private java.lang.String shebeiId;
+
+    //来自于试验计划表(itdm_test_plan),通过试验计划id(jihuaShiyanId)查询
+//    /**报告编号*/
+//    @Excel(name = "报告编号", width = 15)
+//    @ApiModelProperty(value = "报告编号")
+//    private java.lang.String reportNo;
+    /**委托id*/
+    @Excel(name = "委托id", width = 15)
+    @ApiModelProperty(value = "委托id")
+    @Dict(dictTable = "itdm_weituo_info", dicText = "weituo_no", dicCode = "id")
+    private String weituoId;
+
+//    //来自于委托表(itdm_weituo_info),通过委托id(weituoId)查询
+//    /**委托编号*/
+//    @Excel(name = "委托编号", width = 15)
+//    @ApiModelProperty(value = "委托编号")
+//    private String weituoNo;
+//
+//    //来自于样品表(itdm_weituo_yangpin),通过样品id(weituoYangpinId)查询
+//    /**样品名称*/
+//    @Excel(name = "样品名称", width = 15)
+//    @ApiModelProperty(value = "样品名称")
+//    private java.lang.String sampleName;
+//
+//    //来自于设备表(itdm_device),通过设备id(shebeiId)查询
+//    /**设备名称*/
+//    @Excel(name = "设备名称", width = 15)
+//    @ApiModelProperty(value = "设备名称")
+//    private java.lang.String deviceName;
+
+//    //来自于设备表(itdm_device),通过实绩设备id(shijiShebeiId)查询
+//    /**实绩设备名称*/
+//    @Excel(name = "实绩设备名称", width = 15)
+//    @ApiModelProperty(value = "实绩设备名称")
+//    private java.lang.String shijiDeviceName;
+//
+//    //来自于检测项目表(itdm_weituo_yangpin_extend),通过检测项目id(testItemsId)查询
+//    /**检测项目*/
+//    @Excel(name = "检测项目", width = 15)
+//    @ApiModelProperty(value = "检测项目")
+//    private String testItems;
+
+
+}

+ 215 - 0
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/itdmMima/controller/ItdmMimaController.java

@@ -0,0 +1,215 @@
+package org.jeecg.modules.itdmMima.controller;
+
+import java.util.Arrays;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.PasswordUtil;
+import org.jeecg.modules.itdmDevice.entity.ItdmDevice;
+import org.jeecg.modules.itdmDevice.service.IItdmDeviceService;
+import org.jeecg.modules.itdmMima.dto.ItdmMimaDTO;
+import org.jeecg.modules.itdmMima.entity.ItdmMima;
+import org.jeecg.modules.itdmMima.mapper.ItdmMimaMapper;
+import org.jeecg.modules.itdmMima.service.IItdmMimaService;
+
+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.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: 修改密码表
+ * @Author: jeecg-boot
+ * @Date:   2023-05-27
+ * @Version: V1.0
+ */
+@Api(tags="修改密码表")
+@RestController
+@RequestMapping("/itdmMima/itdmMima")
+@Slf4j
+public class ItdmMimaController extends JeecgController<ItdmMima, IItdmMimaService> {
+	@Autowired
+	@SuppressWarnings("all")
+	private IItdmMimaService itdmMimaService;
+	@Autowired
+	@SuppressWarnings("all")
+	private IItdmDeviceService iItdmDeviceService;
+
+	 /**
+	  *  判断是否输入正确密码
+	  */
+	 @AutoLog(value = "判断是否输入正确密码")
+	 @ApiOperation(value="判断是否输入正确密码", notes="修改密码表-判断是否输入正确密码,是的话直接修改设备表该设备id对应的设备")
+	 //@RequiresPermissions("org.jeecg.modules:itdm_mima:panduan")
+	 @GetMapping(value = "/panduan")
+	 public Result<String> panduan(ItdmMimaDTO dto) {
+		 String passwordEncodeYuan = itdmMimaService.getById(dto.getId()).getMima();
+		 String passwordEncodeNow = PasswordUtil.encrypt("admin", dto.getMima(), "RCGTeGiH");
+		 if (!passwordEncodeYuan.equals(passwordEncodeNow)) {
+			 return Result.error("密码输入错误!");
+		 }else {
+			 ItdmDevice itdmDevice = new ItdmDevice();
+			 itdmDevice.setId(dto.getDeviceId());
+			 itdmDevice.setIsRepair(1);
+			 boolean resuit = iItdmDeviceService.updateById(itdmDevice);
+			 if(resuit==true) return Result.OK("编辑成功!");
+			 else return Result.error("编辑失败!");
+		 }
+	 }
+
+	 /**
+	  *  编辑
+	  *
+	  * @param dto
+	  * @return
+	  */
+	 @AutoLog(value = "修改密码表-编辑")
+	 @ApiOperation(value="修改密码表-编辑", notes="修改密码表-编辑")
+	 //@RequiresPermissions("org.jeecg.modules:itdm_mima:edit")
+	 @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	 public Result<String> edit(@RequestBody ItdmMimaDTO dto) {
+		 ItdmMima itdmMimaYuan = itdmMimaService.getById(dto.getId());
+		 String passwordEncode = PasswordUtil.encrypt("admin", dto.getYuanmima(), "RCGTeGiH");
+		 if (!itdmMimaYuan.getMima().equals(passwordEncode)) {
+			 return Result.error("旧密码输入错误!");
+		 }else {
+			 ItdmMima itdmMima = dto.toItdmMima();
+			 itdmMima.setMima(PasswordUtil.encrypt("admin", dto.getMima(), "RCGTeGiH"));
+			 itdmMimaService.updateById(itdmMima);
+			 return Result.OK("编辑成功!");
+		 }
+	 }
+
+
+	/**
+	 * 分页列表查询
+	 *
+	 * @param itdmMima
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "修改密码表-分页列表查询")
+	@ApiOperation(value="修改密码表-分页列表查询", notes="修改密码表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<ItdmMima>> queryPageList(ItdmMima itdmMima,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<ItdmMima> queryWrapper = QueryGenerator.initQueryWrapper(itdmMima, req.getParameterMap());
+		Page<ItdmMima> page = new Page<ItdmMima>(pageNo, pageSize);
+		IPage<ItdmMima> pageList = itdmMimaService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+
+	 /**
+	  * 通过id查询
+	  *
+	  * @param id
+	  * @return
+	  */
+	 //@AutoLog(value = "修改密码表-通过id查询")
+	 @ApiOperation(value="修改密码表-通过id查询", notes="修改密码表-通过id查询")
+	 @GetMapping(value = "/queryById")
+	 public Result<ItdmMima> queryById(@RequestParam(name="id",required=true) String id) {
+		 ItdmMima itdmMima = itdmMimaService.getById(id);
+		 if(itdmMima==null) {
+			 return Result.error("未找到对应数据");
+		 }
+		 return Result.OK(itdmMima);
+	 }
+
+
+
+
+
+
+
+
+
+
+	/**
+	 *   添加
+	 *
+	 * @param itdmMima
+	 * @return
+	 */
+	@AutoLog(value = "修改密码表-添加")
+//	@ApiOperation(value="修改密码表-添加", notes="修改密码表-添加")
+	//@RequiresPermissions("org.jeecg.modules:itdm_mima:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody ItdmMima itdmMima) {
+		itdmMimaService.save(itdmMima);
+		return Result.OK("添加成功!");
+	}
+
+
+
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "修改密码表-通过id删除")
+//	@ApiOperation(value="修改密码表-通过id删除", notes="修改密码表-通过id删除")
+	//@RequiresPermissions("org.jeecg.modules:itdm_mima:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		itdmMimaService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "修改密码表-批量删除")
+//	@ApiOperation(value="修改密码表-批量删除", notes="修改密码表-批量删除")
+	//@RequiresPermissions("org.jeecg.modules:itdm_mima:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.itdmMimaService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+
+
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param itdmMima
+    */
+    //@RequiresPermissions("org.jeecg.modules:itdm_mima:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, ItdmMima itdmMima) {
+        return super.exportXls(request, itdmMima, ItdmMima.class, "修改密码表");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("itdm_mima:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, ItdmMima.class);
+    }
+
+}