转场,转群,改耳号,改备注,改品种部分bug修复,字段顺序调整
This commit is contained in:
@@ -137,7 +137,6 @@ public class BasSheepController extends BaseController {
|
||||
}
|
||||
BasSheep query = new BasSheep();
|
||||
query.setTypeId(typeId.longValue());
|
||||
startPage();
|
||||
List<BasSheep> list = basSheepService.selectBasSheepList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@@ -154,7 +153,6 @@ public class BasSheepController extends BaseController {
|
||||
BasSheep query = new BasSheep();
|
||||
query.setSheepfoldId(sheepfoldId.longValue());
|
||||
query.setTypeId(typeId.longValue());
|
||||
startPage();
|
||||
List<BasSheep> list = basSheepService.selectBasSheepList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@@ -191,7 +189,6 @@ public class BasSheepController extends BaseController {
|
||||
return success(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断耳号是否存在(用于新增羊只时校验)
|
||||
*/
|
||||
|
||||
@@ -77,7 +77,7 @@ public class DaRanchController extends BaseController
|
||||
/**
|
||||
* 获取指定牧场下的所有羊只耳号
|
||||
*/
|
||||
// @GetMapping("/getSheepByRanchId/{ranchId}")
|
||||
@GetMapping("/getSheepByRanchId/{ranchId}")
|
||||
public AjaxResult getSheepByRanchId(@PathVariable Long ranchId) {
|
||||
List<BasSheep> sheepList = basSheepService.getSheepByRanchId(ranchId);
|
||||
return AjaxResult.success(sheepList);
|
||||
|
||||
@@ -3,6 +3,11 @@ package com.zhyc.module.produce.bodyManage.controller;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhyc.common.utils.DateUtils;
|
||||
import com.zhyc.common.utils.SecurityUtils;
|
||||
import com.zhyc.common.utils.StringUtils;
|
||||
import com.zhyc.module.base.domain.BasSheep;
|
||||
import com.zhyc.module.base.service.IBasSheepService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -14,28 +19,28 @@ import com.zhyc.module.produce.bodyManage.domain.ScBodyMeasure;
|
||||
import com.zhyc.module.produce.bodyManage.service.IScBodyMeasureService;
|
||||
import com.zhyc.common.utils.poi.ExcelUtil;
|
||||
import com.zhyc.common.core.page.TableDataInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 体尺测量Controller
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/body_measure/body_measure")
|
||||
public class ScBodyMeasureController extends BaseController
|
||||
{
|
||||
public class ScBodyMeasureController extends BaseController {
|
||||
@Autowired
|
||||
private IScBodyMeasureService scBodyMeasureService;
|
||||
|
||||
@Autowired
|
||||
private IBasSheepService basSheepService;
|
||||
|
||||
/**
|
||||
* 查询体尺测量列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('body_measure:body_measure:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ScBodyMeasure scBodyMeasure)
|
||||
{
|
||||
public TableDataInfo list(ScBodyMeasure scBodyMeasure) {
|
||||
startPage();
|
||||
List<ScBodyMeasure> list = scBodyMeasureService.selectScBodyMeasureList(scBodyMeasure);
|
||||
return getDataTable(list);
|
||||
@@ -47,8 +52,7 @@ public class ScBodyMeasureController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('body_measure:body_measure:export')")
|
||||
@Log(title = "体尺测量", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ScBodyMeasure scBodyMeasure)
|
||||
{
|
||||
public void export(HttpServletResponse response, ScBodyMeasure scBodyMeasure) {
|
||||
List<ScBodyMeasure> list = scBodyMeasureService.selectScBodyMeasureList(scBodyMeasure);
|
||||
ExcelUtil<ScBodyMeasure> util = new ExcelUtil<ScBodyMeasure>(ScBodyMeasure.class);
|
||||
util.exportExcel(response, list, "体尺测量数据");
|
||||
@@ -59,8 +63,7 @@ public class ScBodyMeasureController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('body_measure:body_measure:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(scBodyMeasureService.selectScBodyMeasureById(id));
|
||||
}
|
||||
|
||||
@@ -70,8 +73,7 @@ public class ScBodyMeasureController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('body_measure:body_measure:add')")
|
||||
@Log(title = "体尺测量", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ScBodyMeasure scBodyMeasure)
|
||||
{
|
||||
public AjaxResult add(@RequestBody ScBodyMeasure scBodyMeasure) {
|
||||
return toAjax(scBodyMeasureService.insertScBodyMeasure(scBodyMeasure));
|
||||
}
|
||||
|
||||
@@ -81,8 +83,7 @@ public class ScBodyMeasureController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('body_measure:body_measure:edit')")
|
||||
@Log(title = "体尺测量", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ScBodyMeasure scBodyMeasure)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody ScBodyMeasure scBodyMeasure) {
|
||||
return toAjax(scBodyMeasureService.updateScBodyMeasure(scBodyMeasure));
|
||||
}
|
||||
|
||||
@@ -91,14 +92,82 @@ public class ScBodyMeasureController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('body_measure:body_measure:remove')")
|
||||
@Log(title = "体尺测量", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(scBodyMeasureService.deleteScBodyMeasureByIds(ids));
|
||||
}
|
||||
|
||||
@GetMapping("/search_ear_numbers")
|
||||
public AjaxResult searchEarNumbers(@RequestParam("query") String query){
|
||||
public AjaxResult searchEarNumbers(@RequestParam("query") String query) {
|
||||
return success(scBodyMeasureService.searchEarNumbers(query.trim()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入体尺测量数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('body_measure:body_measure:import')")
|
||||
@Log(title = "体尺测量", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/import")
|
||||
public AjaxResult importData(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
ExcelUtil<ScBodyMeasure> util = new ExcelUtil<>(ScBodyMeasure.class);
|
||||
List<ScBodyMeasure> list = util.importExcel(file.getInputStream());
|
||||
|
||||
// 数据校验和处理
|
||||
StringBuilder errorMsg = new StringBuilder();
|
||||
int successCount = 0;
|
||||
int failCount = 0;
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
ScBodyMeasure measure = list.get(i);
|
||||
try {
|
||||
// 根据耳号查询羊只ID
|
||||
if (StringUtils.isNotBlank(measure.getManageTags())) {
|
||||
BasSheep sheep = basSheepService.selectBasSheepByManageTags(measure.getManageTags().trim());
|
||||
if (sheep == null) {
|
||||
failCount++;
|
||||
errorMsg.append("第").append(i + 2).append("行:耳号【")
|
||||
.append(measure.getManageTags()).append("】不存在;");
|
||||
continue;
|
||||
}
|
||||
measure.setSheepId(sheep.getId());
|
||||
} else {
|
||||
failCount++;
|
||||
errorMsg.append("第").append(i + 2).append("行:耳号不能为空;");
|
||||
continue;
|
||||
}
|
||||
|
||||
// 设置默认值
|
||||
measure.setCreateTime(DateUtils.getNowDate());
|
||||
measure.setCreateBy(SecurityUtils.getUsername());
|
||||
|
||||
scBodyMeasureService.insertScBodyMeasure(measure);
|
||||
successCount++;
|
||||
|
||||
// 更新羊只当前体重
|
||||
if (measure.getCurrentWeight() != null) {
|
||||
BasSheep updateSheep = new BasSheep();
|
||||
updateSheep.setId(measure.getSheepId());
|
||||
updateSheep.setCurrentWeight(measure.getCurrentWeight());
|
||||
basSheepService.updateBasSheep(updateSheep);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
failCount++;
|
||||
errorMsg.append("第").append(i + 2).append("行:").append(e.getMessage()).append(";");
|
||||
}
|
||||
}
|
||||
|
||||
String msg = String.format("导入完成:成功%d条,失败%d条", successCount, failCount);
|
||||
if (failCount > 0) {
|
||||
msg += ";失败原因:" + errorMsg.toString();
|
||||
}
|
||||
return success(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取繁殖状态列表(用于下拉选择)
|
||||
*/
|
||||
@GetMapping("/breedStatus")
|
||||
public AjaxResult listBreedStatus() {
|
||||
return success(scBodyMeasureService.selectBreedStatusList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package com.zhyc.module.produce.bodyManage.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
import com.zhyc.common.core.domain.BaseEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -62,8 +65,10 @@ public class ScBodyMeasure extends BaseEntity {
|
||||
/**
|
||||
* 测量日期
|
||||
*/
|
||||
@Excel(name = "测量日期")
|
||||
private LocalDate measureDate;
|
||||
@Excel(name = "测量日期", dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date measureDate;
|
||||
/**
|
||||
* 羊只类别
|
||||
*/
|
||||
@@ -82,10 +87,12 @@ public class ScBodyMeasure extends BaseEntity {
|
||||
/**
|
||||
* 出生体重
|
||||
*/
|
||||
@Excel(name = "出生体重")
|
||||
private BigDecimal birthWeight;
|
||||
/**
|
||||
* 断奶体重
|
||||
*/
|
||||
@Excel(name = "断奶体重")
|
||||
private BigDecimal weaningWeight;
|
||||
/**
|
||||
* 当前体重
|
||||
@@ -173,6 +180,13 @@ public class ScBodyMeasure extends BaseEntity {
|
||||
*/
|
||||
@Excel(name = "配后天数")
|
||||
private Integer postMatingDay;
|
||||
|
||||
|
||||
/**
|
||||
* 技术员
|
||||
*/
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@@ -180,12 +194,22 @@ public class ScBodyMeasure extends BaseEntity {
|
||||
private String comment;
|
||||
|
||||
/**
|
||||
* 技术员
|
||||
* 前端多耳号查询条件,非表字段
|
||||
*/
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
|
||||
/** 前端多耳号查询条件,非表字段 */
|
||||
private List<String> manageTagsList;
|
||||
|
||||
/**
|
||||
* 是否在群查询条件(0-在群,1-离群),非数据库字段
|
||||
*/
|
||||
private Integer isDelete;
|
||||
|
||||
/**
|
||||
* 月龄查询条件(开始),非数据库字段
|
||||
*/
|
||||
private Integer monthAgeStart;
|
||||
|
||||
/**
|
||||
* 月龄查询条件(结束),非数据库字段
|
||||
*/
|
||||
private Integer monthAgeEnd;
|
||||
}
|
||||
|
||||
@@ -78,6 +78,13 @@ public class ScBodyScore extends BaseEntity {
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
/** 前端多耳号查询条件,非表字段 */
|
||||
/**
|
||||
* 前端多耳号查询条件,非表字段
|
||||
*/
|
||||
private List<String> manageTagsList;
|
||||
|
||||
/**
|
||||
* 是否在群查询条件(0-在群,1-离群),非数据库字段
|
||||
*/
|
||||
private Integer isDelete;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,13 @@ public class ScBreastRating extends BaseEntity {
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
|
||||
/** 前端多耳号查询条件,非表字段 */
|
||||
/**
|
||||
* 前端多耳号查询条件,非表字段
|
||||
*/
|
||||
private List<String> manageTagsList;
|
||||
|
||||
/**
|
||||
* 是否在群查询条件(0-在群,1-离群),非数据库字段
|
||||
*/
|
||||
private Integer isDelete;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.zhyc.module.produce.bodyManage.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.zhyc.module.produce.bodyManage.domain.ScBodyMeasure;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -69,4 +71,9 @@ public interface ScBodyMeasureMapper
|
||||
List<ScBodyMeasure> selectScBodyMeasureList(
|
||||
@Param("sc") ScBodyMeasure sc,
|
||||
@Param("manageTagsList") List<String> manageTagsList);
|
||||
|
||||
/**
|
||||
* 查询繁殖状态列表
|
||||
*/
|
||||
List<Map<String, Object>> selectBreedStatusList();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.zhyc.module.produce.bodyManage.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.zhyc.module.produce.bodyManage.domain.ScBodyMeasure;
|
||||
|
||||
/**
|
||||
@@ -60,4 +62,9 @@ public interface IScBodyMeasureService
|
||||
public int deleteScBodyMeasureById(Long id);
|
||||
|
||||
List<String> searchEarNumbers(String query);
|
||||
|
||||
/**
|
||||
* 查询繁殖状态列表
|
||||
*/
|
||||
List<Map<String, Object>> selectBreedStatusList();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.zhyc.module.produce.bodyManage.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.zhyc.common.utils.DateUtils;
|
||||
import com.zhyc.common.utils.SecurityUtils;
|
||||
import com.zhyc.common.utils.StringUtils;
|
||||
@@ -127,4 +129,9 @@ public class ScBodyMeasureServiceImpl implements IScBodyMeasureService
|
||||
{
|
||||
return scBodyMeasureMapper.deleteScBodyMeasureById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> selectBreedStatusList() {
|
||||
return scBodyMeasureMapper.selectBreedStatusList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,9 +103,6 @@ public class ScTransitionInfoController extends BaseController {
|
||||
|
||||
@PutMapping("/approve")
|
||||
public AjaxResult approveScTransitionInfo(@RequestBody ScTransitionInfo scTransitionInfo) {
|
||||
if ("转场转入".equals(scTransitionInfo.getEventType()) && scTransitionInfo.getSheepfoldId() == null) {
|
||||
return AjaxResult.error("转场转入时,接收羊舍ID不能为空");
|
||||
}
|
||||
int rows = scTransitionInfoService.approveScTransitionInfo(scTransitionInfo);
|
||||
return toAjax(rows);
|
||||
}
|
||||
@@ -114,4 +111,6 @@ public class ScTransitionInfoController extends BaseController {
|
||||
public AjaxResult searchEarNumbers(@RequestParam("query") String query){
|
||||
return success(scTransitionInfoService.searchEarNumbers(query.trim()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -31,20 +31,23 @@ public class ScChangeComment extends BaseEntity {
|
||||
* 羊只id
|
||||
*/
|
||||
private String sheepId;
|
||||
|
||||
@Excel(name = "管理耳号")
|
||||
private String manageTags;
|
||||
|
||||
/** 羊舍 */
|
||||
private Long sheepfoldId;
|
||||
@Excel(name = "羊舍")
|
||||
private String sheepfoldName;
|
||||
|
||||
/**
|
||||
* 事件类型
|
||||
*/
|
||||
@Excel(name = "事件类型")
|
||||
private String eventType;
|
||||
|
||||
/**
|
||||
* 事件日期
|
||||
*/
|
||||
@Excel(name = "事件日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date eventDate;
|
||||
|
||||
/**
|
||||
* 新备注
|
||||
*/
|
||||
@@ -58,17 +61,25 @@ public class ScChangeComment extends BaseEntity {
|
||||
private String oldComment;
|
||||
|
||||
/**
|
||||
* 事件日期
|
||||
* 羊舍
|
||||
*/
|
||||
@Excel(name = "事件日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date eventDate;
|
||||
private Long sheepfoldId;
|
||||
@Excel(name = "羊舍")
|
||||
private String sheepfoldName;
|
||||
|
||||
/**
|
||||
* 技术员
|
||||
*/
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
/** 前端多耳号条件,非数据库字段 */
|
||||
/**
|
||||
* 前端多耳号条件,非数据库字段
|
||||
*/
|
||||
private List<String> manageTagsList;
|
||||
|
||||
/**
|
||||
* 是否在群查询条件(0-在群,1-离群),非数据库字段
|
||||
*/
|
||||
private Integer isDelete;
|
||||
}
|
||||
|
||||
@@ -36,11 +36,10 @@ public class ScChangeEar extends BaseEntity {
|
||||
private String manageTags;
|
||||
|
||||
/**
|
||||
* 羊舍
|
||||
* 品种
|
||||
*/
|
||||
private Long sheepfoldId;
|
||||
@Excel(name = "羊舍")
|
||||
private String sheepfoldName;
|
||||
@Excel(name = "品种")
|
||||
private String varietyName;
|
||||
|
||||
/**
|
||||
* 事件类型(改管理耳号/改电子耳号)
|
||||
@@ -48,6 +47,13 @@ public class ScChangeEar extends BaseEntity {
|
||||
@Excel(name = "事件类型")
|
||||
private String eventType;
|
||||
|
||||
/**
|
||||
* 事件日期
|
||||
*/
|
||||
@Excel(name = "事件日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date eventDate;
|
||||
|
||||
/**
|
||||
* 选择更改耳号类型(0电子耳号1管理耳号)
|
||||
*/
|
||||
@@ -67,17 +73,11 @@ public class ScChangeEar extends BaseEntity {
|
||||
private String oldTag;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
* 羊舍
|
||||
*/
|
||||
@Excel(name = "备注")
|
||||
private String comment;
|
||||
|
||||
/**
|
||||
* 事件日期
|
||||
*/
|
||||
@Excel(name = "事件日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date eventDate;
|
||||
private Long sheepfoldId;
|
||||
@Excel(name = "羊舍")
|
||||
private String sheepfoldName;
|
||||
|
||||
/**
|
||||
* 技术员
|
||||
@@ -85,7 +85,20 @@ public class ScChangeEar extends BaseEntity {
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注")
|
||||
private String comment;
|
||||
|
||||
/** 前端多耳号查询条件,非表字段 */
|
||||
/**
|
||||
* 前端多耳号查询条件,非表字段
|
||||
*/
|
||||
private List<String> manageTagsList;
|
||||
|
||||
|
||||
/**
|
||||
* 在群状态 0-全部 1-在群 2-不在群(列表查询用)
|
||||
*/
|
||||
private Integer inGroup;
|
||||
}
|
||||
|
||||
@@ -31,9 +31,35 @@ public class ScChangeVariety extends BaseEntity {
|
||||
* 羊只id
|
||||
*/
|
||||
private Integer sheepId;
|
||||
|
||||
@Excel(name = "耳号")
|
||||
private String manageTags;
|
||||
|
||||
/**
|
||||
* 事件类型
|
||||
*/
|
||||
@Excel(name = "事件类型")
|
||||
private String eventType;
|
||||
|
||||
/**
|
||||
* 事件日期
|
||||
*/
|
||||
@Excel(name = "事件日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date eventDate;
|
||||
|
||||
/**
|
||||
* 新品种
|
||||
*/
|
||||
@Excel(name = "新品种")
|
||||
private String varietyNew;
|
||||
|
||||
/**
|
||||
* 旧品种
|
||||
*/
|
||||
@Excel(name = "旧品种")
|
||||
private String varietyOld;
|
||||
|
||||
/**
|
||||
* 羊舍
|
||||
*/
|
||||
@@ -42,22 +68,10 @@ public class ScChangeVariety extends BaseEntity {
|
||||
private String sheepfoldName;
|
||||
|
||||
/**
|
||||
* 事件类型
|
||||
* 技术员
|
||||
*/
|
||||
@Excel(name = "事件类型")
|
||||
private String eventType;
|
||||
|
||||
/**
|
||||
* 原品种
|
||||
*/
|
||||
@Excel(name = "原品种")
|
||||
private String varietyOld;
|
||||
|
||||
/**
|
||||
* 新品种
|
||||
*/
|
||||
@Excel(name = "新品种")
|
||||
private String varietyNew;
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
@@ -66,18 +80,12 @@ public class ScChangeVariety extends BaseEntity {
|
||||
private String comment;
|
||||
|
||||
/**
|
||||
* 技术员
|
||||
* 前端多耳号查询条件,非表字段
|
||||
*/
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
private List<String> manageTagsList;
|
||||
|
||||
/**
|
||||
* 事件日期
|
||||
* 是否在群查询条件(0-在群,1-离群),非数据库字段
|
||||
*/
|
||||
@Excel(name = "事件日期",width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date eventDate;
|
||||
|
||||
/** 前端多耳号查询条件,非表字段 */
|
||||
private List<String> manageTagsList;
|
||||
private Integer isDelete;
|
||||
}
|
||||
|
||||
@@ -33,42 +33,6 @@ public class ScTransGroup extends BaseEntity {
|
||||
@Excel(name = "耳号")
|
||||
private String manageTags;
|
||||
|
||||
/**
|
||||
* 事件类型(1-围产转群,2-普通转群,3-育肥转群,4-预售转群)
|
||||
*/
|
||||
private Integer eventType;
|
||||
@Excel(name = "事件类型")
|
||||
private String eventTypeText;
|
||||
|
||||
/**
|
||||
* 转入羊舍
|
||||
*/
|
||||
private String foldTo;
|
||||
|
||||
/**
|
||||
* 转出羊舍
|
||||
*/
|
||||
private String foldFrom;
|
||||
|
||||
/**
|
||||
* 羊只类型
|
||||
*/
|
||||
private Integer sheepTypeId;
|
||||
@Excel(name = "羊只类型")
|
||||
private String sheepTypeName;
|
||||
|
||||
/**
|
||||
* 转出羊舍名称
|
||||
*/
|
||||
@Excel(name = "转出羊舍")
|
||||
private String foldFromName;
|
||||
|
||||
/**
|
||||
* 转入羊舍名称
|
||||
*/
|
||||
@Excel(name = "转入羊舍")
|
||||
private String foldToName;
|
||||
|
||||
/**
|
||||
* 品种id
|
||||
*/
|
||||
@@ -80,40 +44,72 @@ public class ScTransGroup extends BaseEntity {
|
||||
@Excel(name = "品种")
|
||||
private String varietyName;
|
||||
|
||||
/**
|
||||
* 事件类型(1-围产转群,2-普通转群,3-育肥转群,4-预售转群)
|
||||
*/
|
||||
private String eventType;
|
||||
@Excel(name = "事件类型")
|
||||
private String eventTypeText;
|
||||
|
||||
private Integer reason;
|
||||
/**
|
||||
* 转群日期
|
||||
*/
|
||||
@Excel(name = "转群日期")
|
||||
private String transDate;
|
||||
|
||||
/**
|
||||
* 转入羊舍
|
||||
*/
|
||||
private String foldTo;
|
||||
/**
|
||||
* 转入羊舍名称
|
||||
*/
|
||||
@Excel(name = "转入羊舍")
|
||||
private String foldToName;
|
||||
|
||||
/**
|
||||
* 转出羊舍
|
||||
*/
|
||||
private String foldFrom;
|
||||
/**
|
||||
* 转出羊舍名称
|
||||
*/
|
||||
@Excel(name = "转出羊舍")
|
||||
private String foldFromName;
|
||||
|
||||
private String reason;
|
||||
/**
|
||||
* 转群原因描述 用于导出
|
||||
*/
|
||||
@Excel(name = "转群原因")
|
||||
private String reasonText;
|
||||
|
||||
/** 转群日期 */
|
||||
@Excel(name = "转群日期")
|
||||
private String transDate;
|
||||
/**
|
||||
* 技术员
|
||||
*/
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
|
||||
private Integer status;
|
||||
/**
|
||||
* 状态描述 用于导出
|
||||
*/
|
||||
@Excel(name = "状态")
|
||||
private String statusText;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注")
|
||||
private String comment;
|
||||
|
||||
/** 前端多耳号查询条件,非表字段 */
|
||||
/**
|
||||
* 羊只类型
|
||||
*/
|
||||
private Integer sheepTypeId;
|
||||
|
||||
private String sheepTypeName;
|
||||
|
||||
/**
|
||||
* 前端多耳号查询条件,非表字段
|
||||
*/
|
||||
private List<String> manageTagsList;
|
||||
|
||||
/**
|
||||
* 是否在群查询条件(0-在群,1-离群)
|
||||
*/
|
||||
private Integer isDelete;
|
||||
}
|
||||
|
||||
@@ -33,24 +33,6 @@ public class ScTransitionInfo extends BaseEntity {
|
||||
@Excel(name = "耳号")
|
||||
private String manageTags;
|
||||
|
||||
/**
|
||||
* 事件类型
|
||||
*/
|
||||
@Excel(name = "事件类型")
|
||||
private String eventType;
|
||||
|
||||
|
||||
/**
|
||||
* 转场类型
|
||||
*/
|
||||
private Integer transType;
|
||||
@Excel(name = "转场类型")
|
||||
private String transTypeText;
|
||||
|
||||
/** 转场日期 */
|
||||
@Excel(name = "转场日期")
|
||||
private LocalDate transitionDate;
|
||||
|
||||
/**
|
||||
* 品种id
|
||||
*/
|
||||
@@ -62,6 +44,23 @@ public class ScTransitionInfo extends BaseEntity {
|
||||
@Excel(name = "品种")
|
||||
private String varietyName;
|
||||
|
||||
/**
|
||||
* 事件类型
|
||||
*/
|
||||
@Excel(name = "事件类型")
|
||||
private String eventType;
|
||||
|
||||
/** 转场日期 */
|
||||
@Excel(name = "转场日期")
|
||||
private LocalDate transitionDate;
|
||||
|
||||
/**
|
||||
* 转场类型
|
||||
*/
|
||||
private Integer transType;
|
||||
@Excel(name = "转场类型")
|
||||
private String transTypeText;
|
||||
|
||||
/**
|
||||
* 转入牧场
|
||||
*/
|
||||
@@ -69,21 +68,34 @@ public class ScTransitionInfo extends BaseEntity {
|
||||
private String transTo;
|
||||
|
||||
/**
|
||||
* 当前牧场
|
||||
* 转出牧场
|
||||
*/
|
||||
@Excel(name = "当前牧场")
|
||||
@Excel(name = "转出牧场")
|
||||
private String transFrom;
|
||||
|
||||
/**
|
||||
* 羊舍
|
||||
*/
|
||||
@Excel(name = "羊舍")
|
||||
private String sheepfoldName;
|
||||
|
||||
/**
|
||||
* 接收羊舍
|
||||
*/
|
||||
private Long sheepfoldId;
|
||||
|
||||
/**
|
||||
* 技术员
|
||||
*/
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注")
|
||||
private String comment;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@@ -91,12 +103,21 @@ public class ScTransitionInfo extends BaseEntity {
|
||||
@Excel(name = "状态")
|
||||
private String statusText;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注")
|
||||
private String comment;
|
||||
|
||||
/** 前端多耳号查询条件,非表字段 */
|
||||
private List<String> manageTagsList;
|
||||
|
||||
private Integer isDelete;
|
||||
|
||||
/** 羊只类型ID(查询条件,非数据库字段) */
|
||||
private Long sheepTypeId;
|
||||
|
||||
/**
|
||||
* 当前场区ID(查询条件,关联bas_sheep.ranch_id),非数据库字段
|
||||
*/
|
||||
private Long currentRanchId;
|
||||
|
||||
/**
|
||||
* 当前场区名称(展示用),非数据库字段
|
||||
*/
|
||||
private String currentRanchName;
|
||||
}
|
||||
|
||||
@@ -59,11 +59,5 @@ public interface IScTransGroupService {
|
||||
*/
|
||||
public int deleteScTransGroupById(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 审批转群记录
|
||||
*/
|
||||
int approveScTransGroup(ScTransGroup scTransGroup);
|
||||
|
||||
List<String> searchEarNumbers(String query);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ public class ScTransGroupServiceImpl implements IScTransGroupService {
|
||||
public ScTransGroup selectScTransGroupById(Integer id) {
|
||||
ScTransGroup group = scTransGroupMapper.selectScTransGroupById(id);
|
||||
group.setReasonText(convertReason(group.getReason()));
|
||||
group.setStatusText(convertStatus(group.getStatus()));
|
||||
group.setEventTypeText(convertEventType(group.getEventType()));
|
||||
return group;
|
||||
}
|
||||
@@ -60,7 +59,6 @@ public class ScTransGroupServiceImpl implements IScTransGroupService {
|
||||
scTransGroup.getManageTagsList());
|
||||
list.forEach(group -> {
|
||||
group.setReasonText(convertReason(group.getReason()));
|
||||
group.setStatusText(convertStatus(group.getStatus()));
|
||||
group.setEventTypeText(convertEventType(group.getEventType()));
|
||||
});
|
||||
return list;
|
||||
@@ -76,7 +74,6 @@ public class ScTransGroupServiceImpl implements IScTransGroupService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertScTransGroup(ScTransGroup scTransGroup) {
|
||||
scTransGroup.setStatus(0);
|
||||
scTransGroup.setCreateTime(DateUtils.getNowDate());
|
||||
scTransGroup.setCreateBy(SecurityUtils.getUsername());
|
||||
int rows = scTransGroupMapper.insertScTransGroup(scTransGroup);
|
||||
@@ -123,22 +120,6 @@ public class ScTransGroupServiceImpl implements IScTransGroupService {
|
||||
return scTransGroupMapper.deleteScTransGroupById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 审批转群记录
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int approveScTransGroup(ScTransGroup scTransGroup) {
|
||||
int rows = scTransGroupMapper.updateScTransGroup(scTransGroup);
|
||||
|
||||
if (rows > 0 && scTransGroup.getStatus() == 1) {
|
||||
updateSheepFold(scTransGroup);
|
||||
}
|
||||
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新羊只所在羊舍
|
||||
*/
|
||||
@@ -177,38 +158,28 @@ public class ScTransGroupServiceImpl implements IScTransGroupService {
|
||||
/**
|
||||
* 转换转群原因
|
||||
*/
|
||||
private String convertReason(Integer reasonCode) {
|
||||
Map<Integer, String> reasonMap = new HashMap<>();
|
||||
reasonMap.put(0, "新产羊过抗转群");
|
||||
reasonMap.put(1, "治愈转群");
|
||||
reasonMap.put(2, "病羊过抗转群");
|
||||
return reasonMap.getOrDefault(reasonCode, "未知原因");
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换状态
|
||||
*/
|
||||
private String convertStatus(Integer statusCode) {
|
||||
Map<Integer, String> statusMap = new HashMap<>();
|
||||
statusMap.put(0, "待批准");
|
||||
statusMap.put(1, "通过");
|
||||
statusMap.put(2, "驳回");
|
||||
return statusMap.getOrDefault(statusCode, "未知状态");
|
||||
private String convertReason(String reasonCode) {
|
||||
if (reasonCode == null) return "未知原因";
|
||||
Map<String,String> map = new HashMap<>();
|
||||
map.put("0","新产羊过抗转群");
|
||||
map.put("1","治愈转群");
|
||||
map.put("2","病羊过抗转群");
|
||||
return map.getOrDefault(reasonCode, reasonCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换事件类型(1-围产转群,2-普通转群,3-育肥转群,4-预售转群)
|
||||
*/
|
||||
private String convertEventType(Integer eventType) {
|
||||
private String convertEventType(String eventType) {
|
||||
if (eventType == null) {
|
||||
return "未知";
|
||||
}
|
||||
Map<Integer, String> eventTypeMap = new HashMap<>();
|
||||
eventTypeMap.put(1, "围产转群");
|
||||
eventTypeMap.put(2, "普通转群");
|
||||
eventTypeMap.put(3, "育肥转群");
|
||||
eventTypeMap.put(4, "预售转群");
|
||||
return eventTypeMap.getOrDefault(eventType, "未知");
|
||||
Map<String, String> eventTypeMap = new HashMap<>();
|
||||
eventTypeMap.put("1", "围产转群");
|
||||
eventTypeMap.put("2", "普通转群");
|
||||
eventTypeMap.put("3", "育肥转群");
|
||||
eventTypeMap.put("4", "预售转群");
|
||||
return eventTypeMap.getOrDefault(eventType, eventType);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -135,6 +135,11 @@ public class ScTransitionInfoServiceImpl implements IScTransitionInfoService
|
||||
if (existing.getStatus() != 0) {
|
||||
throw new RuntimeException("该记录已完成审批,无法重复操作");
|
||||
}
|
||||
if (scTransitionInfo.getStatus() == 1) { // 同意
|
||||
if ("转场转入".equals(scTransitionInfo.getEventType()) && scTransitionInfo.getSheepfoldId() == null) {
|
||||
throw new RuntimeException("转场转入时,接收羊舍ID不能为空");
|
||||
}
|
||||
}
|
||||
int rows = scTransitionInfoMapper.updateScTransitionInfo(scTransitionInfo);
|
||||
if (rows > 0 && scTransitionInfo.getStatus() == 1) {
|
||||
updateSheepRanch(scTransitionInfo);
|
||||
@@ -143,52 +148,47 @@ public class ScTransitionInfoServiceImpl implements IScTransitionInfoService
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新羊只的所在牧场(基于现有牧场列表接口)
|
||||
* 更新羊只的所在牧场及羊舍
|
||||
*/
|
||||
private void updateSheepRanch(ScTransitionInfo transitionInfo) {
|
||||
/* 1. 目标牧场 */
|
||||
String transTo = transitionInfo.getTransTo();
|
||||
if (StringUtils.isBlank(transTo)) {
|
||||
throw new RuntimeException("转入牧场不能为空");
|
||||
}
|
||||
|
||||
DaRanch query = new DaRanch();
|
||||
query.setRanch(transTo);
|
||||
List<DaRanch> ranchList = daRanchService.selectDaRanchList(query);
|
||||
|
||||
Optional<DaRanch> matchedRanch = ranchList.stream()
|
||||
.filter(ranch -> transTo.equals(ranch.getRanch()))
|
||||
.findFirst();
|
||||
|
||||
if (!matchedRanch.isPresent()) {
|
||||
throw new RuntimeException("转入牧场 [" + transTo + "] 不存在");
|
||||
}
|
||||
Long targetRanchId = matchedRanch.get().getId();
|
||||
|
||||
//获取接收羊舍
|
||||
/* 2. 接收羊舍(审批通过时必传) */
|
||||
Long targetSheepfoldId = transitionInfo.getSheepfoldId();
|
||||
if ("转场转入".equals(transitionInfo.getEventType()) && targetSheepfoldId == null) {
|
||||
throw new RuntimeException("转场转入时,接收羊舍不能为空");
|
||||
if (targetSheepfoldId == null) {
|
||||
throw new RuntimeException("接收羊舍不能为空");
|
||||
}
|
||||
|
||||
/* 3. 逐只迁移 */
|
||||
String manageTags = transitionInfo.getManageTags();
|
||||
if (StringUtils.isBlank(manageTags)) {
|
||||
throw new RuntimeException("耳号不能为空");
|
||||
}
|
||||
List<String> tagList = Arrays.asList(manageTags.split(","));
|
||||
|
||||
for (String tag : tagList) {
|
||||
BasSheep sheep = basSheepService.selectBasSheepByManageTags(tag.trim());
|
||||
if (sheep == null) {
|
||||
throw new RuntimeException("耳号 [" + tag + "] 不存在");
|
||||
}
|
||||
|
||||
BasSheep updateSheep = new BasSheep();
|
||||
updateSheep.setId(sheep.getId());
|
||||
updateSheep.setRanchId(targetRanchId);
|
||||
if ("转场转入".equals(transitionInfo.getEventType())) {
|
||||
updateSheep.setSheepfoldId(targetSheepfoldId);
|
||||
}
|
||||
basSheepMapper.updateBasSheep(updateSheep);
|
||||
BasSheep upd = new BasSheep();
|
||||
upd.setId(sheep.getId());
|
||||
upd.setRanchId(targetRanchId);
|
||||
upd.setSheepfoldId(targetSheepfoldId); // 真正换舍
|
||||
basSheepMapper.updateBasSheep(upd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,10 +48,14 @@ public class ScCastrate extends BaseEntity {
|
||||
@Excel(name = "羊舍名称")
|
||||
private String sheepfoldName;
|
||||
|
||||
/** 品种id */
|
||||
/**
|
||||
* 品种id
|
||||
*/
|
||||
private Long varietyId;
|
||||
|
||||
/** 品种名称(联表查询返回,非数据库字段) */
|
||||
/**
|
||||
* 品种名称(联表查询返回,非数据库字段)
|
||||
*/
|
||||
@Excel(name = "品种")
|
||||
private String varietyName;
|
||||
|
||||
@@ -74,6 +78,13 @@ public class ScCastrate extends BaseEntity {
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private String eventDate;
|
||||
|
||||
/** 前端多耳号查询条件,非表字段 */
|
||||
/**
|
||||
* 前端多耳号查询条件,非表字段
|
||||
*/
|
||||
private List<String> manageTagsList;
|
||||
|
||||
/**
|
||||
* 是否在群查询条件(0-在群,1-离群),非数据库字段
|
||||
*/
|
||||
private Integer isDelete;
|
||||
}
|
||||
|
||||
@@ -18,14 +18,17 @@ import java.util.List;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ScFixHoof extends BaseEntity
|
||||
{
|
||||
public class ScFixHoof extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/** 羊只id */
|
||||
/**
|
||||
* 羊只id
|
||||
*/
|
||||
private Integer sheepId;
|
||||
@Excel(name = "管理耳号")
|
||||
private String manageTags;
|
||||
@@ -36,25 +39,37 @@ public class ScFixHoof extends BaseEntity
|
||||
@Excel(name = "事件类型")
|
||||
private String eventType;
|
||||
|
||||
/** 羊舍id */
|
||||
/**
|
||||
* 羊舍id
|
||||
*/
|
||||
private Integer sheepfold;
|
||||
|
||||
/** 羊舍名称 */
|
||||
/**
|
||||
* 羊舍名称
|
||||
*/
|
||||
@Excel(name = "羊舍名称")
|
||||
private String sheepfoldName;
|
||||
|
||||
/** 品种id */
|
||||
/**
|
||||
* 品种id
|
||||
*/
|
||||
private Long varietyId;
|
||||
|
||||
/** 品种名称(联表查询返回,非数据库字段) */
|
||||
/**
|
||||
* 品种名称(联表查询返回,非数据库字段)
|
||||
*/
|
||||
@Excel(name = "品种")
|
||||
private String varietyName;
|
||||
|
||||
/** 备注 */
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注")
|
||||
private String comment;
|
||||
|
||||
/** 技术员 */
|
||||
/**
|
||||
* 技术员
|
||||
*/
|
||||
@Excel(name = "技术员")
|
||||
private String technician;
|
||||
|
||||
@@ -65,6 +80,13 @@ public class ScFixHoof extends BaseEntity
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private String eventDate;
|
||||
|
||||
/** 前端多耳号查询条件,非表字段 */
|
||||
/**
|
||||
* 前端多耳号查询条件,非表字段
|
||||
*/
|
||||
private List<String> manageTagsList;
|
||||
|
||||
/**
|
||||
* 是否在群查询条件(0-在群,1-离群),非数据库字段
|
||||
*/
|
||||
private Integer isDelete;
|
||||
}
|
||||
|
||||
@@ -103,6 +103,24 @@
|
||||
<if test="sc.params != null and sc.params.beginCreateTime != null and sc.params.beginCreateTime != '' and sc.params.endCreateTime != null and sc.params.endCreateTime != ''">
|
||||
and sm.create_time between #{sc.params.beginCreateTime} and #{sc.params.endCreateTime}
|
||||
</if>
|
||||
<if test="sc.gender != null and sc.gender != ''">
|
||||
and bs.gender = #{sc.gender}
|
||||
</if>
|
||||
<if test="sc.technician != null and sc.technician != ''">
|
||||
and sm.technician like concat('%', #{sc.technician}, '%')
|
||||
</if>
|
||||
<if test="sc.isDelete != null">
|
||||
and bs.is_delete = #{sc.isDelete}
|
||||
</if>
|
||||
<if test="sc.monthAgeStart != null">
|
||||
and <![CDATA[ TIMESTAMPDIFF(MONTH, bs.birthday, CURDATE()) >= #{sc.monthAgeStart} ]]>
|
||||
</if>
|
||||
<if test="sc.monthAgeEnd != null">
|
||||
and <![CDATA[ TIMESTAMPDIFF(MONTH, bs.birthday, CURDATE()) <= #{sc.monthAgeEnd} ]]>
|
||||
</if>
|
||||
<if test="sc.breedStatusName != null and sc.breedStatusName != ''">
|
||||
and bbs.breed = #{sc.breedStatusName}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY sm.create_time DESC
|
||||
</select>
|
||||
@@ -196,6 +214,11 @@
|
||||
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
|
||||
AND bs.is_delete = 0
|
||||
ORDER BY bs.manage_tags
|
||||
LIMIT 50
|
||||
</select>
|
||||
|
||||
<select id="selectBreedStatusList" resultType="java.util.HashMap">
|
||||
SELECT id, breed as label, breed as value
|
||||
FROM bas_breed_status
|
||||
ORDER BY id
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -59,6 +59,9 @@
|
||||
<if test="sc.params != null and sc.params.beginCreateTime != null and sc.params.beginCreateTime != '' and sc.params.endCreateTime != null and sc.params.endCreateTime != ''">
|
||||
and sbs.create_time between #{sc.params.beginCreateTime} and #{sc.params.endCreateTime}
|
||||
</if>
|
||||
<if test="sc.isDelete != null">
|
||||
and bs.is_delete = #{sc.isDelete}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY sbs.create_time DESC
|
||||
</select>
|
||||
|
||||
@@ -57,6 +57,9 @@
|
||||
<if test="sc.params != null and sc.params.beginCreateTime != null and sc.params.endCreateTime != null">
|
||||
and sbr.create_time between #{sc.params.beginCreateTime} and #{sc.params.endCreateTime}
|
||||
</if>
|
||||
<if test="sc.isDelete != null">
|
||||
and bs.is_delete = #{sc.isDelete}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY sbr.create_time DESC
|
||||
</select>
|
||||
@@ -134,7 +137,6 @@
|
||||
FROM bas_sheep bs
|
||||
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
|
||||
AND bs.is_delete = 0
|
||||
ORDER BY bs.manage_tags
|
||||
LIMIT 50
|
||||
ORDER BY bs.manage_tags LIMIT 50
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -43,8 +43,11 @@
|
||||
bs.manage_tags like concat('%', #{tag}, '%')
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sc.sheepfoldId != null">
|
||||
and bs.sheepfold_id = #{sc.sheepfoldId}
|
||||
<!-- <if test="sc.sheepfoldId != null">-->
|
||||
<!-- and bs.sheepfold_id = #{sc.sheepfoldId}-->
|
||||
<!-- </if>-->
|
||||
<if test="sc.technician != null and sc.technician != ''">
|
||||
and scc.technician like concat('%', #{sc.technician}, '%')
|
||||
</if>
|
||||
<if test="sc.newComment != null and sc.newComment != ''">
|
||||
and scc.new_comment like concat('%', #{sc.newComment}, '%')
|
||||
@@ -60,6 +63,9 @@
|
||||
and sc.params.endEventDate != null and sc.params.endEventDate != ''">
|
||||
and scc.event_date between #{sc.params.beginEventDate} and #{sc.params.endEventDate}
|
||||
</if>
|
||||
<if test="sc.isDelete != null">
|
||||
and bs.is_delete = #{sc.isDelete}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY scc.create_time DESC
|
||||
</select>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
sce.sheep_id,
|
||||
bs.manage_tags as manage_tags,
|
||||
sf.sheepfold_name as sheepfold_name,
|
||||
bv.variety as varietyName,
|
||||
case
|
||||
when sce.ear_type = 0 then '改电子耳号'
|
||||
when sce.ear_type = 1 then '改管理耳号'
|
||||
@@ -41,6 +42,7 @@
|
||||
from sc_change_ear sce
|
||||
LEFT JOIN bas_sheep bs ON sce.sheep_id = bs.id
|
||||
LEFT JOIN da_sheepfold sf ON bs.sheepfold_id = sf.id
|
||||
LEFT JOIN bas_sheep_variety bv on bs.variety_id = bv.id
|
||||
</sql>
|
||||
|
||||
<select id="selectScChangeEarList" resultMap="ScChangeEarResult">
|
||||
@@ -53,7 +55,7 @@
|
||||
or bs.electronic_tags like concat('%', #{tag}, '%'))
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sc.sheepfoldId != null">and bs.sheepfold_id = #{sc.sheepfoldId}</if>
|
||||
<if test="sc.technician != null and sc.technician != ''">and sce.technician like concat('%', #{sc.technician}, '%')</if>
|
||||
<if test="sc.earType != null">and sce.ear_type = #{sc.earType}</if>
|
||||
<if test="sc.newTag != null and sc.newTag != ''">and sce.newTag like concat('%', #{sc.newTag}, '%')</if>
|
||||
<if test="sc.oldTag != null and sc.oldTag != ''">and sce.oldTag like concat('%', #{sc.oldTag}, '%')</if>
|
||||
@@ -65,6 +67,12 @@
|
||||
and sc.params.endEventDate != null and sc.params.endEventDate != ''">
|
||||
and sce.event_date between #{sc.params.beginEventDate} and #{sc.params.endEventDate}
|
||||
</if>
|
||||
<if test="sc.inGroup != null">
|
||||
<choose>
|
||||
<when test="sc.inGroup == 1">and bs.is_delete = 0</when>
|
||||
<when test="sc.inGroup == 2">and bs.is_delete = 1</when>
|
||||
</choose>
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY sce.create_time DESC
|
||||
</select>
|
||||
|
||||
@@ -46,15 +46,25 @@
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sc.sheepId != null">and scv.sheep_id = #{sc.sheepId}</if>
|
||||
<if test="sc.sheepfoldId != null">and bs.sheepfold_id = #{sc.sheepfoldId}</if>
|
||||
<if test="sc.varietyOld != null and sc.varietyOld != ''">and scv.variety_old like concat('%', #{sc.varietyOld}, '%')</if>
|
||||
<if test="sc.varietyNew != null and sc.varietyNew != ''">and scv.variety_new like concat('%', #{sc.varietyNew}, '%')</if>
|
||||
<!-- <if test="sc.sheepfoldId != null">and bs.sheepfold_id = #{sc.sheepfoldId}</if>-->
|
||||
<if test="sc.technician != null and sc.technician != ''">and scv.technician like concat('%',
|
||||
#{sc.technician}, '%')
|
||||
</if>
|
||||
<if test="sc.varietyOld != null and sc.varietyOld != ''">and scv.variety_old like concat('%',
|
||||
#{sc.varietyOld}, '%')
|
||||
</if>
|
||||
<if test="sc.varietyNew != null and sc.varietyNew != ''">and scv.variety_new like concat('%',
|
||||
#{sc.varietyNew}, '%')
|
||||
</if>
|
||||
<if test="sc.params != null and sc.params.beginCreateTime != null and sc.params.beginCreateTime != '' and sc.params.endCreateTime != null and sc.params.endCreateTime != ''">
|
||||
and scv.create_time between #{sc.params.beginCreateTime} and #{sc.params.endCreateTime}
|
||||
</if>
|
||||
<if test="sc.params != null and sc.params.beginEventDate != null and sc.params.beginEventDate != '' and sc.params.endEventDate != null and sc.params.endEventDate != ''">
|
||||
and scv.event_date between #{sc.params.beginEventDate} and #{sc.params.endEventDate}
|
||||
</if>
|
||||
<if test="sc.isDelete != null">
|
||||
and bs.is_delete = #{sc.isDelete}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY scv.create_time DESC
|
||||
</select>
|
||||
@@ -119,7 +129,6 @@
|
||||
FROM bas_sheep bs
|
||||
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
|
||||
AND bs.is_delete = 0
|
||||
ORDER BY bs.manage_tags
|
||||
LIMIT 50
|
||||
ORDER BY bs.manage_tags LIMIT 50
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -15,7 +15,6 @@
|
||||
<result property="varietyId" column="variety_id"/>
|
||||
<result property="varietyName" column="varietyName"/>
|
||||
<result property="technician" column="technician"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="comment" column="comment"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
@@ -25,8 +24,8 @@
|
||||
SELECT tg.id,
|
||||
tg.sheep_id,
|
||||
s.manage_tags AS manageTags,
|
||||
tg.event_type AS eventType,
|
||||
tg.trans_date AS transDate,
|
||||
tg.event_type AS eventType,
|
||||
tg.trans_date AS transDate,
|
||||
tg.fold_to,
|
||||
tg.fold_from,
|
||||
tg.reason,
|
||||
@@ -34,7 +33,6 @@
|
||||
bv.variety AS varietyName,
|
||||
st.id AS sheepTypeId,
|
||||
st.name AS sheepTypeName,
|
||||
tg.status,
|
||||
tg.comment,
|
||||
tg.create_by,
|
||||
tg.create_time,
|
||||
@@ -54,20 +52,28 @@
|
||||
<select id="selectScTransGroupList" resultMap="ScTransGroupResult">
|
||||
<include refid="selectScTransGroupVo"/>
|
||||
<where>
|
||||
<if test="manageTagsList != null and manageTagsList.size() > 0">
|
||||
<foreach collection="manageTagsList" item="tag" separator="or" open="and (" close=")">
|
||||
s.manage_tags like concat('%', #{tag}, '%')
|
||||
<if test="sc.manageTagsList != null and sc.manageTagsList.size() > 0">
|
||||
<foreach collection="sc.manageTagsList" item="tag" separator="or" open="and (" close=")">
|
||||
s.manage_tags LIKE CONCAT('%', #{tag}, '%')
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="sc.sheepId != null">and tg.sheep_id = #{sc.sheepId}</if>
|
||||
<if test="sc.foldTo != null and sc.foldTo != ''">and tg.fold_to = #{sc.foldTo}</if>
|
||||
<if test="sc.foldFrom != null and sc.foldFrom != ''">and tg.fold_from = #{sc.foldFrom}</if>
|
||||
<if test="sc.status != null">and tg.status = #{sc.status}</if>
|
||||
<if test="sc.varietyId != null">and tg.variety_id = #{sc.varietyId}</if>
|
||||
<if test="sc.sheepTypeId != null">and st.id = #{sc.sheepTypeId}</if>
|
||||
<if test="sc.params != null and sc.params.beginTransDate != null and sc.params.beginTransDate != '' and sc.params.endTransDate != null and sc.params.endTransDate != ''">
|
||||
and tg.trans_date between #{sc.params.beginTransDate} and #{sc.params.endTransDate}
|
||||
</if>
|
||||
<if test="sc.eventType != null and sc.eventType != ''">
|
||||
and tg.event_type like concat('%', #{sc.eventType}, '%')
|
||||
</if>
|
||||
<if test="sc.technician != null and sc.technician != ''">
|
||||
and tg.technician like concat('%', #{sc.technician}, '%')
|
||||
</if>
|
||||
<if test="sc.isDelete != null">
|
||||
and s.is_delete = #{sc.isDelete}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY tg.create_time DESC
|
||||
</select>
|
||||
@@ -90,7 +96,6 @@
|
||||
<if test="varietyId != null">variety_id,</if>
|
||||
<if test="reason != null">reason,</if>
|
||||
<if test="technician != null and technician != ''">technician,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="comment != null">comment,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
@@ -104,7 +109,6 @@
|
||||
<if test="varietyId != null">#{varietyId},</if>
|
||||
<if test="reason != null">#{reason},</if>
|
||||
<if test="technician != null and technician != ''">#{technician},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
@@ -122,7 +126,6 @@
|
||||
<if test="varietyId != null">variety_id = #{varietyId},</if>
|
||||
<if test="reason != null">reason = #{reason},</if>
|
||||
<if test="technician != null and technician != ''">technician = #{technician},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="comment != null">comment = #{comment},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
@@ -149,6 +152,5 @@
|
||||
WHERE s.manage_tags LIKE CONCAT('%', #{query}, '%')
|
||||
AND s.is_delete = 0
|
||||
ORDER BY s.manage_tags
|
||||
LIMIT 50
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -25,8 +25,10 @@
|
||||
SELECT t.*,
|
||||
bv.variety AS varietyName,
|
||||
bs.manage_tags AS manageTags,
|
||||
sf.sheepfold_name AS sheepfoldName,
|
||||
t.event_type AS eventType,
|
||||
t.transition_date AS transitionDate,
|
||||
dr.ranch AS currentRanchName,
|
||||
CASE t.trans_type
|
||||
WHEN 0 THEN '内部调拨'
|
||||
WHEN 1 THEN '内部销售'
|
||||
@@ -42,6 +44,8 @@
|
||||
FROM sc_transition_info t
|
||||
LEFT JOIN bas_sheep bs ON t.sheep_id = bs.id
|
||||
LEFT JOIN bas_sheep_variety bv ON bs.variety_id = bv.id
|
||||
LEFT JOIN da_sheepfold sf ON t.sheepfold_id = sf.id
|
||||
LEFT JOIN da_ranch dr ON bs.ranch_id = dr.id
|
||||
</sql>
|
||||
|
||||
<select id="selectScTransitionInfoList" resultMap="ScTransitionInfoResult">
|
||||
@@ -61,6 +65,18 @@
|
||||
<if test="sc.params != null and sc.params.beginTransitionDate != null and sc.params.beginTransitionDate != '' and sc.params.endTransitionDate != null and sc.params.endTransitionDate != ''">
|
||||
and t.transition_date between #{sc.params.beginTransitionDate} and #{sc.params.endTransitionDate}
|
||||
</if>
|
||||
<if test="sc.technician != null and sc.technician != ''">
|
||||
and t.technician like concat('%', #{sc.technician}, '%')
|
||||
</if>
|
||||
<if test="sc.isDelete != null">
|
||||
and bs.is_delete = #{sc.isDelete}
|
||||
</if>
|
||||
<if test="sc.sheepTypeId != null">
|
||||
and bs.type_id = #{sc.sheepTypeId}
|
||||
</if>
|
||||
<if test="sc.currentRanchId != null">
|
||||
and bs.ranch_id = #{sc.currentRanchId}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY t.create_time DESC
|
||||
</select>
|
||||
@@ -155,7 +171,6 @@
|
||||
FROM bas_sheep bs
|
||||
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
|
||||
AND bs.is_delete = 0
|
||||
ORDER BY bs.manage_tags
|
||||
LIMIT 50
|
||||
ORDER BY bs.manage_tags LIMIT 50
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -57,6 +57,9 @@
|
||||
<if test="sc.params != null and sc.params.beginEventDate != null and sc.params.beginEventDate != '' and sc.params.endEventDate != null and sc.params.endEventDate != ''">
|
||||
and sc.event_date between #{sc.params.beginEventDate} and #{sc.params.endEventDate}
|
||||
</if>
|
||||
<if test="sc.isDelete != null">
|
||||
and bs.is_delete = #{sc.isDelete}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY sc.create_time DESC
|
||||
</select>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<sql id="selectScFixHoofVo">
|
||||
select fh.id,
|
||||
bs.manage_tags as manageTags,
|
||||
'修蹄' as event_type,
|
||||
'修蹄' as event_type,
|
||||
bs.sheepfold_id as sheepfold,
|
||||
sf.sheepfold_name as sheepfoldName,
|
||||
bs.variety_id as varietyId,
|
||||
@@ -47,13 +47,18 @@
|
||||
</if>
|
||||
<if test="sc.sheepfold != null">and bs.sheepfold_id = #{sc.sheepfold}</if>
|
||||
<if test="sc.varietyId != null">and bs.variety_id = #{sc.varietyId}</if>
|
||||
<if test="sc.technician != null and sc.technician != ''">and fh.technician like concat('%', #{sc.technician}, '%')</if>
|
||||
<if test="sc.technician != null and sc.technician != ''">and fh.technician like concat('%',
|
||||
#{sc.technician}, '%')
|
||||
</if>
|
||||
<if test="sc.params != null and sc.params.beginCreateTime != null and sc.params.beginCreateTime != '' and sc.params.endCreateTime != null and sc.params.endCreateTime != ''">
|
||||
and fh.create_time between #{sc.params.beginCreateTime} and #{sc.params.endCreateTime}
|
||||
</if>
|
||||
<if test="sc.params != null and sc.params.beginEventDate != null and sc.params.beginEventDate != '' and sc.params.endEventDate != null and sc.params.endEventDate != ''">
|
||||
and fh.event_date between #{sc.params.beginEventDate} and #{sc.params.endEventDate}
|
||||
</if>
|
||||
<if test="sc.isDelete != null">
|
||||
and bs.is_delete = #{sc.isDelete}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY fh.create_time DESC
|
||||
</select>
|
||||
@@ -118,6 +123,5 @@
|
||||
WHERE bs.manage_tags LIKE CONCAT('%', #{query}, '%')
|
||||
AND bs.is_delete = 0
|
||||
ORDER BY bs.manage_tags
|
||||
LIMIT 50
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user