Commit 5d461a68 authored by ad's avatar ad

Merge remote-tracking branch 'origin/dev' into dev

parents 7bef42b8 6782a3e0
......@@ -100,8 +100,8 @@ public class MaterialManagementApi {
* 查询未审核卡体详情
*/
@RequestMapping("selectCardBody")
public List<CardBodyEntity> selectCardBody(@Param("date")String date){
return materialManagementService.selectCardBody(replaceDate(date));
public List<CardBodyEntity> selectCardBody(@Param("date")String date,@Param("name")String name){
return materialManagementService.selectCardBody(replaceDate(date),name);
}
......@@ -121,8 +121,8 @@ public class MaterialManagementApi {
* 查询未审核膜详情
*/
@RequestMapping("selectPlasticFilm")
public List<PlasticFilmEntity> selectPlasticFilm(@Param("date")String date){
return materialManagementService.selectPlasticFilm(replaceDate(date));
public List<PlasticFilmEntity> selectPlasticFilm(@Param("date")String date,@Param("name")String name){
return materialManagementService.selectPlasticFilm(replaceDate(date),name);
}
......
......@@ -110,11 +110,19 @@ public interface MaterialManagementMapper {
"UNION all \n" +
"select * from card_body where to_char(CHECK_DATE,'yyyyMMdd') = #{date}")
public List<CardBodyEntity> selectCardBodyByState(String date);
@Select("select * from card_body where state = 0 and name =#{name}\n" +
"UNION all \n" +
"select * from card_body where to_char(CHECK_DATE,'yyyyMMdd') = #{date} and name =#{name}")
public List<CardBodyEntity> selectCardBodyByStateAndName(@Param("date")String date,@Param("name")String name);
@Select("select * from Plastic_Film where state = 0 \n" +
"UNION all \n" +
"select * from Plastic_Film where to_char(CHECK_DATE,'yyyyMMdd') = #{date}")
public List<PlasticFilmEntity> selectPlasticFilmByState(String date);
@Select("select * from Plastic_Film where state = 0 and name =#{name}\n" +
"UNION all \n" +
"select * from Plastic_Film where to_char(CHECK_DATE,'yyyyMMdd') = #{date} and name =#{name}")
public List<PlasticFilmEntity> selectPlasticFilmByStateAndName(@Param("date")String date,@Param("name")String name);
@Update("update card_body set state =1, check_date = sysdate where CARD_BODY_ID = #{id}")
public boolean updateCardBodyState(long id);
......@@ -204,4 +212,8 @@ public interface MaterialManagementMapper {
"where SYS_USER_ROLE.ROLE_ID = 31 or SYS_USER_ROLE.ROLE_ID = 90")
public List<Map<String,Object>> selectPlasticFilmOperation();
@Select("select * from user_info left join SYS_USER_ROLE on user_info.ID = SYS_USER_ROLE.USER_ID\n" +
"where user_info.NAME = #{name}")
public List<Map<String,Object>> selectRoleByUserName(String name);
}
......@@ -27,11 +27,11 @@ public interface MaterialManagementService {
public boolean updateCardBodyState(long id);
public List<CardBodyEntity> selectCardBody(String date);
public List<CardBodyEntity> selectCardBody(String date,String name);
public boolean updatePlasticFilm(long id);
public List<PlasticFilmEntity> selectPlasticFilm(String date);
public List<PlasticFilmEntity> selectPlasticFilm(String date,String name);
public Map<String,Object> selectCardBodyReport(String beginDate, String endDate, String typeCode, String name, String cardBodyType,long start,long end);
......
......@@ -71,8 +71,17 @@ public class MaterialManagementServiceImpl implements MaterialManagementService
}
@Override
public List<CardBodyEntity> selectCardBody(String date) {
return materialManagementMapper.selectCardBodyByState(date);
public List<CardBodyEntity> selectCardBody(String date,String name) {
List<Map<String, Object>> maps = materialManagementMapper.selectRoleByUserName(name);
//判断查询人是否是耗材管理人员
//如果是耗材管理人员 查询全部记录
//不是 查询本人记录
if (maps.size()>0&&"90".equals(maps.get(0).get("ROLE_ID")+"")){
return materialManagementMapper.selectCardBodyByState(date);
}else {
return materialManagementMapper.selectCardBodyByStateAndName(date,name);
}
}
@Override
......@@ -81,8 +90,17 @@ public class MaterialManagementServiceImpl implements MaterialManagementService
}
@Override
public List<PlasticFilmEntity> selectPlasticFilm(String date) {
return materialManagementMapper.selectPlasticFilmByState(date);
public List<PlasticFilmEntity> selectPlasticFilm(String date,String name) {
List<Map<String, Object>> maps = materialManagementMapper.selectRoleByUserName(name);
//判断查询人是否是耗材管理人员
//如果是耗材管理人员 查询全部记录
//不是 查询本人记录
if (maps.size()>0&&"90".equals(maps.get(0).get("ROLE_ID")+"")){
return materialManagementMapper.selectPlasticFilmByState(date);
}else {
return materialManagementMapper.selectPlasticFilmByStateAndName(date,name);
}
}
@Override
......
......@@ -162,7 +162,6 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
id:searchInput
}
}).then(function successCallback(response) {
console.log(response.data,"------------------------")
success(response.data)
})
},
......@@ -1238,12 +1237,13 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
success(response.data)
})
},
selectMaterialManagement:function(date,success) {
selectMaterialManagement:function(date,name,success) {
$http({
method: 'GET',
url: "../MaterialManagementApi/selectCardBody" + urlTimeStamp(),
params:{
date:date
date:date,
name:name
}
}).then(function successCallback(response) {
success(response.data)
......@@ -1260,12 +1260,13 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
success(response.data)
})
},
selectFilmManagement:function(date,success) {
selectFilmManagement:function(date,name,success) {
$http({
method: 'GET',
url: "../MaterialManagementApi/selectPlasticFilm" + urlTimeStamp(),
params:{
date:date
date:date,
name:name
}
}).then(function successCallback(response) {
success(response.data)
......
......@@ -50,7 +50,8 @@ angular.module('AvatarCheck.filmManagement', ['ngRoute', 'AvatarCheck.http'])
if(date==''){
date = $scope.choseDate;
}
HttpService.selectFilmManagement(date,function (data) {
var name = $rootScope.loginData.name;
HttpService.selectFilmManagement(date,name,function (data) {
$scope.filmManagement = data;
console.log($scope.filmManagement,"$scope.filmManagement")
})
......
......@@ -54,8 +54,8 @@ angular.module('AvatarCheck.materialManagement', ['ngRoute', 'AvatarCheck.http']
if(date==''){
date = $scope.choseDate;
}
console.log(date)
HttpService.selectMaterialManagement(date,function (data) {
var name = $rootScope.loginData.name;
HttpService.selectMaterialManagement(date,name,function (data) {
$scope.materialManagement = data;
console.log($scope.materialManagement,"$scope.materialManagement")
})
......
......@@ -153,6 +153,8 @@
</div>
</div>
<!---没查到数据-->
<div >{{searchResult.length}} searchResult.length</div>
<div >{{searchResult.size()}} searchResult.size()</div>
<div class="box-info"
ng-if="(searchResult.workOrderDate.length==0&&searchResult.ACCdata.length==0&&searchResult.PRODData.length==0) ||searchResult==null">
<div>
......
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