派工单修改,权限修改

This commit is contained in:
2026-01-13 21:46:01 +08:00
parent 2722fb985e
commit 458a440f63
7 changed files with 106 additions and 31 deletions

View File

@@ -90,12 +90,12 @@ public class DewormServiceImpl implements IDewormService
Deworm dew = new Deworm();
BeanUtils.copyProperties(deworm, dew);
dew.setSheepId(Long.valueOf(sheepId));
dew.setVariety(sheepFile.getVariety());
dew.setSheepType(sheepFile.getName());
dew.setMonthAge(sheepFile.getMonthAge());
dew.setGender(String.valueOf(sheepFile.getGender()));
dew.setBreed(sheepFile.getBreed());
dew.setParity(sheepFile.getParity());
dew.setVariety(sheepFile.getVariety() != null ? sheepFile.getVariety() : "");
dew.setSheepType(sheepFile.getName() != null ? sheepFile.getName() : "");
dew.setMonthAge(sheepFile.getMonthAge() != null ? sheepFile.getMonthAge() : 0);
dew.setGender(sheepFile.getGender() != null ? String.valueOf(sheepFile.getGender()) : "");
dew.setBreed(sheepFile.getBreed() != null ? sheepFile.getBreed() : "");
dew.setParity(sheepFile.getParity() != null ? sheepFile.getParity() : 0);
medicineUsage.setSheepId(sheepId);
// 获取药品使用记录的id

View File

@@ -3,6 +3,8 @@ package com.zhyc.module.biosafety.service.impl;
import java.beans.Transient;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.common.utils.SecurityUtils;
import com.zhyc.common.utils.bean.BeanUtils;
@@ -92,12 +94,14 @@ public class HealthServiceImpl implements IHealthService
Health heal = new Health();
BeanUtils.copyProperties(health, heal);
heal.setSheepId(Long.valueOf(sheepId));
heal.setVariety(sheepFile.getVariety());
heal.setSheepType(sheepFile.getName());
heal.setMonthAge(sheepFile.getMonthAge());
heal.setGender(String.valueOf(sheepFile.getGender()));
heal.setBreed(sheepFile.getBreed());
heal.setParity(sheepFile.getParity());
// 处理数据为空的情况
heal.setVariety(sheepFile.getVariety() != null ? sheepFile.getVariety() : "");
heal.setSheepType(sheepFile.getName() != null ? sheepFile.getName() : "");
heal.setMonthAge(sheepFile.getMonthAge() != null ? sheepFile.getMonthAge() : 0);
heal.setGender(sheepFile.getGender() != null ? String.valueOf(sheepFile.getGender()) : "");
heal.setBreed(sheepFile.getBreed() != null ? sheepFile.getBreed() : "");
heal.setParity(sheepFile.getParity() != null ? sheepFile.getParity() : 0);
medicineUsage.setSheepId(sheepId);
// 获取药品使用记录的id

View File

@@ -97,13 +97,12 @@ public class ImmunityServiceImpl implements IImmunityService
Immunity imm = new Immunity();
BeanUtils.copyProperties(immunity, imm);
imm.setSheepId(Long.valueOf(sheepId));
imm.setVariety(sheepFile.getVariety());
imm.setSheepType(sheepFile.getName());
imm.setMonthAge(sheepFile.getMonthAge());
imm.setGender(String.valueOf(sheepFile.getGender()));
imm.setBreed(sheepFile.getBreed());
imm.setParity(sheepFile.getParity());
imm.setVariety(sheepFile.getVariety() != null ? sheepFile.getVariety() : "");
imm.setSheepType(sheepFile.getName() != null ? sheepFile.getName() : "");
imm.setMonthAge(sheepFile.getMonthAge() != null ? sheepFile.getMonthAge() : 0);
imm.setGender(sheepFile.getGender() != null ? String.valueOf(sheepFile.getGender()) : "");
imm.setBreed(sheepFile.getBreed() != null ? sheepFile.getBreed() : "");
imm.setParity(sheepFile.getParity() != null ? sheepFile.getParity() : 0);
medicineUsage.setSheepId(sheepId);
// 获取药品使用记录的id
Integer usageId = medicineUsageService.insertSwMedicineUsage(medicineUsage);

View File

@@ -44,6 +44,7 @@ public class WorkOrderController extends BaseController
{
startPage();
List<WorkOrder> list = workOrderService.selectWorkOrderList(workOrder);
return getDataTable(list);
}

View File

@@ -42,6 +42,8 @@ public class WorkOrder extends BaseEntity
/** 业务类型1免疫 2保健 3转群 4称重 5配种 6干奶 7淘汰 8消毒 9饲喂必填 */
@Excel(name = "业务类型1免疫 2保健 3转群 4称重 5配种 6干奶 7淘汰 8消毒 9饲喂必填")
private Integer bizType;
private String bizTypes;
private Integer [] bizTypeArray;
/** 简短任务标 */
@Excel(name = "简短任务标")
@@ -100,10 +102,14 @@ public class WorkOrder extends BaseEntity
/** 状态0待派工 1已派工 2执行中 3已完成 4已取消 5异常必填 */
@Excel(name = "状态0待派工 1已派工 2执行中 3已完成 4已取消 5异常必填")
private Integer status;
private String statuss;
private Integer [] statusArray;
/** 优先级1普通 2重要 3紧急必填 */
@Excel(name = "优先级1普通 2重要 3紧急必填")
private Integer priority;
private String prioritys;
private Integer [] priorityArray;
/** 派工人用户 */
@Excel(name = "派工人用户")
@@ -113,8 +119,8 @@ public class WorkOrder extends BaseEntity
private String issuer;
/** 派工时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "派工时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "派工时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date issueTime;
/** 接工人用户 */
@@ -125,13 +131,13 @@ public class WorkOrder extends BaseEntity
private String receiver;
/** 接工时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "接工时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "接工时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date receiveTime;
/** 实际完成时间,可空 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "实际完成时间,可空", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "实际完成时间,可空", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date finishTime;
/** 执行结果填报,可空 */

