Commit 1cd3c583 authored by 何龙龙's avatar 何龙龙

服务分配页面第三次提交 修改完善分配提交

parent f888d1fa
......@@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* CH_SRV_SEND
......@@ -17,6 +19,7 @@ import java.util.Date;
@Data
//@KeySequence("CH_SRV_SEND_SQE")
public class ChSrvSend implements Serializable {
/**
* 服务分配ID
*/
......@@ -41,6 +44,7 @@ public class ChSrvSend implements Serializable {
/**
* 分配时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date allotTime;
/**
......@@ -51,6 +55,7 @@ public class ChSrvSend implements Serializable {
/**
* 创建时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date effTime;
/**
......@@ -61,11 +66,13 @@ public class ChSrvSend implements Serializable {
/**
* 终止时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endTime;
/**
* 首次操作时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date fcd;
/**
......@@ -76,6 +83,7 @@ public class ChSrvSend implements Serializable {
/**
* 末次操作时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date lcd;
/**
......@@ -91,6 +99,7 @@ public class ChSrvSend implements Serializable {
/**
* 服务分配终止时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date stopTime;
/**
......
package com.hungraim.ltc.governance.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -17,6 +18,7 @@ import com.hungraim.ltc.pojo.vo.governance.DisableInfoVo;
import com.hungraim.ltc.pojo.vo.governance.SrvSendVO;
import com.hungraim.ltc.util.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -134,14 +136,14 @@ public class BuildBedController {
* 提交分配机构
*/
@PostMapping("/submit")
public Result submit(@RequestBody ChrSrvVo chrSrvVo) {
public Result submit(ChrSrvVo chrSrvVo) {
List<ChSrvSend> chSrvSends = chrSrvVo.getChSrvSends();
if (chSrvSends != null && chSrvSends.size() > 0) {
Long disabInfoId = null;
for (ChSrvSend chSrvSend : chSrvSends) {
disabInfoId = chSrvSend.getDisabInfoId();
// 判斷參數是否存在
if (StrUtil.isBlankIfStr(chSrvSend.getDisabInfoId()) || StrUtil.isBlankIfStr(chSrvSend.getSrvOrganId()) || StrUtil.isBlankIfStr(chSrvSend.getSrvModeId())) {
if (chSrvSend.getDisabInfoId()==null || chSrvSend.getSrvOrganId()==null || chSrvSend.getSrvModeId()==null) {
return Result.failed("参数不全!");
}
chSrvSend.setAllotTime(new Date());
......@@ -162,5 +164,6 @@ public class BuildBedController {
}
}
......@@ -21,4 +21,5 @@ public interface SrvSendService extends IService<ChSrvSend> {
List<DisableInfoTaskVO> selectBydisableInfoId(Integer disableInfoId);
Long selectMaxId();
}
......@@ -16,6 +16,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.stream.Collectors;
@Service
......@@ -30,12 +31,12 @@ public class SrvSendServiceImpl extends ServiceImpl<SrvSendMapper, ChSrvSend> im
Integer current = disableInfo.getCurrent();
Integer limit = disableInfo.getLimit();
if (current == null || current < 1) {
current =1;
current = 1;
}
if (limit == null || limit < 1) {
limit =1 ;
limit = 1;
}
Page<SrvSendVO> page = new Page<>(current,limit);
Page<SrvSendVO> page = new Page<>(current, limit);
return sendMapper.selectSendList(page, disableInfo, chSrvOrgan, chSrvSend);
}
......@@ -60,4 +61,5 @@ public class SrvSendServiceImpl extends ServiceImpl<SrvSendMapper, ChSrvSend> im
return this.baseMapper.selectMaxId();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment