Browse Source

feat(交付物插件): 交付物插件相关接口添加initialDution,duration,checkDuration

master
zhangsan 3 years ago
parent
commit
0d35d97ab1
  1. 0
      1
  2. 4
      pom.xml
  3. 67
      ptos_serv_ccsens.http
  4. 5
      ptos_serv_ccsens.json
  5. 2
      src/main/java/com/ccsens/ptccsens/api/DebugController.java
  6. 2
      src/main/java/com/ccsens/ptccsens/api/DeliverController.java
  7. 4
      src/main/java/com/ccsens/ptccsens/bean/dto/DeliverDto.java
  8. 11
      src/main/java/com/ccsens/ptccsens/bean/po/PluDeliver.java
  9. 60
      src/main/java/com/ccsens/ptccsens/bean/po/PluDeliverExample.java
  10. 11
      src/main/java/com/ccsens/ptccsens/bean/po/PluDeliverRecord.java
  11. 11
      src/main/java/com/ccsens/ptccsens/bean/po/PluDeliverRecordCheckLog.java
  12. 60
      src/main/java/com/ccsens/ptccsens/bean/po/PluDeliverRecordCheckLogExample.java
  13. 60
      src/main/java/com/ccsens/ptccsens/bean/po/PluDeliverRecordExample.java
  14. 12
      src/main/java/com/ccsens/ptccsens/bean/vo/DeliverVo.java
  15. 3
      src/main/java/com/ccsens/ptccsens/service/DeliverService.java
  16. 21
      src/main/resources/mapper_dao/PluDeliverDao.xml
  17. 28
      src/main/resources/mapper_raw/PluDeliverMapper.xml
  18. 27
      src/main/resources/mapper_raw/PluDeliverRecordCheckLogMapper.xml
  19. 28
      src/main/resources/mapper_raw/PluDeliverRecordMapper.xml
  20. 8
      src/main/resources/mbg.xml
  21. 59
      src/test/java/com/ccsens/ptccsens/api/DebugControllerTest.java
  22. 80
      src/test/java/com/ccsens/ptccsens/api/DeliverControllerTest.java

4
pom.xml

@ -21,9 +21,9 @@
</parent>
<dependencies>
<!--TALL_SDK-->
<!--PTOS_SDK-->
<dependency>
<artifactId>tallsdk</artifactId>
<artifactId>ptos_sdk</artifactId>
<groupId>com.ccsensptos</groupId>
<version>0.0.1-SNAPSHOT</version>
</dependency>

67
ptos_serv_ccsens.http

@ -0,0 +1,67 @@
###
### login
# @name login
# POST http://localhost:7290/users/signin
POST http://101.201.226.163/gateway/ptostall/users/signin
{{type}}
Authorization: Bearer {{login.response.body.$.data.token}}
deviceId: 66666
{
"client": 0,
"type": 3,
"data": {
"identifier": "zy",
"credential": "123456"
}
}
<> 2022-04-27T141611.200.json
<> 2022-04-27T141601.200.json
###
GET http://localhost:7320/v1.0/debug
Accept: application/json;charset=UTF-8
###
POST http://localhost:7320/v1.0/deliver/queryChecker
Accept: application/json;charset=UTF-8
Cache-Control: no-cache
Content-Type: application/json
{
"param": {
"projectId": 1
}
}
###
POST http://localhost:7320/v1.0/deliver/saveDeliver
Accept: application/json;charset=UTF-8
Cache-Control: no-cache
Content-Type: application/json
{
"param": {
"projectId": 1,
"taskId": 1,
"deliverName": "测试i交付物"
}
}
### 查看交付物提交记录
POST http://localhost:7320/v1.0/deliver/queryCheckLog
{{type}}
Authorization: Bearer {{login.response.body.$.data.token}}
{
"param":{
"deliverRecordId": "1506479764368793600"
}
}

5
ptos_serv_ccsens.json

@ -0,0 +1,5 @@
{
"dev": {
"name": "value"
}
}

