重新使用主次表生成作物档案,暂未生成作物阶段。
This commit is contained in:
@ -1,104 +0,0 @@
|
||||
package com.jlt.csa.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.jlt.csa.domain.CropPhase;
|
||||
import com.jlt.csa.service.ICropPhaseService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 作物生长阶段Controller
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-03-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/csa/phase")
|
||||
public class CropPhaseController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICropPhaseService cropPhaseService;
|
||||
|
||||
/**
|
||||
* 查询作物生长阶段列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:phase:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CropPhase cropPhase)
|
||||
{
|
||||
startPage();
|
||||
List<CropPhase> list = cropPhaseService.selectCropPhaseList(cropPhase);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出作物生长阶段列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:phase:export')")
|
||||
@Log(title = "作物生长阶段", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CropPhase cropPhase)
|
||||
{
|
||||
List<CropPhase> list = cropPhaseService.selectCropPhaseList(cropPhase);
|
||||
ExcelUtil<CropPhase> util = new ExcelUtil<CropPhase>(CropPhase.class);
|
||||
util.exportExcel(response, list, "作物生长阶段数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取作物生长阶段详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:phase:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(cropPhaseService.selectCropPhaseById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增作物生长阶段
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:phase:add')")
|
||||
@Log(title = "作物生长阶段", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CropPhase cropPhase)
|
||||
{
|
||||
return toAjax(cropPhaseService.insertCropPhase(cropPhase));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改作物生长阶段
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:phase:edit')")
|
||||
@Log(title = "作物生长阶段", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CropPhase cropPhase)
|
||||
{
|
||||
return toAjax(cropPhaseService.updateCropPhase(cropPhase));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除作物生长阶段
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('csa:phase:remove')")
|
||||
@Log(title = "作物生长阶段", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(cropPhaseService.deleteCropPhaseByIds(ids));
|
||||
}
|
||||
}
|
@ -1,26 +1,27 @@
|
||||
package com.jlt.csa.domain;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 作物档案对象 csa_crop_files
|
||||
* 作物档案对象 csa_crop_file
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-03-25
|
||||
* @author 郏磊涛
|
||||
* @date 2022-03-30
|
||||
*/
|
||||
public class CropFiles extends BaseEntity
|
||||
public class CropFile extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 作物档案id */
|
||||
private Long id;
|
||||
private Long cropId;
|
||||
|
||||
/** 作物名称 */
|
||||
@Excel(name = "作物名称")
|
||||
private String name;
|
||||
private String cropName;
|
||||
|
||||
/** 种植指南 */
|
||||
private String plantGuide;
|
||||
@ -30,6 +31,7 @@ public class CropFiles extends BaseEntity
|
||||
private String picture;
|
||||
|
||||
/** 作物描述 */
|
||||
@Excel(name = "作物描述")
|
||||
private String description;
|
||||
|
||||
/** 状态 */
|
||||
@ -39,23 +41,26 @@ public class CropFiles extends BaseEntity
|
||||
/** 删除标志 */
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id)
|
||||
/** 作物生长阶段信息 */
|
||||
private List<CropPhase> cropPhaseList;
|
||||
|
||||
public void setCropId(Long cropId)
|
||||
{
|
||||
this.id = id;
|
||||
this.cropId = cropId;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
public Long getCropId()
|
||||
{
|
||||
return id;
|
||||
return cropId;
|
||||
}
|
||||
public void setName(String name)
|
||||
public void setCropName(String cropName)
|
||||
{
|
||||
this.name = name;
|
||||
this.cropName = cropName;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
public String getCropName()
|
||||
{
|
||||
return name;
|
||||
return cropName;
|
||||
}
|
||||
public void setPlantGuide(String plantGuide)
|
||||
{
|
||||
@ -103,11 +108,21 @@ public class CropFiles extends BaseEntity
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public List<CropPhase> getCropPhaseList()
|
||||
{
|
||||
return cropPhaseList;
|
||||
}
|
||||
|
||||
public void setCropPhaseList(List<CropPhase> cropPhaseList)
|
||||
{
|
||||
this.cropPhaseList = cropPhaseList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("cropId", getCropId())
|
||||
.append("cropName", getCropName())
|
||||
.append("plantGuide", getPlantGuide())
|
||||
.append("picture", getPicture())
|
||||
.append("description", getDescription())
|
||||
@ -118,6 +133,7 @@ public class CropFiles extends BaseEntity
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("cropPhaseList", getCropPhaseList())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -8,22 +8,23 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
/**
|
||||
* 作物生长阶段对象 csa_crop_phase
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-03-26
|
||||
* @author 郏磊涛
|
||||
* @date 2022-03-30
|
||||
*/
|
||||
public class CropPhase extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 阶段id */
|
||||
private Long id;
|
||||
private Long phaseId;
|
||||
|
||||
/** 作物id */
|
||||
/** 作物 */
|
||||
@Excel(name = "作物")
|
||||
private Long cropId;
|
||||
|
||||
/** 阶段名称 */
|
||||
@Excel(name = "阶段名称")
|
||||
private String name;
|
||||
private String phaseName;
|
||||
|
||||
/** 产出 */
|
||||
@Excel(name = "产出")
|
||||
@ -33,21 +34,21 @@ public class CropPhase extends BaseEntity
|
||||
@Excel(name = "代表图片")
|
||||
private String picture;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 删除标志 */
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id)
|
||||
public void setPhaseId(Long phaseId)
|
||||
{
|
||||
this.id = id;
|
||||
this.phaseId = phaseId;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
public Long getPhaseId()
|
||||
{
|
||||
return id;
|
||||
return phaseId;
|
||||
}
|
||||
public void setCropId(Long cropId)
|
||||
{
|
||||
@ -58,14 +59,14 @@ public class CropPhase extends BaseEntity
|
||||
{
|
||||
return cropId;
|
||||
}
|
||||
public void setName(String name)
|
||||
public void setPhaseName(String phaseName)
|
||||
{
|
||||
this.name = name;
|
||||
this.phaseName = phaseName;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
public String getPhaseName()
|
||||
{
|
||||
return name;
|
||||
return phaseName;
|
||||
}
|
||||
public void setProduction(String production)
|
||||
{
|
||||
@ -107,9 +108,9 @@ public class CropPhase extends BaseEntity
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("phaseId", getPhaseId())
|
||||
.append("cropId", getCropId())
|
||||
.append("name", getName())
|
||||
.append("phaseName", getPhaseName())
|
||||
.append("production", getProduction())
|
||||
.append("picture", getPicture())
|
||||
.append("status", getStatus())
|
||||
|
@ -0,0 +1,87 @@
|
||||
package com.jlt.csa.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.jlt.csa.domain.CropFile;
|
||||
import com.jlt.csa.domain.CropPhase;
|
||||
|
||||
/**
|
||||
* 作物档案Mapper接口
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-03-30
|
||||
*/
|
||||
public interface CropFileMapper
|
||||
{
|
||||
/**
|
||||
* 查询作物档案
|
||||
*
|
||||
* @param cropId 作物档案主键
|
||||
* @return 作物档案
|
||||
*/
|
||||
public CropFile selectCropFileByCropId(Long cropId);
|
||||
|
||||
/**
|
||||
* 查询作物档案列表
|
||||
*
|
||||
* @param cropFile 作物档案
|
||||
* @return 作物档案集合
|
||||
*/
|
||||
public List<CropFile> selectCropFileList(CropFile cropFile);
|
||||
|
||||
/**
|
||||
* 新增作物档案
|
||||
*
|
||||
* @param cropFile 作物档案
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCropFile(CropFile cropFile);
|
||||
|
||||
/**
|
||||
* 修改作物档案
|
||||
*
|
||||
* @param cropFile 作物档案
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCropFile(CropFile cropFile);
|
||||
|
||||
/**
|
||||
* 删除作物档案
|
||||
*
|
||||
* @param cropId 作物档案主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCropFileByCropId(Long cropId);
|
||||
|
||||
/**
|
||||
* 批量删除作物档案
|
||||
*
|
||||
* @param cropIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCropFileByCropIds(Long[] cropIds);
|
||||
|
||||
/**
|
||||
* 批量删除作物生长阶段
|
||||
*
|
||||
* @param cropIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCropPhaseByCropIds(Long[] cropIds);
|
||||
|
||||
/**
|
||||
* 批量新增作物生长阶段
|
||||
*
|
||||
* @param cropPhaseList 作物生长阶段列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchCropPhase(List<CropPhase> cropPhaseList);
|
||||
|
||||
|
||||
/**
|
||||
* 通过作物档案主键删除作物生长阶段信息
|
||||
*
|
||||
* @param cropId 作物档案ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCropPhaseByCropId(Long cropId);
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
package com.jlt.csa.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.jlt.csa.domain.CropFiles;
|
||||
|
||||
/**
|
||||
* 作物档案Mapper接口
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-03-25
|
||||
*/
|
||||
public interface CropFilesMapper
|
||||
{
|
||||
/**
|
||||
* 查询作物档案
|
||||
*
|
||||
* @param id 作物档案主键
|
||||
* @return 作物档案
|
||||
*/
|
||||
public CropFiles selectCropFilesById(Long id);
|
||||
|
||||
/**
|
||||
* 查询作物档案列表
|
||||
*
|
||||
* @param cropFiles 作物档案
|
||||
* @return 作物档案集合
|
||||
*/
|
||||
public List<CropFiles> selectCropFilesList(CropFiles cropFiles);
|
||||
|
||||
/**
|
||||
* 新增作物档案
|
||||
*
|
||||
* @param cropFiles 作物档案
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCropFiles(CropFiles cropFiles);
|
||||
|
||||
/**
|
||||
* 修改作物档案
|
||||
*
|
||||
* @param cropFiles 作物档案
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCropFiles(CropFiles cropFiles);
|
||||
|
||||
/**
|
||||
* 删除作物档案
|
||||
*
|
||||
* @param id 作物档案主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCropFilesById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除作物档案
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCropFilesByIds(Long[] ids);
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
package com.jlt.csa.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.jlt.csa.domain.CropPhase;
|
||||
|
||||
/**
|
||||
* 作物生长阶段Mapper接口
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-03-26
|
||||
*/
|
||||
public interface CropPhaseMapper
|
||||
{
|
||||
/**
|
||||
* 查询作物生长阶段
|
||||
*
|
||||
* @param id 作物生长阶段主键
|
||||
* @return 作物生长阶段
|
||||
*/
|
||||
public CropPhase selectCropPhaseById(Long id);
|
||||
|
||||
/**
|
||||
* 查询作物生长阶段列表
|
||||
*
|
||||
* @param cropPhase 作物生长阶段
|
||||
* @return 作物生长阶段集合
|
||||
*/
|
||||
public List<CropPhase> selectCropPhaseList(CropPhase cropPhase);
|
||||
|
||||
/**
|
||||
* 新增作物生长阶段
|
||||
*
|
||||
* @param cropPhase 作物生长阶段
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCropPhase(CropPhase cropPhase);
|
||||
|
||||
/**
|
||||
* 修改作物生长阶段
|
||||
*
|
||||
* @param cropPhase 作物生长阶段
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCropPhase(CropPhase cropPhase);
|
||||
|
||||
/**
|
||||
* 删除作物生长阶段
|
||||
*
|
||||
* @param id 作物生长阶段主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCropPhaseById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除作物生长阶段
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCropPhaseByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.jlt.csa.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.jlt.csa.domain.CropFile;
|
||||
|
||||
/**
|
||||
* 作物档案Service接口
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-03-30
|
||||
*/
|
||||
public interface ICropFileService
|
||||
{
|
||||
/**
|
||||
* 查询作物档案
|
||||
*
|
||||
* @param cropId 作物档案主键
|
||||
* @return 作物档案
|
||||
*/
|
||||
public CropFile selectCropFileByCropId(Long cropId);
|
||||
|
||||
/**
|
||||
* 查询作物档案列表
|
||||
*
|
||||
* @param cropFile 作物档案
|
||||
* @return 作物档案集合
|
||||
*/
|
||||
public List<CropFile> selectCropFileList(CropFile cropFile);
|
||||
|
||||
/**
|
||||
* 新增作物档案
|
||||
*
|
||||
* @param cropFile 作物档案
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCropFile(CropFile cropFile);
|
||||
|
||||
/**
|
||||
* 修改作物档案
|
||||
*
|
||||
* @param cropFile 作物档案
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCropFile(CropFile cropFile);
|
||||
|
||||
/**
|
||||
* 批量删除作物档案
|
||||
*
|
||||
* @param cropIds 需要删除的作物档案主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCropFileByCropIds(Long[] cropIds);
|
||||
|
||||
/**
|
||||
* 删除作物档案信息
|
||||
*
|
||||
* @param cropId 作物档案主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCropFileByCropId(Long cropId);
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
package com.jlt.csa.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.jlt.csa.domain.CropFiles;
|
||||
|
||||
/**
|
||||
* 作物档案Service接口
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-03-25
|
||||
*/
|
||||
public interface ICropFilesService
|
||||
{
|
||||
/**
|
||||
* 查询作物档案
|
||||
*
|
||||
* @param id 作物档案主键
|
||||
* @return 作物档案
|
||||
*/
|
||||
public CropFiles selectCropFilesById(Long id);
|
||||
|
||||
/**
|
||||
* 查询作物档案列表
|
||||
*
|
||||
* @param cropFiles 作物档案
|
||||
* @return 作物档案集合
|
||||
*/
|
||||
public List<CropFiles> selectCropFilesList(CropFiles cropFiles);
|
||||
|
||||
/**
|
||||
* 新增作物档案
|
||||
*
|
||||
* @param cropFiles 作物档案
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCropFiles(CropFiles cropFiles);
|
||||
|
||||
/**
|
||||
* 修改作物档案
|
||||
*
|
||||
* @param cropFiles 作物档案
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCropFiles(CropFiles cropFiles);
|
||||
|
||||
/**
|
||||
* 批量删除作物档案
|
||||
*
|
||||
* @param ids 需要删除的作物档案主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCropFilesByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除作物档案信息
|
||||
*
|
||||
* @param id 作物档案主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCropFilesById(Long id);
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
package com.jlt.csa.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.jlt.csa.domain.CropPhase;
|
||||
|
||||
/**
|
||||
* 作物生长阶段Service接口
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-03-26
|
||||
*/
|
||||
public interface ICropPhaseService
|
||||
{
|
||||
/**
|
||||
* 查询作物生长阶段
|
||||
*
|
||||
* @param id 作物生长阶段主键
|
||||
* @return 作物生长阶段
|
||||
*/
|
||||
public CropPhase selectCropPhaseById(Long id);
|
||||
|
||||
/**
|
||||
* 查询作物生长阶段列表
|
||||
*
|
||||
* @param cropPhase 作物生长阶段
|
||||
* @return 作物生长阶段集合
|
||||
*/
|
||||
public List<CropPhase> selectCropPhaseList(CropPhase cropPhase);
|
||||
|
||||
/**
|
||||
* 新增作物生长阶段
|
||||
*
|
||||
* @param cropPhase 作物生长阶段
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCropPhase(CropPhase cropPhase);
|
||||
|
||||
/**
|
||||
* 修改作物生长阶段
|
||||
*
|
||||
* @param cropPhase 作物生长阶段
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCropPhase(CropPhase cropPhase);
|
||||
|
||||
/**
|
||||
* 批量删除作物生长阶段
|
||||
*
|
||||
* @param ids 需要删除的作物生长阶段主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCropPhaseByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除作物生长阶段信息
|
||||
*
|
||||
* @param id 作物生长阶段主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCropPhaseById(Long id);
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
package com.jlt.csa.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.jlt.csa.domain.CropPhase;
|
||||
import com.jlt.csa.mapper.CropFileMapper;
|
||||
import com.jlt.csa.domain.CropFile;
|
||||
import com.jlt.csa.service.ICropFileService;
|
||||
|
||||
/**
|
||||
* 作物档案Service业务层处理
|
||||
*
|
||||
* @author 郏磊涛
|
||||
* @date 2022-03-30
|
||||
*/
|
||||
@Service
|
||||
public class CropFileServiceImpl implements ICropFileService
|
||||
{
|
||||
@Autowired
|
||||
private CropFileMapper cropFileMapper;
|
||||
|
||||
/**
|
||||
* 查询作物档案
|
||||
*
|
||||
* @param cropId 作物档案主键
|
||||
* @return 作物档案
|
||||
*/
|
||||
@Override
|
||||
public CropFile selectCropFileByCropId(Long cropId)
|
||||
{
|
||||
return cropFileMapper.selectCropFileByCropId(cropId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询作物档案列表
|
||||
*
|
||||
* @param cropFile 作物档案
|
||||
* @return 作物档案
|
||||
*/
|
||||
@Override
|
||||
public List<CropFile> selectCropFileList(CropFile cropFile)
|
||||
{
|
||||
return cropFileMapper.selectCropFileList(cropFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增作物档案
|
||||
*
|
||||
* @param cropFile 作物档案
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insertCropFile(CropFile cropFile)
|
||||
{
|
||||
cropFile.setCreateTime(DateUtils.getNowDate());
|
||||
int rows = cropFileMapper.insertCropFile(cropFile);
|
||||
insertCropPhase(cropFile);
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改作物档案
|
||||
*
|
||||
* @param cropFile 作物档案
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int updateCropFile(CropFile cropFile)
|
||||
{
|
||||
cropFile.setUpdateTime(DateUtils.getNowDate());
|
||||
cropFileMapper.deleteCropPhaseByCropId(cropFile.getCropId());
|
||||
insertCropPhase(cropFile);
|
||||
return cropFileMapper.updateCropFile(cropFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除作物档案
|
||||
*
|
||||
* @param cropIds 需要删除的作物档案主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteCropFileByCropIds(Long[] cropIds)
|
||||
{
|
||||
cropFileMapper.deleteCropPhaseByCropIds(cropIds);
|
||||
return cropFileMapper.deleteCropFileByCropIds(cropIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除作物档案信息
|
||||
*
|
||||
* @param cropId 作物档案主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteCropFileByCropId(Long cropId)
|
||||
{
|
||||
cropFileMapper.deleteCropPhaseByCropId(cropId);
|
||||
return cropFileMapper.deleteCropFileByCropId(cropId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增作物生长阶段信息
|
||||
*
|
||||
* @param cropFile 作物档案对象
|
||||
*/
|
||||
public void insertCropPhase(CropFile cropFile)
|
||||
{
|
||||
List<CropPhase> cropPhaseList = cropFile.getCropPhaseList();
|
||||
Long cropId = cropFile.getCropId();
|
||||
if (StringUtils.isNotNull(cropPhaseList))
|
||||
{
|
||||
List<CropPhase> list = new ArrayList<CropPhase>();
|
||||
for (CropPhase cropPhase : cropPhaseList)
|
||||
{
|
||||
cropPhase.setCropId(cropId);
|
||||
list.add(cropPhase);
|
||||
}
|
||||
if (list.size() > 0)
|
||||
{
|
||||
cropFileMapper.batchCropPhase(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
package com.jlt.csa.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.jlt.csa.mapper.CropFilesMapper;
|
||||
import com.jlt.csa.domain.CropFiles;
|
||||
import com.jlt.csa.service.ICropFilesService;
|
||||
|
||||
/**
|
||||
* 作物档案Service业务层处理
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-03-25
|
||||
*/
|
||||
@Service
|
||||
public class CropFilesServiceImpl implements ICropFilesService
|
||||
{
|
||||
@Autowired
|
||||
private CropFilesMapper cropFilesMapper;
|
||||
|
||||
/**
|
||||
* 查询作物档案
|
||||
*
|
||||
* @param id 作物档案主键
|
||||
* @return 作物档案
|
||||
*/
|
||||
@Override
|
||||
public CropFiles selectCropFilesById(Long id)
|
||||
{
|
||||
return cropFilesMapper.selectCropFilesById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询作物档案列表
|
||||
*
|
||||
* @param cropFiles 作物档案
|
||||
* @return 作物档案
|
||||
*/
|
||||
@Override
|
||||
public List<CropFiles> selectCropFilesList(CropFiles cropFiles)
|
||||
{
|
||||
return cropFilesMapper.selectCropFilesList(cropFiles);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增作物档案
|
||||
*
|
||||
* @param cropFiles 作物档案
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCropFiles(CropFiles cropFiles)
|
||||
{
|
||||
cropFiles.setCreateTime(DateUtils.getNowDate());
|
||||
return cropFilesMapper.insertCropFiles(cropFiles);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改作物档案
|
||||
*
|
||||
* @param cropFiles 作物档案
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCropFiles(CropFiles cropFiles)
|
||||
{
|
||||
cropFiles.setUpdateTime(DateUtils.getNowDate());
|
||||
return cropFilesMapper.updateCropFiles(cropFiles);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除作物档案
|
||||
*
|
||||
* @param ids 需要删除的作物档案主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCropFilesByIds(Long[] ids)
|
||||
{
|
||||
return cropFilesMapper.deleteCropFilesByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除作物档案信息
|
||||
*
|
||||
* @param id 作物档案主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCropFilesById(Long id)
|
||||
{
|
||||
return cropFilesMapper.deleteCropFilesById(id);
|
||||
}
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
package com.jlt.csa.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.jlt.csa.mapper.CropPhaseMapper;
|
||||
import com.jlt.csa.domain.CropPhase;
|
||||
import com.jlt.csa.service.ICropPhaseService;
|
||||
|
||||
/**
|
||||
* 作物生长阶段Service业务层处理
|
||||
*
|
||||
* @author JiaLeitao
|
||||
* @date 2022-03-26
|
||||
*/
|
||||
@Service
|
||||
public class CropPhaseServiceImpl implements ICropPhaseService
|
||||
{
|
||||
@Autowired
|
||||
private CropPhaseMapper cropPhaseMapper;
|
||||
|
||||
/**
|
||||
* 查询作物生长阶段
|
||||
*
|
||||
* @param id 作物生长阶段主键
|
||||
* @return 作物生长阶段
|
||||
*/
|
||||
@Override
|
||||
public CropPhase selectCropPhaseById(Long id)
|
||||
{
|
||||
return cropPhaseMapper.selectCropPhaseById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询作物生长阶段列表
|
||||
*
|
||||
* @param cropPhase 作物生长阶段
|
||||
* @return 作物生长阶段
|
||||
*/
|
||||
@Override
|
||||
public List<CropPhase> selectCropPhaseList(CropPhase cropPhase)
|
||||
{
|
||||
return cropPhaseMapper.selectCropPhaseList(cropPhase);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增作物生长阶段
|
||||
*
|
||||
* @param cropPhase 作物生长阶段
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCropPhase(CropPhase cropPhase)
|
||||
{
|
||||
cropPhase.setCreateTime(DateUtils.getNowDate());
|
||||
return cropPhaseMapper.insertCropPhase(cropPhase);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改作物生长阶段
|
||||
*
|
||||
* @param cropPhase 作物生长阶段
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCropPhase(CropPhase cropPhase)
|
||||
{
|
||||
cropPhase.setUpdateTime(DateUtils.getNowDate());
|
||||
return cropPhaseMapper.updateCropPhase(cropPhase);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除作物生长阶段
|
||||
*
|
||||
* @param ids 需要删除的作物生长阶段主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCropPhaseByIds(Long[] ids)
|
||||
{
|
||||
return cropPhaseMapper.deleteCropPhaseByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除作物生长阶段信息
|
||||
*
|
||||
* @param id 作物生长阶段主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCropPhaseById(Long id)
|
||||
{
|
||||
return cropPhaseMapper.deleteCropPhaseById(id);
|
||||
}
|
||||
}
|
137
private-farm/src/main/resources/mapper/csa/CropFileMapper.xml
Normal file
137
private-farm/src/main/resources/mapper/csa/CropFileMapper.xml
Normal file
@ -0,0 +1,137 @@
|
||||
<?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.jlt.csa.mapper.CropFileMapper">
|
||||
|
||||
<resultMap type="CropFile" id="CropFileResult">
|
||||
<result property="cropId" column="crop_id" />
|
||||
<result property="cropName" column="crop_name" />
|
||||
<result property="plantGuide" column="plant_guide" />
|
||||
<result property="picture" column="picture" />
|
||||
<result property="description" column="description" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="CropFileCropPhaseResult" type="CropFile" extends="CropFileResult">
|
||||
<collection property="cropPhaseList" notNullColumn="sub_phase_id" javaType="java.util.List" resultMap="CropPhaseResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="CropPhase" id="CropPhaseResult">
|
||||
<result property="phaseId" column="sub_phase_id" />
|
||||
<result property="cropId" column="sub_crop_id" />
|
||||
<result property="phaseName" column="sub_phase_name" />
|
||||
<result property="production" column="sub_production" />
|
||||
<result property="picture" column="sub_picture" />
|
||||
<result property="status" column="sub_status" />
|
||||
<result property="delFlag" column="sub_del_flag" />
|
||||
<result property="createBy" column="sub_create_by" />
|
||||
<result property="createTime" column="sub_create_time" />
|
||||
<result property="updateBy" column="sub_update_by" />
|
||||
<result property="updateTime" column="sub_update_time" />
|
||||
<result property="remark" column="sub_remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCropFileVo">
|
||||
select crop_id, crop_name, plant_guide, picture, description, status, del_flag, create_by, create_time, update_by, update_time, remark from csa_crop_file
|
||||
</sql>
|
||||
|
||||
<select id="selectCropFileList" parameterType="CropFile" resultMap="CropFileResult">
|
||||
<include refid="selectCropFileVo"/>
|
||||
<where>
|
||||
<if test="cropName != null and cropName != ''"> and crop_name like concat('%', #{cropName}, '%')</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCropFileByCropId" parameterType="Long" resultMap="CropFileCropPhaseResult">
|
||||
select a.crop_id, a.crop_name, a.plant_guide, a.picture, a.description, a.status, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
|
||||
b.phase_id as sub_phase_id, b.crop_id as sub_crop_id, b.phase_name as sub_phase_name, b.production as sub_production, b.picture as sub_picture, b.status as sub_status, b.del_flag as sub_del_flag, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time, b.remark as sub_remark
|
||||
from csa_crop_file a
|
||||
left join csa_crop_phase b on b.crop_id = a.crop_id
|
||||
where a.crop_id = #{cropId}
|
||||
</select>
|
||||
|
||||
<insert id="insertCropFile" parameterType="CropFile" useGeneratedKeys="true" keyProperty="cropId">
|
||||
insert into csa_crop_file
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="cropName != null and cropName != ''">crop_name,</if>
|
||||
<if test="plantGuide != null">plant_guide,</if>
|
||||
<if test="picture != null">picture,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="cropName != null and cropName != ''">#{cropName},</if>
|
||||
<if test="plantGuide != null">#{plantGuide},</if>
|
||||
<if test="picture != null">#{picture},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCropFile" parameterType="CropFile">
|
||||
update csa_crop_file
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="cropName != null and cropName != ''">crop_name = #{cropName},</if>
|
||||
<if test="plantGuide != null">plant_guide = #{plantGuide},</if>
|
||||
<if test="picture != null">picture = #{picture},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where crop_id = #{cropId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCropFileByCropId" parameterType="Long">
|
||||
delete from csa_crop_file where crop_id = #{cropId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCropFileByCropIds" parameterType="String">
|
||||
delete from csa_crop_file where crop_id in
|
||||
<foreach item="cropId" collection="array" open="(" separator="," close=")">
|
||||
#{cropId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCropPhaseByCropIds" parameterType="String">
|
||||
delete from csa_crop_phase where crop_id in
|
||||
<foreach item="cropId" collection="array" open="(" separator="," close=")">
|
||||
#{cropId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCropPhaseByCropId" parameterType="Long">
|
||||
delete from csa_crop_phase where crop_id = #{cropId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchCropPhase">
|
||||
insert into csa_crop_phase( phase_id, crop_id, phase_name, production, picture, status, del_flag, create_by, create_time, update_by, update_time, remark) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.phaseId}, #{item.cropId}, #{item.phaseName}, #{item.production}, #{item.picture}, #{item.status}, #{item.delFlag}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
@ -1,96 +0,0 @@
|
||||
<?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.jlt.csa.mapper.CropFilesMapper">
|
||||
|
||||
<resultMap type="CropFiles" id="CropFilesResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="plantGuide" column="plant_guide" />
|
||||
<result property="picture" column="picture" />
|
||||
<result property="description" column="description" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCropFilesVo">
|
||||
select id, name, plant_guide, picture, description, status, del_flag, create_by, create_time, update_by, update_time, remark from csa_crop_files
|
||||
</sql>
|
||||
|
||||
<select id="selectCropFilesList" parameterType="CropFiles" resultMap="CropFilesResult">
|
||||
<include refid="selectCropFilesVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCropFilesById" parameterType="Long" resultMap="CropFilesResult">
|
||||
<include refid="selectCropFilesVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCropFiles" parameterType="CropFiles" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into csa_crop_files
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="plantGuide != null">plant_guide,</if>
|
||||
<if test="picture != null">picture,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="plantGuide != null">#{plantGuide},</if>
|
||||
<if test="picture != null">#{picture},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCropFiles" parameterType="CropFiles">
|
||||
update csa_crop_files
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="plantGuide != null">plant_guide = #{plantGuide},</if>
|
||||
<if test="picture != null">picture = #{picture},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCropFilesById" parameterType="Long">
|
||||
delete from csa_crop_files where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCropFilesByIds" parameterType="String">
|
||||
delete from csa_crop_files where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Reference in New Issue
Block a user