Commit 01d623dd authored by dahai's avatar dahai

添加并修改查询提交人提交的废证详情

parent 8c4dd12e
package com.yxproject.start.api;
import com.yxproject.start.entity.FailedCardEntity;
import com.yxproject.start.entity.FailedCardReasonDicEntity;
import com.yxproject.start.entity.SpecialCardEntity;
import com.yxproject.start.entity.TaskEntity;
......@@ -11,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
......@@ -64,6 +66,20 @@ public class FailedCardApi {
return resultList;
}
/**
* 查询提交人上传的废证详情
* @param date 提交日期
* @param name 提交人姓名
* @return
*/
@RequestMapping("queryFailedCardInfo")
public List<FailedCardEntity> queryFailedCardInfo(@RequestParam("date") String date,@RequestParam("name") String name) {
List<FailedCardEntity> failedCardEntities = failedCardService.selectFailedCardInfo(replaceDate(date), name);
return failedCardEntities;
}
/**
* 添加废证
*
......@@ -190,6 +206,15 @@ public class FailedCardApi {
}
return true;
}
/**
* 去除字符串中中线
*
* @param str
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "").replace(" ","").replace(":","");
}
}
......@@ -6,7 +6,7 @@ import java.util.Objects;
/**
* @auther zhangyusheng
* 2019/4/1 10:42
* 2019/4/30 10:05
*/
@Entity
@Table(name = "FAILED_CARD", schema = "YINGXIN", catalog = "")
......@@ -23,6 +23,8 @@ public class FailedCardEntity {
private Long initiator;
private String note;
private Long workGroup;
private String name;
private Time submitDate;
@Id
@Column(name = "FAILED_CARD_ID")
......@@ -144,6 +146,26 @@ public class FailedCardEntity {
this.workGroup = workGroup;
}
@Basic
@Column(name = "NAME")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Basic
@Column(name = "SUBMIT_DATE")
public Time getSubmitDate() {
return submitDate;
}
public void setSubmitDate(Time submitDate) {
this.submitDate = submitDate;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
......@@ -160,11 +182,13 @@ public class FailedCardEntity {
Objects.equals(state, that.state) &&
Objects.equals(initiator, that.initiator) &&
Objects.equals(note, that.note) &&
Objects.equals(workGroup, that.workGroup);
Objects.equals(workGroup, that.workGroup) &&
Objects.equals(name, that.name) &&
Objects.equals(submitDate, that.submitDate);
}
@Override
public int hashCode() {
return Objects.hash(failedCardId, failedCardReasonId, acceptNo, taskId, positionDate, finishDate, allotDate, printDate, state, initiator, note, workGroup);
return Objects.hash(failedCardId, failedCardReasonId, acceptNo, taskId, positionDate, finishDate, allotDate, printDate, state, initiator, note, workGroup, name, submitDate);
}
}
......@@ -143,4 +143,13 @@ public interface FailedCardMapper {
" WHERE PROD_CARD_T.ID_NO=#{id} or PROD_CARD_T.ACCEPT_NO=#{id}")
public Map<String,Object>selectDataById(String id);
/**
* 查询提交人提交的废证详情
* @param date 提交日期
* @param name 提交人姓名
* @return
*/
@Select("select * from failed_card where name = #{name} and to_char(submit_date,'yyyyMMdd') = #{date}")
public List<FailedCardEntity> selectFailedCardInfo(@Param("date")String date, @Param("name")String name);
}
......@@ -40,5 +40,7 @@ public interface FailedCardService {
public Map<String,Object> selectDataById(String id);
public List<FailedCardEntity> selectFailedCardInfo(String date ,String name);
}
......@@ -132,5 +132,8 @@ public class FailedCardServiceImpl implements FailedCardService {
return resultMap;
}
@Override
public List<FailedCardEntity> selectFailedCardInfo(String date, String name) {
return failedCardMapper.selectFailedCardInfo(date,name);
}
}
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