2
src/main/java/com/ccsens/ptccsens/api/DebugController.java

@ -66,9 +66,9 @@ public class DebugController {
// });
// }
//
// });
// }
return JsonResponse.newInstance().ok("测试");
}
}

2
src/main/java/com/ccsens/ptccsens/api/DeliverController.java

@ -1,6 +1,5 @@
package com.ccsens.ptccsens.api;
import com.ccsens.ptccsens.annotation.MustLogin;
import com.ccsens.ptccsens.bean.dto.DeliverDto;
import com.ccsens.ptccsens.bean.vo.DeliverVo;
@ -20,7 +19,6 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* @author AUSU
*/

4
src/main/java/com/ccsens/ptccsens/bean/dto/DeliverDto.java

@ -77,6 +77,8 @@ public class DeliverDto {
private List<Long> checkerList;
@ApiModelProperty("消息id")
private String msgId;
@ApiModelProperty("工作量时长")
private Long duration;
}
@Data
@ -94,6 +96,8 @@ public class DeliverDto {
private String remark;
@ApiModelProperty("分数")
private BigDecimal score;
@ApiModelProperty("检查人认为的工作量时长")
private Long checkDuration;
@ApiModelProperty("消息id")
private String msgId;
}

11
src/main/java/com/ccsens/ptccsens/bean/po/PluDeliver.java

