Commit 8ee8787e by huangtao

销毁审批

parent 90b819ae
...@@ -13,7 +13,9 @@ import com.jmai.physic.vo.PhysicDestroyCheckVO; ...@@ -13,7 +13,9 @@ import com.jmai.physic.vo.PhysicDestroyCheckVO;
import com.jmai.physic.vo.PhysicDestroyNumVO; import com.jmai.physic.vo.PhysicDestroyNumVO;
import com.jmai.physic.vo.PhysicDestroyVO; import com.jmai.physic.vo.PhysicDestroyVO;
import com.jmai.sys.aop.Auth; import com.jmai.sys.aop.Auth;
import com.jmai.sys.ctx.SpringContextUtils;
import com.jmai.sys.dto.ResponseData; import com.jmai.sys.dto.ResponseData;
import com.jmai.sys.entity.SysUser;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
...@@ -35,7 +37,6 @@ import java.util.List; ...@@ -35,7 +37,6 @@ import java.util.List;
@Api(tags = "销毁审批") @Api(tags = "销毁审批")
@ApiImplicitParams({@ApiImplicitParam(paramType = "header", name = "Access-Token", value = "凭证", required = true, dataType = "string")}) @ApiImplicitParams({@ApiImplicitParam(paramType = "header", name = "Access-Token", value = "凭证", required = true, dataType = "string")})
public class PhysicDestroyCheckController { public class PhysicDestroyCheckController {
@Resource @Resource
private PhysicDestroyCheckService physicDestroyCheckService; private PhysicDestroyCheckService physicDestroyCheckService;
......
...@@ -20,6 +20,6 @@ public interface PhysicStorageAmpouleMapper extends BaseMapper<PhysicStorageAmpo ...@@ -20,6 +20,6 @@ public interface PhysicStorageAmpouleMapper extends BaseMapper<PhysicStorageAmpo
Integer selectCurrentSumByName(@Param("name") String name,@Param("spec") String spec,@Param("factoryName") String factoryName,@Param("deptId")Long deptId); Integer selectCurrentSumByName(@Param("name") String name,@Param("spec") String spec,@Param("factoryName") String factoryName,@Param("deptId")Long deptId);
List<PhysicDestroyNumVO> selectDestroy(); List<PhysicDestroyNumVO> selectDestroy(@Param("deptId") Long deptId);
} }
...@@ -82,9 +82,9 @@ public class PhysicDestroyCheckServiceImpl extends BaseServiceImpl<PhysicDestroy ...@@ -82,9 +82,9 @@ public class PhysicDestroyCheckServiceImpl extends BaseServiceImpl<PhysicDestroy
public PhysicDestroyCheck sign(PhysicDestroyCheckSignReq physicDestroyCheckSignReq) { public PhysicDestroyCheck sign(PhysicDestroyCheckSignReq physicDestroyCheckSignReq) {
Boolean f = false; Boolean f = false;
Long userId = SpringContextUtils.getUserId(); Long userId = SpringContextUtils.getUserId();
SysUser sysUser = sysUserMapper.selectById(userId);
String getstamp = cloudsignService.sign(physicDestroyCheckSignReq.getEncryptedToken(), physicDestroyCheckSignReq.getRelBizNo(), physicDestroyCheckSignReq.getBase64SourceData()); String getstamp = cloudsignService.sign(physicDestroyCheckSignReq.getEncryptedToken(), physicDestroyCheckSignReq.getRelBizNo(), physicDestroyCheckSignReq.getBase64SourceData());
PhysicDestroyCheck physicDestroyCheck = physicDestroyCheckMapper.selectById(physicDestroyCheckSignReq.getPhysicDestroyCheckId()); PhysicDestroyCheck physicDestroyCheck = physicDestroyCheckMapper.selectById(physicDestroyCheckSignReq.getPhysicDestroyCheckId());
SysUser sysUser = sysUserMapper.selectById(userId);
if(physicDestroyCheck.getStatus().equals(0)){ if(physicDestroyCheck.getStatus().equals(0)){
if(!RoleTypeEum.isPass(sysUser.getRoleAsList(),RoleTypeEum.XH)){ if(!RoleTypeEum.isPass(sysUser.getRoleAsList(),RoleTypeEum.XH)){
throw new ServiceException("需要销毁人权限才可进行签名"); throw new ServiceException("需要销毁人权限才可进行签名");
...@@ -168,9 +168,10 @@ public class PhysicDestroyCheckServiceImpl extends BaseServiceImpl<PhysicDestroy ...@@ -168,9 +168,10 @@ public class PhysicDestroyCheckServiceImpl extends BaseServiceImpl<PhysicDestroy
} }
@Override @Override
public List<PhysicDestroyNumVO> listDestroy() { public List<PhysicDestroyNumVO> listDestroy( ) {
List<PhysicDestroyNumVO> list= physicStorageAmpouleMapper.selectDestroy(); Long userId = SpringContextUtils.getUserId();
SysUser sysUser = sysUserMapper.selectById(userId);
List<PhysicDestroyNumVO> list= physicStorageAmpouleMapper.selectDestroy(sysUser.getDeptId());
return list; return list;
} }
} }
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
<select id="selectDestroy" resultType="com.jmai.physic.vo.PhysicDestroyNumVO"> <select id="selectDestroy" resultType="com.jmai.physic.vo.PhysicDestroyNumVO">
select physic_name,physic_spec,batch_no,factory_name,unit,remark from physic_storage_ampoule select physic_name,physic_spec,batch_no,factory_name,unit,(IFNULL(sum(acquire_num),0) - IFNULL(sum(expend_num),0))as destroyNum from physic_storage_ampoule
where type =2 and destroy_status =0 where ((type =2 and destroy_status =0 and accept_dept_id =#{deptId}) or (type =2 and destroy_status =1 and accept_dept_id =#{deptId}))
gropu by physic_name,physic_spec,batch_no,factory_name,accept_dept_id group by physic_name,physic_spec,batch_no,factory_name,accept_dept_id
</select> </select>
</mapper> </mapper>
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 sign in to comment