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.zcg.ZcgSearchForm;
import com.hxhq.business.service.*;
import com.hxhq.common.core.constant.CacheConstants;
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.domain.AjaxResult;
import com.hxhq.common.core.web.page.TableDataInfo;
import com.hxhq.common.redis.service.RedisService;
import com.hxhq.common.security.annotation.RequiresPermissions;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.weaver.loadtime.Aj;
import org.springframework.beans.factory.annotation.Autowired;
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.concurrent.TimeUnit;
/**
@ -32,8 +39,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("/business/public")
public class PublicController extends BaseController
{
public class PublicController extends BaseController {
@Autowired
private ITemplateService templateService;
@Autowired
@ -46,14 +52,45 @@ public class PublicController extends BaseController
private IAnimalSpeciesService animalSpeciesService;
@Autowired
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
*/
@GetMapping("/roomList")
public AjaxResult getRoomList(String syqy) {
if(StringUtils.isNotEmpty(syqy)) {
if (StringUtils.isNotEmpty(syqy)) {
LambdaQueryWrapper<Room> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Room::getSyqy, syqy);
List<Room> list = roomService.list(queryWrapper);
@ -66,11 +103,12 @@ public class PublicController extends BaseController
/**
* 动物种属-笼具列表
*
* @return
*/
@GetMapping("/animalSpeciesList")
public AjaxResult getAnimalSpeciesList(String animalSpecies) {
if(StringUtils.isNotEmpty(animalSpecies)) {
if (StringUtils.isNotEmpty(animalSpecies)) {
LambdaQueryWrapper<AnimalSpecies> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AnimalSpecies::getAnimalSpecies, animalSpecies);
List<AnimalSpecies> list = animalSpeciesService.list(queryWrapper);
@ -86,8 +124,7 @@ public class PublicController extends BaseController
* 查询模板列表
*/
@GetMapping("/templateList")
public TableDataInfo list(Template template)
{
public TableDataInfo list(Template template) {
startPage();
List<Template> list = templateService.queryList(template);
return getDataTable(list);
@ -97,20 +134,19 @@ public class PublicController extends BaseController
* 查询试验列表
*/
@GetMapping("/studyList")
public TableDataInfo studyList(Study study)
{
public TableDataInfo studyList(Study study) {
startPage();
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());
}
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());
}
List<Study> list = studyService.list(queryWrapper);
@ -122,10 +158,9 @@ public class PublicController extends BaseController
* 查询试验预填表单列表
*/
@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));
}
@ -134,8 +169,7 @@ public class PublicController extends BaseController
* 查询暂存柜列表
*/
@GetMapping("/zcgList")
public AjaxResult zcgList(ZcgSearchForm form)
{
public AjaxResult zcgList(ZcgSearchForm 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")
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)
private String qmyy;
@ -90,6 +103,30 @@ public class StudyFormFill extends MpBaseEntity
@TableField(exist = false)
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() {
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:已归还*/
private Integer syghzt;
/** 来源:1:资源库;3:产生*/
private Integer ly;
public Integer getLy() {
return ly;
}
public void setLy(Integer ly) {
this.ly = ly;
}
public Integer getSyghzt() {
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:已归还*/
private Integer syghzt;
/** 来源:1:资源库;3:产生*/
private Integer ly;
public Integer getLy() {
return ly;
}
public void setLy(Integer ly) {
this.ly = ly;
}
public Integer getSyghzt() {
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());
this.updateById(studyFormFillOld);
// todo 处置存放用量
List<ObjectCompareUtil.FieldChange> fieldChanges = ObjectCompareUtil.compareObjects(studyFormFillOld, studyFormFill);
if (fieldChanges.size() > 0) {
//稽查轨迹

Loading…
Cancel
Save