@ -12,6 +12,8 @@ public class PluDeliver implements Serializable {
private String description;
private Long initialDuration;
private Long operator;
private Date createdAt;
@ -54,6 +56,14 @@ public class PluDeliver implements Serializable {
this.description = description == null ? null : description.trim();
}
public Long getInitialDuration() {
return initialDuration;
}
public void setInitialDuration(Long initialDuration) {
this.initialDuration = initialDuration;
}
public Long getOperator() {
return operator;
}
@ -96,6 +106,7 @@ public class PluDeliver implements Serializable {
sb.append(", taskSubId=").append(taskSubId);
sb.append(", name=").append(name);
sb.append(", description=").append(description);
sb.append(", initialDuration=").append(initialDuration);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);

60
src/main/java/com/ccsens/ptccsens/bean/po/PluDeliverExample.java

@ -365,6 +365,66 @@ public class PluDeliverExample {
return (Criteria) this;
}
public Criteria andInitialDurationIsNull() {
addCriterion("initial_duration is null");
return (Criteria) this;
}
public Criteria andInitialDurationIsNotNull() {
addCriterion("initial_duration is not null");
return (Criteria) this;
}
public Criteria andInitialDurationEqualTo(Long value) {
addCriterion("initial_duration =", value, "initialDuration");
return (Criteria) this;
}
public Criteria andInitialDurationNotEqualTo(Long value) {
addCriterion("initial_duration <>", value, "initialDuration");
return (Criteria) this;
}
public Criteria andInitialDurationGreaterThan(Long value) {
addCriterion("initial_duration >", value, "initialDuration");
return (Criteria) this;
}
public Criteria andInitialDurationGreaterThanOrEqualTo(Long value) {
addCriterion("initial_duration >=", value, "initialDuration");
return (Criteria) this;
}
public Criteria andInitialDurationLessThan(Long value) {
addCriterion("initial_duration <", value, "initialDuration");
return (Criteria) this;
}
public Criteria andInitialDurationLessThanOrEqualTo(Long value) {
addCriterion("initial_duration <=", value, "initialDuration");
return (Criteria) this;
}
public Criteria andInitialDurationIn(List<Long> values) {
addCriterion("initial_duration in", values, "initialDuration");
return (Criteria) this;
}
public Criteria andInitialDurationNotIn(List<Long> values) {
addCriterion("initial_duration not in", values, "initialDuration");
return (Criteria) this;
}
public Criteria andInitialDurationBetween(Long value1, Long value2) {
addCriterion("initial_duration between", value1, value2, "initialDuration");
return (Criteria) this;
}
public Criteria andInitialDurationNotBetween(Long value1, Long value2) {
addCriterion("initial_duration not between", value1, value2, "initialDuration");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;

11
src/main/java/com/ccsens/ptccsens/bean/po/PluDeliverRecord.java

@ -12,6 +12,8 @@ public class PluDeliverRecord implements Serializable {
private Long memberId;
private Long duration;
private Long operator;
private Date createdAt;
@ -54,6 +56,14 @@ public class PluDeliverRecord implements Serializable {
this.memberId = memberId;
}
public Long getDuration() {
return duration;
}
public void setDuration(Long duration) {
this.duration = duration;
}
public Long getOperator() {
return operator;
}
@ -96,6 +106,7 @@ public class PluDeliverRecord implements Serializable {
sb.append(", deliverId=").append(deliverId);
sb.append(", submitTime=").append(submitTime);
sb.append(", memberId=").append(memberId);
sb.append(", duration=").append(duration);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);

11
src/main/java/com/ccsens/ptccsens/bean/po/PluDeliverRecordCheckLog.java

@ -17,6 +17,8 @@ public class PluDeliverRecordCheckLog implements Serializable {
private Long time;
private Long checkDuration;
private Long operator;
private Date createdAt;
@ -75,6 +77,14 @@ public class PluDeliverRecordCheckLog implements Serializable {
this.time = time;
}
public Long getCheckDuration() {
return checkDuration;
}
public void setCheckDuration(Long checkDuration) {
this.checkDuration = checkDuration;
}
public Long getOperator() {
return operator;
}
@ -119,6 +129,7 @@ public class PluDeliverRecordCheckLog implements Serializable {
sb.append(", remark=").append(remark);
sb.append(", checkStatus=").append(checkStatus);
sb.append(", time=").append(time);
sb.append(", checkDuration=").append(checkDuration);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);

60
src/main/java/com/ccsens/ptccsens/bean/po/PluDeliverRecordCheckLogExample.java

@ -476,6 +476,66 @@ public class PluDeliverRecordCheckLogExample {
return (Criteria) this;
}
public Criteria andCheckDurationIsNull() {
addCriterion("check_duration is null");
return (Criteria) this;
}
public Criteria andCheckDurationIsNotNull() {
addCriterion("check_duration is not null");
return (Criteria) this;
}
public Criteria andCheckDurationEqualTo(Long value) {
addCriterion("check_duration =", value, "checkDuration");
return (Criteria) this;
}
public Criteria andCheckDurationNotEqualTo(Long value) {
addCriterion("check_duration <>", value, "checkDuration");
return (Criteria) this;
}
public Criteria andCheckDurationGreaterThan(Long value) {
addCriterion("check_duration >", value, "checkDuration");
return (Criteria) this;
}
public Criteria andCheckDurationGreaterThanOrEqualTo(Long value) {
addCriterion("check_duration >=", value, "checkDuration");
return (Criteria) this;
}
public Criteria andCheckDurationLessThan(Long value) {
addCriterion("check_duration <", value, "checkDuration");
return (Criteria) this;
}
public Criteria andCheckDurationLessThanOrEqualTo(Long value) {
addCriterion("check_duration <=", value, "checkDuration");
return (Criteria) this;
}
public Criteria andCheckDurationIn(List<Long> values) {
addCriterion("check_duration in", values, "checkDuration");
return (Criteria) this;
}
public Criteria andCheckDurationNotIn(List<Long> values) {
addCriterion("check_duration not in", values, "checkDuration");
return (Criteria) this;
}
public Criteria andCheckDurationBetween(Long value1, Long value2) {
addCriterion("check_duration between", value1, value2, "checkDuration");
return (Criteria) this;
}
public Criteria andCheckDurationNotBetween(Long value1, Long value2) {
addCriterion("check_duration not between", value1, value2, "checkDuration");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;

60
src/main/java/com/ccsens/ptccsens/bean/po/PluDeliverRecordExample.java

@ -345,6 +345,66 @@ public class PluDeliverRecordExample {
return (Criteria) this;
}
public Criteria andDurationIsNull() {
addCriterion("duration is null");
return (Criteria) this;
}
public Criteria andDurationIsNotNull() {
addCriterion("duration is not null");
return (Criteria) this;
}
public Criteria andDurationEqualTo(Long value) {
addCriterion("duration =", value, "duration");
return (Criteria) this;
}
public Criteria andDurationNotEqualTo(Long value) {
addCriterion("duration <>", value, "duration");
return (Criteria) this;
}
public Criteria andDurationGreaterThan(Long value) {
addCriterion("duration >", value, "duration");
return (Criteria) this;
}
public Criteria andDurationGreaterThanOrEqualTo(Long value) {
addCriterion("duration >=", value, "duration");
return (Criteria) this;
}
public Criteria andDurationLessThan(Long value) {
addCriterion("duration <", value, "duration");
return (Criteria) this;
}
public Criteria andDurationLessThanOrEqualTo(Long value) {
addCriterion("duration <=", value, "duration");
return (Criteria) this;
}
public Criteria andDurationIn(List<Long> values) {
addCriterion("duration in", values, "duration");
return (Criteria) this;
}
public Criteria andDurationNotIn(List<Long> values) {
addCriterion("duration not in", values, "duration");
return (Criteria) this;
}
public Criteria andDurationBetween(Long value1, Long value2) {
addCriterion("duration between", value1, value2, "duration");
return (Criteria) this;
}
public Criteria andDurationNotBetween(Long value1, Long value2) {
addCriterion("duration not between", value1, value2, "duration");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;

12
src/main/java/com/ccsens/ptccsens/bean/vo/DeliverVo.java

@ -20,6 +20,9 @@ public class DeliverVo {
private String deliverId;
@ApiModelProperty("交付物名字")
private String deliverName;
@ApiModelProperty("交付物默认时长(ms)")
private Long initialDuration;
@ApiModelProperty("交付物提交记录id")
private String deliverRecordId;
@ApiModelProperty("文件路径")
@ -32,6 +35,9 @@ public class DeliverVo {
private String submitMemberName;
@ApiModelProperty("检查人列表")
private List<CheckerInfo> checkerList;
@ApiModelProperty("任务执行人选择的交付物时长(ms)")
private Long duration;
}
@Data
@ -53,6 +59,8 @@ public class DeliverVo {
private Byte isMine;
@ApiModelProperty("检查时间")
private Long checkTime;
@ApiModelProperty("检查人认为时长(ms)")
private Long checkDuration;
}
@Data
@ -62,6 +70,8 @@ public class DeliverVo {
private Long deliverId;
@ApiModelProperty("交付物名字")
private String deliverName;
@ApiModelProperty("默认工作量时长(ms)")
private Long initialDuration;
@ApiModelProperty("交付物提交id")
private List<DeliverRecord> deliverRecordList;
}
@ -74,6 +84,8 @@ public class DeliverVo {
private List<String> details;
@ApiModelProperty("提交时间")
private Long submitTime;
@ApiModelProperty("任务执行者选择的工作量时长(ms)")
private Long duration;
@ApiModelProperty("检查人列表")
private List<CheckerInfo> checkerList;
}

3
src/main/java/com/ccsens/ptccsens/service/DeliverService.java

@ -120,6 +120,8 @@ public class DeliverService implements IDeliverService {
deliverRecord.setDeliverId(pluDeliver.getId());
deliverRecord.setMemberId(memberIdByUserId);
deliverRecord.setSubmitTime(System.currentTimeMillis());
////添加duration字段
deliverRecord.setDuration(param.getDuration());
deliverRecordMapper.insertSelective(deliverRecord);
//添加提交的文件信息
if(CollectionUtil.isNotEmpty(param.getFileList())){
@ -197,6 +199,7 @@ public class DeliverService implements IDeliverService {
checkLog.setCheckStatus(param.getType());
checkLog.setRemark(param.getRemark());
checkLog.setScore(param.getScore());
checkLog.setCheckDuration(param.getCheckDuration());
checkLog.setTime(System.currentTimeMillis());
checkLogMapper.insertSelective(checkLog);
//----------------消息------------------------

21
src/main/resources/mapper_dao/PluDeliverDao.xml

@ -9,6 +9,8 @@
<result column="submitTime" property="submitTime"/>
<result column="submitMemberId" property="submitMemberId"/>
<result column="submitMemberName" property="submitMemberName"/>
<result column="initialDuration" property="initialDuration"/>
<result column="duration" property="duration"/>
<collection property="details" ofType="String">
<result column="details"/>
</collection>
@ -21,6 +23,7 @@
<result column="remark" property="remark"/>
<result column="isMine" property="isMine"/>
<result column="checkTime" property="checkTime"/>
<result column="checkDuration" property="checkDuration"/>
</collection>
</resultMap>
<insert id="insertSelectiveList">
@ -103,9 +106,11 @@
SELECT
d.id as deliverId,
d.`name` as deliverName,
d.initial_duration as initialDuration,
dr.id as deliverRecordId,
dr.submit_time as submitTime,
dr.member_id as submitMemberId,
dr.duration as duration,
m.`name` as submitMemberName
FROM
t_plu_deliver d
@ -136,7 +141,8 @@
cl.check_status as `status`,
cl.remark,
cl.score,
cl.time as checkTime
cl.time as checkTime,
cl.check_duration as checkDuration
FROM
t_plu_deliver_record_check c
LEFT JOIN t_plu_deliver_record_check_log cl on c.id = cl.record_check_id and cl.rec_status = 0
@ -152,9 +158,11 @@
<resultMap id="deliverRecord" type="com.ccsens.ptccsens.bean.vo.DeliverVo$QueryDeliverRecord">
<result column="deliverId" property="deliverId"/>
<result column="deliverName" property="deliverName"/>
<result column="initialDuration" property="initialDuration"/>
<collection property="deliverRecordList" ofType="com.ccsens.ptccsens.bean.vo.DeliverVo$DeliverRecord">
<id column="deliverRecordId" property="deliverRecordId"/>
<result column="submitTime" property="submitTime"/>
<result column="duration" property="duration"/>
<collection property="details" ofType="String">
<result column="details"/>
</collection>
@ -167,6 +175,7 @@
<result column="remark" property="remark"/>
<result column="isMine" property="isMine"/>
<result column="checkTime" property="checkTime"/>
<result column="checkDuration" property="checkDuration"/>
</collection>
</collection>
</resultMap>
@ -182,8 +191,10 @@
SELECT
d.id as deliverId,
d.`name` as deliverName,
d.initial_duration as initialDuration,
dr.id as deliverRecordId,
dr.submit_time as submitTime
dr.submit_time as submitTime,
dr.duration as duration
FROM
t_plu_deliver d
LEFT JOIN t_plu_deliver_record dr on d.id = dr.deliver_id and dr.rec_status = 0
@ -211,7 +222,8 @@
cl.check_status as `status`,
cl.remark,
cl.score,
cl.time as checkTime
cl.time as checkTime,
cl.check_duration as checkDuration
FROM
t_plu_deliver_record_check c
LEFT JOIN t_plu_deliver_record_check_log cl on c.id = cl.record_check_id and cl.rec_status = 0
@ -233,7 +245,8 @@
cl.check_status as `status`,
cl.remark,
cl.score,
cl.time as checkTime
cl.time as checkTime,
cl.check_duration as checkDuration
FROM
t_plu_deliver_record_check_log cl
LEFT JOIN t_plu_deliver_record_check c on c.id = cl.record_check_id and c.rec_status = 0

28
src/main/resources/mapper_raw/PluDeliverMapper.xml

@ -6,6 +6,7 @@
<result column="task_sub_id" jdbcType="BIGINT" property="taskSubId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="initial_duration" jdbcType="BIGINT" property="initialDuration" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
@ -70,7 +71,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, task_sub_id, name, description, operator, created_at, updated_at, rec_status
id, task_sub_id, name, description, initial_duration, operator, created_at, updated_at,
rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.ptccsens.bean.po.PluDeliverExample" resultMap="BaseResultMap">
select
@ -104,11 +106,13 @@
</delete>
<insert id="insert" parameterType="com.ccsens.ptccsens.bean.po.PluDeliver">
insert into t_plu_deliver (id, task_sub_id, name,
description, operator, created_at,
updated_at, rec_status)
description, initial_duration, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{taskSubId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
#{description,jdbcType=VARCHAR}, #{initialDuration,jdbcType=BIGINT}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ptccsens.bean.po.PluDeliver">
insert into t_plu_deliver
@ -125,6 +129,9 @@
<if test="description != null">
description,
</if>
<if test="initialDuration != null">
initial_duration,
</if>
<if test="operator != null">
operator,
</if>
@ -151,6 +158,9 @@
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="initialDuration != null">
#{initialDuration,jdbcType=BIGINT},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
@ -186,6 +196,9 @@
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.initialDuration != null">
initial_duration = #{record.initialDuration,jdbcType=BIGINT},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
@ -209,6 +222,7 @@
task_sub_id = #{record.taskSubId,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
initial_duration = #{record.initialDuration,jdbcType=BIGINT},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
@ -229,6 +243,9 @@
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="initialDuration != null">
initial_duration = #{initialDuration,jdbcType=BIGINT},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
@ -249,6 +266,7 @@
set task_sub_id = #{taskSubId,jdbcType=BIGINT},
name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
initial_duration = #{initialDuration,jdbcType=BIGINT},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},

27
src/main/resources/mapper_raw/PluDeliverRecordCheckLogMapper.xml

@ -8,6 +8,7 @@
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="check_status" jdbcType="TINYINT" property="checkStatus" />
<result column="time" jdbcType="BIGINT" property="time" />
<result column="check_duration" jdbcType="BIGINT" property="checkDuration" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
@ -72,8 +73,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, record_check_id, score, remark, check_status, time, operator, created_at, updated_at,
rec_status
id, record_check_id, score, remark, check_status, time, check_duration, operator,
created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.ptccsens.bean.po.PluDeliverRecordCheckLogExample" resultMap="BaseResultMap">
select
@ -108,12 +109,12 @@
<insert id="insert" parameterType="com.ccsens.ptccsens.bean.po.PluDeliverRecordCheckLog">
insert into t_plu_deliver_record_check_log (id, record_check_id, score,
remark, check_status, time,
operator, created_at, updated_at,
rec_status)
check_duration, operator, created_at,
updated_at, rec_status)
values (#{id,jdbcType=BIGINT}, #{recordCheckId,jdbcType=BIGINT}, #{score,jdbcType=DECIMAL},
#{remark,jdbcType=VARCHAR}, #{checkStatus,jdbcType=TINYINT}, #{time,jdbcType=BIGINT},
#{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
#{checkDuration,jdbcType=BIGINT}, #{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ptccsens.bean.po.PluDeliverRecordCheckLog">
insert into t_plu_deliver_record_check_log
@ -136,6 +137,9 @@
<if test="time != null">
time,
</if>
<if test="checkDuration != null">
check_duration,
</if>
<if test="operator != null">
operator,
</if>
@ -168,6 +172,9 @@
<if test="time != null">
#{time,jdbcType=BIGINT},
</if>
<if test="checkDuration != null">
#{checkDuration,jdbcType=BIGINT},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
@ -209,6 +216,9 @@
<if test="record.time != null">
time = #{record.time,jdbcType=BIGINT},
</if>
<if test="record.checkDuration != null">
check_duration = #{record.checkDuration,jdbcType=BIGINT},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
@ -234,6 +244,7 @@
remark = #{record.remark,jdbcType=VARCHAR},
check_status = #{record.checkStatus,jdbcType=TINYINT},
time = #{record.time,jdbcType=BIGINT},
check_duration = #{record.checkDuration,jdbcType=BIGINT},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
@ -260,6 +271,9 @@
<if test="time != null">
time = #{time,jdbcType=BIGINT},
</if>
<if test="checkDuration != null">
check_duration = #{checkDuration,jdbcType=BIGINT},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
@ -282,6 +296,7 @@
remark = #{remark,jdbcType=VARCHAR},
check_status = #{checkStatus,jdbcType=TINYINT},
time = #{time,jdbcType=BIGINT},
check_duration = #{checkDuration,jdbcType=BIGINT},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},

28
src/main/resources/mapper_raw/PluDeliverRecordMapper.xml

@ -6,6 +6,7 @@
<result column="deliver_id" jdbcType="BIGINT" property="deliverId" />
<result column="submit_time" jdbcType="BIGINT" property="submitTime" />
<result column="member_id" jdbcType="BIGINT" property="memberId" />
<result column="duration" jdbcType="BIGINT" property="duration" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
@ -70,7 +71,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, deliver_id, submit_time, member_id, operator, created_at, updated_at, rec_status
id, deliver_id, submit_time, member_id, duration, operator, created_at, updated_at,
rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.ptccsens.bean.po.PluDeliverRecordExample" resultMap="BaseResultMap">
select
@ -104,11 +106,13 @@
</delete>
<insert id="insert" parameterType="com.ccsens.ptccsens.bean.po.PluDeliverRecord">
insert into t_plu_deliver_record (id, deliver_id, submit_time,
member_id, operator, created_at,
updated_at, rec_status)
member_id, duration, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{deliverId,jdbcType=BIGINT}, #{submitTime,jdbcType=BIGINT},
#{memberId,jdbcType=BIGINT}, #{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
#{memberId,jdbcType=BIGINT}, #{duration,jdbcType=BIGINT}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ptccsens.bean.po.PluDeliverRecord">
insert into t_plu_deliver_record
@ -125,6 +129,9 @@
<if test="memberId != null">
member_id,
</if>
<if test="duration != null">
duration,
</if>
<if test="operator != null">
operator,
</if>
@ -151,6 +158,9 @@
<if test="memberId != null">
#{memberId,jdbcType=BIGINT},
</if>
<if test="duration != null">
#{duration,jdbcType=BIGINT},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
@ -186,6 +196,9 @@
<if test="record.memberId != null">
member_id = #{record.memberId,jdbcType=BIGINT},
</if>
<if test="record.duration != null">
duration = #{record.duration,jdbcType=BIGINT},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
@ -209,6 +222,7 @@
deliver_id = #{record.deliverId,jdbcType=BIGINT},
submit_time = #{record.submitTime,jdbcType=BIGINT},
member_id = #{record.memberId,jdbcType=BIGINT},
duration = #{record.duration,jdbcType=BIGINT},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
@ -229,6 +243,9 @@
<if test="memberId != null">
member_id = #{memberId,jdbcType=BIGINT},
</if>
<if test="duration != null">
duration = #{duration,jdbcType=BIGINT},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
@ -249,6 +266,7 @@
set deliver_id = #{deliverId,jdbcType=BIGINT},
submit_time = #{submitTime,jdbcType=BIGINT},
member_id = #{memberId,jdbcType=BIGINT},
duration = #{duration,jdbcType=BIGINT},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},

8
src/main/resources/mbg.xml

@ -90,12 +90,12 @@
<!-- <table tableName="t_pro_task_sub" domainObjectName="ProTaskSub"></table>-->
<!-- <table tableName="t_pro_task_version" domainObjectName="ProTaskVersion"></table>-->
<!-- <table tableName="t_sys_log" domainObjectName="SysLog"></table>-->
<!-- <table tableName="t_plu_deliver" domainObjectName="PluDeliver"></table>-->
<!-- <table tableName="t_plu_deliver_record" domainObjectName="PluDeliverRecord"></table>-->
<table tableName="t_plu_deliver" domainObjectName="PluDeliver"></table>
<table tableName="t_plu_deliver_record" domainObjectName="PluDeliverRecord"></table>
<!-- <table tableName="t_plu_deliver_record_file" domainObjectName="PluDeliverRecordFile"></table>-->
<!-- <table tableName="t_plu_deliver_record_check" domainObjectName="PluDeliverRecordCheck"></table>-->
<!-- <table tableName="t_plu_deliver_record_check_log" domainObjectName="PluDeliverRecordCheckLog"></table>-->
<table tableName="t_plu_clocking_in" domainObjectName="PluClockingIn"></table>
<table tableName="t_plu_deliver_record_check_log" domainObjectName="PluDeliverRecordCheckLog"></table>
<!-- <table tableName="t_plu_clocking_in" domainObjectName="PluClockingIn"></table>-->
<!-- <table tableName="t_sys_holidays" domainObjectName="SysHolidays"></table>-->

59
src/test/java/com/ccsens/ptccsens/api/DebugControllerTest.java

@ -0,0 +1,59 @@
package com.ccsens.ptccsens.api;
import com.ccsens.ptccsens.PtCcsensApplication;
import com.itextpdf.text.log.SysoLogger;
import org.hamcrest.core.Is;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.ResultMatcher;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import static org.junit.Assert.*;
/**
* @author mr.zhangsan
* @date 2022/4/26 17:01
* @version: v1.0
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = PtCcsensApplication.class)
public class DebugControllerTest {
@Autowired
private WebApplicationContext context;
private MockMvc mockMvc;
@Before
public void before() throws Exception {
mockMvc = MockMvcBuilders.webAppContextSetup(context).build();
}
@Test
public void debug() throws Exception {
MvcResult mvcResult = mockMvc.perform(
MockMvcRequestBuilders.get("/debug")
.param("name", "felord.cn")
.param("age", "18")
.header("Api-Version", "v1")
).andExpect(ResultMatcher.matchAll(
MockMvcResultMatchers.status().isOk(),
MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON_UTF8),
MockMvcResultMatchers.jsonPath("$.code", Is.is(200))
)
).andDo(MockMvcResultHandlers.print()).andReturn();
System.out.println("Test Result: " + mvcResult.getResponse().getContentAsString());
}
}

80
src/test/java/com/ccsens/ptccsens/api/DeliverControllerTest.java

@ -0,0 +1,80 @@
package com.ccsens.ptccsens.api;
import com.ccsens.ptccsens.PtCcsensApplication;
import org.hamcrest.core.Is;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.ResultMatcher;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
/**
* @author mr.zhangsan
* @date 2022/4/26 18:40
* @version: v1.0
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = PtCcsensApplication.class)
public class DeliverControllerTest {
@Autowired
private WebApplicationContext context;
private MockMvc mockMvc;
@Before
public void before() throws Exception {
mockMvc = MockMvcBuilders.webAppContextSetup(context).build();
}
@Test
public void queryChecker() throws Exception {
MvcResult mvcResult = mockMvc.perform(
MockMvcRequestBuilders.get("/deliver/queryChecker")
.param("name", "felord.cn")
.param("age", "18")
.header("Api-Version", "v1")
).andExpect(ResultMatcher.matchAll(
MockMvcResultMatchers.status().isOk(),
MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON_UTF8),
MockMvcResultMatchers.jsonPath("$.code", Is.is(200))
)
).andDo(MockMvcResultHandlers.print()).andReturn();
System.out.println("Test Result: " + mvcResult.getResponse().getContentAsString());
}
@Test
public void saveDeliver() {
}
@Test
public void getDeliver() {
}
@Test
public void submitDeliver() {
}
@Test
public void checkDeliver() {
}
@Test
public void queryRecord() {
}
@Test
public void queryCheckLog() {
}
}
Loading…
Cancel
Save