View File

@@ -43,9 +43,44 @@ public class WorkOrderServiceImpl implements IWorkOrderService
public List<WorkOrder> selectWorkOrderList(WorkOrder workOrder)
{
String username = SecurityUtils.getLoginUser().getUser().getNickName();
// 业务类型处理
if (workOrder.getBizTypes() != null && !workOrder.getBizTypes().isEmpty() &&
!workOrder.getBizTypes().equals("0")) {
String[] bizTypeStrs = workOrder.getBizTypes().split(",");
Integer[] bizTypes = new Integer[bizTypeStrs.length];
for (int i = 0; i < bizTypeStrs.length; i++) {
bizTypes[i] = Integer.parseInt(bizTypeStrs[i].trim());
}
workOrder.setBizTypeArray(bizTypes);
}
// 优先级处理
if (workOrder.getPrioritys() != null && !workOrder.getPrioritys().isEmpty() &&
!workOrder.getPrioritys().equals("0")) {
String[] priorityStrs = workOrder.getPrioritys().split(",");
Integer[] prioritys = new Integer[priorityStrs.length];
for (int i = 0; i < priorityStrs.length; i++) {
prioritys[i] = Integer.parseInt(priorityStrs[i].trim());
}
workOrder.setPriorityArray(prioritys);
}
// 状态处理
if (workOrder.getStatuss() != null && !workOrder.getStatuss().isEmpty() &&
!workOrder.getStatuss().equals("0")) {
String[] statusStrs = workOrder.getStatuss().split(",");
Integer[] statuss = new Integer[statusStrs.length];
for (int i = 0; i < statusStrs.length; i++) {
statuss[i] = Integer.parseInt(statusStrs[i].trim());
}
workOrder.setStatusArray(statuss);
}
return workOrderMapper.selectWorkOrderList(workOrder);
}
/**
* 新增派工单
*

View File

@@ -45,21 +45,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="orderNo != null and orderNo != ''"> and order_no like concat('%', #{orderNo}, '%')</if>
<if test="planId != null "> and plan_id = #{planId}</if>
<if test="bizType != null "> and biz_type = #{bizType}</if>
<!-- 业务类型批量查询 -->
<if test="bizTypeArray != null and bizTypesArray.length > 0">
and biz_type in
<foreach collection="bizTypeArray" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- 单个业务类型查询(保留原有逻辑) -->
<if test="bizType != null and bizTypeArray == null">
and biz_type = #{bizType}
</if>
<if test="title != null and title != ''"> and title like concat('%', #{title},'%')</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="department != null and department != ''"> and department = #{department}</if>
<if test="executor != null and executor != ''"> and executor like concat('%',#{executor},'%') </if>
<if test="beginPlanDate != null and endPlanDate != null ">
and execute_date between #{beginPlanDate} and #{endPlanDate}
</if>
and execute_date between #{beginPlanDate} and #{endPlanDate}
</if>
<if test="executeTime != null and executeTime != ''"> and execute_time = #{executeTime}</if>
<if test="sheepScope != null and sheepScope != ''"> and sheep_scope = #{sheepScope}</if>
<if test="location != null and location != ''"> and location = #{location}</if>
<if test="materialList != null and materialList != ''"> and material_list = #{materialList}</if>
<if test="toolList != null and toolList != ''"> and tool_list = #{toolList}</if>
<if test="status != null "> and status = #{status}</if>
<if test="priority != null "> and priority = #{priority}</if>
<!-- 状态批量查询 -->
<if test="statusArray != null and statusArray.length > 0">
and status in
<foreach collection="statusArray" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- 单个状态查询(保留原有逻辑) -->
<if test="status != null and statusArray == null">
and status = #{status}
</if>
<!-- 优先级批量查询 -->
<if test="priorityArray != null and priorityArray.length > 0">
and priority in
<foreach collection="priorityArray" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- 单个优先级查询(保留原有逻辑) -->
<if test="priority != null and priorityArray == null">
and priority = #{priority}
</if>
<if test="issuer != null "> and issuer like concat('%',#{issuer},'%') </if>
<if test="issueTime != null "> and issue_time = #{issueTime}</if>
<if test="receiverId != null "> and receiver_id = #{receiverId}</if>
@@ -67,13 +97,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="beginFinishDate != null and endFinishDate != null ">
and finish_time between #{beginFinishDate} and #{endFinishDate}
</if>
<if test="result != null and result != ''"> and result = #{result}</if>
</where>
order by execute_date desc
</select>
<select id="selectWorkOrderById" parameterType="Long" resultMap="WorkOrderResult">
<include refid="selectWorkOrderVo"/>
where id = #{id}