Commit 14170667 authored by dahai's avatar dahai

添加审核耗材管理API

修改添加耗材管理状态
parent 04db94e3
...@@ -26,8 +26,8 @@ public class MaterialManagementApi { ...@@ -26,8 +26,8 @@ public class MaterialManagementApi {
* @return * @return
*/ */
@RequestMapping("insertFilm") @RequestMapping("insertFilm")
public boolean insertFilm(@Param("totalCount")String totalCount, @Param("plasticFilmType")String plasticFilmType, @Param("note")String note, @Param("name")String name){ public boolean insertFilm(@Param("totalCount")String totalCount, @Param("plasticFilmType")String plasticFilmType, @Param("note")String note, @Param("name")String name,@Param("state")String state){
boolean result = materialManagementService.insertFilm(totalCount, plasticFilmType, note,name); boolean result = materialManagementService.insertFilm(totalCount, plasticFilmType, note,name,Long.valueOf(state));
return result; return result;
} }
...@@ -39,8 +39,8 @@ public class MaterialManagementApi { ...@@ -39,8 +39,8 @@ public class MaterialManagementApi {
* @return * @return
*/ */
@RequestMapping("insertCardBody") @RequestMapping("insertCardBody")
public boolean insertCardBody(@Param("cardType")String cardType,@Param("totalCount")String totalCount,@Param("note")String note, @Param("name")String name, @Param("cardBodyType")String cardBodyType){ public boolean insertCardBody(@Param("cardType")String cardType,@Param("totalCount")String totalCount,@Param("note")String note, @Param("name")String name, @Param("cardBodyType")String cardBodyType,@Param("state")String state){
boolean result = materialManagementService.insertCardBody(cardType, totalCount, note,name,cardBodyType); boolean result = materialManagementService.insertCardBody(cardType, totalCount, note,name,cardBodyType,Long.valueOf(state));
return result; return result;
} }
...@@ -108,6 +108,47 @@ public class MaterialManagementApi { ...@@ -108,6 +108,47 @@ public class MaterialManagementApi {
} }
/**
* 更新卡体详情状态
* @param id cardBodyID
* @return
*/
@RequestMapping("updateCardBody")
public boolean updateCardBody(@Param("id")String id){
return materialManagementService.updateCardBodyState(Long.valueOf(id));
}
/**
* 查询未审核卡体详情
*/
@RequestMapping("selectCardBody")
public List<CardBodyEntity> selectCardBody(){
return materialManagementService.selectCardBody();
}
/**
* 更新膜详情状态
* @param id cardBodyID
* @return
*/
@RequestMapping("updatePlasticFilm")
public boolean updatePlasticFilm(@Param("id")String id){
return materialManagementService.updatePlasticFilm(Long.valueOf(id));
}
/**
* 查询未审核膜详情
*/
@RequestMapping("selectPlasticFilm")
public List<PlasticFilmEntity> selectPlasticFilm(){
return materialManagementService.selectPlasticFilm();
}
......
...@@ -2,23 +2,23 @@ package com.yxproject.start.entity; ...@@ -2,23 +2,23 @@ package com.yxproject.start.entity;
import javax.persistence.*; import javax.persistence.*;
import java.sql.Time; import java.sql.Time;
import java.util.Date;
import java.util.Objects; import java.util.Objects;
/** /**
* @auther zhangyusheng * @auther zhangyusheng
* 2019/4/1 15:03 * 2019/4/28 15:12
*/ */
@Entity @Entity
@Table(name = "CARD_BODY", schema = "YINGXIN", catalog = "") @Table(name = "CARD_BODY", schema = "YINGXIN", catalog = "")
public class CardBodyEntity { public class CardBodyEntity {
private long cardBodyId; private long cardBodyId;
private Date saveDate; private Time saveDate;
private Long cardType; private Long cardType;
private Long totalCount; private Long totalCount;
private String note; private String note;
private String name;
private Long cardBodyType; private Long cardBodyType;
private String name;
private long state;
@Id @Id
@Column(name = "CARD_BODY_ID") @Column(name = "CARD_BODY_ID")
...@@ -32,11 +32,11 @@ public class CardBodyEntity { ...@@ -32,11 +32,11 @@ public class CardBodyEntity {
@Basic @Basic
@Column(name = "SAVE_DATE") @Column(name = "SAVE_DATE")
public Date getSaveDate() { public Time getSaveDate() {
return saveDate; return saveDate;
} }
public void setSaveDate(Date saveDate) { public void setSaveDate(Time saveDate) {
this.saveDate = saveDate; this.saveDate = saveDate;
} }
...@@ -70,6 +70,16 @@ public class CardBodyEntity { ...@@ -70,6 +70,16 @@ public class CardBodyEntity {
this.note = note; this.note = note;
} }
@Basic
@Column(name = "CARD_BODY_TYPE")
public Long getCardBodyType() {
return cardBodyType;
}
public void setCardBodyType(Long cardBodyType) {
this.cardBodyType = cardBodyType;
}
@Basic @Basic
@Column(name = "NAME") @Column(name = "NAME")
public String getName() { public String getName() {
...@@ -80,12 +90,23 @@ public class CardBodyEntity { ...@@ -80,12 +90,23 @@ public class CardBodyEntity {
this.name = name; this.name = name;
} }
@Basic
@Column(name = "STATE")
public long getState() {
return state;
}
public void setState(long state) {
this.state = state;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
CardBodyEntity that = (CardBodyEntity) o; CardBodyEntity that = (CardBodyEntity) o;
return cardBodyId == that.cardBodyId && return cardBodyId == that.cardBodyId &&
state == that.state &&
Objects.equals(saveDate, that.saveDate) && Objects.equals(saveDate, that.saveDate) &&
Objects.equals(cardType, that.cardType) && Objects.equals(cardType, that.cardType) &&
Objects.equals(totalCount, that.totalCount) && Objects.equals(totalCount, that.totalCount) &&
...@@ -96,16 +117,6 @@ public class CardBodyEntity { ...@@ -96,16 +117,6 @@ public class CardBodyEntity {
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(cardBodyId, saveDate, cardBodyType,cardType, totalCount, note, name); return Objects.hash(cardBodyId, saveDate, cardType, totalCount, note, cardBodyType, name, state);
}
@Basic
@Column(name = "CARD_BODY_TYPE")
public Long getCardBodyType() {
return cardBodyType;
}
public void setCardBodyType(Long cardBodyType) {
this.cardBodyType = cardBodyType;
} }
} }
...@@ -6,17 +6,18 @@ import java.util.Objects; ...@@ -6,17 +6,18 @@ import java.util.Objects;
/** /**
* @auther zhangyusheng * @auther zhangyusheng
* 2019/4/1 15:04 * 2019/4/28 15:12
*/ */
@Entity @Entity
@Table(name = "PLASTIC_FILM", schema = "YINGXIN", catalog = "") @Table(name = "PLASTIC_FILM", schema = "YINGXIN", catalog = "")
public class PlasticFilmEntity { public class PlasticFilmEntity {
private long plasticFilmId; private long plasticFilmId;
private String saveDate; private Time saveDate;
private Long totalCount; private Long totalCount;
private Long plasticFilmType; private Long plasticFilmType;
private String note; private String note;
private String name; private String name;
private long state;
@Id @Id
@Column(name = "PLASTIC_FILM_ID") @Column(name = "PLASTIC_FILM_ID")
...@@ -30,11 +31,11 @@ public class PlasticFilmEntity { ...@@ -30,11 +31,11 @@ public class PlasticFilmEntity {
@Basic @Basic
@Column(name = "SAVE_DATE") @Column(name = "SAVE_DATE")
public String getSaveDate() { public Time getSaveDate() {
return saveDate; return saveDate;
} }
public void setSaveDate(String saveDate) { public void setSaveDate(Time saveDate) {
this.saveDate = saveDate; this.saveDate = saveDate;
} }
...@@ -78,12 +79,23 @@ public class PlasticFilmEntity { ...@@ -78,12 +79,23 @@ public class PlasticFilmEntity {
this.name = name; this.name = name;
} }
@Basic
@Column(name = "STATE")
public long getState() {
return state;
}
public void setState(long state) {
this.state = state;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
PlasticFilmEntity that = (PlasticFilmEntity) o; PlasticFilmEntity that = (PlasticFilmEntity) o;
return plasticFilmId == that.plasticFilmId && return plasticFilmId == that.plasticFilmId &&
state == that.state &&
Objects.equals(saveDate, that.saveDate) && Objects.equals(saveDate, that.saveDate) &&
Objects.equals(totalCount, that.totalCount) && Objects.equals(totalCount, that.totalCount) &&
Objects.equals(plasticFilmType, that.plasticFilmType) && Objects.equals(plasticFilmType, that.plasticFilmType) &&
...@@ -93,6 +105,6 @@ public class PlasticFilmEntity { ...@@ -93,6 +105,6 @@ public class PlasticFilmEntity {
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(plasticFilmId, saveDate, totalCount, plasticFilmType, note, name); return Objects.hash(plasticFilmId, saveDate, totalCount, plasticFilmType, note, name, state);
} }
} }
...@@ -2,19 +2,14 @@ package com.yxproject.start.mapper; ...@@ -2,19 +2,14 @@ package com.yxproject.start.mapper;
import com.yxproject.start.entity.CardBodyEntity; import com.yxproject.start.entity.CardBodyEntity;
import com.yxproject.start.entity.PlasticFilmEntity; import com.yxproject.start.entity.PlasticFilmEntity;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
@Mapper @Mapper
public interface MaterialManagementMapper { public interface MaterialManagementMapper {
@Insert("INSERT INTO PLASTIC_FILM (TOTAL_COUNT,PLASTIC_FILM_TYPE,NOTE,name)VALUES(#{totalCount},#{plasticFilmType},#{note},#{name})") @Insert("INSERT INTO PLASTIC_FILM (TOTAL_COUNT,PLASTIC_FILM_TYPE,NOTE,name,state) VALUES(#{totalCount},#{plasticFilmType},#{note},#{name},#{state})")
public boolean insertFilm(@Param("totalCount") String totalCount, @Param("plasticFilmType") String plasticFilmType, @Param("note") String note, @Param("name") String name); public boolean insertFilm(@Param("totalCount") String totalCount, @Param("plasticFilmType") String plasticFilmType, @Param("note") String note, @Param("name") String name, @Param("state") long state);
@Select("<script>" + @Select("<script>" +
"select * from plastic_film where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate}" + "select * from plastic_film where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate}" +
...@@ -50,8 +45,8 @@ public interface MaterialManagementMapper { ...@@ -50,8 +45,8 @@ public interface MaterialManagementMapper {
public String selectFilmCount2(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("typeCode") String typeCode, @Param("name") String name); public String selectFilmCount2(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("typeCode") String typeCode, @Param("name") String name);
@Insert("INSERT INTO CARD_BODY (CARD_TYPE,TOTAL_COUNT,NOTE,name,CARD_BODY_TYPE)VALUES(#{cardType},#{totalCount},#{note},#{name},#{cardBodyType})") @Insert("INSERT INTO CARD_BODY (CARD_TYPE,TOTAL_COUNT,NOTE,name,CARD_BODY_TYPE,state)VALUES(#{cardType},#{totalCount},#{note},#{name},#{cardBodyType},#{state})")
public boolean insertCardBody(@Param("cardType") String cardType, @Param("totalCount") String totalCount, @Param("note") String note, @Param("name") String name, @Param("cardBodyType") long cardBodyType); public boolean insertCardBody(@Param("cardType") String cardType, @Param("totalCount") String totalCount, @Param("note") String note, @Param("name") String name, @Param("cardBodyType") long cardBodyType, @Param("state") long state);
@Select("<script>" + @Select("<script>" +
...@@ -66,7 +61,7 @@ public interface MaterialManagementMapper { ...@@ -66,7 +61,7 @@ public interface MaterialManagementMapper {
" and card_Body_Type =#{cardBodyType} " + " and card_Body_Type =#{cardBodyType} " +
"</if>" + "</if>" +
"</script>") "</script>")
public List<CardBodyEntity> selectCardBody(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("typeCode") String typeCode, @Param("name") String name,@Param("cardBodyType")String cardBodyType); public List<CardBodyEntity> selectCardBody(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("typeCode") String typeCode, @Param("name") String name, @Param("cardBodyType")String cardBodyType);
@Select("<script>" + @Select("<script>" +
"select sum(TOTAL_COUNT) cardType1 from CARD_BODY where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate} and CARD_TYPE=1" + "select sum(TOTAL_COUNT) cardType1 from CARD_BODY where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate} and CARD_TYPE=1" +
...@@ -90,4 +85,15 @@ public interface MaterialManagementMapper { ...@@ -90,4 +85,15 @@ public interface MaterialManagementMapper {
"</script>") "</script>")
public String selectCardCount2(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("typeCode") String typeCode, @Param("name") String name); public String selectCardCount2(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("typeCode") String typeCode, @Param("name") String name);
@Select("select * from card_body where state = 0")
public List<CardBodyEntity> selectCardBodyByState();
@Select("select * from Plastic_Film where state = 0")
public List<PlasticFilmEntity> selectPlasticFilmByState();
@Update("update card_body set state =1 where CARD_BODY_ID = #{id}")
public boolean updateCardBodyState(long id);
@Update("update PLASTIC_FILM set state =1 where PLASTIC_FILM_ID = #{id}")
public boolean updatePlasticFilmState(long id);
} }
...@@ -4,19 +4,17 @@ import com.yxproject.start.entity.CardBodyEntity; ...@@ -4,19 +4,17 @@ import com.yxproject.start.entity.CardBodyEntity;
import com.yxproject.start.entity.PlasticFilmEntity; import com.yxproject.start.entity.PlasticFilmEntity;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
public interface MaterialManagementService { public interface MaterialManagementService {
public boolean insertFilm( @Param("totalCount")String totalCount, @Param("plasticFilmType")String plasticFilmType, @Param("note")String note,String name); public boolean insertFilm( @Param("totalCount")String totalCount, @Param("plasticFilmType")String plasticFilmType, @Param("note")String note,String name,long state);
public List<PlasticFilmEntity> selectFilm(@Param("beginDate") String beginDate, @Param("endDate")String endDate,String typeCode, String name); public List<PlasticFilmEntity> selectFilm(@Param("beginDate") String beginDate, @Param("endDate")String endDate, String typeCode, String name);
public boolean insertCardBody(@Param("cardType")String cardType,@Param("totalCount")String totalCount,@Param("note")String note, String name,String cardBodyType); public boolean insertCardBody(@Param("cardType")String cardType,@Param("totalCount")String totalCount,@Param("note")String note, String name,String cardBodyType,long state);
public List<CardBodyEntity> selectCardBody(@Param("beginDate")String beginDate, @Param("endDate")String endDate,String typeCode, String name,String cardBodyType); public List<CardBodyEntity> selectCardBody(@Param("beginDate")String beginDate, @Param("endDate")String endDate, String typeCode, String name, String cardBodyType);
public String selectFilmCount1(@Param("beginDate") String beginDate,@Param("endDate")String endDate,String typeCode, String name); public String selectFilmCount1(@Param("beginDate") String beginDate,@Param("endDate")String endDate,String typeCode, String name);
...@@ -26,5 +24,12 @@ public interface MaterialManagementService { ...@@ -26,5 +24,12 @@ public interface MaterialManagementService {
public String selectCardCount2(@Param("beginDate")String beginDate,@Param("endDate")String endDate,String typeCode, String name); public String selectCardCount2(@Param("beginDate")String beginDate,@Param("endDate")String endDate,String typeCode, String name);
public boolean updateCardBodyState(long id);
public List<CardBodyEntity> selectCardBody();
public boolean updatePlasticFilm(long id);
public List<PlasticFilmEntity> selectPlasticFilm();
} }
...@@ -7,34 +7,32 @@ import com.yxproject.start.service.MaterialManagementService; ...@@ -7,34 +7,32 @@ import com.yxproject.start.service.MaterialManagementService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
@Service @Service
public class MaterialManagementServiceImpl implements MaterialManagementService { public class MaterialManagementServiceImpl implements MaterialManagementService {
@Autowired @Autowired
private MaterialManagementMapper materialManagementMapper; private MaterialManagementMapper materialManagementMapper;
@Override @Override
public boolean insertFilm( String totalCount, String plasticFilmType, String note,String name) { public boolean insertFilm( String totalCount, String plasticFilmType, String note,String name,long state) {
materialManagementMapper.insertFilm(totalCount,plasticFilmType,note,name); materialManagementMapper.insertFilm(totalCount,plasticFilmType,note,name,state);
return true; return true;
} }
@Override @Override
public List<PlasticFilmEntity> selectFilm(String beginDate, String endDate,String typeCode, String name) { public List<PlasticFilmEntity> selectFilm(String beginDate, String endDate, String typeCode, String name) {
List<PlasticFilmEntity> resultList = materialManagementMapper.selectFilm(beginDate, endDate,typeCode,name); List<PlasticFilmEntity> resultList = materialManagementMapper.selectFilm(beginDate, endDate,typeCode,name);
return resultList; return resultList;
} }
@Override @Override
public boolean insertCardBody( String cardType, String totalCount, String note,String name,String cardBodyType) { public boolean insertCardBody( String cardType, String totalCount, String note,String name,String cardBodyType,long state) {
materialManagementMapper.insertCardBody(cardType,totalCount,note,name,Long.valueOf(cardBodyType)); materialManagementMapper.insertCardBody(cardType,totalCount,note,name,Long.valueOf(cardBodyType),state);
return true; return true;
} }
@Override @Override
public List<CardBodyEntity> selectCardBody(String beginDate, String endDate,String typeCode, String name,String cardBodyType) { public List<CardBodyEntity> selectCardBody(String beginDate, String endDate, String typeCode, String name, String cardBodyType) {
List<CardBodyEntity> resultList = materialManagementMapper.selectCardBody(beginDate, endDate, typeCode, name,cardBodyType); List<CardBodyEntity> resultList = materialManagementMapper.selectCardBody(beginDate, endDate, typeCode, name,cardBodyType);
return resultList; return resultList;
} }
...@@ -64,4 +62,25 @@ public class MaterialManagementServiceImpl implements MaterialManagementService ...@@ -64,4 +62,25 @@ public class MaterialManagementServiceImpl implements MaterialManagementService
} }
@Override
public boolean updateCardBodyState(long id) {
return materialManagementMapper.updateCardBodyState(id);
}
@Override
public List<CardBodyEntity> selectCardBody() {
return materialManagementMapper.selectCardBodyByState();
}
@Override
public boolean updatePlasticFilm(long id) {
return materialManagementMapper.updatePlasticFilmState(id);
}
@Override
public List<PlasticFilmEntity> selectPlasticFilm() {
return materialManagementMapper.selectPlasticFilmByState();
}
} }
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