Browse Source

feat:[试验管理][填报表单]填报

master
15881625488@163.com 2 days ago
parent
commit
b4ed03d469
5 changed files with 114 additions and 20 deletions
  1. +54
    -20
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java
  2. +37
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormFill.java
  3. +11
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyGyzj.java
  4. +11
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyMjy.java
  5. +1
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormFillServiceImpl.java

+ 54
- 20
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java View File

@ -11,17 +11,24 @@ import com.hxhq.business.form.study.StudyFormPreSearchForm;
import com.hxhq.business.form.study.StudySearchForm; import com.hxhq.business.form.study.StudySearchForm;
import com.hxhq.business.form.zcg.ZcgSearchForm; import com.hxhq.business.form.zcg.ZcgSearchForm;
import com.hxhq.business.service.*; import com.hxhq.business.service.*;
import com.hxhq.common.core.constant.CacheConstants;
import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.exception.ServiceException;
import com.hxhq.common.core.utils.DateUtils;
import com.hxhq.common.core.web.controller.BaseController; import com.hxhq.common.core.web.controller.BaseController;
import com.hxhq.common.core.web.domain.AjaxResult; import com.hxhq.common.core.web.domain.AjaxResult;
import com.hxhq.common.core.web.page.TableDataInfo; import com.hxhq.common.core.web.page.TableDataInfo;
import com.hxhq.common.redis.service.RedisService;
import com.hxhq.common.security.annotation.RequiresPermissions; import com.hxhq.common.security.annotation.RequiresPermissions;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.aspectj.weaver.loadtime.Aj; import org.aspectj.weaver.loadtime.Aj;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit;
/** /**
@ -32,8 +39,7 @@ import java.util.List;
*/ */
@RestController @RestController
@RequestMapping("/business/public") @RequestMapping("/business/public")
public class PublicController extends BaseController
{
public class PublicController extends BaseController {
@Autowired @Autowired
private ITemplateService templateService; private ITemplateService templateService;
@Autowired @Autowired
@ -46,14 +52,45 @@ public class PublicController extends BaseController
private IAnimalSpeciesService animalSpeciesService; private IAnimalSpeciesService animalSpeciesService;
@Autowired @Autowired
private IZcgService zcgService; private IZcgService zcgService;
@Autowired
private RedisService redisService;
/**
* 获取编号
*
* @return
*/
@GetMapping("/getSn")
public AjaxResult getSn(Integer count) {
if (count == null || count.intValue() <= 0) {
return AjaxResult.error("参数错误");
}
Integer start = 1;
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
String today = sdf.format(new Date());
//获取当前最大编号
String maxNum = redisService.getCacheObject(today);
if (StringUtils.isNoneBlank(maxNum)) {
start = Integer.parseInt(maxNum)+1;
}
HashMap<String, Object> map = new HashMap<String, Object>(count);
for (int i = 0; i < count;i++){
map.put("sn"+i,today+String.format("%04d", start));
start++;
}
//更新当前最大编号
redisService.setCacheObject(today,start,60*60*24L, TimeUnit.SECONDS);
return AjaxResult.success(map);
}
/** /**
* 试验区域-饲养间列表 * 试验区域-饲养间列表
*
* @return * @return
*/ */
@GetMapping("/roomList") @GetMapping("/roomList")
public AjaxResult getRoomList(String syqy) { public AjaxResult getRoomList(String syqy) {
if(StringUtils.isNotEmpty(syqy)) {
if (StringUtils.isNotEmpty(syqy)) {
LambdaQueryWrapper<Room> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Room> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Room::getSyqy, syqy); queryWrapper.eq(Room::getSyqy, syqy);
List<Room> list = roomService.list(queryWrapper); List<Room> list = roomService.list(queryWrapper);
@ -66,11 +103,12 @@ public class PublicController extends BaseController
/** /**
* 动物种属-笼具列表 * 动物种属-笼具列表
*
* @return * @return
*/ */
@GetMapping("/animalSpeciesList") @GetMapping("/animalSpeciesList")
public AjaxResult getAnimalSpeciesList(String animalSpecies) { public AjaxResult getAnimalSpeciesList(String animalSpecies) {
if(StringUtils.isNotEmpty(animalSpecies)) {
if (StringUtils.isNotEmpty(animalSpecies)) {
LambdaQueryWrapper<AnimalSpecies> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<AnimalSpecies> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AnimalSpecies::getAnimalSpecies, animalSpecies); queryWrapper.eq(AnimalSpecies::getAnimalSpecies, animalSpecies);
List<AnimalSpecies> list = animalSpeciesService.list(queryWrapper); List<AnimalSpecies> list = animalSpeciesService.list(queryWrapper);
@ -86,8 +124,7 @@ public class PublicController extends BaseController
* 查询模板列表 * 查询模板列表
*/ */
@GetMapping("/templateList") @GetMapping("/templateList")
public TableDataInfo list(Template template)
{
public TableDataInfo list(Template template) {
startPage(); startPage();
List<Template> list = templateService.queryList(template); List<Template> list = templateService.queryList(template);
return getDataTable(list); return getDataTable(list);
@ -97,20 +134,19 @@ public class PublicController extends BaseController
* 查询试验列表 * 查询试验列表
*/ */
@GetMapping("/studyList") @GetMapping("/studyList")
public TableDataInfo studyList(Study study)
{
public TableDataInfo studyList(Study study) {
startPage(); startPage();
QueryWrapper<Study> queryWrapper = Wrappers.query(); QueryWrapper<Study> queryWrapper = Wrappers.query();
if(study.getStatus()!=null&&study.getStatus().intValue()>0){
if (study.getStatus() != null && study.getStatus().intValue() > 0) {
queryWrapper.eq("status", study.getStatus()); queryWrapper.eq("status", study.getStatus());
} }
if(com.hxhq.common.core.utils.StringUtils.isNoneBlank(study.getName())){
queryWrapper.like("s.name",study.getName());
if (com.hxhq.common.core.utils.StringUtils.isNoneBlank(study.getName())) {
queryWrapper.like("s.name", study.getName());
} }
if(com.hxhq.common.core.utils.StringUtils.isNoneBlank(study.getSn())){
queryWrapper.like("s.sn",study.getSn());
if (com.hxhq.common.core.utils.StringUtils.isNoneBlank(study.getSn())) {
queryWrapper.like("s.sn", study.getSn());
} }
if(study.getLeader()!=null&&study.getLeader().longValue()>0){
if (study.getLeader() != null && study.getLeader().longValue() > 0) {
queryWrapper.eq("leader", study.getLeader()); queryWrapper.eq("leader", study.getLeader());
} }
List<Study> list = studyService.list(queryWrapper); List<Study> list = studyService.list(queryWrapper);
@ -122,10 +158,9 @@ public class PublicController extends BaseController
* 查询试验预填表单列表 * 查询试验预填表单列表
*/ */
@GetMapping("/studyFormPreList") @GetMapping("/studyFormPreList")
public AjaxResult studyFormPreList(StudyFormPreSearchForm form)
{
if(form.getStudyId()==null||form.getStudyId().longValue()<0){
throw new ServiceException("试验id不能为空");
public AjaxResult studyFormPreList(StudyFormPreSearchForm form) {
if (form.getStudyId() == null || form.getStudyId().longValue() < 0) {
throw new ServiceException("试验id不能为空");
} }
return AjaxResult.success(studyFormPreService.queryList(form)); return AjaxResult.success(studyFormPreService.queryList(form));
} }
@ -134,8 +169,7 @@ public class PublicController extends BaseController
* 查询暂存柜列表 * 查询暂存柜列表
*/ */
@GetMapping("/zcgList") @GetMapping("/zcgList")
public AjaxResult zcgList(ZcgSearchForm form)
{
public AjaxResult zcgList(ZcgSearchForm form) {
return AjaxResult.success(zcgService.queryList(form)); return AjaxResult.success(zcgService.queryList(form));
} }
} }

+ 37
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormFill.java View File

@ -61,6 +61,19 @@ public class StudyFormFill extends MpBaseEntity
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date tjsj; private Date tjsj;
/** 用量信息 */
private String ylxx;
/** 填报开始时间 */
@Excel(name = "填报开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date tbkssj;
/** 填报结束时间 */
@Excel(name = "填报结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date tbjssj;
/** 签名意义 */ /** 签名意义 */
@TableField(exist = false) @TableField(exist = false)
private String qmyy; private String qmyy;
@ -90,6 +103,30 @@ public class StudyFormFill extends MpBaseEntity
@TableField(exist = false) @TableField(exist = false)
private String studyMc; private String studyMc;
public String getYlxx() {
return ylxx;
}
public void setYlxx(String ylxx) {
this.ylxx = ylxx;
}
public Date getTbkssj() {
return tbkssj;
}
public void setTbkssj(Date tbkssj) {
this.tbkssj = tbkssj;
}
public Date getTbjssj() {
return tbjssj;
}
public void setTbjssj(Date tbjssj) {
this.tbjssj = tbjssj;
}
public String getStudySn() { public String getStudySn() {
return studySn; return studySn;
} }

+ 11
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyGyzj.java View File

@ -24,6 +24,17 @@ public class StudyGyzj extends MpBaseEntity
/** 试验归还状态:1:未归还;10:已归还*/ /** 试验归还状态:1:未归还;10:已归还*/
private Integer syghzt; private Integer syghzt;
/** 来源:1:资源库;3:产生*/
private Integer ly;
public Integer getLy() {
return ly;
}
public void setLy(Integer ly) {
this.ly = ly;
}
public Integer getSyghzt() { public Integer getSyghzt() {
return syghzt; return syghzt;
} }

+ 11
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyMjy.java View File

@ -24,6 +24,17 @@ public class StudyMjy extends MpBaseEntity
/** 试验归还状态:1:未归还;10:已归还*/ /** 试验归还状态:1:未归还;10:已归还*/
private Integer syghzt; private Integer syghzt;
/** 来源:1:资源库;3:产生*/
private Integer ly;
public Integer getLy() {
return ly;
}
public void setLy(Integer ly) {
this.ly = ly;
}
public Integer getSyghzt() { public Integer getSyghzt() {
return syghzt; return syghzt;
} }

+ 1
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormFillServiceImpl.java View File

@ -331,6 +331,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl
studyFormFillOld.setBdzt(StudyFormFillBdztEnum.ytj.getValue()); studyFormFillOld.setBdzt(StudyFormFillBdztEnum.ytj.getValue());
this.updateById(studyFormFillOld); this.updateById(studyFormFillOld);
// todo 处置存放用量 // todo 处置存放用量
List<ObjectCompareUtil.FieldChange> fieldChanges = ObjectCompareUtil.compareObjects(studyFormFillOld, studyFormFill); List<ObjectCompareUtil.FieldChange> fieldChanges = ObjectCompareUtil.compareObjects(studyFormFillOld, studyFormFill);
if (fieldChanges.size() > 0) { if (fieldChanges.size() > 0) {
//稽查轨迹 //稽查轨迹

Loading…
Cancel
Save